@innovastudio/contentbox-runtime 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contentbox-runtime.esm.js +4915 -4022
- package/dist/contentbox-runtime.min.js +106 -106
- package/package.json +3 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var ContentBoxRuntime=(function(){"use strict";var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var ht={exports:{}},qi=ht.exports,Kt;function Ri(){return Kt||(Kt=1,(function(m,e){(function(i,s){m.exports=s()})(qi,function(){var i=typeof window<"u"?window:typeof Qt<"u"?Qt:typeof self<"u"?self:{},s="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,o=typeof i=="object"&&i&&i.Object===Object&&i,h=typeof self=="object"&&self&&self.Object===Object&&self,f=o||h||Function("return this")(),v=Object.prototype.toString,S=Math.max,R=Math.min,y=function(){return f.Date.now()};function E(A,j,U){var Y,Z,ee,te,K,me,le=0,Ce=!1,pe=!1,xe=!0;if(typeof A!="function")throw new TypeError(s);function Le(ce){var Re=Y,De=Z;return Y=Z=void 0,le=ce,te=A.apply(De,Re)}function $e(ce){var Re=ce-me;return me===void 0||Re>=j||Re<0||pe&&ce-le>=ee}function Ne(){var ce=y();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(Re){var De=j-(Re-me);return pe?R(De,ee-(Re-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&Y?Le(ce):(Y=Z=void 0,te)}function ke(){var ce=y(),Re=$e(ce);if(Y=arguments,Z=this,me=ce,Re){if(K===void 0)return(function(De){return le=De,K=setTimeout(Ne,j),Ce?Le(De):te})(me);if(pe)return K=setTimeout(Ne,j),Le(me)}return K===void 0&&(K=setTimeout(Ne,j)),te}return j=k(j)||0,b(U)&&(Ce=!!U.leading,ee=(pe="maxWait"in U)?S(k(U.maxWait)||0,j):ee,xe="trailing"in U?!!U.trailing:xe),ke.cancel=function(){K!==void 0&&clearTimeout(K),le=0,Y=me=Z=K=void 0},ke.flush=function(){return K===void 0?te:Pe(y())},ke}function b(A){var j=typeof A;return!!A&&(j=="object"||j=="function")}function k(A){if(typeof A=="number")return A;if((function(Y){return typeof Y=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(Y)&&v.call(Y)==n})(A))return t;if(b(A)){var j=typeof A.valueOf=="function"?A.valueOf():A;A=b(j)?j+"":j}if(typeof A!="string")return A===0?A:+A;A=A.replace(r,"");var U=u.test(A);return U||c.test(A)?d(A.slice(2),U?2:8):a.test(A)?t:+A}var C=function(A,j,U){var Y=!0,Z=!0;if(typeof A!="function")throw new TypeError(s);return b(U)&&(Y="leading"in U?!!U.leading:Y,Z="trailing"in U?!!U.trailing:Z),E(A,j,{leading:Y,maxWait:j,trailing:Z})},g="Expected a function",w=NaN,q="[object Symbol]",V=/^\s+|\s+$/g,I=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,G=/^0o[0-7]+$/i,B=parseInt,M=typeof i=="object"&&i&&i.Object===Object&&i,_=typeof self=="object"&&self&&self.Object===Object&&self,L=M||_||Function("return this")(),P=Object.prototype.toString,W=Math.max,N=Math.min,J=function(){return L.Date.now()};function Q(A){var j=typeof A;return!!A&&(j=="object"||j=="function")}function se(A){if(typeof A=="number")return A;if((function(Y){return typeof Y=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(Y)&&P.call(Y)==q})(A))return w;if(Q(A)){var j=typeof A.valueOf=="function"?A.valueOf():A;A=Q(j)?j+"":j}if(typeof A!="string")return A===0?A:+A;A=A.replace(V,"");var U=F.test(A);return U||G.test(A)?B(A.slice(2),U?2:8):I.test(A)?w:+A}var re=function(A,j,U){var Y,Z,ee,te,K,me,le=0,Ce=!1,pe=!1,xe=!0;if(typeof A!="function")throw new TypeError(g);function Le(ce){var Re=Y,De=Z;return Y=Z=void 0,le=ce,te=A.apply(De,Re)}function $e(ce){var Re=ce-me;return me===void 0||Re>=j||Re<0||pe&&ce-le>=ee}function Ne(){var ce=J();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(Re){var De=j-(Re-me);return pe?N(De,ee-(Re-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&Y?Le(ce):(Y=Z=void 0,te)}function ke(){var ce=J(),Re=$e(ce);if(Y=arguments,Z=this,me=ce,Re){if(K===void 0)return(function(De){return le=De,K=setTimeout(Ne,j),Ce?Le(De):te})(me);if(pe)return K=setTimeout(Ne,j),Le(me)}return K===void 0&&(K=setTimeout(Ne,j)),te}return j=se(j)||0,Q(U)&&(Ce=!!U.leading,ee=(pe="maxWait"in U)?W(se(U.maxWait)||0,j):ee,xe="trailing"in U?!!U.trailing:xe),ke.cancel=function(){K!==void 0&&clearTimeout(K),le=0,Y=me=Z=K=void 0},ke.flush=function(){return K===void 0?te:Pe(J())},ke},ae=function(){};function de(A){A&&A.forEach(function(j){var U=Array.prototype.slice.call(j.addedNodes),Y=Array.prototype.slice.call(j.removedNodes);if((function Z(ee){var te=void 0,K=void 0;for(te=0;te<ee.length;te+=1)if((K=ee[te]).dataset&&K.dataset.aos||K.children&&Z(K.children))return!0;return!1})(U.concat(Y)))return ae()})}function ue(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var Se={isSupported:function(){return!!ue()},ready:function(A,j){var U=window.document,Y=new(ue())(de);ae=j,Y.observe(U.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},Ie=function(A,j){if(!(A instanceof j))throw new TypeError("Cannot call a class as a function")},Ae=(function(){function A(j,U){for(var Y=0;Y<U.length;Y++){var Z=U[Y];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(j,Z.key,Z)}}return function(j,U,Y){return U&&A(j.prototype,U),Y&&A(j,Y),j}})(),qe=Object.assign||function(A){for(var j=1;j<arguments.length;j++){var U=arguments[j];for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(A[Y]=U[Y])}return A},Ee=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,be=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,X=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,ie=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function ge(){return navigator.userAgent||navigator.vendor||window.opera||""}var ve=new((function(){function A(){Ie(this,A)}return Ae(A,[{key:"phone",value:function(){var j=ge();return!(!Ee.test(j)&&!be.test(j.substr(0,4)))}},{key:"mobile",value:function(){var j=ge();return!(!X.test(j)&&!ie.test(j.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),A})()),Oe=function(A,j){var U=void 0;return ve.ie11()?(U=document.createEvent("CustomEvent")).initCustomEvent(A,!0,!0,{detail:j}):U=new CustomEvent(A,{detail:j}),document.dispatchEvent(U)},ye=function(A){return A.forEach(function(j,U){return(function(Y,Z){var ee=Y.options,te=Y.position,K=Y.node,me=(Y.data,function(){Y.animated&&((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.remove(pe)})})(K,ee.animatedClassNames),Oe("aos:out",K),Y.options.id&&Oe("aos:in:"+Y.options.id,K),Y.animated=!1)});ee.mirror&&Z>=te.out&&!ee.once?me():Z>=te.in?Y.animated||((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.add(pe)})})(K,ee.animatedClassNames),Oe("aos:in",K),Y.options.id&&Oe("aos:in:"+Y.options.id,K),Y.animated=!0):Y.animated&&!ee.once&&me()})(j,window.pageYOffset)})},fe=function(A){for(var j=0,U=0;A&&!isNaN(A.offsetLeft)&&!isNaN(A.offsetTop);)j+=A.offsetLeft-(A.tagName!="BODY"?A.scrollLeft:0),U+=A.offsetTop-(A.tagName!="BODY"?A.scrollTop:0),A=A.offsetParent;return{top:U,left:j}},he=function(A,j,U){var Y=A.getAttribute("data-aos-"+j);if(Y!==void 0){if(Y==="true")return!0;if(Y==="false")return!1}return Y||U},ne=function(A,j){return A.forEach(function(U,Y){var Z=he(U.node,"mirror",j.mirror),ee=he(U.node,"once",j.once),te=he(U.node,"id"),K=j.useClassNames&&U.node.getAttribute("data-aos"),me=[j.animatedClassName].concat(K?K.split(" "):[]).filter(function(le){return typeof le=="string"});j.initClassName&&U.node.classList.add(j.initClassName),U.position={in:(function(le,Ce,pe){var xe=window.innerHeight,Le=he(le,"anchor"),$e=he(le,"anchor-placement"),Ne=Number(he(le,"offset",$e?0:Ce)),Pe=$e||pe,ke=le;Le&&document.querySelectorAll(Le)&&(ke=document.querySelectorAll(Le)[0]);var ce=fe(ke).top-xe;switch(Pe){case"top-bottom":break;case"center-bottom":ce+=ke.offsetHeight/2;break;case"bottom-bottom":ce+=ke.offsetHeight;break;case"top-center":ce+=xe/2;break;case"center-center":ce+=xe/2+ke.offsetHeight/2;break;case"bottom-center":ce+=xe/2+ke.offsetHeight;break;case"top-top":ce+=xe;break;case"bottom-top":ce+=xe+ke.offsetHeight;break;case"center-top":ce+=xe+ke.offsetHeight/2}return ce+Ne})(U.node,j.offset,j.anchorPlacement),out:Z&&(function(le,Ce){var pe=he(le,"anchor"),xe=he(le,"offset",Ce),Le=le;return pe&&document.querySelectorAll(pe)&&(Le=document.querySelectorAll(pe)[0]),fe(Le).top+Le.offsetHeight-xe})(U.node,j.offset)},U.options={once:ee,mirror:Z,animatedClassNames:me,id:te}}),A},Me=function(){var A=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(A,function(j){return{node:j}})},l=[],p=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},T=function(){return document.all&&!window.atob},O=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(p=!0),p&&(l=ne(l,x),ye(l),window.addEventListener("scroll",C(function(){ye(l,x.once)},x.throttleDelay)))},D=function(){if(l=Me(),$(x.disable)||T())return H();O()},H=function(){l.forEach(function(A,j){A.node.removeAttribute("data-aos"),A.node.removeAttribute("data-aos-easing"),A.node.removeAttribute("data-aos-duration"),A.node.removeAttribute("data-aos-delay"),x.initClassName&&A.node.classList.remove(x.initClassName),x.animatedClassName&&A.node.classList.remove(x.animatedClassName)})},$=function(A){return A===!0||A==="mobile"&&ve.mobile()||A==="phone"&&ve.phone()||A==="tablet"&&ve.tablet()||typeof A=="function"&&A()===!0};return{init:function(A){return x=qe(x,A),l=Me(),x.disableMutationObserver||Se.isSupported()||(console.info(`
|
|
1
|
+
var ContentBoxRuntime=(function(){"use strict";var Si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var vt={exports:{}},ms=vt.exports,Ti;function bs(){return Ti||(Ti=1,(function(u,e){(function(i,s){u.exports=s()})(ms,function(){var i=typeof window<"u"?window:typeof Si<"u"?Si:typeof self<"u"?self:{},s="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,o=typeof i=="object"&&i&&i.Object===Object&&i,h=typeof self=="object"&&self&&self.Object===Object&&self,f=o||h||Function("return this")(),m=Object.prototype.toString,w=Math.max,E=Math.min,b=function(){return f.Date.now()};function k(R,P,B){var F,Z,_e,pe,Q,ye,oe=0,Ie=!1,Ee=!1,Ce=!0;if(typeof R!="function")throw new TypeError(s);function je(se){var qe=F,Pe=Z;return F=Z=void 0,oe=se,pe=R.apply(Pe,qe)}function Ve(se){var qe=se-ye;return ye===void 0||qe>=P||qe<0||Ee&&se-oe>=_e}function Be(){var se=b();if(Ve(se))return Ze(se);Q=setTimeout(Be,(function(qe){var Pe=P-(qe-ye);return Ee?E(Pe,_e-(qe-oe)):Pe})(se))}function Ze(se){return Q=void 0,Ce&&F?je(se):(F=Z=void 0,pe)}function De(){var se=b(),qe=Ve(se);if(F=arguments,Z=this,ye=se,qe){if(Q===void 0)return(function(Pe){return oe=Pe,Q=setTimeout(Be,P),Ie?je(Pe):pe})(ye);if(Ee)return Q=setTimeout(Be,P),je(ye)}return Q===void 0&&(Q=setTimeout(Be,P)),pe}return P=v(P)||0,g(B)&&(Ie=!!B.leading,_e=(Ee="maxWait"in B)?w(v(B.maxWait)||0,P):_e,Ce="trailing"in B?!!B.trailing:Ce),De.cancel=function(){Q!==void 0&&clearTimeout(Q),oe=0,F=ye=Z=Q=void 0},De.flush=function(){return Q===void 0?pe:Ze(b())},De}function g(R){var P=typeof R;return!!R&&(P=="object"||P=="function")}function v(R){if(typeof R=="number")return R;if((function(F){return typeof F=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(F)&&m.call(F)==n})(R))return t;if(g(R)){var P=typeof R.valueOf=="function"?R.valueOf():R;R=g(P)?P+"":P}if(typeof R!="string")return R===0?R:+R;R=R.replace(r,"");var B=l.test(R);return B||c.test(R)?d(R.slice(2),B?2:8):a.test(R)?t:+R}var _=function(R,P,B){var F=!0,Z=!0;if(typeof R!="function")throw new TypeError(s);return g(B)&&(F="leading"in B?!!B.leading:F,Z="trailing"in B?!!B.trailing:Z),k(R,P,{leading:F,maxWait:P,trailing:Z})},p="Expected a function",y=NaN,T="[object Symbol]",M=/^\s+|\s+$/g,q=/^[-+]0x[0-9a-f]+$/i,D=/^0b[01]+$/i,$=/^0o[0-7]+$/i,j=parseInt,O=typeof i=="object"&&i&&i.Object===Object&&i,x=typeof self=="object"&&self&&self.Object===Object&&self,S=O||x||Function("return this")(),A=Object.prototype.toString,N=Math.max,L=Math.min,V=function(){return S.Date.now()};function U(R){var P=typeof R;return!!R&&(P=="object"||P=="function")}function Y(R){if(typeof R=="number")return R;if((function(F){return typeof F=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(F)&&A.call(F)==T})(R))return y;if(U(R)){var P=typeof R.valueOf=="function"?R.valueOf():R;R=U(P)?P+"":P}if(typeof R!="string")return R===0?R:+R;R=R.replace(M,"");var B=D.test(R);return B||$.test(R)?j(R.slice(2),B?2:8):q.test(R)?y:+R}var G=function(R,P,B){var F,Z,_e,pe,Q,ye,oe=0,Ie=!1,Ee=!1,Ce=!0;if(typeof R!="function")throw new TypeError(p);function je(se){var qe=F,Pe=Z;return F=Z=void 0,oe=se,pe=R.apply(Pe,qe)}function Ve(se){var qe=se-ye;return ye===void 0||qe>=P||qe<0||Ee&&se-oe>=_e}function Be(){var se=V();if(Ve(se))return Ze(se);Q=setTimeout(Be,(function(qe){var Pe=P-(qe-ye);return Ee?L(Pe,_e-(qe-oe)):Pe})(se))}function Ze(se){return Q=void 0,Ce&&F?je(se):(F=Z=void 0,pe)}function De(){var se=V(),qe=Ve(se);if(F=arguments,Z=this,ye=se,qe){if(Q===void 0)return(function(Pe){return oe=Pe,Q=setTimeout(Be,P),Ie?je(Pe):pe})(ye);if(Ee)return Q=setTimeout(Be,P),je(ye)}return Q===void 0&&(Q=setTimeout(Be,P)),pe}return P=Y(P)||0,U(B)&&(Ie=!!B.leading,_e=(Ee="maxWait"in B)?N(Y(B.maxWait)||0,P):_e,Ce="trailing"in B?!!B.trailing:Ce),De.cancel=function(){Q!==void 0&&clearTimeout(Q),oe=0,F=ye=Z=Q=void 0},De.flush=function(){return Q===void 0?pe:Ze(V())},De},K=function(){};function ie(R){R&&R.forEach(function(P){var B=Array.prototype.slice.call(P.addedNodes),F=Array.prototype.slice.call(P.removedNodes);if((function Z(_e){var pe=void 0,Q=void 0;for(pe=0;pe<_e.length;pe+=1)if((Q=_e[pe]).dataset&&Q.dataset.aos||Q.children&&Z(Q.children))return!0;return!1})(B.concat(F)))return K()})}function ee(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var be={isSupported:function(){return!!ee()},ready:function(R,P){var B=window.document,F=new(ee())(ie);K=P,F.observe(B.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},Ae=function(R,P){if(!(R instanceof P))throw new TypeError("Cannot call a class as a function")},ke=(function(){function R(P,B){for(var F=0;F<B.length;F++){var Z=B[F];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(P,Z.key,Z)}}return function(P,B,F){return B&&R(P.prototype,B),F&&R(P,F),P}})(),Re=Object.assign||function(R){for(var P=1;P<arguments.length;P++){var B=arguments[P];for(var F in B)Object.prototype.hasOwnProperty.call(B,F)&&(R[F]=B[F])}return R},Se=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,ue=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,z=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,X=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function ae(){return navigator.userAgent||navigator.vendor||window.opera||""}var de=new((function(){function R(){Ae(this,R)}return ke(R,[{key:"phone",value:function(){var P=ae();return!(!Se.test(P)&&!ue.test(P.substr(0,4)))}},{key:"mobile",value:function(){var P=ae();return!(!z.test(P)&&!X.test(P.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),R})()),we=function(R,P){var B=void 0;return de.ie11()?(B=document.createEvent("CustomEvent")).initCustomEvent(R,!0,!0,{detail:P}):B=new CustomEvent(R,{detail:P}),document.dispatchEvent(B)},he=function(R){return R.forEach(function(P,B){return(function(F,Z){var _e=F.options,pe=F.position,Q=F.node,ye=(F.data,function(){F.animated&&((function(oe,Ie){Ie&&Ie.forEach(function(Ee){return oe.classList.remove(Ee)})})(Q,_e.animatedClassNames),we("aos:out",Q),F.options.id&&we("aos:in:"+F.options.id,Q),F.animated=!1)});_e.mirror&&Z>=pe.out&&!_e.once?ye():Z>=pe.in?F.animated||((function(oe,Ie){Ie&&Ie.forEach(function(Ee){return oe.classList.add(Ee)})})(Q,_e.animatedClassNames),we("aos:in",Q),F.options.id&&we("aos:in:"+F.options.id,Q),F.animated=!0):F.animated&&!_e.once&&ye()})(P,window.pageYOffset)})},le=function(R){for(var P=0,B=0;R&&!isNaN(R.offsetLeft)&&!isNaN(R.offsetTop);)P+=R.offsetLeft-(R.tagName!="BODY"?R.scrollLeft:0),B+=R.offsetTop-(R.tagName!="BODY"?R.scrollTop:0),R=R.offsetParent;return{top:B,left:P}},ne=function(R,P,B){var F=R.getAttribute("data-aos-"+P);if(F!==void 0){if(F==="true")return!0;if(F==="false")return!1}return F||B},J=function(R,P){return R.forEach(function(B,F){var Z=ne(B.node,"mirror",P.mirror),_e=ne(B.node,"once",P.once),pe=ne(B.node,"id"),Q=P.useClassNames&&B.node.getAttribute("data-aos"),ye=[P.animatedClassName].concat(Q?Q.split(" "):[]).filter(function(oe){return typeof oe=="string"});P.initClassName&&B.node.classList.add(P.initClassName),B.position={in:(function(oe,Ie,Ee){var Ce=window.innerHeight,je=ne(oe,"anchor"),Ve=ne(oe,"anchor-placement"),Be=Number(ne(oe,"offset",Ve?0:Ie)),Ze=Ve||Ee,De=oe;je&&document.querySelectorAll(je)&&(De=document.querySelectorAll(je)[0]);var se=le(De).top-Ce;switch(Ze){case"top-bottom":break;case"center-bottom":se+=De.offsetHeight/2;break;case"bottom-bottom":se+=De.offsetHeight;break;case"top-center":se+=Ce/2;break;case"center-center":se+=Ce/2+De.offsetHeight/2;break;case"bottom-center":se+=Ce/2+De.offsetHeight;break;case"top-top":se+=Ce;break;case"bottom-top":se+=Ce+De.offsetHeight;break;case"center-top":se+=Ce+De.offsetHeight/2}return se+Be})(B.node,P.offset,P.anchorPlacement),out:Z&&(function(oe,Ie){var Ee=ne(oe,"anchor"),Ce=ne(oe,"offset",Ie),je=oe;return Ee&&document.querySelectorAll(Ee)&&(je=document.querySelectorAll(Ee)[0]),le(je).top+je.offsetHeight-Ce})(B.node,P.offset)},B.options={once:_e,mirror:Z,animatedClassNames:ye,id:pe}}),R},Oe=function(){var R=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(R,function(P){return{node:P}})},xe=[],Me=!1,re={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},C=function(){return document.all&&!window.atob},H=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(Me=!0),Me&&(xe=J(xe,re),he(xe),window.addEventListener("scroll",_(function(){he(xe,re.once)},re.throttleDelay)))},W=function(){if(xe=Oe(),fe(re.disable)||C())return ce();H()},ce=function(){xe.forEach(function(R,P){R.node.removeAttribute("data-aos"),R.node.removeAttribute("data-aos-easing"),R.node.removeAttribute("data-aos-duration"),R.node.removeAttribute("data-aos-delay"),re.initClassName&&R.node.classList.remove(re.initClassName),re.animatedClassName&&R.node.classList.remove(re.animatedClassName)})},fe=function(R){return R===!0||R==="mobile"&&de.mobile()||R==="phone"&&de.phone()||R==="tablet"&&de.tablet()||typeof R=="function"&&R()===!0};return{init:function(R){return re=Re(re,R),xe=Oe(),re.disableMutationObserver||be.isSupported()||(console.info(`
|
|
2
2
|
aos: MutationObserver is not supported on this browser,
|
|
3
3
|
code mutations observing has been disabled.
|
|
4
4
|
You may have to call "refreshHard()" by yourself.
|
|
5
|
-
`),
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(c,d){if(c){if(typeof c=="string")return r(c,d);var o=Object.prototype.toString.call(c).slice(8,-1);return o==="Object"&&c.constructor&&(o=c.constructor.name),o==="Map"||o==="Set"?Array.from(c):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(c,d):void 0}}function r(c,d){(d==null||d>c.length)&&(d=c.length);for(var o=0,h=new Array(d);o<d;o++)h[o]=c[o];return h}function a(c,d){if(typeof Symbol<"u"&&Symbol.iterator in Object(c)){var o=[],h=!0,f=!1,v=void 0;try{for(var S,R=c[Symbol.iterator]();!(h=(S=R.next()).done)&&(o.push(S.value),!d||o.length!==d);h=!0);}catch(y){f=!0,v=y}finally{try{h||R.return==null||R.return()}finally{if(f)throw v}}return o}}function u(c){if(Array.isArray(c))return c}(function(){function c(g){return["elInY+elHeight","elCenterY-".concat(g=0<arguments.length&&g!==void 0?g:30),"elCenterY","elCenterY+".concat(g),"elOutY-elHeight"]}var d,o,h,f,v,S,R={fadeInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:0,{opacity:[c(0<arguments.length&&g!==void 0?g:30),[w,1,1,1,w]]}},fadeIn:function(g,w){return{opacity:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:0,1]]}},fadeOut:function(g,w){return{opacity:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&w!==void 0?w:0]]}},blurInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:20,{blur:[c(0<arguments.length&&g!==void 0?g:100),[w,0,0,0,w]]}},blurIn:function(g,w){return{blur:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:20,0]]}},blurOut:function(g,w){return{opacity:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[0,1<arguments.length&&w!==void 0?w:20]]}},scaleInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:.6,{scale:[c(0<arguments.length&&g!==void 0?g:100),[w,1,1,1,w]]}},scaleIn:function(g,w){return{scale:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:.6,1]]}},scaleOut:function(g,w){return{scale:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&w!==void 0?w:.6]]}},slideX:function(g,w){return{translateX:[["elInY",0<arguments.length&&g!==void 0?g:0],[0,1<arguments.length&&w!==void 0?w:500]]}},slideY:function(g,w){return{translateY:[["elInY",0<arguments.length&&g!==void 0?g:0],[0,1<arguments.length&&w!==void 0?w:500]]}},spin:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotate:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},flipX:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotateX:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},flipY:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotateY:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},jiggle:function(g,w){return g=0<arguments.length&&g!==void 0?g:50,w=1<arguments.length&&w!==void 0?w:40,{skewX:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},seesaw:function(g,w){return g=0<arguments.length&&g!==void 0?g:50,w=1<arguments.length&&w!==void 0?w:40,{skewY:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},zigzag:function(g,w){return g=0<arguments.length&&g!==void 0?g:100,w=1<arguments.length&&w!==void 0?w:100,{translateX:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},hueRotate:function(g,w){return g=0<arguments.length&&g!==void 0?g:600,{"hue-rotate":[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}}},y=(d=["perspective","scaleX","scaleY","scale","skewX","skewY","skew","rotateX","rotateY","rotate"],o=["blur","hue-rotate","brightness"],h=["translateX","translateY","translateZ"],f=["perspective","border-radius","blur","translateX","translateY","translateZ"],v=["hue-rotate","rotate","rotateX","rotateY","skew","skewX","skewY"],S={easeInQuad:function(g){return g*g},easeOutQuad:function(g){return g*(2-g)},easeInOutQuad:function(g){return g<.5?2*g*g:(4-2*g)*g-1},easeInCubic:function(g){return g*g*g},easeOutCubic:function(g){return--g*g*g+1},easeInOutCubic:function(g){return g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1},easeInQuart:function(g){return g*g*g*g},easeOutQuart:function(g){return 1- --g*g*g*g},easeInOutQuart:function(g){return g<.5?8*g*g*g*g:1-8*--g*g*g*g},easeInQuint:function(g){return g*g*g*g*g},easeOutQuint:function(g){return 1+--g*g*g*g*g},easeInOutQuint:function(g){return g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g},easeOutBounce:function(g){var w=7.5625,q=2.75;return g<1/q?w*g*g:g<2/q?w*(g-=1.5/q)*g+.75:g<2.5/q?w*(g-=2.25/q)*g+.9375:w*(g-=2.625/q)*g+.984375},easeInBounce:function(g){return 1-S.easeOutBounce(1-g)},easeOutBack:function(g){return 1+2.70158*Math.pow(g-1,3)+1.70158*Math.pow(g-1,2)},easeInBack:function(g){return 2.70158*g*g*g-1.70158*g*g}},new function g(){var w=this;e(this,g),i(this,"drivers",[]),i(this,"elements",[]),i(this,"frame",0),i(this,"debug",!1),i(this,"windowWidth",0),i(this,"windowHeight",0),i(this,"presets",R),i(this,"debugData",{frameLengths:[]}),i(this,"init",function(){w.findAndAddElements(),window.requestAnimationFrame(w.onAnimationFrame),w.windowWidth=document.body.clientWidth,w.windowHeight=document.body.clientHeight,window.onresize=w.onWindowResize}),i(this,"onWindowResize",function(){document.body.clientWidth===w.windowWidth&&document.body.clientHeight===w.windowHeight||(w.windowWidth=document.body.clientWidth,w.windowHeight=document.body.clientHeight,w.elements.forEach(function(q){return q.calculateTransforms()}))}),i(this,"onAnimationFrame",function(q){w.debug&&(w.debugData.frameStart=Date.now());var V,I={};w.drivers.forEach(function(F){I[F.name]=F.getValue(w.frame)}),w.elements.forEach(function(F){F.update(I,w.frame)}),w.debug&&w.debugData.frameLengths.push(Date.now()-w.debugData.frameStart),w.frame%60==0&&w.debug&&(V=Math.ceil(w.debugData.frameLengths.reduce(function(F,G){return F+G},0)/60),console.log("Average frame calculation time: ".concat(V,"ms")),w.debugData.frameLengths=[]),w.frame++,window.requestAnimationFrame(w.onAnimationFrame)}),i(this,"addDriver",function(q,V){var I=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};w.drivers.push(new k(q,V,I))}),i(this,"removeDriver",function(q){w.drivers=w.drivers.filter(function(V){return V.name!==q})}),i(this,"findAndAddElements",function(){w.elements=[],document.querySelectorAll(".lax").forEach(function(q){var V=[];q.classList.forEach(function(F){F.includes("lax_preset")&&(F=F.replace("lax_preset_",""),V.push(F))});var I=i({},"scrollY",{presets:V});w.elements.push(new C(".lax",w,q,I,0,{}))})}),i(this,"addElements",function(q,V,I){document.querySelectorAll(q).forEach(function(F,G){w.elements.push(new C(q,w,F,V,G,I))})}),i(this,"removeElements",function(q){w.elements=w.elements.filter(function(V){return V.selector!==q})}),i(this,"addElement",function(q,V,I){w.elements.push(new C("",w,q,V,0,I))}),i(this,"removeElement",function(q){w.elements=w.elements.filter(function(V){return V.domElement!==q})})});function E(g,w){if(Array.isArray(g))return g;for(var q=Object.keys(g).map(function(G){return parseInt(G)}).sort(function(G,B){return B<G?1:-1}),V=q[q.length-1],I=0;I<q.length;I++){var F=q[I];if(w<F){V=F;break}}return g[V]}function b(g,N,q){var V=N.width,I=N.height,L=N.x,W=N.y;if(typeof g=="number")return g;var F,G=document.body.scrollHeight,B=document.body.scrollWidth,M=window.innerWidth,_=window.innerHeight,P=s((F=window.pageXOffset!==void 0,P=(document.compatMode||"")==="CSS1Compat",N=F?window.pageXOffset:(P?document.documentElement:document.body).scrollLeft,[F?window.pageYOffset:(P?document.documentElement:document.body).scrollTop,N]),2),N=P[0],L=L+P[1],P=L+V,W=W+N,N=W+I;return Function("return ".concat(g.replace(/screenWidth/g,M).replace(/screenHeight/g,_).replace(/pageHeight/g,G).replace(/pageWidth/g,B).replace(/elWidth/g,V).replace(/elHeight/g,I).replace(/elInY/g,W-_).replace(/elOutY/g,N).replace(/elCenterY/g,W+I/2-_/2).replace(/elInX/g,L-M).replace(/elOutX/g,P).replace(/elCenterX/g,L+V/2-M/2).replace(/index/g,q)))()}function k(g,w){var q=this,V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};e(this,k),i(this,"getValueFn",void 0),i(this,"name",""),i(this,"lastValue",0),i(this,"frameStep",1),i(this,"m1",0),i(this,"m2",0),i(this,"inertia",0),i(this,"inertiaEnabled",!1),i(this,"getValue",function(I){var F=q.lastValue;return I%q.frameStep==0&&(F=q.getValueFn(I)),q.inertiaEnabled&&(I=F-q.lastValue,q.m1=.8*q.m1+I*.19999999999999996,q.m2=.8*q.m2+q.m1*.19999999999999996,q.inertia=Math.round(5e3*q.m2)/15e3),q.lastValue=F,[q.lastValue,q.inertia]}),this.name=g,this.getValueFn=w,Object.keys(V).forEach(function(I){q[I]=V[I]}),this.lastValue=this.getValueFn(0)}function C(g,w,q,V){var I=this,F=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,B=5<arguments.length&&arguments[5]!==void 0?arguments[5]:{};e(this,C),i(this,"domElement",void 0),i(this,"transformsData",void 0),i(this,"styles",{}),i(this,"selector",""),i(this,"groupIndex",0),i(this,"laxInstance",void 0),i(this,"onUpdate",void 0),i(this,"update",function(M,_){var L,P=I.transforms,W={};for(L in P){var N=P[L];M[L]||console.error("No lax driver with name: ",L);var J,Q=s(M[L],2),se=Q[0],re=Q[1];for(J in N){var ae,Ae=s(N[J],3),de=Ae[0],ue=Ae[1],qe=Ae[2],be=qe===void 0?{}:qe,Se=be.modValue,Ee=be.frameStep,Ie=Ee===void 0?1:Ee,X=be.easing,Ae=be.inertia,qe=be.inertiaMode,Ee=be.cssFn,be=be.cssUnit,be=be===void 0?"":be,X=S[X];_%Ie==0&&(X=(function(ie,ge,ve,Oe){var ye=0;if(ie.forEach(function(ne){ne<ve&&ye++}),ye<=0)return ge[0];if(ye>=ie.length)return ge[ie.length-1];var fe,he=(he=ie[fe=ye-1],ie=ie[ye],(ve-he)/(ie-he));return Oe&&(he=Oe(he)),fe=ge[fe],ge=ge[ye],fe*(1-(he=he))+ge*he})(de,ue,Se?se%Se:se,X),Ae&&(ae=re*Ae,qe==="absolute"&&(ae=Math.abs(ae)),X+=ae),ae=(be||f.includes(J)?"px":v.includes(J)?"deg":"")=="px"?0:3,ae=X.toFixed(ae),W[J]=Ee?Ee(ae,I.domElement):ae+be)}}I.applyStyles(W),I.onUpdate&&I.onUpdate(M,I.domElement)}),i(this,"calculateTransforms",function(){I.transforms={};var M,_=I.laxInstance.windowWidth;for(M in I.transformsData)(function(L){var P=I.transformsData[L],W={},N=P.presets;(N===void 0?[]:N).forEach(function(de){var se,ue=s(de.split(":"),3),re=ue[0],ae=ue[1],de=ue[2],ue=window.lax.presets[re];ue?(se=ue(ae,de),Object.keys(se).forEach(function(Se){P[Se]=se[Se]})):console.error("Lax preset cannot be found with name: ",re)}),delete P.presets;for(var J in P)(function(Q){var se=s(P[Q],3),de=se[0],ae=de===void 0?[-1e9,1e9]:de,de=se[1],de=de===void 0?[-1e9,1e9]:de,se=se[2],se=se===void 0?{}:se,re=I.domElement.getBoundingClientRect(),ae=E(ae,_).map(function(ue){return b(ue,re,I.groupIndex)}),de=E(de,_).map(function(ue){return b(ue,re,I.groupIndex)});W[Q]=[ae,de,se]})(J);I.transforms[L]=W})(M)}),i(this,"applyStyles",function(M){var _,L,P,W=(_=M,L={transform:"",filter:""},P={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(_).forEach(function(N){var J=_[N],Q=f.includes(N)?"px":v.includes(N)?"deg":"";h.includes(N)?P[N]=J:d.includes(N)?L.transform+="".concat(N,"(").concat(J).concat(Q,") "):o.includes(N)?L.filter+="".concat(N,"(").concat(J).concat(Q,") "):L[N]="".concat(J).concat(Q," ")}),L.transform="translate3d(".concat(P.translateX,"px, ").concat(P.translateY,"px, ").concat(P.translateZ,"px) ").concat(L.transform),L);Object.keys(W).forEach(function(N){I.domElement.style.setProperty(N,W[N])})}),this.selector=g,this.laxInstance=w,this.domElement=q,this.transformsData=V,this.groupIndex=F;var G=(F=B.style)===void 0?{}:F,B=B.onUpdate;Object.keys(G).forEach(function(M){q.style.setProperty(M,G[M])}),B&&(this.onUpdate=B),this.calculateTransforms()}m.exports!==void 0?m.exports=y:window.lax=y})()})(Mt)),Mt.exports}var Ni=Ii();const et=dt(Ni);class Pi{constructor(e={}){const i={};this.settings=Object.assign(this,i,e),this.elements=[]}init(){et.init(),et.addDriver("scrollY",function(){return window.scrollY}),this.refresh(),this.lax=et,Object.assign(this,et)}refresh(){let e=!1;document.body.hasAttribute("data-skrollrr-off")&&(e=!0),this.elements.forEach(t=>{et.removeElement(t),t.style&&(t.style.transition&&(t.style.transition=""),t.style.transform&&(t.style.transform=""))}),this.elements=[];let i=window.innerWidth;document.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]").forEach(t=>{let n=!1;if(i<=760&&t.closest(".m-skrollrr-off")&&(n=!0),e||n){t.style.transform="",t.style.transition="",t.style.opacity="";return}t.style.transform="";let r=this.getObjVal(t,"data-top-bottom"),a=this.getObjVal(t,"data-top"),u=this.getObjVal(t,"data-50-top"),c=this.getObjVal(t,"data-100-top"),d=this.getObjVal(t,"data-center-bottom"),o=this.getObjVal(t,"data-center"),h=this.getObjVal(t,"data-center-top"),f=this.getObjVal(t,"data--400-bottom"),v=this.getObjVal(t,"data--300-bottom"),S=this.getObjVal(t,"data--200-bottom"),R=this.getObjVal(t,"data--150-bottom"),y=this.getObjVal(t,"data--100-bottom"),E=this.getObjVal(t,"data--50-bottom"),b=this.getObjVal(t,"data-bottom"),k=this.getObjVal(t,"data-50-bottom"),C=this.getObjVal(t,"data-100-bottom"),g=this.getObjVal(t,"data-150-bottom"),w=this.getObjVal(t,"data-200-bottom"),q=this.getObjVal(t,"data-300-bottom"),V=this.getObjVal(t,"data-400-bottom"),I=this.getObjVal(t,"data-bottom-top"),F=this.getObjVal(t,"data-in"),G=this.getObjVal(t,"data-in-150"),B=this.getObjVal(t,"data-in-300"),M=this.getObjVal(t,"data-cen--150"),_=this.getObjVal(t,"data-cen"),L=this.getObjVal(t,"data-cen-150"),P=this.getObjVal(t,"data-out--300"),W=this.getObjVal(t,"data-out--150"),N=this.getObjVal(t,"data-out"),J=!1;t.hasAttribute("data-xs")&&(J=!0);let Q=!1;t.hasAttribute("data-sm")&&(Q=!0);let se=!1;t.hasAttribute("data-md")&&(se=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let re={},ae={},de={},ue={},Se={},Ie={},Ae={},qe={},Ee={},be={},X={},ie={},ge={},ve={},Oe={},ye={},fe={},he={},ne={},Me={},l={},p={},x={},T={},O={},D={},H={},$={},A={},j={},U={},Y={},Z={};(i>1280||i>970&&i<=1280&&!se||i>760&&i<=970&&!Q||i<=760&&!J)&&(de=this.getObjVal(t,"data-t"),ue=this.getObjVal(t,"data-t-100"),Se=this.getObjVal(t,"data-t-200"),Ie=this.getObjVal(t,"data-t-300"),Ae=this.getObjVal(t,"data-t-400"),qe=this.getObjVal(t,"data-t-500"),Ee=this.getObjVal(t,"data-t-600"),be=this.getObjVal(t,"data-t-700"),X=this.getObjVal(t,"data-t-800"),ie=this.getObjVal(t,"data-t-900"),ge=this.getObjVal(t,"data-t-1000"),ve=this.getObjVal(t,"data-t-1100"),Oe=this.getObjVal(t,"data-t-1200"),ye=this.getObjVal(t,"data-t-1300"),fe=this.getObjVal(t,"data-t-1400"),he=this.getObjVal(t,"data-t-1500"),ne=this.getObjVal(t,"data-t-1600"),Me=this.getObjVal(t,"data-t-1700"),l=this.getObjVal(t,"data-t-1800"),p=this.getObjVal(t,"data-t-1900"),x=this.getObjVal(t,"data-t-2000"),T=this.getObjVal(t,"data-t-2100"),O=this.getObjVal(t,"data-t-2200"),D=this.getObjVal(t,"data-t-2300"),H=this.getObjVal(t,"data-t-2400"),$=this.getObjVal(t,"data-t-2500"),A=this.getObjVal(t,"data-t-2600"),j=this.getObjVal(t,"data-t-2700"),U=this.getObjVal(t,"data-t-2800")),i>970&&i<=1280&&se&&(t.hasAttribute("data-md-t")&&(de=this.getObjVal(t,"data-md-t")),t.hasAttribute("data-md-t-100")&&(ue=this.getObjVal(t,"data-md-t-100")),t.hasAttribute("data-md-t-200")&&(Se=this.getObjVal(t,"data-md-t-200")),t.hasAttribute("data-md-t-300")&&(Ie=this.getObjVal(t,"data-md-t-300")),t.hasAttribute("data-md-t-400")&&(Ae=this.getObjVal(t,"data-md-t-400")),t.hasAttribute("data-md-t-500")&&(qe=this.getObjVal(t,"data-md-t-500")),t.hasAttribute("data-md-t-600")&&(Ee=this.getObjVal(t,"data-md-t-600")),t.hasAttribute("data-md-t-700")&&(be=this.getObjVal(t,"data-md-t-700")),t.hasAttribute("data-md-t-800")&&(X=this.getObjVal(t,"data-md-t-800")),t.hasAttribute("data-md-t-900")&&(ie=this.getObjVal(t,"data-md-t-900")),t.hasAttribute("data-md-t-1000")&&(ge=this.getObjVal(t,"data-md-t-1000")),t.hasAttribute("data-md-t-1100")&&(ve=this.getObjVal(t,"data-md-t-1100")),t.hasAttribute("data-md-t-1200")&&(Oe=this.getObjVal(t,"data-md-t-1200")),t.hasAttribute("data-md-t-1300")&&(ye=this.getObjVal(t,"data-md-t-1300")),t.hasAttribute("data-md-t-1400")&&(fe=this.getObjVal(t,"data-md-t-1400")),t.hasAttribute("data-md-t-1500")&&(he=this.getObjVal(t,"data-md-t-1500")),t.hasAttribute("data-md-t-1600")&&(ne=this.getObjVal(t,"data-md-t-1600")),t.hasAttribute("data-md-t-1700")&&(Me=this.getObjVal(t,"data-md-t-1700")),t.hasAttribute("data-md-t-1800")&&(l=this.getObjVal(t,"data-md-t-1800")),t.hasAttribute("data-md-t-1900")&&(p=this.getObjVal(t,"data-md-t-1900")),t.hasAttribute("data-md-t-2000")&&(x=this.getObjVal(t,"data-md-t-2000")),t.hasAttribute("data-md-t-2100")&&(T=this.getObjVal(t,"data-md-t-2100")),t.hasAttribute("data-md-t-2200")&&(O=this.getObjVal(t,"data-md-t-2200")),t.hasAttribute("data-md-t-2300")&&(D=this.getObjVal(t,"data-md-t-2300")),t.hasAttribute("data-md-t-2400")&&(H=this.getObjVal(t,"data-md-t-2400")),t.hasAttribute("data-md-t-2500")&&($=this.getObjVal(t,"data-md-t-2500")),t.hasAttribute("data-md-t-2600")&&(A=this.getObjVal(t,"data-md-t-2600")),t.hasAttribute("data-md-t-2700")&&(j=this.getObjVal(t,"data-md-t-2700")),t.hasAttribute("data-md-t-2800")&&(U=this.getObjVal(t,"data-md-t-2800"))),i<=970&&t.hasAttribute("m-data-out")&&(N=this.getObjVal(t,"m-data-out")),(i>760&&i<=970&&Q||i<=760&&!J&&Q)&&(t.hasAttribute("data-sm-t")&&(de=this.getObjVal(t,"data-sm-t")),t.hasAttribute("data-sm-t-100")&&(ue=this.getObjVal(t,"data-sm-t-100")),t.hasAttribute("data-sm-t-200")&&(Se=this.getObjVal(t,"data-sm-t-200")),t.hasAttribute("data-sm-t-300")&&(Ie=this.getObjVal(t,"data-sm-t-300")),t.hasAttribute("data-sm-t-400")&&(Ae=this.getObjVal(t,"data-sm-t-400")),t.hasAttribute("data-sm-t-500")&&(qe=this.getObjVal(t,"data-sm-t-500")),t.hasAttribute("data-sm-t-600")&&(Ee=this.getObjVal(t,"data-sm-t-600")),t.hasAttribute("data-sm-t-700")&&(be=this.getObjVal(t,"data-sm-t-700")),t.hasAttribute("data-sm-t-800")&&(X=this.getObjVal(t,"data-sm-t-800")),t.hasAttribute("data-sm-t-900")&&(ie=this.getObjVal(t,"data-sm-t-900")),t.hasAttribute("data-sm-t-1000")&&(ge=this.getObjVal(t,"data-sm-t-1000")),t.hasAttribute("data-sm-t-1100")&&(ve=this.getObjVal(t,"data-sm-t-1100")),t.hasAttribute("data-sm-t-1200")&&(Oe=this.getObjVal(t,"data-sm-t-1200")),t.hasAttribute("data-sm-t-1300")&&(ye=this.getObjVal(t,"data-sm-t-1300")),t.hasAttribute("data-sm-t-1400")&&(fe=this.getObjVal(t,"data-sm-t-1400")),t.hasAttribute("data-sm-t-1500")&&(he=this.getObjVal(t,"data-sm-t-1500")),t.hasAttribute("data-sm-t-1600")&&(ne=this.getObjVal(t,"data-sm-t-1600")),t.hasAttribute("data-sm-t-1700")&&(Me=this.getObjVal(t,"data-sm-t-1700")),t.hasAttribute("data-sm-t-1800")&&(l=this.getObjVal(t,"data-sm-t-1800")),t.hasAttribute("data-sm-t-1900")&&(p=this.getObjVal(t,"data-sm-t-1900")),t.hasAttribute("data-sm-t-2000")&&(x=this.getObjVal(t,"data-sm-t-2000")),t.hasAttribute("data-sm-t-2100")&&(T=this.getObjVal(t,"data-sm-t-2100")),t.hasAttribute("data-sm-t-2200")&&(O=this.getObjVal(t,"data-sm-t-2200")),t.hasAttribute("data-sm-t-2300")&&(D=this.getObjVal(t,"data-sm-t-2300")),t.hasAttribute("data-sm-t-2400")&&(H=this.getObjVal(t,"data-sm-t-2400")),t.hasAttribute("data-sm-t-2500")&&($=this.getObjVal(t,"data-sm-t-2500")),t.hasAttribute("data-sm-t-2600")&&(A=this.getObjVal(t,"data-sm-t-2600")),t.hasAttribute("data-sm-t-2700")&&(j=this.getObjVal(t,"data-sm-t-2700")),t.hasAttribute("data-sm-t-2800")&&(U=this.getObjVal(t,"data-sm-t-2800"))),i<=414&&J&&(t.hasAttribute("data-xs-t")&&(de=this.getObjVal(t,"data-xs-t")),t.hasAttribute("data-xs-t-100")&&(ue=this.getObjVal(t,"data-xs-t-100")),t.hasAttribute("data-xs-t-200")&&(Se=this.getObjVal(t,"data-xs-t-200")),t.hasAttribute("data-xs-t-300")&&(Ie=this.getObjVal(t,"data-xs-t-300")),t.hasAttribute("data-xs-t-400")&&(Ae=this.getObjVal(t,"data-xs-t-400")),t.hasAttribute("data-xs-t-500")&&(qe=this.getObjVal(t,"data-xs-t-500")),t.hasAttribute("data-xs-t-600")&&(Ee=this.getObjVal(t,"data-xs-t-600")),t.hasAttribute("data-xs-t-700")&&(be=this.getObjVal(t,"data-xs-t-700")),t.hasAttribute("data-xs-t-800")&&(X=this.getObjVal(t,"data-xs-t-800")),t.hasAttribute("data-xs-t-900")&&(ie=this.getObjVal(t,"data-xs-t-900")),t.hasAttribute("data-xs-t-1000")&&(ge=this.getObjVal(t,"data-xs-t-1000")),t.hasAttribute("data-xs-t-1100")&&(ve=this.getObjVal(t,"data-xs-t-1100")),t.hasAttribute("data-xs-t-1200")&&(Oe=this.getObjVal(t,"data-xs-t-1200")),t.hasAttribute("data-xs-t-1300")&&(ye=this.getObjVal(t,"data-xs-t-1300")),t.hasAttribute("data-xs-t-1400")&&(fe=this.getObjVal(t,"data-xs-t-1400")),t.hasAttribute("data-xs-t-1500")&&(he=this.getObjVal(t,"data-xs-t-1500")),t.hasAttribute("data-xs-t-1600")&&(ne=this.getObjVal(t,"data-xs-t-1600")),t.hasAttribute("data-xs-t-1700")&&(Me=this.getObjVal(t,"data-xs-t-1700")),t.hasAttribute("data-xs-t-1800")&&(l=this.getObjVal(t,"data-xs-t-1800")),t.hasAttribute("data-xs-t-1900")&&(p=this.getObjVal(t,"data-xs-t-1900")),t.hasAttribute("data-xs-t-2000")&&(x=this.getObjVal(t,"data-xs-t-2000")),t.hasAttribute("data-xs-t-2100")&&(T=this.getObjVal(t,"data-xs-t-2100")),t.hasAttribute("data-xs-t-2200")&&(O=this.getObjVal(t,"data-xs-t-2200")),t.hasAttribute("data-xs-t-2300")&&(D=this.getObjVal(t,"data-xs-t-2300")),t.hasAttribute("data-xs-t-2400")&&(H=this.getObjVal(t,"data-xs-t-2400")),t.hasAttribute("data-xs-t-2500")&&($=this.getObjVal(t,"data-xs-t-2500")),t.hasAttribute("data-xs-t-2600")&&(A=this.getObjVal(t,"data-xs-t-2600")),t.hasAttribute("data-xs-t-2700")&&(j=this.getObjVal(t,"data-xs-t-2700")),t.hasAttribute("data-xs-t-2800")&&(U=this.getObjVal(t,"data-xs-t-2800")));let ee=de,te=ue,K=Se,me=Ie,le=Ae,Ce=qe,pe=Ee,xe=be,Le=X,$e=ie,Ne=ge,Pe=ve,ke=Oe,ce=ye,Re=fe,De=he,Ge=ne,st=Me,_e=l,He=p,Ue=x,Xe=T,nt=O,rt=D,at=H,Ot=$,At=A,qt=j,Rt=U,Ke=window.innerHeight;Ke<730?(re=ee,ae=te,de=K,ue=me,Se=le,Ie=Ce,Ae=pe,qe=xe,Ee=Le,be=$e,X=Ne,ie=Pe,ge=ke,ve=ce,Oe=Re,ye=De,fe=Ge,he=st,ne=_e,Me=He,l=Ue,p=Xe,x=nt,T=rt,O=at,D=Ot,H=At,$=qt,A=Rt,j={},U={}):Ke>=730&&Ke<790?(ae=ee,de=te,ue=K,Se=me,Ie=le,Ae=Ce,qe=pe,Ee=xe,be=Le,X=$e,ie=Ne,ge=Pe,ve=ke,Oe=ce,ye=Re,fe=De,he=Ge,ne=st,Me=_e,l=He,p=Ue,x=Xe,T=nt,O=rt,D=at,H=Ot,$=At,A=qt,j=Rt,U={}):Ke>=790&&Ke<840||(Ke>=840&&Ke<1125?(de={},ue=ee,Se=te,Ie=K,Ae=me,qe=le,Ee=Ce,be=pe,X=xe,ie=Le,ge=$e,ve=Ne,Oe=Pe,ye=ke,fe=ce,he=Re,ne=De,Me=Ge,l=st,p=_e,x=He,T=Ue,O=Xe,D=nt,H=rt,$=at,A=Ot,j=At,U=qt,Y=Rt):(de={},ue={},Se=ee,Ie=te,Ae=K,qe=me,Ee=le,be=Ce,X=pe,ie=xe,ge=Le,ve=$e,Oe=Ne,ye=Pe,fe=ke,he=ce,ne=Re,Me=De,l=Ge,p=st,x=_e,T=He,O=Ue,D=Xe,H=nt,$=rt,A=at,j=Ot,U=At,Y=qt,Z=Rt));let z={};Object.keys(I).length!==0&&(z=this.parseObj(I,"elInY",z)),Object.keys(V).length!==0&&(z=this.parseObj(V,"elInY+50",z)),Object.keys(q).length!==0&&(z=this.parseObj(q,"elInY+100",z)),Object.keys(w).length!==0&&(z=this.parseObj(w,"elInY+150",z)),Object.keys(g).length!==0&&(z=this.parseObj(g,"elInY+200",z)),Object.keys(C).length!==0&&(z=this.parseObj(C,"elInY+250",z)),Object.keys(k).length!==0&&(z=this.parseObj(k,"elInY+300",z)),Object.keys(b).length!==0&&(z=this.parseObj(b,"elInY+350",z)),Object.keys(E).length!==0&&(z=this.parseObj(E,"elInY+400",z)),Object.keys(y).length!==0&&(z=this.parseObj(y,"elInY+450",z)),Object.keys(R).length!==0&&(z=this.parseObj(R,"elInY+500",z)),Object.keys(S).length!==0&&(z=this.parseObj(S,"elInY+550",z)),Object.keys(v).length!==0&&(z=this.parseObj(v,"elInY+600",z)),Object.keys(f).length!==0&&(z=this.parseObj(f,"elInY+650",z)),Object.keys(h).length!==0&&(z=this.parseObj(h,"elCenterY-300",z)),Object.keys(o).length!==0&&(z=this.parseObj(o,"elCenterY",z)),Object.keys(d).length!==0&&(z=this.parseObj(d,"elCenterY+100",z)),Object.keys(c).length!==0&&(z=this.parseObj(c,"elCenterY+200",z)),Object.keys(u).length!==0&&(z=this.parseObj(u,"elCenterY+300",z)),Object.keys(a).length!==0&&(z=this.parseObj(a,"elOutY-300",z)),Object.keys(r).length!==0&&(z=this.parseObj(r,"elOutY",z)),Object.keys(F).length!==0&&(z=this.parseObj(F,"elInY",z)),Object.keys(G).length!==0&&(z=this.parseObj(G,"elInY+150",z)),Object.keys(B).length!==0&&(z=this.parseObj(B,"elInY+300 ",z)),Object.keys(M).length!==0&&(z=this.parseObj(M,"elCenterY-150",z)),Object.keys(_).length!==0&&(z=this.parseObj(_,"elCenterY",z)),Object.keys(L).length!==0&&(z=this.parseObj(L,"elCenterY+150",z)),Object.keys(P).length!==0&&(z=this.parseObj(P,"elOutY-300 ",z)),Object.keys(W).length!==0&&(z=this.parseObj(W,"elOutY-150 ",z)),Object.keys(N).length!==0&&(z=this.parseObj(N,"elOutY",z)),Object.keys(re).length!==0&&(z=this.parseObj(re,"elInY-200",z)),Object.keys(ae).length!==0&&(z=this.parseObj(ae,"elInY-100",z)),Object.keys(de).length!==0&&(z=this.parseObj(de,"elInY",z)),Object.keys(ue).length!==0&&(z=this.parseObj(ue,"elInY+100",z)),Object.keys(Se).length!==0&&(z=this.parseObj(Se,"elInY+200",z)),Object.keys(Ie).length!==0&&(z=this.parseObj(Ie,"elInY+300 ",z)),Object.keys(Ae).length!==0&&(z=this.parseObj(Ae,"elInY+400 ",z)),Object.keys(qe).length!==0&&(z=this.parseObj(qe,"elInY+500 ",z)),Object.keys(Ee).length!==0&&(z=this.parseObj(Ee,"elInY+600 ",z)),Object.keys(be).length!==0&&(z=this.parseObj(be,"elInY+700 ",z)),Object.keys(X).length!==0&&(z=this.parseObj(X,"elInY+800 ",z)),Object.keys(ie).length!==0&&(z=this.parseObj(ie,"elInY+900 ",z)),Object.keys(ge).length!==0&&(z=this.parseObj(ge,"elInY+1000 ",z)),Object.keys(ve).length!==0&&(z=this.parseObj(ve,"elInY+1100 ",z)),Object.keys(Oe).length!==0&&(z=this.parseObj(Oe,"elInY+1200 ",z)),Object.keys(ye).length!==0&&(z=this.parseObj(ye,"elInY+1300 ",z)),Object.keys(fe).length!==0&&(z=this.parseObj(fe,"elInY+1400 ",z)),Object.keys(he).length!==0&&(z=this.parseObj(he,"elInY+1500 ",z)),Object.keys(ne).length!==0&&(z=this.parseObj(ne,"elInY+1600 ",z)),Object.keys(Me).length!==0&&(z=this.parseObj(Me,"elInY+1700 ",z)),Object.keys(l).length!==0&&(z=this.parseObj(l,"elInY+1800 ",z)),Object.keys(p).length!==0&&(z=this.parseObj(p,"elInY+1900 ",z)),Object.keys(x).length!==0&&(z=this.parseObj(x,"elInY+2000 ",z)),Object.keys(T).length!==0&&(z=this.parseObj(T,"elInY+2100 ",z)),Object.keys(O).length!==0&&(z=this.parseObj(O,"elInY+2200 ",z)),Object.keys(D).length!==0&&(z=this.parseObj(D,"elInY+2300 ",z)),Object.keys(H).length!==0&&(z=this.parseObj(H,"elInY+2400 ",z)),Object.keys($).length!==0&&(z=this.parseObj($,"elInY+2500 ",z)),Object.keys(A).length!==0&&(z=this.parseObj(A,"elInY+2600 ",z)),Object.keys(j).length!==0&&(z=this.parseObj(j,"elInY+2700 ",z)),Object.keys(U).length!==0&&(z=this.parseObj(U,"elInY+2800 ",z)),Object.keys(Y).length!==0&&(z=this.parseObj(Y,"elInY+2900 ",z)),Object.keys(Z).length!==0&&(z=this.parseObj(Z,"elInY+3000 ",z)),t.style.transition="",t.setAttribute("data-dummy-selector","1"),et.addElements("[data-dummy-selector]",{scrollY:z}),this.elements.push(document.querySelector("[data-dummy-selector]")),t.removeAttribute("data-dummy-selector"),setTimeout(()=>{t.style.opacity=1,t.getAttribute("data-smooth-scrolling")==="off"||this.settings.transition&&(t.style.transition=this.settings.transition)},100)})}parseTransformProperty(e){for(var i=/(\w+)\((.+?)\)/g,s={},t;t=i.exec(e);)s[t[1]]=s[t[1]]?s[t[1]].concat([t[2]]):[t[2]];return s}getObjVal(e,i){let s={},t=e.getAttribute(i);return t&&t.split(";").forEach(r=>{if(r.indexOf("transform")!==-1&&(s=this.parseTransformProperty(r)),r.indexOf("opacity")!==-1){let a=r.replace("opacity:","").replace(";","");s.opacity=[parseFloat(a)]}}),s}parseObj(e,i,s){if(e.translateY){let t;e.translateY[0].indexOf("%")!==-1?t=parseFloat(e.translateY[0])/100*window.innerHeight:t=parseFloat(e.translateY[0]),s.translateY||(s.translateY=[[],[]]),s.translateY[0].push(i),s.translateY[1].push(t)}if(e.translateX){let t;e.translateX[0].indexOf("%")!==-1?t=parseFloat(e.translateX[0])/100*window.innerWidth:t=parseFloat(e.translateX[0]),s.translateX||(s.translateX=[[],[]]),s.translateX[0].push(i),s.translateX[1].push(t)}if(e.scale){let t=parseFloat(e.scale[0]);s.scale||(s.scale=[[],[]]),s.scale[0].push(i),s.scale[1].push(t)}if(e.rotate){let t=parseFloat(e.rotate[0]);s.rotate||(s.rotate=[[],[]]),s.rotate[0].push(i),s.rotate[1].push(t)}if(e.opacity){let t=parseFloat(e.opacity[0]);s.opacity||(s.opacity=[[],[]]),s.opacity[0].push(i),s.opacity[1].push(t)}return s}}var jt={exports:{}},ti;function Di(){return ti||(ti=1,(function(m,e){(function(s,t){m.exports=t()})(window,function(){return(function(i){var s={};function t(n){if(s[n])return s[n].exports;var r=s[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=s,t.d=function(n,r,a){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:a})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var u in n)t.d(a,u,(function(c){return n[c]}).bind(null,u));return a},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=2)})([(function(i,s){/*!
|
|
5
|
+
`),re.disableMutationObserver=!0),re.disableMutationObserver||be.ready("[data-aos]",W),fe(re.disable)||C()?ce():(document.querySelector("body").setAttribute("data-aos-easing",re.easing),document.querySelector("body").setAttribute("data-aos-duration",re.duration),document.querySelector("body").setAttribute("data-aos-delay",re.delay),["DOMContentLoaded","load"].indexOf(re.startEvent)===-1?document.addEventListener(re.startEvent,function(){H(!0)}):window.addEventListener("load",function(){H(!0)}),re.startEvent==="DOMContentLoaded"&&["complete","interactive"].indexOf(document.readyState)>-1&&H(!0),window.addEventListener("resize",G(H,re.debounceDelay,!0)),window.addEventListener("orientationchange",G(H,re.debounceDelay,!0)),xe)},refresh:H,refreshHard:W}})})(vt)),vt.exports}var ys=bs();const vs=yt(ys);var Qt={exports:{}},Ei;function ws(){return Ei||(Ei=1,(function(u){function e(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}function i(c,d,o){return d in c?Object.defineProperty(c,d,{value:o,enumerable:!0,configurable:!0,writable:!0}):c[d]=o,c}function s(c,d){return l(c)||a(c,d)||n(c,d)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(c,d){if(c){if(typeof c=="string")return r(c,d);var o=Object.prototype.toString.call(c).slice(8,-1);return o==="Object"&&c.constructor&&(o=c.constructor.name),o==="Map"||o==="Set"?Array.from(c):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(c,d):void 0}}function r(c,d){(d==null||d>c.length)&&(d=c.length);for(var o=0,h=new Array(d);o<d;o++)h[o]=c[o];return h}function a(c,d){if(typeof Symbol<"u"&&Symbol.iterator in Object(c)){var o=[],h=!0,f=!1,m=void 0;try{for(var w,E=c[Symbol.iterator]();!(h=(w=E.next()).done)&&(o.push(w.value),!d||o.length!==d);h=!0);}catch(b){f=!0,m=b}finally{try{h||E.return==null||E.return()}finally{if(f)throw m}}return o}}function l(c){if(Array.isArray(c))return c}(function(){function c(p){return["elInY+elHeight","elCenterY-".concat(p=0<arguments.length&&p!==void 0?p:30),"elCenterY","elCenterY+".concat(p),"elOutY-elHeight"]}var d,o,h,f,m,w,E={fadeInOut:function(p,y){return y=1<arguments.length&&y!==void 0?y:0,{opacity:[c(0<arguments.length&&p!==void 0?p:30),[y,1,1,1,y]]}},fadeIn:function(p,y){return{opacity:[["elInY+elHeight",0<arguments.length&&p!==void 0?p:"elCenterY"],[1<arguments.length&&y!==void 0?y:0,1]]}},fadeOut:function(p,y){return{opacity:[[0<arguments.length&&p!==void 0?p:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&y!==void 0?y:0]]}},blurInOut:function(p,y){return y=1<arguments.length&&y!==void 0?y:20,{blur:[c(0<arguments.length&&p!==void 0?p:100),[y,0,0,0,y]]}},blurIn:function(p,y){return{blur:[["elInY+elHeight",0<arguments.length&&p!==void 0?p:"elCenterY"],[1<arguments.length&&y!==void 0?y:20,0]]}},blurOut:function(p,y){return{opacity:[[0<arguments.length&&p!==void 0?p:"elCenterY","elOutY-elHeight"],[0,1<arguments.length&&y!==void 0?y:20]]}},scaleInOut:function(p,y){return y=1<arguments.length&&y!==void 0?y:.6,{scale:[c(0<arguments.length&&p!==void 0?p:100),[y,1,1,1,y]]}},scaleIn:function(p,y){return{scale:[["elInY+elHeight",0<arguments.length&&p!==void 0?p:"elCenterY"],[1<arguments.length&&y!==void 0?y:.6,1]]}},scaleOut:function(p,y){return{scale:[[0<arguments.length&&p!==void 0?p:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&y!==void 0?y:.6]]}},slideX:function(p,y){return{translateX:[["elInY",0<arguments.length&&p!==void 0?p:0],[0,1<arguments.length&&y!==void 0?y:500]]}},slideY:function(p,y){return{translateY:[["elInY",0<arguments.length&&p!==void 0?p:0],[0,1<arguments.length&&y!==void 0?y:500]]}},spin:function(p,y){return p=0<arguments.length&&p!==void 0?p:1e3,{rotate:[[0,p],[0,1<arguments.length&&y!==void 0?y:360],{modValue:p}]}},flipX:function(p,y){return p=0<arguments.length&&p!==void 0?p:1e3,{rotateX:[[0,p],[0,1<arguments.length&&y!==void 0?y:360],{modValue:p}]}},flipY:function(p,y){return p=0<arguments.length&&p!==void 0?p:1e3,{rotateY:[[0,p],[0,1<arguments.length&&y!==void 0?y:360],{modValue:p}]}},jiggle:function(p,y){return p=0<arguments.length&&p!==void 0?p:50,y=1<arguments.length&&y!==void 0?y:40,{skewX:[[0,+p,2*p,3*p,4*p],[0,y,0,-y,0],{modValue:4*p}]}},seesaw:function(p,y){return p=0<arguments.length&&p!==void 0?p:50,y=1<arguments.length&&y!==void 0?y:40,{skewY:[[0,+p,2*p,3*p,4*p],[0,y,0,-y,0],{modValue:4*p}]}},zigzag:function(p,y){return p=0<arguments.length&&p!==void 0?p:100,y=1<arguments.length&&y!==void 0?y:100,{translateX:[[0,+p,2*p,3*p,4*p],[0,y,0,-y,0],{modValue:4*p}]}},hueRotate:function(p,y){return p=0<arguments.length&&p!==void 0?p:600,{"hue-rotate":[[0,p],[0,1<arguments.length&&y!==void 0?y:360],{modValue:p}]}}},b=(d=["perspective","scaleX","scaleY","scale","skewX","skewY","skew","rotateX","rotateY","rotate"],o=["blur","hue-rotate","brightness"],h=["translateX","translateY","translateZ"],f=["perspective","border-radius","blur","translateX","translateY","translateZ"],m=["hue-rotate","rotate","rotateX","rotateY","skew","skewX","skewY"],w={easeInQuad:function(p){return p*p},easeOutQuad:function(p){return p*(2-p)},easeInOutQuad:function(p){return p<.5?2*p*p:(4-2*p)*p-1},easeInCubic:function(p){return p*p*p},easeOutCubic:function(p){return--p*p*p+1},easeInOutCubic:function(p){return p<.5?4*p*p*p:(p-1)*(2*p-2)*(2*p-2)+1},easeInQuart:function(p){return p*p*p*p},easeOutQuart:function(p){return 1- --p*p*p*p},easeInOutQuart:function(p){return p<.5?8*p*p*p*p:1-8*--p*p*p*p},easeInQuint:function(p){return p*p*p*p*p},easeOutQuint:function(p){return 1+--p*p*p*p*p},easeInOutQuint:function(p){return p<.5?16*p*p*p*p*p:1+16*--p*p*p*p*p},easeOutBounce:function(p){var y=7.5625,T=2.75;return p<1/T?y*p*p:p<2/T?y*(p-=1.5/T)*p+.75:p<2.5/T?y*(p-=2.25/T)*p+.9375:y*(p-=2.625/T)*p+.984375},easeInBounce:function(p){return 1-w.easeOutBounce(1-p)},easeOutBack:function(p){return 1+2.70158*Math.pow(p-1,3)+1.70158*Math.pow(p-1,2)},easeInBack:function(p){return 2.70158*p*p*p-1.70158*p*p}},new function p(){var y=this;e(this,p),i(this,"drivers",[]),i(this,"elements",[]),i(this,"frame",0),i(this,"debug",!1),i(this,"windowWidth",0),i(this,"windowHeight",0),i(this,"presets",E),i(this,"debugData",{frameLengths:[]}),i(this,"init",function(){y.findAndAddElements(),window.requestAnimationFrame(y.onAnimationFrame),y.windowWidth=document.body.clientWidth,y.windowHeight=document.body.clientHeight,window.onresize=y.onWindowResize}),i(this,"onWindowResize",function(){document.body.clientWidth===y.windowWidth&&document.body.clientHeight===y.windowHeight||(y.windowWidth=document.body.clientWidth,y.windowHeight=document.body.clientHeight,y.elements.forEach(function(T){return T.calculateTransforms()}))}),i(this,"onAnimationFrame",function(T){y.debug&&(y.debugData.frameStart=Date.now());var M,q={};y.drivers.forEach(function(D){q[D.name]=D.getValue(y.frame)}),y.elements.forEach(function(D){D.update(q,y.frame)}),y.debug&&y.debugData.frameLengths.push(Date.now()-y.debugData.frameStart),y.frame%60==0&&y.debug&&(M=Math.ceil(y.debugData.frameLengths.reduce(function(D,$){return D+$},0)/60),console.log("Average frame calculation time: ".concat(M,"ms")),y.debugData.frameLengths=[]),y.frame++,window.requestAnimationFrame(y.onAnimationFrame)}),i(this,"addDriver",function(T,M){var q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};y.drivers.push(new v(T,M,q))}),i(this,"removeDriver",function(T){y.drivers=y.drivers.filter(function(M){return M.name!==T})}),i(this,"findAndAddElements",function(){y.elements=[],document.querySelectorAll(".lax").forEach(function(T){var M=[];T.classList.forEach(function(D){D.includes("lax_preset")&&(D=D.replace("lax_preset_",""),M.push(D))});var q=i({},"scrollY",{presets:M});y.elements.push(new _(".lax",y,T,q,0,{}))})}),i(this,"addElements",function(T,M,q){document.querySelectorAll(T).forEach(function(D,$){y.elements.push(new _(T,y,D,M,$,q))})}),i(this,"removeElements",function(T){y.elements=y.elements.filter(function(M){return M.selector!==T})}),i(this,"addElement",function(T,M,q){y.elements.push(new _("",y,T,M,0,q))}),i(this,"removeElement",function(T){y.elements=y.elements.filter(function(M){return M.domElement!==T})})});function k(p,y){if(Array.isArray(p))return p;for(var T=Object.keys(p).map(function($){return parseInt($)}).sort(function($,j){return j<$?1:-1}),M=T[T.length-1],q=0;q<T.length;q++){var D=T[q];if(y<D){M=D;break}}return p[M]}function g(p,L,T){var M=L.width,q=L.height,S=L.x,N=L.y;if(typeof p=="number")return p;var D,$=document.body.scrollHeight,j=document.body.scrollWidth,O=window.innerWidth,x=window.innerHeight,A=s((D=window.pageXOffset!==void 0,A=(document.compatMode||"")==="CSS1Compat",L=D?window.pageXOffset:(A?document.documentElement:document.body).scrollLeft,[D?window.pageYOffset:(A?document.documentElement:document.body).scrollTop,L]),2),L=A[0],S=S+A[1],A=S+M,N=N+L,L=N+q;return Function("return ".concat(p.replace(/screenWidth/g,O).replace(/screenHeight/g,x).replace(/pageHeight/g,$).replace(/pageWidth/g,j).replace(/elWidth/g,M).replace(/elHeight/g,q).replace(/elInY/g,N-x).replace(/elOutY/g,L).replace(/elCenterY/g,N+q/2-x/2).replace(/elInX/g,S-O).replace(/elOutX/g,A).replace(/elCenterX/g,S+M/2-O/2).replace(/index/g,T)))()}function v(p,y){var T=this,M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};e(this,v),i(this,"getValueFn",void 0),i(this,"name",""),i(this,"lastValue",0),i(this,"frameStep",1),i(this,"m1",0),i(this,"m2",0),i(this,"inertia",0),i(this,"inertiaEnabled",!1),i(this,"getValue",function(q){var D=T.lastValue;return q%T.frameStep==0&&(D=T.getValueFn(q)),T.inertiaEnabled&&(q=D-T.lastValue,T.m1=.8*T.m1+q*.19999999999999996,T.m2=.8*T.m2+T.m1*.19999999999999996,T.inertia=Math.round(5e3*T.m2)/15e3),T.lastValue=D,[T.lastValue,T.inertia]}),this.name=p,this.getValueFn=y,Object.keys(M).forEach(function(q){T[q]=M[q]}),this.lastValue=this.getValueFn(0)}function _(p,y,T,M){var q=this,D=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,j=5<arguments.length&&arguments[5]!==void 0?arguments[5]:{};e(this,_),i(this,"domElement",void 0),i(this,"transformsData",void 0),i(this,"styles",{}),i(this,"selector",""),i(this,"groupIndex",0),i(this,"laxInstance",void 0),i(this,"onUpdate",void 0),i(this,"update",function(O,x){var S,A=q.transforms,N={};for(S in A){var L=A[S];O[S]||console.error("No lax driver with name: ",S);var V,U=s(O[S],2),Y=U[0],G=U[1];for(V in L){var K,ke=s(L[V],3),ie=ke[0],ee=ke[1],Re=ke[2],ue=Re===void 0?{}:Re,be=ue.modValue,Se=ue.frameStep,Ae=Se===void 0?1:Se,z=ue.easing,ke=ue.inertia,Re=ue.inertiaMode,Se=ue.cssFn,ue=ue.cssUnit,ue=ue===void 0?"":ue,z=w[z];x%Ae==0&&(z=(function(X,ae,de,we){var he=0;if(X.forEach(function(J){J<de&&he++}),he<=0)return ae[0];if(he>=X.length)return ae[X.length-1];var le,ne=(ne=X[le=he-1],X=X[he],(de-ne)/(X-ne));return we&&(ne=we(ne)),le=ae[le],ae=ae[he],le*(1-(ne=ne))+ae*ne})(ie,ee,be?Y%be:Y,z),ke&&(K=G*ke,Re==="absolute"&&(K=Math.abs(K)),z+=K),K=(ue||f.includes(V)?"px":m.includes(V)?"deg":"")=="px"?0:3,K=z.toFixed(K),N[V]=Se?Se(K,q.domElement):K+ue)}}q.applyStyles(N),q.onUpdate&&q.onUpdate(O,q.domElement)}),i(this,"calculateTransforms",function(){q.transforms={};var O,x=q.laxInstance.windowWidth;for(O in q.transformsData)(function(S){var A=q.transformsData[S],N={},L=A.presets;(L===void 0?[]:L).forEach(function(ie){var Y,ee=s(ie.split(":"),3),G=ee[0],K=ee[1],ie=ee[2],ee=window.lax.presets[G];ee?(Y=ee(K,ie),Object.keys(Y).forEach(function(be){A[be]=Y[be]})):console.error("Lax preset cannot be found with name: ",G)}),delete A.presets;for(var V in A)(function(U){var Y=s(A[U],3),ie=Y[0],K=ie===void 0?[-1e9,1e9]:ie,ie=Y[1],ie=ie===void 0?[-1e9,1e9]:ie,Y=Y[2],Y=Y===void 0?{}:Y,G=q.domElement.getBoundingClientRect(),K=k(K,x).map(function(ee){return g(ee,G,q.groupIndex)}),ie=k(ie,x).map(function(ee){return g(ee,G,q.groupIndex)});N[U]=[K,ie,Y]})(V);q.transforms[S]=N})(O)}),i(this,"applyStyles",function(O){var x,S,A,N=(x=O,S={transform:"",filter:""},A={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(x).forEach(function(L){var V=x[L],U=f.includes(L)?"px":m.includes(L)?"deg":"";h.includes(L)?A[L]=V:d.includes(L)?S.transform+="".concat(L,"(").concat(V).concat(U,") "):o.includes(L)?S.filter+="".concat(L,"(").concat(V).concat(U,") "):S[L]="".concat(V).concat(U," ")}),S.transform="translate3d(".concat(A.translateX,"px, ").concat(A.translateY,"px, ").concat(A.translateZ,"px) ").concat(S.transform),S);Object.keys(N).forEach(function(L){q.domElement.style.setProperty(L,N[L])})}),this.selector=p,this.laxInstance=y,this.domElement=T,this.transformsData=M,this.groupIndex=D;var $=(D=j.style)===void 0?{}:D,j=j.onUpdate;Object.keys($).forEach(function(O){T.style.setProperty(O,$[O])}),j&&(this.onUpdate=j),this.calculateTransforms()}u.exports!==void 0?u.exports=b:window.lax=b})()})(Qt)),Qt.exports}var xs=ws();const lt=yt(xs);class ks{constructor(e={}){const i={};this.settings=Object.assign(this,i,e),this.elements=[]}init(){lt.init(),lt.addDriver("scrollY",function(){return window.scrollY}),this.refresh(),this.lax=lt,Object.assign(this,lt)}refresh(){let e=!1;document.body.hasAttribute("data-skrollrr-off")&&(e=!0),this.elements.forEach(t=>{lt.removeElement(t),t.style&&(t.style.transition&&(t.style.transition=""),t.style.transform&&(t.style.transform=""))}),this.elements=[];let i=window.innerWidth;document.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]").forEach(t=>{let n=!1;if(i<=760&&t.closest(".m-skrollrr-off")&&(n=!0),e||n){t.style.transform="",t.style.transition="",t.style.opacity="";return}t.style.transform="";let r=this.getObjVal(t,"data-top-bottom"),a=this.getObjVal(t,"data-top"),l=this.getObjVal(t,"data-50-top"),c=this.getObjVal(t,"data-100-top"),d=this.getObjVal(t,"data-center-bottom"),o=this.getObjVal(t,"data-center"),h=this.getObjVal(t,"data-center-top"),f=this.getObjVal(t,"data--400-bottom"),m=this.getObjVal(t,"data--300-bottom"),w=this.getObjVal(t,"data--200-bottom"),E=this.getObjVal(t,"data--150-bottom"),b=this.getObjVal(t,"data--100-bottom"),k=this.getObjVal(t,"data--50-bottom"),g=this.getObjVal(t,"data-bottom"),v=this.getObjVal(t,"data-50-bottom"),_=this.getObjVal(t,"data-100-bottom"),p=this.getObjVal(t,"data-150-bottom"),y=this.getObjVal(t,"data-200-bottom"),T=this.getObjVal(t,"data-300-bottom"),M=this.getObjVal(t,"data-400-bottom"),q=this.getObjVal(t,"data-bottom-top"),D=this.getObjVal(t,"data-in"),$=this.getObjVal(t,"data-in-150"),j=this.getObjVal(t,"data-in-300"),O=this.getObjVal(t,"data-cen--150"),x=this.getObjVal(t,"data-cen"),S=this.getObjVal(t,"data-cen-150"),A=this.getObjVal(t,"data-out--300"),N=this.getObjVal(t,"data-out--150"),L=this.getObjVal(t,"data-out"),V=!1;t.hasAttribute("data-xs")&&(V=!0);let U=!1;t.hasAttribute("data-sm")&&(U=!0);let Y=!1;t.hasAttribute("data-md")&&(Y=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let G={},K={},ie={},ee={},be={},Ae={},ke={},Re={},Se={},ue={},z={},X={},ae={},de={},we={},he={},le={},ne={},J={},Oe={},xe={},Me={},re={},C={},H={},W={},ce={},fe={},R={},P={},B={},F={},Z={};(i>1280||i>970&&i<=1280&&!Y||i>760&&i<=970&&!U||i<=760&&!V)&&(ie=this.getObjVal(t,"data-t"),ee=this.getObjVal(t,"data-t-100"),be=this.getObjVal(t,"data-t-200"),Ae=this.getObjVal(t,"data-t-300"),ke=this.getObjVal(t,"data-t-400"),Re=this.getObjVal(t,"data-t-500"),Se=this.getObjVal(t,"data-t-600"),ue=this.getObjVal(t,"data-t-700"),z=this.getObjVal(t,"data-t-800"),X=this.getObjVal(t,"data-t-900"),ae=this.getObjVal(t,"data-t-1000"),de=this.getObjVal(t,"data-t-1100"),we=this.getObjVal(t,"data-t-1200"),he=this.getObjVal(t,"data-t-1300"),le=this.getObjVal(t,"data-t-1400"),ne=this.getObjVal(t,"data-t-1500"),J=this.getObjVal(t,"data-t-1600"),Oe=this.getObjVal(t,"data-t-1700"),xe=this.getObjVal(t,"data-t-1800"),Me=this.getObjVal(t,"data-t-1900"),re=this.getObjVal(t,"data-t-2000"),C=this.getObjVal(t,"data-t-2100"),H=this.getObjVal(t,"data-t-2200"),W=this.getObjVal(t,"data-t-2300"),ce=this.getObjVal(t,"data-t-2400"),fe=this.getObjVal(t,"data-t-2500"),R=this.getObjVal(t,"data-t-2600"),P=this.getObjVal(t,"data-t-2700"),B=this.getObjVal(t,"data-t-2800")),i>970&&i<=1280&&Y&&(t.hasAttribute("data-md-t")&&(ie=this.getObjVal(t,"data-md-t")),t.hasAttribute("data-md-t-100")&&(ee=this.getObjVal(t,"data-md-t-100")),t.hasAttribute("data-md-t-200")&&(be=this.getObjVal(t,"data-md-t-200")),t.hasAttribute("data-md-t-300")&&(Ae=this.getObjVal(t,"data-md-t-300")),t.hasAttribute("data-md-t-400")&&(ke=this.getObjVal(t,"data-md-t-400")),t.hasAttribute("data-md-t-500")&&(Re=this.getObjVal(t,"data-md-t-500")),t.hasAttribute("data-md-t-600")&&(Se=this.getObjVal(t,"data-md-t-600")),t.hasAttribute("data-md-t-700")&&(ue=this.getObjVal(t,"data-md-t-700")),t.hasAttribute("data-md-t-800")&&(z=this.getObjVal(t,"data-md-t-800")),t.hasAttribute("data-md-t-900")&&(X=this.getObjVal(t,"data-md-t-900")),t.hasAttribute("data-md-t-1000")&&(ae=this.getObjVal(t,"data-md-t-1000")),t.hasAttribute("data-md-t-1100")&&(de=this.getObjVal(t,"data-md-t-1100")),t.hasAttribute("data-md-t-1200")&&(we=this.getObjVal(t,"data-md-t-1200")),t.hasAttribute("data-md-t-1300")&&(he=this.getObjVal(t,"data-md-t-1300")),t.hasAttribute("data-md-t-1400")&&(le=this.getObjVal(t,"data-md-t-1400")),t.hasAttribute("data-md-t-1500")&&(ne=this.getObjVal(t,"data-md-t-1500")),t.hasAttribute("data-md-t-1600")&&(J=this.getObjVal(t,"data-md-t-1600")),t.hasAttribute("data-md-t-1700")&&(Oe=this.getObjVal(t,"data-md-t-1700")),t.hasAttribute("data-md-t-1800")&&(xe=this.getObjVal(t,"data-md-t-1800")),t.hasAttribute("data-md-t-1900")&&(Me=this.getObjVal(t,"data-md-t-1900")),t.hasAttribute("data-md-t-2000")&&(re=this.getObjVal(t,"data-md-t-2000")),t.hasAttribute("data-md-t-2100")&&(C=this.getObjVal(t,"data-md-t-2100")),t.hasAttribute("data-md-t-2200")&&(H=this.getObjVal(t,"data-md-t-2200")),t.hasAttribute("data-md-t-2300")&&(W=this.getObjVal(t,"data-md-t-2300")),t.hasAttribute("data-md-t-2400")&&(ce=this.getObjVal(t,"data-md-t-2400")),t.hasAttribute("data-md-t-2500")&&(fe=this.getObjVal(t,"data-md-t-2500")),t.hasAttribute("data-md-t-2600")&&(R=this.getObjVal(t,"data-md-t-2600")),t.hasAttribute("data-md-t-2700")&&(P=this.getObjVal(t,"data-md-t-2700")),t.hasAttribute("data-md-t-2800")&&(B=this.getObjVal(t,"data-md-t-2800"))),i<=970&&t.hasAttribute("m-data-out")&&(L=this.getObjVal(t,"m-data-out")),(i>760&&i<=970&&U||i<=760&&!V&&U)&&(t.hasAttribute("data-sm-t")&&(ie=this.getObjVal(t,"data-sm-t")),t.hasAttribute("data-sm-t-100")&&(ee=this.getObjVal(t,"data-sm-t-100")),t.hasAttribute("data-sm-t-200")&&(be=this.getObjVal(t,"data-sm-t-200")),t.hasAttribute("data-sm-t-300")&&(Ae=this.getObjVal(t,"data-sm-t-300")),t.hasAttribute("data-sm-t-400")&&(ke=this.getObjVal(t,"data-sm-t-400")),t.hasAttribute("data-sm-t-500")&&(Re=this.getObjVal(t,"data-sm-t-500")),t.hasAttribute("data-sm-t-600")&&(Se=this.getObjVal(t,"data-sm-t-600")),t.hasAttribute("data-sm-t-700")&&(ue=this.getObjVal(t,"data-sm-t-700")),t.hasAttribute("data-sm-t-800")&&(z=this.getObjVal(t,"data-sm-t-800")),t.hasAttribute("data-sm-t-900")&&(X=this.getObjVal(t,"data-sm-t-900")),t.hasAttribute("data-sm-t-1000")&&(ae=this.getObjVal(t,"data-sm-t-1000")),t.hasAttribute("data-sm-t-1100")&&(de=this.getObjVal(t,"data-sm-t-1100")),t.hasAttribute("data-sm-t-1200")&&(we=this.getObjVal(t,"data-sm-t-1200")),t.hasAttribute("data-sm-t-1300")&&(he=this.getObjVal(t,"data-sm-t-1300")),t.hasAttribute("data-sm-t-1400")&&(le=this.getObjVal(t,"data-sm-t-1400")),t.hasAttribute("data-sm-t-1500")&&(ne=this.getObjVal(t,"data-sm-t-1500")),t.hasAttribute("data-sm-t-1600")&&(J=this.getObjVal(t,"data-sm-t-1600")),t.hasAttribute("data-sm-t-1700")&&(Oe=this.getObjVal(t,"data-sm-t-1700")),t.hasAttribute("data-sm-t-1800")&&(xe=this.getObjVal(t,"data-sm-t-1800")),t.hasAttribute("data-sm-t-1900")&&(Me=this.getObjVal(t,"data-sm-t-1900")),t.hasAttribute("data-sm-t-2000")&&(re=this.getObjVal(t,"data-sm-t-2000")),t.hasAttribute("data-sm-t-2100")&&(C=this.getObjVal(t,"data-sm-t-2100")),t.hasAttribute("data-sm-t-2200")&&(H=this.getObjVal(t,"data-sm-t-2200")),t.hasAttribute("data-sm-t-2300")&&(W=this.getObjVal(t,"data-sm-t-2300")),t.hasAttribute("data-sm-t-2400")&&(ce=this.getObjVal(t,"data-sm-t-2400")),t.hasAttribute("data-sm-t-2500")&&(fe=this.getObjVal(t,"data-sm-t-2500")),t.hasAttribute("data-sm-t-2600")&&(R=this.getObjVal(t,"data-sm-t-2600")),t.hasAttribute("data-sm-t-2700")&&(P=this.getObjVal(t,"data-sm-t-2700")),t.hasAttribute("data-sm-t-2800")&&(B=this.getObjVal(t,"data-sm-t-2800"))),i<=414&&V&&(t.hasAttribute("data-xs-t")&&(ie=this.getObjVal(t,"data-xs-t")),t.hasAttribute("data-xs-t-100")&&(ee=this.getObjVal(t,"data-xs-t-100")),t.hasAttribute("data-xs-t-200")&&(be=this.getObjVal(t,"data-xs-t-200")),t.hasAttribute("data-xs-t-300")&&(Ae=this.getObjVal(t,"data-xs-t-300")),t.hasAttribute("data-xs-t-400")&&(ke=this.getObjVal(t,"data-xs-t-400")),t.hasAttribute("data-xs-t-500")&&(Re=this.getObjVal(t,"data-xs-t-500")),t.hasAttribute("data-xs-t-600")&&(Se=this.getObjVal(t,"data-xs-t-600")),t.hasAttribute("data-xs-t-700")&&(ue=this.getObjVal(t,"data-xs-t-700")),t.hasAttribute("data-xs-t-800")&&(z=this.getObjVal(t,"data-xs-t-800")),t.hasAttribute("data-xs-t-900")&&(X=this.getObjVal(t,"data-xs-t-900")),t.hasAttribute("data-xs-t-1000")&&(ae=this.getObjVal(t,"data-xs-t-1000")),t.hasAttribute("data-xs-t-1100")&&(de=this.getObjVal(t,"data-xs-t-1100")),t.hasAttribute("data-xs-t-1200")&&(we=this.getObjVal(t,"data-xs-t-1200")),t.hasAttribute("data-xs-t-1300")&&(he=this.getObjVal(t,"data-xs-t-1300")),t.hasAttribute("data-xs-t-1400")&&(le=this.getObjVal(t,"data-xs-t-1400")),t.hasAttribute("data-xs-t-1500")&&(ne=this.getObjVal(t,"data-xs-t-1500")),t.hasAttribute("data-xs-t-1600")&&(J=this.getObjVal(t,"data-xs-t-1600")),t.hasAttribute("data-xs-t-1700")&&(Oe=this.getObjVal(t,"data-xs-t-1700")),t.hasAttribute("data-xs-t-1800")&&(xe=this.getObjVal(t,"data-xs-t-1800")),t.hasAttribute("data-xs-t-1900")&&(Me=this.getObjVal(t,"data-xs-t-1900")),t.hasAttribute("data-xs-t-2000")&&(re=this.getObjVal(t,"data-xs-t-2000")),t.hasAttribute("data-xs-t-2100")&&(C=this.getObjVal(t,"data-xs-t-2100")),t.hasAttribute("data-xs-t-2200")&&(H=this.getObjVal(t,"data-xs-t-2200")),t.hasAttribute("data-xs-t-2300")&&(W=this.getObjVal(t,"data-xs-t-2300")),t.hasAttribute("data-xs-t-2400")&&(ce=this.getObjVal(t,"data-xs-t-2400")),t.hasAttribute("data-xs-t-2500")&&(fe=this.getObjVal(t,"data-xs-t-2500")),t.hasAttribute("data-xs-t-2600")&&(R=this.getObjVal(t,"data-xs-t-2600")),t.hasAttribute("data-xs-t-2700")&&(P=this.getObjVal(t,"data-xs-t-2700")),t.hasAttribute("data-xs-t-2800")&&(B=this.getObjVal(t,"data-xs-t-2800")));let _e=ie,pe=ee,Q=be,ye=Ae,oe=ke,Ie=Re,Ee=Se,Ce=ue,je=z,Ve=X,Be=ae,Ze=de,De=we,se=he,qe=le,Pe=ne,$t=J,Ht=Oe,zt=xe,Vt=Me,Bt=re,Ut=C,Ft=H,Yt=W,Wt=ce,Gt=fe,Xt=R,Jt=P,Zt=B,ot=window.innerHeight;ot<730?(G=_e,K=pe,ie=Q,ee=ye,be=oe,Ae=Ie,ke=Ee,Re=Ce,Se=je,ue=Ve,z=Be,X=Ze,ae=De,de=se,we=qe,he=Pe,le=$t,ne=Ht,J=zt,Oe=Vt,xe=Bt,Me=Ut,re=Ft,C=Yt,H=Wt,W=Gt,ce=Xt,fe=Jt,R=Zt,P={},B={}):ot>=730&&ot<790?(K=_e,ie=pe,ee=Q,be=ye,Ae=oe,ke=Ie,Re=Ee,Se=Ce,ue=je,z=Ve,X=Be,ae=Ze,de=De,we=se,he=qe,le=Pe,ne=$t,J=Ht,Oe=zt,xe=Vt,Me=Bt,re=Ut,C=Ft,H=Yt,W=Wt,ce=Gt,fe=Xt,R=Jt,P=Zt,B={}):ot>=790&&ot<840||(ot>=840&&ot<1125?(ie={},ee=_e,be=pe,Ae=Q,ke=ye,Re=oe,Se=Ie,ue=Ee,z=Ce,X=je,ae=Ve,de=Be,we=Ze,he=De,le=se,ne=qe,J=Pe,Oe=$t,xe=Ht,Me=zt,re=Vt,C=Bt,H=Ut,W=Ft,ce=Yt,fe=Wt,R=Gt,P=Xt,B=Jt,F=Zt):(ie={},ee={},be=_e,Ae=pe,ke=Q,Re=ye,Se=oe,ue=Ie,z=Ee,X=Ce,ae=je,de=Ve,we=Be,he=Ze,le=De,ne=se,J=qe,Oe=Pe,xe=$t,Me=Ht,re=zt,C=Vt,H=Bt,W=Ut,ce=Ft,fe=Yt,R=Wt,P=Gt,B=Xt,F=Jt,Z=Zt));let I={};Object.keys(q).length!==0&&(I=this.parseObj(q,"elInY",I)),Object.keys(M).length!==0&&(I=this.parseObj(M,"elInY+50",I)),Object.keys(T).length!==0&&(I=this.parseObj(T,"elInY+100",I)),Object.keys(y).length!==0&&(I=this.parseObj(y,"elInY+150",I)),Object.keys(p).length!==0&&(I=this.parseObj(p,"elInY+200",I)),Object.keys(_).length!==0&&(I=this.parseObj(_,"elInY+250",I)),Object.keys(v).length!==0&&(I=this.parseObj(v,"elInY+300",I)),Object.keys(g).length!==0&&(I=this.parseObj(g,"elInY+350",I)),Object.keys(k).length!==0&&(I=this.parseObj(k,"elInY+400",I)),Object.keys(b).length!==0&&(I=this.parseObj(b,"elInY+450",I)),Object.keys(E).length!==0&&(I=this.parseObj(E,"elInY+500",I)),Object.keys(w).length!==0&&(I=this.parseObj(w,"elInY+550",I)),Object.keys(m).length!==0&&(I=this.parseObj(m,"elInY+600",I)),Object.keys(f).length!==0&&(I=this.parseObj(f,"elInY+650",I)),Object.keys(h).length!==0&&(I=this.parseObj(h,"elCenterY-300",I)),Object.keys(o).length!==0&&(I=this.parseObj(o,"elCenterY",I)),Object.keys(d).length!==0&&(I=this.parseObj(d,"elCenterY+100",I)),Object.keys(c).length!==0&&(I=this.parseObj(c,"elCenterY+200",I)),Object.keys(l).length!==0&&(I=this.parseObj(l,"elCenterY+300",I)),Object.keys(a).length!==0&&(I=this.parseObj(a,"elOutY-300",I)),Object.keys(r).length!==0&&(I=this.parseObj(r,"elOutY",I)),Object.keys(D).length!==0&&(I=this.parseObj(D,"elInY",I)),Object.keys($).length!==0&&(I=this.parseObj($,"elInY+150",I)),Object.keys(j).length!==0&&(I=this.parseObj(j,"elInY+300 ",I)),Object.keys(O).length!==0&&(I=this.parseObj(O,"elCenterY-150",I)),Object.keys(x).length!==0&&(I=this.parseObj(x,"elCenterY",I)),Object.keys(S).length!==0&&(I=this.parseObj(S,"elCenterY+150",I)),Object.keys(A).length!==0&&(I=this.parseObj(A,"elOutY-300 ",I)),Object.keys(N).length!==0&&(I=this.parseObj(N,"elOutY-150 ",I)),Object.keys(L).length!==0&&(I=this.parseObj(L,"elOutY",I)),Object.keys(G).length!==0&&(I=this.parseObj(G,"elInY-200",I)),Object.keys(K).length!==0&&(I=this.parseObj(K,"elInY-100",I)),Object.keys(ie).length!==0&&(I=this.parseObj(ie,"elInY",I)),Object.keys(ee).length!==0&&(I=this.parseObj(ee,"elInY+100",I)),Object.keys(be).length!==0&&(I=this.parseObj(be,"elInY+200",I)),Object.keys(Ae).length!==0&&(I=this.parseObj(Ae,"elInY+300 ",I)),Object.keys(ke).length!==0&&(I=this.parseObj(ke,"elInY+400 ",I)),Object.keys(Re).length!==0&&(I=this.parseObj(Re,"elInY+500 ",I)),Object.keys(Se).length!==0&&(I=this.parseObj(Se,"elInY+600 ",I)),Object.keys(ue).length!==0&&(I=this.parseObj(ue,"elInY+700 ",I)),Object.keys(z).length!==0&&(I=this.parseObj(z,"elInY+800 ",I)),Object.keys(X).length!==0&&(I=this.parseObj(X,"elInY+900 ",I)),Object.keys(ae).length!==0&&(I=this.parseObj(ae,"elInY+1000 ",I)),Object.keys(de).length!==0&&(I=this.parseObj(de,"elInY+1100 ",I)),Object.keys(we).length!==0&&(I=this.parseObj(we,"elInY+1200 ",I)),Object.keys(he).length!==0&&(I=this.parseObj(he,"elInY+1300 ",I)),Object.keys(le).length!==0&&(I=this.parseObj(le,"elInY+1400 ",I)),Object.keys(ne).length!==0&&(I=this.parseObj(ne,"elInY+1500 ",I)),Object.keys(J).length!==0&&(I=this.parseObj(J,"elInY+1600 ",I)),Object.keys(Oe).length!==0&&(I=this.parseObj(Oe,"elInY+1700 ",I)),Object.keys(xe).length!==0&&(I=this.parseObj(xe,"elInY+1800 ",I)),Object.keys(Me).length!==0&&(I=this.parseObj(Me,"elInY+1900 ",I)),Object.keys(re).length!==0&&(I=this.parseObj(re,"elInY+2000 ",I)),Object.keys(C).length!==0&&(I=this.parseObj(C,"elInY+2100 ",I)),Object.keys(H).length!==0&&(I=this.parseObj(H,"elInY+2200 ",I)),Object.keys(W).length!==0&&(I=this.parseObj(W,"elInY+2300 ",I)),Object.keys(ce).length!==0&&(I=this.parseObj(ce,"elInY+2400 ",I)),Object.keys(fe).length!==0&&(I=this.parseObj(fe,"elInY+2500 ",I)),Object.keys(R).length!==0&&(I=this.parseObj(R,"elInY+2600 ",I)),Object.keys(P).length!==0&&(I=this.parseObj(P,"elInY+2700 ",I)),Object.keys(B).length!==0&&(I=this.parseObj(B,"elInY+2800 ",I)),Object.keys(F).length!==0&&(I=this.parseObj(F,"elInY+2900 ",I)),Object.keys(Z).length!==0&&(I=this.parseObj(Z,"elInY+3000 ",I)),t.style.transition="",t.setAttribute("data-dummy-selector","1"),lt.addElements("[data-dummy-selector]",{scrollY:I}),this.elements.push(document.querySelector("[data-dummy-selector]")),t.removeAttribute("data-dummy-selector"),setTimeout(()=>{t.style.opacity=1,t.getAttribute("data-smooth-scrolling")==="off"||this.settings.transition&&(t.style.transition=this.settings.transition)},100)})}parseTransformProperty(e){for(var i=/(\w+)\((.+?)\)/g,s={},t;t=i.exec(e);)s[t[1]]=s[t[1]]?s[t[1]].concat([t[2]]):[t[2]];return s}getObjVal(e,i){let s={},t=e.getAttribute(i);return t&&t.split(";").forEach(r=>{if(r.indexOf("transform")!==-1&&(s=this.parseTransformProperty(r)),r.indexOf("opacity")!==-1){let a=r.replace("opacity:","").replace(";","");s.opacity=[parseFloat(a)]}}),s}parseObj(e,i,s){if(e.translateY){let t;e.translateY[0].indexOf("%")!==-1?t=parseFloat(e.translateY[0])/100*window.innerHeight:t=parseFloat(e.translateY[0]),s.translateY||(s.translateY=[[],[]]),s.translateY[0].push(i),s.translateY[1].push(t)}if(e.translateX){let t;e.translateX[0].indexOf("%")!==-1?t=parseFloat(e.translateX[0])/100*window.innerWidth:t=parseFloat(e.translateX[0]),s.translateX||(s.translateX=[[],[]]),s.translateX[0].push(i),s.translateX[1].push(t)}if(e.scale){let t=parseFloat(e.scale[0]);s.scale||(s.scale=[[],[]]),s.scale[0].push(i),s.scale[1].push(t)}if(e.rotate){let t=parseFloat(e.rotate[0]);s.rotate||(s.rotate=[[],[]]),s.rotate[0].push(i),s.rotate[1].push(t)}if(e.opacity){let t=parseFloat(e.opacity[0]);s.opacity||(s.opacity=[[],[]]),s.opacity[0].push(i),s.opacity[1].push(t)}return s}}var Kt={exports:{}},Ci;function _s(){return Ci||(Ci=1,(function(u,e){(function(s,t){u.exports=t()})(window,function(){return(function(i){var s={};function t(n){if(s[n])return s[n].exports;var r=s[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=s,t.d=function(n,r,a){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:a})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var l in n)t.d(a,l,(function(c){return n[c]}).bind(null,l));return a},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=2)})([(function(i,s){/*!
|
|
7
7
|
* object-extend
|
|
8
8
|
* A well-tested function to deep extend (or merge) JavaScript objects without further dependencies.
|
|
9
9
|
*
|
|
@@ -13,7 +13,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
13
13
|
* Released under the MIT license.
|
|
14
14
|
*
|
|
15
15
|
* Date: 2013-04-10
|
|
16
|
-
*/i.exports=function t(n,r){return n==null||r==null||Object.keys(r).forEach(function(a){Object.prototype.toString.call(r[a])=="[object Object]"?Object.prototype.toString.call(n[a])!="[object Object]"?n[a]=r[a]:n[a]=t(n[a],r[a]):n[a]=r[a]}),n}}),(function(i,s){Array.prototype.each=function(t){for(var n=this.length,r=0;r<n;r++){var a=this[r];a&&t(a,r)}},NodeList.prototype.each=Array.prototype.each,NodeList.prototype.filter=Array.prototype.filter}),(function(i,s,t){t.r(s);var n=(function(){this.trigger={once:!1,offset:{viewport:{x:0,y:0},element:{x:0,y:0}},toggle:{class:{in:"visible",out:"invisible"},callback:{in:null,visible:null,out:null}}},this.scroll={sustain:300,element:window,callback:function(){},start:function(){},stop:function(){},directionChange:function(){}}}),r=t(0),a=t.n(r);t(1);function
|
|
16
|
+
*/i.exports=function t(n,r){return n==null||r==null||Object.keys(r).forEach(function(a){Object.prototype.toString.call(r[a])=="[object Object]"?Object.prototype.toString.call(n[a])!="[object Object]"?n[a]=r[a]:n[a]=t(n[a],r[a]):n[a]=r[a]}),n}}),(function(i,s){Array.prototype.each=function(t){for(var n=this.length,r=0;r<n;r++){var a=this[r];a&&t(a,r)}},NodeList.prototype.each=Array.prototype.each,NodeList.prototype.filter=Array.prototype.filter}),(function(i,s,t){t.r(s);var n=(function(){this.trigger={once:!1,offset:{viewport:{x:0,y:0},element:{x:0,y:0}},toggle:{class:{in:"visible",out:"invisible"},callback:{in:null,visible:null,out:null}}},this.scroll={sustain:300,element:window,callback:function(){},start:function(){},stop:function(){},directionChange:function(){}}}),r=t(0),a=t.n(r);t(1);function l(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function c(j,O){for(var x=0;x<O.length;x++){var S=O[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(j,S.key,S)}}function d(j,O,x){return O&&c(j.prototype,O),j}function o(j){return Number(j)===j&&j%1===0}function h(j){return Number(j)===j&&j%1!==0}var f=(function(){function j(O,x){l(this,j),this.element=O,x=a()(new n().trigger,x),this.offset=x.offset,this.toggle=x.toggle,this.once=x.once,this.visible=null,this.active=!0}return d(j,[{key:"checkVisibility",value:function(x,S){if(!this.active)return this.visible;var A=x.offsetWidth||x.innerWidth||0,N=x.offsetHeight||x.innerHeight||0,L={w:A,h:N},V=this.getBounds(),U=this._checkVisibility(V,L,S);if(U!==this.visible){this.visible=U;var Y=this._toggleCallback();Y instanceof Promise?Y.then(this._toggleClass.bind(this)).catch(function(G){console.error("Trigger promise failed"),console.error(G)}):this._toggleClass(),this.visible&&this.once&&(this.active=!1)}else if(U&&typeof this.toggle.callback.visible=="function")return this.toggle.callback.visible.call(this.element,this);return U}},{key:"getBounds",value:function(){return this.element.getBoundingClientRect()}},{key:"_getElementOffset",value:function(x,S){var A={x:0,y:0};return typeof this.offset.element.x=="function"?A.x=x.width*this.offset.element.x(this,x,S):h(this.offset.element.x)?A.x=x.width*this.offset.element.x:o(this.offset.element.x)&&(A.x=this.offset.element.x),typeof this.offset.element.y=="function"?A.y=x.height*this.offset.element.y(this,x,S):h(this.offset.element.y)?A.y=x.height*this.offset.element.y:o(this.offset.element.y)&&(A.y=this.offset.element.y),A}},{key:"_getViewportOffset",value:function(x,S){var A={x:0,y:0};return typeof this.offset.viewport.x=="function"?A.x=x.w*this.offset.viewport.x(this,x,S):h(this.offset.viewport.x)?A.x=x.w*this.offset.viewport.x:o(this.offset.viewport.x)&&(A.x=this.offset.viewport.x),typeof this.offset.viewport.y=="function"?A.y=x.h*this.offset.viewport.y(this,x,S):h(this.offset.viewport.y)?A.y=x.h*this.offset.viewport.y:o(this.offset.viewport.y)&&(A.y=this.offset.viewport.y),A}},{key:"_checkVisibility",value:function(x,S,A){var N=this._getElementOffset(x,A),L=this._getViewportOffset(S,A),V=!0;return x.left-L.x<-(x.width-N.x)&&(V=!1),x.left+L.x>S.w-N.x&&(V=!1),x.top-L.y<-(x.height-N.y)&&(V=!1),x.top+L.y>S.h-N.y&&(V=!1),V}},{key:"_toggleClass",value:function(){var x=this;if(this.visible){Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(S){x.element.classList.add(S)}):this.element.classList.add(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(S){x.element.classList.remove(S)}):this.element.classList.remove(this.toggle.class.out);return}Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(S){x.element.classList.remove(S)}):this.element.classList.remove(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(S){x.element.classList.add(S)}):this.element.classList.add(this.toggle.class.out)}},{key:"_toggleCallback",value:function(){if(this.visible){if(typeof this.toggle.callback.in=="function")return this.toggle.callback.in.call(this.element,this)}else if(typeof this.toggle.callback.out=="function")return this.toggle.callback.out.call(this.element,this)}}]),j})();function m(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function w(j,O){for(var x=0;x<O.length;x++){var S=O[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(j,S.key,S)}}function E(j,O,x){return O&&w(j.prototype,O),j}var b=(function(){function j(O){m(this,j),this.triggers=O instanceof Array?O:[]}return E(j,[{key:"add",value:function(x){var S=this;if(x instanceof f)return this.triggers.push(x);x.each(function(A){A instanceof f?S.triggers.push(A):console.error("Object added to TriggerCollection is not a Trigger. Object: ",A)})}},{key:"remove",value:function(x){x instanceof f&&(x=[x]),this.triggers=this.triggers.filter(function(S){var A=!1;return x.each(function(N){N==S&&(A=!0)}),!A})}},{key:"query",value:function(x){return this.triggers.filter(function(S){var A=S.element,N=A.parentNode,L=[].slice.call(N.querySelectorAll(x));return L.indexOf(A)>-1})}},{key:"search",value:function(x){var S=this.triggers.filter(function(A){if(x instanceof NodeList||Array.isArray(x)){var N=!1;return x.each(function(L){A.element==L&&(N=!0)}),N}return A.element==x});return S.length==0?null:S.length>1?S:S[0]}},{key:"call",value:function(x){this.triggers.each(x)}}]),j})();function k(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function g(j,O){for(var x=0;x<O.length;x++){var S=O[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(j,S.key,S)}}function v(j,O,x){return O&&g(j.prototype,O),j}var _=(function(){function j(O,x){k(this,j),this._parseOptions(O),typeof x=="function"&&(this.callback=x),this.direction="none",this.position=this.getPosition(),this.lastAction=this._getTimestamp(),this._startRun(),this._boundListener=this._didScroll.bind(this),this.element.addEventListener("scroll",this._boundListener)}return v(j,[{key:"_parseOptions",value:function(x){var S=new n().scroll;typeof x!="function"?(S.callback=function(){},S=a()(S,x)):S.callback=x,this.element=S.element,this.sustain=S.sustain,this.callback=S.callback,this.startCallback=S.start,this.stopCallback=S.stop,this.directionChange=S.directionChange}},{key:"_didScroll",value:function(){var x=this.getPosition();if(this.position!==x){var S=this.direction;x.x!==this.position.x?S=x.x>this.position.x?"right":"left":x.y!==this.position.y?S=x.y>this.position.y?"bottom":"top":S="none",S!==this.direction&&(this.direction=S,typeof this.directionChange=="function"&&this.directionChange(this.direction)),this.position=x,this.lastAction=this._getTimestamp()}else this.direction="none";this.running||this._startRun()}},{key:"_startRun",value:function(){this.running=!0,typeof this.startCallback=="function"&&this.startCallback(),this._loop()}},{key:"_stopRun",value:function(){this.running=!1,typeof this.stopCallback=="function"&&this.stopCallback()}},{key:"getPosition",value:function(){var x=this.element.pageXOffset||this.element.scrollLeft||document.documentElement.scrollLeft||0,S=this.element.pageYOffset||this.element.scrollTop||document.documentElement.scrollTop||0;return{x,y:S}}},{key:"_getTimestamp",value:function(){return Number(Date.now())}},{key:"_tick",value:function(){this.callback(this.position,this.direction);var x=this._getTimestamp();x-this.lastAction>this.sustain&&this._stopRun(),this.running&&this._loop()}},{key:"_loop",value:function(){var x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(S){setTimeout(S,16.666666666666668)};x(this._tick.bind(this))}},{key:"kill",value:function(){this.running=!1,this.element.removeEventListener("scroll",this._boundListener)}}]),j})();t.d(s,"Trigger",function(){return M}),t.d(s,"TriggerCollection",function(){return q}),t.d(s,"ScrollAnimationLoop",function(){return D}),t.d(s,"default",function(){return $});function p(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function y(j,O){for(var x=0;x<O.length;x++){var S=O[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(j,S.key,S)}}function T(j,O,x){return O&&y(j.prototype,O),j}/*!
|
|
17
17
|
* ScrollTrigger
|
|
18
18
|
*
|
|
19
19
|
*
|
|
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
* Released under the MIT license.
|
|
24
24
|
*
|
|
25
25
|
* Date: 2017-07-09
|
|
26
|
-
*/var V=f,I=y,F=C,G=(function(){function B(M){g(this,B),this._parseOptions(M),this._initCollection(),this._initLoop()}return q(B,[{key:"_parseOptions",value:function(_){_=a()(new n,_),this.defaultTrigger=_.trigger,this.scrollOptions=_.scroll}},{key:"_initCollection",value:function(){var _=document.querySelectorAll("[data-scroll]"),L=[];_.length>0&&(L=this.createTriggers(_)),this.collection=new I(L)}},{key:"_initLoop",value:function(){var _=this;this.loop=new F({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function(P,W){_._scrollCallback(P,W)},start:function(){_._scrollStart()},stop:function(){_._scrollStop()},directionChange:function(P){_._scrollDirectionChange(P)}})}},{key:"_scrollCallback",value:function(_,L){var P=this;this.collection.call(function(W){W.checkVisibility(P.scrollOptions.element,L)}),this.scrollOptions.callback(_,L)}},{key:"_scrollStart",value:function(){this.scrollOptions.start()}},{key:"_scrollStop",value:function(){this.scrollOptions.stop()}},{key:"_scrollDirectionChange",value:function(_){this.scrollOptions.directionChange(_)}},{key:"createTrigger",value:function(_,L){return new V(_,a()(this.defaultTrigger,L))}},{key:"createTriggers",value:function(_,L){var P=this,W=[];return _.each(function(N){W.push(P.createTrigger(N,L))}),W}},{key:"add",value:function(_,L){return _ instanceof HTMLElement?(this.collection.add(this.createTrigger(_,L)),this):_ instanceof V?(this.collection.add(_),this):_ instanceof NodeList?(this.collection.add(this.createTriggers(_,L)),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.add(_),this):Array.isArray(_)&&_.length&&_[0]instanceof HTMLElement?(this.collection.add(this.createTriggers(_,L)),this):(this.collection.add(this.createTriggers(document.querySelectorAll(_),L)),this)}},{key:"remove",value:function(_){return _ instanceof V?(this.collection.remove(_),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.remove(_),this):_ instanceof HTMLElement?(this.collection.remove(this.search(_)),this):Array.isArray(_)&&_.length&&_[0]instanceof HTMLElement?(this.collection.remove(this.search(_)),this):_ instanceof NodeList?(this.collection.remove(this.search(_)),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.remove(_),this):(this.collection.remove(this.query(_.toString())),this)}},{key:"query",value:function(_){return this.collection.query(_)}},{key:"search",value:function(_){return this.collection.search(_)}},{key:"listen",value:function(){this.loop||this._initLoop()}},{key:"kill",value:function(){this.loop.kill(),this.loop=null}}]),B})()})])})})(jt)),jt.exports}var Hi=Di();const $i=dt(Hi);var pt={exports:{}},zi=pt.exports,ii;function Vi(){return ii||(ii=1,(function(m,e){(function(i,s){m.exports=s()})(zi,(function(){function i(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}function s(l,p){for(var x=0;x<p.length;x++){var T=p[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(l,n(T.key),T)}}function t(l,p,x){return p&&s(l.prototype,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function n(l){var p=(function(x,T){if(typeof x!="object"||!x)return x;var O=x[Symbol.toPrimitive];if(O!==void 0){var D=O.call(x,T);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)})(l,"string");return typeof p=="symbol"?p:p+""}function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(l)}var a=Date.now();function u(){var l={},p=!0,x=0,T=arguments.length;Object.prototype.toString.call(arguments[0])==="[object Boolean]"&&(p=arguments[0],x++);for(var O=function(H){for(var $ in H)Object.prototype.hasOwnProperty.call(H,$)&&(p&&Object.prototype.toString.call(H[$])==="[object Object]"?l[$]=u(!0,l[$],H[$]):l[$]=H[$])};x<T;x++){var D=arguments[x];O(D)}return l}function c(l,p){if((G(l)||l===window||l===document)&&(l=[l]),M(l)||_(l)||(l=[l]),W(l)!=0){if(M(l)&&!_(l))for(var x=l.length,T=0;T<x&&p.call(l[T],l[T],T,l)!==!1;T++);else if(_(l)){for(var O in l)if(P(l,O)&&p.call(l[O],l[O],O,l)===!1)break}}}function d(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,T=l[a]=l[a]||[],O={all:T,evt:null,found:null};return p&&x&&W(T)>0&&c(T,(function(D,H){if(D.eventName==p&&D.fn.toString()==x.toString())return O.found=!0,O.evt=H,!1})),O}function o(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=p.onElement,T=p.withCallback,O=p.avoidDuplicate,D=O===void 0||O,H=p.once,$=H!==void 0&&H,A=p.useCapture,j=A!==void 0&&A,U=arguments.length>2?arguments[2]:void 0,Y=x||[];function Z(ee){I(T)&&T.call(U,ee,this),$&&Z.destroy()}return F(Y)&&(Y=document.querySelectorAll(Y)),Z.destroy=function(){c(Y,(function(ee){var te=d(ee,l,Z);te.found&&te.all.splice(te.evt,1),ee.removeEventListener&&ee.removeEventListener(l,Z,j)}))},c(Y,(function(ee){var te=d(ee,l,Z);(ee.addEventListener&&D&&!te.found||!D)&&(ee.addEventListener(l,Z,j),te.all.push({eventName:l,fn:Z}))})),Z}function h(l,p){c(p.split(" "),(function(x){return l.classList.add(x)}))}function f(l,p){c(p.split(" "),(function(x){return l.classList.remove(x)}))}function v(l,p){return l.classList.contains(p)}function S(l,p){for(;l!==document.body;){if(!(l=l.parentElement))return!1;if(typeof l.matches=="function"?l.matches(p):l.msMatchesSelector(p))return l}}function R(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||p==="")return!1;if(p==="none")return I(x)&&x(),!1;var T=g(),O=p.split(" ");c(O,(function(D){h(l,"g"+D)})),o(T,{onElement:l,avoidDuplicate:!1,once:!0,withCallback:function(D,H){c(O,(function($){f(H,"g"+$)})),I(x)&&x()}})}function y(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(p==="")return l.style.webkitTransform="",l.style.MozTransform="",l.style.msTransform="",l.style.OTransform="",l.style.transform="",!1;l.style.webkitTransform=p,l.style.MozTransform=p,l.style.msTransform=p,l.style.OTransform=p,l.style.transform=p}function E(l){l.style.display="block"}function b(l){l.style.display="none"}function k(l){var p=document.createDocumentFragment(),x=document.createElement("div");for(x.innerHTML=l;x.firstChild;)p.appendChild(x.firstChild);return p}function C(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function g(){var l,p=document.createElement("fakeelement"),x={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(l in x)if(p.style[l]!==void 0)return x[l]}function w(l,p,x,T){if(l())p();else{var O;x||(x=100);var D=setInterval((function(){l()&&(clearInterval(D),O&&clearTimeout(O),p())}),x)}}function q(l,p,x){if(L(l))console.error("Inject assets error");else if(I(p)&&(x=p,p=!1),F(p)&&p in window)I(x)&&x();else{var T;if(l.indexOf(".css")!==-1){if((T=document.querySelectorAll('link[href="'+l+'"]'))&&T.length>0)return void(I(x)&&x());var O=document.getElementsByTagName("head")[0],D=O.querySelectorAll('link[rel="stylesheet"]'),H=document.createElement("link");return H.rel="stylesheet",H.type="text/css",H.href=l,H.media="all",D?O.insertBefore(H,D[0]):O.appendChild(H),void(I(x)&&x())}if((T=document.querySelectorAll('script[src="'+l+'"]'))&&T.length>0){if(I(x)){if(F(p))return w((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}}else{var $=document.createElement("script");$.type="text/javascript",$.src=l,$.onload=function(){if(I(x)){if(F(p))return w((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}},document.body.appendChild($)}}}function V(){return"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function I(l){return typeof l=="function"}function F(l){return typeof l=="string"}function G(l){return!(!l||!l.nodeType||l.nodeType!=1)}function B(l){return Array.isArray(l)}function M(l){return l&&l.length&&isFinite(l.length)}function _(l){return r(l)==="object"&&l!=null&&!I(l)&&!B(l)}function L(l){return l==null}function P(l,p){return l!==null&&hasOwnProperty.call(l,p)}function W(l){if(_(l)){if(l.keys)return l.keys().length;var p=0;for(var x in l)P(l,x)&&p++;return p}return l.length}function N(l){return!isNaN(parseFloat(l))&&isFinite(l)}function J(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,p=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!p.length)return!1;if(p.length==1)return p[0];typeof l=="string"&&(l=parseInt(l));var x=[];c(p,(function($){x.push($.getAttribute("data-taborder"))}));var T=Math.max.apply(Math,x.map((function($){return parseInt($)}))),O=l<0?1:l+1;O>T&&(O="1");var D=x.filter((function($){return $>=parseInt(O)})),H=D.sort()[0];return document.querySelector('.gbtn[data-taborder="'.concat(H,'"]'))}function Q(l){if(l.events.hasOwnProperty("keyboard"))return!1;l.events.keyboard=o("keydown",{onElement:window,withCallback:function(p,x){var T=(p=p||window.event).keyCode;if(T==9){var O=document.querySelector(".gbtn.focused");if(!O){var D=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if(D=="input"||D=="textarea"||D=="button")return}p.preventDefault();var H=document.querySelectorAll(".gbtn[data-taborder]");if(!H||H.length<=0)return;if(!O){var $=J();return void($&&($.focus(),h($,"focused")))}var A=J(O.getAttribute("data-taborder"));f(O,"focused"),A&&(A.focus(),h(A,"focused"))}T==39&&l.nextSlide(),T==37&&l.prevSlide(),T==27&&l.close()}})}var se=t((function l(p,x){var T=this,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(i(this,l),this.img=p,this.slide=x,this.onclose=O,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener("mousedown",(function(D){return T.dragStart(D)}),!1),this.img.addEventListener("mouseup",(function(D){return T.dragEnd(D)}),!1),this.img.addEventListener("mousemove",(function(D){return T.drag(D)}),!1),this.img.addEventListener("click",(function(D){return T.slide.classList.contains("dragging-nav")?(T.zoomOut(),!1):T.zoomedIn?void(T.zoomedIn&&!T.dragging&&T.zoomOut()):T.zoomIn()}),!1),this.img.setZoomEvents=!0}),[{key:"zoomIn",value:function(){var l=this.widowWidth();if(!(this.zoomedIn||l<=768)){var p=this.img;if(p.setAttribute("data-style",p.getAttribute("style")),p.style.maxWidth=p.naturalWidth+"px",p.style.maxHeight=p.naturalHeight+"px",p.naturalWidth>l){var x=l/2-p.naturalWidth/2;this.setTranslate(this.img.parentNode,x,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}}},{key:"zoomOut",value:function(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&typeof this.onclose=="function"&&this.onclose()}},{key:"dragStart",value:function(l){l.preventDefault(),this.zoomedIn?(l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset),l.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))):this.active=!1}},{key:"dragEnd",value:function(l){var p=this;l.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout((function(){p.dragging=!1,p.img.isDragging=!1,p.img.classList.remove("dragging")}),100)}},{key:"drag",value:function(l){this.active&&(l.preventDefault(),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:"onMove",value:function(l){if(this.zoomedIn){var p=l.clientX-this.img.naturalWidth/2,x=l.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,p,x)}}},{key:"setTranslate",value:function(l,p,x){l.style.transform="translate3d("+p+"px, "+x+"px, 0)"}},{key:"widowWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),re=t((function l(){var p=this,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l);var T=x.dragEl,O=x.toleranceX,D=O===void 0?40:O,H=x.toleranceY,$=H===void 0?65:H,A=x.slide,j=A===void 0?null:A,U=x.instance,Y=U===void 0?null:U;this.el=T,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=D,this.toleranceY=$,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=j,this.instance=Y,this.el.addEventListener("mousedown",(function(Z){return p.dragStart(Z)}),!1),this.el.addEventListener("mouseup",(function(Z){return p.dragEnd(Z)}),!1),this.el.addEventListener("mousemove",(function(Z){return p.drag(Z)}),!1)}),[{key:"dragStart",value:function(l){if(this.slide.classList.contains("zoomed"))this.active=!1;else{l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset);var p=l.target.nodeName.toLowerCase();l.target.classList.contains("nodrag")||S(l.target,".nodrag")||["input","select","textarea","button","a"].indexOf(p)!==-1?this.active=!1:(l.preventDefault(),(l.target===this.el||p!=="img"&&S(l.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=S(l.target,".ginner-container")))}}},{key:"dragEnd",value:function(l){var p=this;l&&l.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,this.doSlideChange=="right"&&this.instance.prevSlide(),this.doSlideChange=="left"&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout((function(){p.instance.preventOutsideClick=!1,p.toleranceReached=!1,p.lastDirection=null,p.dragging=!1,p.el.isDragging=!1,p.el.classList.remove("dragging"),p.slide.classList.remove("dragging-nav"),p.dragContainer.style.transform="",p.dragContainer.style.transition=""}),100)}},{key:"drag",value:function(l){if(this.active){l.preventDefault(),this.slide.classList.add("dragging-nav"),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var p=Math.abs(this.currentX),x=Math.abs(this.currentY);if(p>0&&p>=Math.abs(this.currentY)&&(!this.lastDirection||this.lastDirection=="x")){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);var T=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&T&&(this.doSlideChange=T),this.instance.settings.dragAutoSnap&&T)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),T=="right"&&this.instance.prevSlide(),void(T=="left"&&this.instance.nextSlide())}if(this.toleranceY>0&&x>0&&x>=p&&(!this.lastDirection||this.lastDirection=="y")){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);var O=this.shouldClose();return!this.instance.settings.dragAutoSnap&&O&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&O&&this.instance.close())}}}},{key:"shouldChange",value:function(){var l=!1;if(Math.abs(this.currentX)>=this.toleranceX){var p=this.currentX>0?"right":"left";(p=="left"&&this.slide!==this.slide.parentNode.lastChild||p=="right"&&this.slide!==this.slide.parentNode.firstChild)&&(l=p)}return l}},{key:"shouldClose",value:function(){var l=!1;return Math.abs(this.currentY)>=this.toleranceY&&(l=!0),l}},{key:"setTranslate",value:function(l,p,x){var T=arguments.length>3&&arguments[3]!==void 0&&arguments[3];l.style.transition=T?"all .2s ease":"",l.style.transform="translate3d(".concat(p,"px, ").concat(x,"px, 0)")}}]);function ae(l,p,x,T){var O=l.querySelector(".gslide-media"),D=new Image,H="gSlideTitle_"+x,$="gSlideDesc_"+x;D.addEventListener("load",(function(){I(T)&&T()}),!1),D.src=p.href,p.sizes!=""&&p.srcset!=""&&(D.sizes=p.sizes,D.srcset=p.srcset),D.alt="",L(p.alt)||p.alt===""||(D.alt=p.alt),p.title!==""&&D.setAttribute("aria-labelledby",H),p.description!==""&&D.setAttribute("aria-describedby",$),p.hasOwnProperty("_hasCustomWidth")&&p._hasCustomWidth&&(D.style.width=p.width),p.hasOwnProperty("_hasCustomHeight")&&p._hasCustomHeight&&(D.style.height=p.height),O.insertBefore(D,O.firstChild)}function de(l,p,x,T){var O=this,D=l.querySelector(".ginner-container"),H="gvideo"+x,$=l.querySelector(".gslide-media"),A=this.getAllPlayers();h(D,"gvideo-container"),$.insertBefore(k('<div class="gvideo-wrapper"></div>'),$.firstChild);var j=l.querySelector(".gvideo-wrapper");q(this.settings.plyr.css,"Plyr");var U=p.href,Y=p?.videoProvider,Z=!1;$.style.maxWidth=p.width,q(this.settings.plyr.js,"Plyr",(function(){if(!Y&&U.match(/vimeo\.com\/([0-9]*)/)&&(Y="vimeo"),!Y&&(U.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||U.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||U.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||U.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))&&(Y="youtube"),Y==="local"||!Y){Y="local";var ee='<video id="'+H+'" ';ee+='style="background:#000; max-width: '.concat(p.width,';" '),ee+='preload="metadata" ',ee+='x-webkit-airplay="allow" ',ee+="playsinline ",ee+="controls ",ee+='class="gvideo-local">',ee+='<source src="'.concat(U,'">'),Z=k(ee+="</video>")}var te=Z||k('<div id="'.concat(H,'" data-plyr-provider="').concat(Y,'" data-plyr-embed-id="').concat(U,'"></div>'));h(j,"".concat(Y,"-video gvideo")),j.appendChild(te),j.setAttribute("data-id",H),j.setAttribute("data-index",x);var K=P(O.settings.plyr,"config")?O.settings.plyr.config:{},me=new Plyr("#"+H,K);me.on("ready",(function(le){A[H]=le.detail.plyr,I(T)&&T()})),w((function(){return l.querySelector("iframe")&&l.querySelector("iframe").dataset.ready=="true"}),(function(){O.resize(l)})),me.on("enterfullscreen",ue),me.on("exitfullscreen",ue)}))}function ue(l){var p=S(l.target,".gslide-media");l.type==="enterfullscreen"&&h(p,"fullscreen"),l.type==="exitfullscreen"&&f(p,"fullscreen")}function Se(l,p,x,T){var O,D=this,H=l.querySelector(".gslide-media"),$=!(!P(p,"href")||!p.href)&&p.href.split("#").pop().trim(),A=!(!P(p,"content")||!p.content)&&p.content;if(A&&(F(A)&&(O=k('<div class="ginlined-content">'.concat(A,"</div>"))),G(A))){A.style.display=="none"&&(A.style.display="block");var j=document.createElement("div");j.className="ginlined-content",j.appendChild(A),O=j}if($){var U=document.getElementById($);if(!U)return!1;var Y=U.cloneNode(!0);Y.style.height=p.height,Y.style.maxWidth=p.width,h(Y,"ginlined-content"),O=Y}if(!O)return console.error("Unable to append inline slide content",p),!1;H.style.height=p.height,H.style.width=p.width,H.appendChild(O),this.events["inlineclose"+$]=o("click",{onElement:H.querySelectorAll(".gtrigger-close"),withCallback:function(Z){Z.preventDefault(),D.close()}}),I(T)&&T()}function Ie(l,p,x,T){var O=l.querySelector(".gslide-media"),D=(function(H){var $=H.url,A=H.allow,j=H.callback,U=H.appendTo,Y=document.createElement("iframe");return Y.className="vimeo-video gvideo",Y.src=$,Y.style.width="100%",Y.style.height="100%",A&&Y.setAttribute("allow",A),Y.onload=function(){Y.onload=null,h(Y,"node-ready"),I(j)&&j()},U&&U.appendChild(Y),Y})({url:p.href,callback:T});O.parentNode.style.maxWidth=p.width,O.parentNode.style.height=p.height,O.appendChild(D)}var Ae=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},_(p)&&(this.defaults=u(this.defaults,p))}),[{key:"sourceType",value:function(l){var p=l;return(l=l.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)!==null?"image":l.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||l.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)||l.match(/vimeo\.com\/([0-9]*)/)||l.match(/\.(mp4|ogg|webm|mov)/)!==null?"video":l.match(/\.(mp3|wav|wma|aac|ogg)/)!==null?"audio":l.indexOf("#")>-1&&p.split("#").pop().trim()!==""?"inline":l.indexOf("goajax=true")>-1?"ajax":"external"}},{key:"parseConfig",value:function(l,p){var x=this,T=u({descPosition:p.descPosition},this.defaults);if(_(l)&&!G(l)){P(l,"type")||(P(l,"content")&&l.content?l.type="inline":P(l,"href")&&(l.type=this.sourceType(l.href)));var O=u(T,l);return this.setSize(O,p),O}var D="",H=l.getAttribute("data-glightbox"),$=l.nodeName.toLowerCase();if($==="a"&&(D=l.href),$==="img"&&(D=l.src,T.alt=l.alt),T.href=D,c(T,(function(ee,te){P(p,te)&&te!=="width"&&(T[te]=p[te]);var K=l.dataset[te];L(K)||(T[te]=x.sanitizeValue(K))})),T.content&&(T.type="inline"),!T.type&&D&&(T.type=this.sourceType(D)),L(H)){if(!T.title&&$=="a"){var A=l.title;L(A)||A===""||(T.title=A)}if(!T.title&&$=="img"){var j=l.alt;L(j)||j===""||(T.title=j)}}else{var U=[];c(T,(function(ee,te){U.push(";\\s?"+te)})),U=U.join("\\s?:|"),H.trim()!==""&&c(T,(function(ee,te){var K=H,me=new RegExp("s?"+te+"s?:s?(.*?)("+U+"s?:|$)"),le=K.match(me);if(le&&le.length&&le[1]){var Ce=le[1].trim().replace(/;\s*$/,"");T[te]=x.sanitizeValue(Ce)}}))}if(T.description&&T.description.substring(0,1)==="."){var Y;try{Y=document.querySelector(T.description).innerHTML}catch(ee){if(!(ee instanceof DOMException))throw ee}Y&&(T.description=Y)}if(!T.description){var Z=l.querySelector(".glightbox-desc");Z&&(T.description=Z.innerHTML)}return this.setSize(T,p,l),this.slideConfig=T,T}},{key:"setSize",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,T=l.type=="video"?this.checkSize(p.videosWidth):this.checkSize(p.width),O=this.checkSize(p.height);return l.width=P(l,"width")&&l.width!==""?this.checkSize(l.width):T,l.height=P(l,"height")&&l.height!==""?this.checkSize(l.height):O,x&&l.type=="image"&&(l._hasCustomWidth=!!x.dataset.width,l._hasCustomHeight=!!x.dataset.height),l}},{key:"checkSize",value:function(l){return N(l)?"".concat(l,"px"):l}},{key:"sanitizeValue",value:function(l){return l!=="true"&&l!=="false"?l:l==="true"}}]),qe=t((function l(p,x,T){i(this,l),this.element=p,this.instance=x,this.index=T}),[{key:"setContent",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(v(p,"loaded"))return!1;var T=this.instance.settings,O=this.slideConfig,D=V();I(T.beforeSlideLoad)&&T.beforeSlideLoad({index:this.index,slide:p,player:!1});var H=O.type,$=O.descPosition,A=p.querySelector(".gslide-media"),j=p.querySelector(".gslide-title"),U=p.querySelector(".gslide-desc"),Y=p.querySelector(".gdesc-inner"),Z=x,ee="gSlideTitle_"+this.index,te="gSlideDesc_"+this.index;if(I(T.afterSlideLoad)&&(Z=function(){I(x)&&x(),T.afterSlideLoad({index:l.index,slide:p,player:l.instance.getSlidePlayerInstance(l.index)})}),O.title==""&&O.description==""?Y&&Y.parentNode.parentNode.removeChild(Y.parentNode):(j&&O.title!==""?(j.id=ee,j.innerHTML=O.title):j.parentNode.removeChild(j),U&&O.description!==""?(U.id=te,D&&T.moreLength>0?(O.smallDescription=this.slideShortDesc(O.description,T.moreLength,T.moreText),U.innerHTML=O.smallDescription,this.descriptionEvents(U,O)):U.innerHTML=O.description):U.parentNode.removeChild(U),h(A.parentNode,"desc-".concat($)),h(Y.parentNode,"description-".concat($))),h(A,"gslide-".concat(H)),h(p,"loaded"),H!=="video"){if(H!=="external")return H==="inline"?(Se.apply(this.instance,[p,O,this.index,Z]),void(O.draggable&&new re({dragEl:p.querySelector(".gslide-inline"),toleranceX:T.dragToleranceX,toleranceY:T.dragToleranceY,slide:p,instance:this.instance}))):void(H!=="image"?I(Z)&&Z():ae(p,O,this.index,(function(){var K=p.querySelector("img");O.draggable&&new re({dragEl:K,toleranceX:T.dragToleranceX,toleranceY:T.dragToleranceY,slide:p,instance:l.instance}),O.zoomable&&K.naturalWidth>K.offsetWidth&&(h(K,"zoomable"),new se(K,p,(function(){l.instance.resize()}))),I(Z)&&Z()})));Ie.apply(this,[p,O,this.index,Z])}else de.apply(this.instance,[p,O,this.index,Z])}},{key:"slideShortDesc",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,x=arguments.length>2&&arguments[2]!==void 0&&arguments[2],T=document.createElement("div");T.innerHTML=l;var O=T.innerText,D=x;if((l=O.trim()).length<=p)return l;var H=l.substr(0,p-1);return D?(T=null,H+'... <a href="#" class="desc-more">'+x+"</a>"):H}},{key:"descriptionEvents",value:function(l,p){var x=this,T=l.querySelector(".desc-more");if(!T)return!1;o("click",{onElement:T,withCallback:function(O,D){O.preventDefault();var H=document.body,$=S(D,".gslide-desc");if(!$)return!1;$.innerHTML=p.description,h(H,"gdesc-open");var A=o("click",{onElement:[H,S($,".gslide-description")],withCallback:function(j,U){j.target.nodeName.toLowerCase()!=="a"&&(f(H,"gdesc-open"),h(H,"gdesc-closed"),$.innerHTML=p.smallDescription,x.descriptionEvents($,p),setTimeout((function(){f(H,"gdesc-closed")}),400),A.destroy())}})}})}},{key:"create",value:function(){return k(this.instance.settings.slideHTML)}},{key:"getConfig",value:function(){G(this.element)||this.element.hasOwnProperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var l=new Ae(this.instance.settings.slideExtraAttributes);return this.slideConfig=l.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function Ee(l){return Math.sqrt(l.x*l.x+l.y*l.y)}function be(l,p){var x=(function(T,O){var D=Ee(T)*Ee(O);if(D===0)return 0;var H=(function($,A){return $.x*A.x+$.y*A.y})(T,O)/D;return H>1&&(H=1),Math.acos(H)})(l,p);return(function(T,O){return T.x*O.y-O.x*T.y})(l,p)>0&&(x*=-1),180*x/Math.PI}var X=t((function l(p){i(this,l),this.handlers=[],this.el=p}),[{key:"add",value:function(l){this.handlers.push(l)}},{key:"del",value:function(l){l||(this.handlers=[]);for(var p=this.handlers.length;p>=0;p--)this.handlers[p]===l&&this.handlers.splice(p,1)}},{key:"dispatch",value:function(){for(var l=0,p=this.handlers.length;l<p;l++){var x=this.handlers[l];typeof x=="function"&&x.apply(this.el,arguments)}}}]);function ie(l,p){var x=new X(l);return x.add(p),x}var ge=t((function l(p,x){i(this,l),this.element=typeof p=="string"?document.querySelector(p):p,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var T=function(){};this.rotate=ie(this.element,x.rotate||T),this.touchStart=ie(this.element,x.touchStart||T),this.multipointStart=ie(this.element,x.multipointStart||T),this.multipointEnd=ie(this.element,x.multipointEnd||T),this.pinch=ie(this.element,x.pinch||T),this.swipe=ie(this.element,x.swipe||T),this.tap=ie(this.element,x.tap||T),this.doubleTap=ie(this.element,x.doubleTap||T),this.longTap=ie(this.element,x.longTap||T),this.singleTap=ie(this.element,x.singleTap||T),this.pressMove=ie(this.element,x.pressMove||T),this.twoFingerPressMove=ie(this.element,x.twoFingerPressMove||T),this.touchMove=ie(this.element,x.touchMove||T),this.touchEnd=ie(this.element,x.touchEnd||T),this.touchCancel=ie(this.element,x.touchCancel||T),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}),[{key:"start",value:function(l){if(l.touches)if(l.target&&l.target.nodeName&&["a","button","input"].indexOf(l.target.nodeName.toLowerCase())>=0)console.log("ignore drag for this touched element",l.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=l.touches[0].pageX,this.y1=l.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(l,this.element),this.preTapPosition.x!==null&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var p=this.preV;if(l.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var x={x:l.touches[1].pageX-this.x1,y:l.touches[1].pageY-this.y1};p.x=x.x,p.y=x.y,this.pinchStartLen=Ee(p),this.multipointStart.dispatch(l,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout((function(){this.longTap.dispatch(l,this.element),this._preventTap=!0}).bind(this),750)}}},{key:"move",value:function(l){if(l.touches){var p=this.preV,x=l.touches.length,T=l.touches[0].pageX,O=l.touches[0].pageY;if(this.isDoubleTap=!1,x>1){var D=l.touches[1].pageX,H=l.touches[1].pageY,$={x:l.touches[1].pageX-T,y:l.touches[1].pageY-O};p.x!==null&&(this.pinchStartLen>0&&(l.zoom=Ee($)/this.pinchStartLen,this.pinch.dispatch(l,this.element)),l.angle=be($,p),this.rotate.dispatch(l,this.element)),p.x=$.x,p.y=$.y,this.x2!==null&&this.sx2!==null?(l.deltaX=(T-this.x2+D-this.sx2)/2,l.deltaY=(O-this.y2+H-this.sy2)/2):(l.deltaX=0,l.deltaY=0),this.twoFingerPressMove.dispatch(l,this.element),this.sx2=D,this.sy2=H}else{if(this.x2!==null){l.deltaX=T-this.x2,l.deltaY=O-this.y2;var A=Math.abs(this.x1-this.x2),j=Math.abs(this.y1-this.y2);(A>10||j>10)&&(this._preventTap=!0)}else l.deltaX=0,l.deltaY=0;this.pressMove.dispatch(l,this.element)}this.touchMove.dispatch(l,this.element),this._cancelLongTap(),this.x2=T,this.y2=O,x>1&&l.preventDefault()}}},{key:"end",value:function(l){if(l.changedTouches){this._cancelLongTap();var p=this;l.touches.length<2&&(this.multipointEnd.dispatch(l,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(l.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){p.swipe.dispatch(l,p.element)}),0)):(this.tapTimeout=setTimeout((function(){p._preventTap||p.tap.dispatch(l,p.element),p.isDoubleTap&&(p.doubleTap.dispatch(l,p.element),p.isDoubleTap=!1)}),0),p.isDoubleTap||(p.singleTapTimeout=setTimeout((function(){p.singleTap.dispatch(l,p.element)}),250))),this.touchEnd.dispatch(l,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelAll",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:"cancel",value:function(l){this.cancelAll(),this.touchCancel.dispatch(l,this.element)}},{key:"_cancelLongTap",value:function(){clearTimeout(this.longTapTimeout)}},{key:"_cancelSingleTap",value:function(){clearTimeout(this.singleTapTimeout)}},{key:"_swipeDirection",value:function(l,p,x,T){return Math.abs(l-p)>=Math.abs(x-T)?l-p>0?"Left":"Right":x-T>0?"Up":"Down"}},{key:"on",value:function(l,p){this[l]&&this[l].add(p)}},{key:"off",value:function(l,p){this[l]&&this[l].del(p)}},{key:"destroy",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}]);function ve(l){var p=(function(){var H,$=document.createElement("fakeelement"),A={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(H in A)if($.style[H]!==void 0)return A[H]})(),x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T=v(l,"gslide-media")?l:l.querySelector(".gslide-media"),O=S(T,".ginner-container"),D=l.querySelector(".gslide-description");x>769&&(T=O),h(T,"greset"),y(T,"translate3d(0, 0, 0)"),o(p,{onElement:T,once:!0,withCallback:function(H,$){f(T,"greset")}}),T.style.opacity="",D&&(D.style.opacity="")}function Oe(l){if(l.events.hasOwnProperty("touch"))return!1;var p,x,T,O=C(),D=O.width,H=O.height,$=!1,A=null,j=null,U=null,Y=!1,Z=1,ee=1,te=!1,K=!1,me=null,le=null,Ce=null,pe=null,xe=0,Le=0,$e=!1,Ne=!1,Pe={},ke={},ce=0,Re=0,De=document.getElementById("glightbox-slider"),Ge=document.querySelector(".goverlay"),st=new ge(De,{touchStart:function(_e){if($=!0,(v(_e.targetTouches[0].target,"ginner-container")||S(_e.targetTouches[0].target,".gslide-desc")||_e.targetTouches[0].target.nodeName.toLowerCase()=="a")&&($=!1),S(_e.targetTouches[0].target,".gslide-inline")&&!v(_e.targetTouches[0].target.parentNode,"gslide-inline")&&($=!1),$){if(ke=_e.targetTouches[0],Pe.pageX=_e.targetTouches[0].pageX,Pe.pageY=_e.targetTouches[0].pageY,ce=_e.targetTouches[0].clientX,Re=_e.targetTouches[0].clientY,A=l.activeSlide,j=A.querySelector(".gslide-media"),T=A.querySelector(".gslide-inline"),U=null,v(j,"gslide-image")&&(U=j.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(j=A.querySelector(".ginner-container")),f(Ge,"greset"),_e.pageX>20&&_e.pageX<window.innerWidth-20)return;_e.preventDefault()}},touchMove:function(_e){if($&&(ke=_e.targetTouches[0],!te&&!K)){if(T&&T.offsetHeight>H){var He=Pe.pageX-ke.pageX;if(Math.abs(He)<=13)return!1}Y=!0;var Ue,Xe=_e.targetTouches[0].clientX,nt=_e.targetTouches[0].clientY,rt=ce-Xe,at=Re-nt;if(Math.abs(rt)>Math.abs(at)?($e=!1,Ne=!0):(Ne=!1,$e=!0),p=ke.pageX-Pe.pageX,xe=100*p/D,x=ke.pageY-Pe.pageY,Le=100*x/H,$e&&U&&(Ue=1-Math.abs(x)/H,Ge.style.opacity=Ue,l.settings.touchFollowAxis&&(xe=0)),Ne&&(Ue=1-Math.abs(p)/D,j.style.opacity=Ue,l.settings.touchFollowAxis&&(Le=0)),!U)return y(j,"translate3d(".concat(xe,"%, 0, 0)"));y(j,"translate3d(".concat(xe,"%, ").concat(Le,"%, 0)"))}},touchEnd:function(){if($){if(Y=!1,K||te)return Ce=me,void(pe=le);var _e=Math.abs(parseInt(Le)),He=Math.abs(parseInt(xe));if(!(_e>29&&U))return _e<29&&He<25?(h(Ge,"greset"),Ge.style.opacity=1,ve(j)):void 0;l.close()}},multipointEnd:function(){setTimeout((function(){te=!1}),50)},multipointStart:function(){te=!0,Z=ee||1},pinch:function(_e){if(!U||Y)return!1;te=!0,U.scaleX=U.scaleY=Z*_e.zoom;var He=Z*_e.zoom;if(K=!0,He<=1)return K=!1,He=1,pe=null,Ce=null,me=null,le=null,void U.setAttribute("style","");He>4.5&&(He=4.5),U.style.transform="scale3d(".concat(He,", ").concat(He,", 1)"),ee=He},pressMove:function(_e){if(K&&!te){var He=ke.pageX-Pe.pageX,Ue=ke.pageY-Pe.pageY;Ce&&(He+=Ce),pe&&(Ue+=pe),me=He,le=Ue;var Xe="translate3d(".concat(He,"px, ").concat(Ue,"px, 0)");ee&&(Xe+=" scale3d(".concat(ee,", ").concat(ee,", 1)")),y(U,Xe)}},swipe:function(_e){if(!K)if(te)te=!1;else{if(_e.direction=="Left"){if(l.index==l.elements.length-1)return ve(j);l.nextSlide()}if(_e.direction=="Right"){if(l.index==0)return ve(j);l.prevSlide()}}}});l.events.touch=st}var ye=V(),fe=V()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,he=document.getElementsByTagName("html")[0],ne={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>'},slideHTML:`<div class="gslide">
|
|
26
|
+
*/var M=f,q=b,D=_,$=(function(){function j(O){p(this,j),this._parseOptions(O),this._initCollection(),this._initLoop()}return T(j,[{key:"_parseOptions",value:function(x){x=a()(new n,x),this.defaultTrigger=x.trigger,this.scrollOptions=x.scroll}},{key:"_initCollection",value:function(){var x=document.querySelectorAll("[data-scroll]"),S=[];x.length>0&&(S=this.createTriggers(x)),this.collection=new q(S)}},{key:"_initLoop",value:function(){var x=this;this.loop=new D({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function(A,N){x._scrollCallback(A,N)},start:function(){x._scrollStart()},stop:function(){x._scrollStop()},directionChange:function(A){x._scrollDirectionChange(A)}})}},{key:"_scrollCallback",value:function(x,S){var A=this;this.collection.call(function(N){N.checkVisibility(A.scrollOptions.element,S)}),this.scrollOptions.callback(x,S)}},{key:"_scrollStart",value:function(){this.scrollOptions.start()}},{key:"_scrollStop",value:function(){this.scrollOptions.stop()}},{key:"_scrollDirectionChange",value:function(x){this.scrollOptions.directionChange(x)}},{key:"createTrigger",value:function(x,S){return new M(x,a()(this.defaultTrigger,S))}},{key:"createTriggers",value:function(x,S){var A=this,N=[];return x.each(function(L){N.push(A.createTrigger(L,S))}),N}},{key:"add",value:function(x,S){return x instanceof HTMLElement?(this.collection.add(this.createTrigger(x,S)),this):x instanceof M?(this.collection.add(x),this):x instanceof NodeList?(this.collection.add(this.createTriggers(x,S)),this):Array.isArray(x)&&x.length&&x[0]instanceof M?(this.collection.add(x),this):Array.isArray(x)&&x.length&&x[0]instanceof HTMLElement?(this.collection.add(this.createTriggers(x,S)),this):(this.collection.add(this.createTriggers(document.querySelectorAll(x),S)),this)}},{key:"remove",value:function(x){return x instanceof M?(this.collection.remove(x),this):Array.isArray(x)&&x.length&&x[0]instanceof M?(this.collection.remove(x),this):x instanceof HTMLElement?(this.collection.remove(this.search(x)),this):Array.isArray(x)&&x.length&&x[0]instanceof HTMLElement?(this.collection.remove(this.search(x)),this):x instanceof NodeList?(this.collection.remove(this.search(x)),this):Array.isArray(x)&&x.length&&x[0]instanceof M?(this.collection.remove(x),this):(this.collection.remove(this.query(x.toString())),this)}},{key:"query",value:function(x){return this.collection.query(x)}},{key:"search",value:function(x){return this.collection.search(x)}},{key:"listen",value:function(){this.loop||this._initLoop()}},{key:"kill",value:function(){this.loop.kill(),this.loop=null}}]),j})()})])})})(Kt)),Kt.exports}var Ss=_s();const Ts=yt(Ss),Oi=Date.now();function et(){let u={},e=!0,i=0,s=arguments.length;Object.prototype.toString.call(arguments[0])==="[object Boolean]"&&(e=arguments[0],i++);let t=n=>{for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e&&Object.prototype.toString.call(n[r])==="[object Object]"?u[r]=et(!0,u[r],n[r]):u[r]=n[r])};for(;i<s;i++){let n=arguments[i];t(n)}return u}function Ne(u,e){if((tt(u)||u===window||u===document)&&(u=[u]),!Ii(u)&&!ut(u)&&(u=[u]),ji(u)!=0){if(Ii(u)&&!ut(u)){let i=u.length,s=0;for(;s<i&&e.call(u[s],u[s],s,u)!==!1;s++);}else if(ut(u)){for(let i in u)if(He(u,i)&&e.call(u[i],u[i],i,u)===!1)break}}}function Li(u,e=null,i=null){const s=u[Oi]=u[Oi]||[],t={all:s,evt:null,found:null};return e&&i&&ji(s)>0&&Ne(s,(n,r)=>{if(n.eventName==e&&n.fn.toString()==i.toString())return t.found=!0,t.evt=r,!1}),t}function Ge(u,{onElement:e,withCallback:i,avoidDuplicate:s=!0,once:t=!1,useCapture:n=!1}={},r){let a=e||[];ft(a)&&(a=document.querySelectorAll(a));function l(c){Te(i)&&i.call(r,c,this),t&&l.destroy()}return l.destroy=function(){Ne(a,c=>{const d=Li(c,u,l);d.found&&d.all.splice(d.evt,1),c.removeEventListener&&c.removeEventListener(u,l,n)})},Ne(a,c=>{const d=Li(c,u,l);(c.addEventListener&&s&&!d.found||!s)&&(c.addEventListener(u,l,n),d.all.push({eventName:u,fn:l}))}),l}function ge(u,e){Ne(e.split(" "),i=>u.classList.add(i))}function $e(u,e){Ne(e.split(" "),i=>u.classList.remove(i))}function Ue(u,e){return u.classList.contains(e)}function Qe(u,e){for(;u!==document.body;){if(u=u.parentElement,!u)return!1;if(typeof u.matches=="function"?u.matches(e):u.msMatchesSelector(e))return u}}function ct(u,e="",i=!1){if(!u||e==="")return!1;if(e==="none")return Te(i)&&i(),!1;const s=Es(),t=e.split(" ");Ne(t,n=>{ge(u,"g"+n)}),Ge(s,{onElement:u,avoidDuplicate:!1,once:!0,withCallback:(n,r)=>{Ne(t,a=>{$e(r,"g"+a)}),Te(i)&&i()}})}function wt(u,e=""){if(e==="")return u.style.webkitTransform="",u.style.MozTransform="",u.style.msTransform="",u.style.OTransform="",u.style.transform="",!1;u.style.webkitTransform=e,u.style.MozTransform=e,u.style.msTransform=e,u.style.OTransform=e,u.style.transform=e}function Ai(u){u.style.display="block"}function ei(u){u.style.display="none"}function nt(u){let e=document.createDocumentFragment(),i=document.createElement("div");for(i.innerHTML=u;i.firstChild;)e.appendChild(i.firstChild);return e}function Ri(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function Es(){let u,e=document.createElement("fakeelement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(u in i)if(e.style[u]!==void 0)return i[u]}function Cs(){let u,e=document.createElement("fakeelement");const i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(u in i)if(e.style[u]!==void 0)return i[u]}function Os(u){let{url:e,allow:i,callback:s,appendTo:t}=u,n=document.createElement("iframe");return n.className="vimeo-video gvideo",n.src=e,n.style.width="100%",n.style.height="100%",i&&n.setAttribute("allow",i),n.onload=function(){n.onload=null,ge(n,"node-ready"),Te(s)&&s()},t&&t.appendChild(n),n}function ti(u,e,i,s){if(u()){e();return}i||(i=100);let t=setInterval(()=>{u()&&(clearInterval(t),e())},i)}function qi(u,e,i){if(We(u)){console.error("Inject assets error");return}if(Te(e)&&(i=e,e=!1),ft(e)&&e in window){Te(i)&&i();return}let s;if(u.indexOf(".css")!==-1){if(s=document.querySelectorAll('link[href="'+u+'"]'),s&&s.length>0){Te(i)&&i();return}const n=document.getElementsByTagName("head")[0],r=n.querySelectorAll('link[rel="stylesheet"]'),a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.href=u,a.media="all",r?n.insertBefore(a,r[0]):n.appendChild(a),Te(i)&&i();return}if(s=document.querySelectorAll('script[src="'+u+'"]'),s&&s.length>0){if(Te(i)){if(ft(e))return ti(()=>typeof window[e]<"u",()=>{i()}),!1;i()}return}let t=document.createElement("script");t.type="text/javascript",t.src=u,t.onload=()=>{if(Te(i)){if(ft(e))return ti(()=>typeof window[e]<"u",()=>{i()}),!1;i()}},document.body.appendChild(t)}function ii(){return typeof window>"u"?!1:"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function Ls(){return typeof document>"u"?!1:ii()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints}function Te(u){return typeof u=="function"}function ft(u){return typeof u=="string"}function tt(u){return!!(u&&u.nodeType&&u.nodeType==1)}function Mi(u){return Array.isArray(u)}function Ii(u){return u&&u.length&&isFinite(u.length)}function ut(u){return typeof u==="object"&&u!=null&&!Te(u)&&!Mi(u)}function We(u){return u==null}function He(u,e){return u!==null&&hasOwnProperty.call(u,e)}function ji(u){if(ut(u)){if(u.keys)return u.keys().length;let e=0;for(let i in u)He(u,i)&&e++;return e}else return u.length}function xt(u){return!isNaN(parseFloat(u))&&isFinite(u)}function Ni(u=-1){const e=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!e.length)return!1;if(e.length==1)return e[0];typeof u=="string"&&(u=parseInt(u));const i=[];Ne(e,a=>{i.push(a.getAttribute("data-taborder"))});const s=Math.max.apply(Math,i.map(a=>parseInt(a)));let t=u<0?1:u+1;t>s&&(t="1");const r=i.filter(a=>a>=parseInt(t)).sort()[0];return document.querySelector(`.gbtn[data-taborder="${r}"]`)}function As(u){if(u.events.hasOwnProperty("keyboard"))return!1;u.events.keyboard=Ge("keydown",{onElement:window,withCallback:(e,i)=>{e=e||window.event;const s=e.keyCode;if(s==9){const t=document.querySelector(".gbtn.focused");if(!t){const l=document.activeElement&&document.activeElement.nodeName?document.activeElement.nodeName.toLocaleLowerCase():!1;if(l=="input"||l=="textarea"||l=="button")return}e.preventDefault();const n=document.querySelectorAll(".gbtn[data-taborder]");if(!n||n.length<=0)return;if(!t){const l=Ni();l&&(l.focus(),ge(l,"focused"));return}let r=t.getAttribute("data-taborder"),a=Ni(r);$e(t,"focused"),a&&(a.focus(),ge(a,"focused"))}s==39&&u.nextSlide(),s==37&&u.prevSlide(),s==27&&u.close()}})}function kt(u){return Math.sqrt(u.x*u.x+u.y*u.y)}function Rs(u,e){return u.x*e.x+u.y*e.y}function qs(u,e){var i=kt(u)*kt(e);if(i===0)return 0;var s=Rs(u,e)/i;return s>1&&(s=1),Math.acos(s)}function Ms(u,e){return u.x*e.y-e.x*u.y}function Is(u,e){var i=qs(u,e);return Ms(u,e)>0&&(i*=-1),i*180/Math.PI}class js{constructor(e){this.handlers=[],this.el=e}add(e){this.handlers.push(e)}del(e){e||(this.handlers=[]);for(var i=this.handlers.length;i>=0;i--)this.handlers[i]===e&&this.handlers.splice(i,1)}dispatch(){for(var e=0,i=this.handlers.length;e<i;e++){var s=this.handlers[e];typeof s=="function"&&s.apply(this.el,arguments)}}}function Fe(u,e){var i=new js(u);return i.add(e),i}class Ns{constructor(e,i){this.element=typeof e=="string"?document.querySelector(e):e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var s=function(){};this.rotate=Fe(this.element,i.rotate||s),this.touchStart=Fe(this.element,i.touchStart||s),this.multipointStart=Fe(this.element,i.multipointStart||s),this.multipointEnd=Fe(this.element,i.multipointEnd||s),this.pinch=Fe(this.element,i.pinch||s),this.swipe=Fe(this.element,i.swipe||s),this.tap=Fe(this.element,i.tap||s),this.doubleTap=Fe(this.element,i.doubleTap||s),this.longTap=Fe(this.element,i.longTap||s),this.singleTap=Fe(this.element,i.singleTap||s),this.pressMove=Fe(this.element,i.pressMove||s),this.twoFingerPressMove=Fe(this.element,i.twoFingerPressMove||s),this.touchMove=Fe(this.element,i.touchMove||s),this.touchEnd=Fe(this.element,i.touchEnd||s),this.touchCancel=Fe(this.element,i.touchCancel||s),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}start(e){if(!e.touches)return;const i=["a","button","input"];if(e.target&&e.target.nodeName&&i.indexOf(e.target.nodeName.toLowerCase())>=0){console.log("ignore drag for this touched element",e.target.nodeName.toLowerCase());return}this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),this.preTapPosition.x!==null&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var s=this.preV,t=e.touches.length;if(t>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};s.x=n.x,s.y=n.y,this.pinchStartLen=kt(s),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout((function(){this.longTap.dispatch(e,this.element),this._preventTap=!0}).bind(this),750)}move(e){if(e.touches){var i=this.preV,s=e.touches.length,t=e.touches[0].pageX,n=e.touches[0].pageY;if(this.isDoubleTap=!1,s>1){var r=e.touches[1].pageX,a=e.touches[1].pageY,l={x:e.touches[1].pageX-t,y:e.touches[1].pageY-n};i.x!==null&&(this.pinchStartLen>0&&(e.zoom=kt(l)/this.pinchStartLen,this.pinch.dispatch(e,this.element)),e.angle=Is(l,i),this.rotate.dispatch(e,this.element)),i.x=l.x,i.y=l.y,this.x2!==null&&this.sx2!==null?(e.deltaX=(t-this.x2+r-this.sx2)/2,e.deltaY=(n-this.y2+a-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=r,this.sy2=a}else{if(this.x2!==null){e.deltaX=t-this.x2,e.deltaY=n-this.y2;var c=Math.abs(this.x1-this.x2),d=Math.abs(this.y1-this.y2);(c>10||d>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=t,this.y2=n,s>1&&e.preventDefault()}}end(e){if(e.changedTouches){this._cancelLongTap();var i=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout(function(){i.swipe.dispatch(e,i.element)},0)):(this.tapTimeout=setTimeout(function(){i._preventTap||i.tap.dispatch(e,i.element),i.isDoubleTap&&(i.doubleTap.dispatch(e,i.element),i.isDoubleTap=!1)},0),i.isDoubleTap||(i.singleTapTimeout=setTimeout(function(){i.singleTap.dispatch(e,i.element)},250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}cancelAll(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}cancel(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)}_cancelLongTap(){clearTimeout(this.longTapTimeout)}_cancelSingleTap(){clearTimeout(this.singleTapTimeout)}_swipeDirection(e,i,s,t){return Math.abs(e-i)>=Math.abs(s-t)?e-i>0?"Left":"Right":s-t>0?"Up":"Down"}on(e,i){this[e]&&this[e].add(i)}off(e,i){this[e]&&this[e].del(i)}destroy(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}function si(u){const e=Cs(),i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;let s=Ue(u,"gslide-media")?u:u.querySelector(".gslide-media"),t=Qe(s,".ginner-container"),n=u.querySelector(".gslide-description");i>769&&(s=t),ge(s,"greset"),wt(s,"translate3d(0, 0, 0)"),Ge(e,{onElement:s,once:!0,withCallback:(r,a)=>{$e(s,"greset")}}),s.style.opacity="",n&&(n.style.opacity="")}function Ds(u){if(u.events.hasOwnProperty("touch"))return!1;let e=Ri(),i=e.width,s=e.height,t=!1,n=null,r=null,a=null,l=!1,c=1,d=4.5,o=1,h=!1,f=!1,m=null,w=null,E=null,b=null,k,g,v=0,_=0,p=!1,y=!1,T={},M={},q=0,D=0,$;const j=document.getElementById("glightbox-slider"),O=document.querySelector(".goverlay"),x=new Ns(j,{touchStart:S=>{if(t=!0,(Ue(S.targetTouches[0].target,"ginner-container")||Qe(S.targetTouches[0].target,".gslide-desc")||S.targetTouches[0].target.nodeName.toLowerCase()=="a")&&(t=!1),Qe(S.targetTouches[0].target,".gslide-inline")&&!Ue(S.targetTouches[0].target.parentNode,"gslide-inline")&&(t=!1),t){if(M=S.targetTouches[0],T.pageX=S.targetTouches[0].pageX,T.pageY=S.targetTouches[0].pageY,q=S.targetTouches[0].clientX,D=S.targetTouches[0].clientY,n=u.activeSlide,r=n.querySelector(".gslide-media"),$=n.querySelector(".gslide-inline"),a=null,Ue(r,"gslide-image")&&(a=r.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(r=n.querySelector(".ginner-container")),$e(O,"greset"),S.pageX>20&&S.pageX<window.innerWidth-20)return;S.preventDefault()}},touchMove:S=>{if(!t||(M=S.targetTouches[0],h||f))return;if($&&$.offsetHeight>s){const Y=T.pageX-M.pageX;if(Math.abs(Y)<=13)return!1}l=!0;let A=S.targetTouches[0].clientX,N=S.targetTouches[0].clientY,L=q-A,V=D-N;Math.abs(L)>Math.abs(V)?(p=!1,y=!0):(y=!1,p=!0),k=M.pageX-T.pageX,v=k*100/i,g=M.pageY-T.pageY,_=g*100/s;let U;if(p&&a&&(U=1-Math.abs(g)/s,O.style.opacity=U,u.settings.touchFollowAxis&&(v=0)),y&&(U=1-Math.abs(k)/i,r.style.opacity=U,u.settings.touchFollowAxis&&(_=0)),!a)return wt(r,`translate3d(${v}%, 0, 0)`);wt(r,`translate3d(${v}%, ${_}%, 0)`)},touchEnd:()=>{if(!t)return;if(l=!1,f||h){E=m,b=w;return}const S=Math.abs(parseInt(_)),A=Math.abs(parseInt(v));if(S>29&&a){u.close();return}if(S<29&&A<25)return ge(O,"greset"),O.style.opacity=1,si(r)},multipointEnd:()=>{setTimeout(()=>{h=!1},50)},multipointStart:()=>{h=!0,c=o||1},pinch:S=>{if(!a||l)return!1;h=!0,a.scaleX=a.scaleY=c*S.zoom;let A=c*S.zoom;if(f=!0,A<=1){f=!1,A=1,b=null,E=null,m=null,w=null,a.setAttribute("style","");return}A>d&&(A=d),a.style.transform=`scale3d(${A}, ${A}, 1)`,o=A},pressMove:S=>{if(f&&!h){var A=M.pageX-T.pageX,N=M.pageY-T.pageY;E&&(A=A+E),b&&(N=N+b),m=A,w=N;let L=`translate3d(${A}px, ${N}px, 0)`;o&&(L+=` scale3d(${o}, ${o}, 1)`),wt(a,L)}},swipe:S=>{if(!f){if(h){h=!1;return}if(S.direction=="Left"){if(u.index==u.elements.length-1)return si(r);u.nextSlide()}if(S.direction=="Right"){if(u.index==0)return si(r);u.prevSlide()}}}});u.events.touch=x}class Ps{constructor(e,i,s=null){if(this.img=e,this.slide=i,this.onclose=s,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener("mousedown",t=>this.dragStart(t),!1),this.img.addEventListener("mouseup",t=>this.dragEnd(t),!1),this.img.addEventListener("mousemove",t=>this.drag(t),!1),this.img.addEventListener("click",t=>{if(this.slide.classList.contains("dragging-nav"))return this.zoomOut(),!1;if(!this.zoomedIn)return this.zoomIn();this.zoomedIn&&!this.dragging&&this.zoomOut()},!1),this.img.setZoomEvents=!0}zoomIn(){let e=this.widowWidth();if(this.zoomedIn||e<=768)return;const i=this.img;if(i.setAttribute("data-style",i.getAttribute("style")),i.style.maxWidth=i.naturalWidth+"px",i.style.maxHeight=i.naturalHeight+"px",i.naturalWidth>e){let s=e/2-i.naturalWidth/2;this.setTranslate(this.img.parentNode,s,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}zoomOut(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&typeof this.onclose=="function"&&this.onclose()}dragStart(e){if(e.preventDefault(),!this.zoomedIn){this.active=!1;return}e.type==="touchstart"?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset),e.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))}dragEnd(e){e.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout(()=>{this.dragging=!1,this.img.isDragging=!1,this.img.classList.remove("dragging")},100)}drag(e){this.active&&(e.preventDefault(),e.type==="touchmove"?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}onMove(e){if(!this.zoomedIn)return;let i=e.clientX-this.img.naturalWidth/2,s=e.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,i,s)}setTranslate(e,i,s){e.style.transform="translate3d("+i+"px, "+s+"px, 0)"}widowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}class Di{constructor(e={}){let{dragEl:i,toleranceX:s=40,toleranceY:t=65,slide:n=null,instance:r=null}=e;this.el=i,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=s,this.toleranceY=t,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=n,this.instance=r,this.el.addEventListener("mousedown",a=>this.dragStart(a),!1),this.el.addEventListener("mouseup",a=>this.dragEnd(a),!1),this.el.addEventListener("mousemove",a=>this.drag(a),!1)}dragStart(e){if(this.slide.classList.contains("zoomed")){this.active=!1;return}e.type==="touchstart"?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset);let i=e.target.nodeName.toLowerCase(),s=["input","select","textarea","button","a"];if(e.target.classList.contains("nodrag")||Qe(e.target,".nodrag")||s.indexOf(i)!==-1){this.active=!1;return}e.preventDefault(),(e.target===this.el||i!=="img"&&Qe(e.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=Qe(e.target,".ginner-container"))}dragEnd(e){e&&e.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,this.doSlideChange=="right"&&this.instance.prevSlide(),this.doSlideChange=="left"&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout(()=>{this.instance.preventOutsideClick=!1,this.toleranceReached=!1,this.lastDirection=null,this.dragging=!1,this.el.isDragging=!1,this.el.classList.remove("dragging"),this.slide.classList.remove("dragging-nav"),this.dragContainer.style.transform="",this.dragContainer.style.transition=""},100)}drag(e){if(this.active){e.preventDefault(),this.slide.classList.add("dragging-nav"),e.type==="touchmove"?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;let i=Math.abs(this.currentX),s=Math.abs(this.currentY);if(i>0&&i>=Math.abs(this.currentY)&&(!this.lastDirection||this.lastDirection=="x")){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);let t=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&t&&(this.doSlideChange=t),this.instance.settings.dragAutoSnap&&t){this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),t=="right"&&this.instance.prevSlide(),t=="left"&&this.instance.nextSlide();return}}if(this.toleranceY>0&&s>0&&s>=i&&(!this.lastDirection||this.lastDirection=="y")){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);let t=this.shouldClose();!this.instance.settings.dragAutoSnap&&t&&(this.doSlideClose=!0),this.instance.settings.dragAutoSnap&&t&&this.instance.close();return}}}shouldChange(){let e=!1;if(Math.abs(this.currentX)>=this.toleranceX){let s=this.currentX>0?"right":"left";(s=="left"&&this.slide!==this.slide.parentNode.lastChild||s=="right"&&this.slide!==this.slide.parentNode.firstChild)&&(e=s)}return e}shouldClose(){let e=!1;return Math.abs(this.currentY)>=this.toleranceY&&(e=!0),e}setTranslate(e,i,s,t=!1){t?e.style.transition="all .2s ease":e.style.transition="",e.style.transform=`translate3d(${i}px, ${s}px, 0)`}}function $s(u,e,i,s){const t=u.querySelector(".gslide-media");let n=new Image,r="gSlideTitle_"+i,a="gSlideDesc_"+i;n.addEventListener("load",()=>{Te(s)&&s()},!1),n.src=e.href,e.sizes!=""&&e.srcset!=""&&(n.sizes=e.sizes,n.srcset=e.srcset),n.alt="",!We(e.alt)&&e.alt!==""&&(n.alt=e.alt),e.title!==""&&n.setAttribute("aria-labelledby",r),e.description!==""&&n.setAttribute("aria-describedby",a),e.hasOwnProperty("_hasCustomWidth")&&e._hasCustomWidth&&(n.style.width=e.width),e.hasOwnProperty("_hasCustomHeight")&&e._hasCustomHeight&&(n.style.height=e.height),t.insertBefore(n,t.firstChild)}function Hs(u,e,i,s){const t=u.querySelector(".ginner-container"),n="gvideo"+i,r=u.querySelector(".gslide-media"),a=this.getAllPlayers();ge(t,"gvideo-container"),r.insertBefore(nt('<div class="gvideo-wrapper"></div>'),r.firstChild);const l=u.querySelector(".gvideo-wrapper");qi(this.settings.plyr.css,"Plyr");let c=e.href,d=e?.videoProvider,o=!1;r.style.maxWidth=e.width,qi(this.settings.plyr.js,"Plyr",()=>{if(!d&&c.match(/vimeo\.com\/([0-9]*)/)&&(d="vimeo"),!d&&(c.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||c.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||c.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/))&&(d="youtube"),d==="local"||!d){d="local";let w='<video id="'+n+'" ';w+=`style="background:#000; max-width: ${e.width};" `,w+='preload="metadata" ',w+='x-webkit-airplay="allow" ',w+="playsinline ",w+="controls ",w+='class="gvideo-local">',w+=`<source src="${c}">`,w+="</video>",o=nt(w)}const h=o||nt(`<div id="${n}" data-plyr-provider="${d}" data-plyr-embed-id="${c}"></div>`);ge(l,`${d}-video gvideo`),l.appendChild(h),l.setAttribute("data-id",n),l.setAttribute("data-index",i);const f=He(this.settings.plyr,"config")?this.settings.plyr.config:{},m=new Plyr("#"+n,f);m.on("ready",w=>{a[n]=w.detail.plyr,Te(s)&&s()}),ti(()=>u.querySelector("iframe")&&u.querySelector("iframe").dataset.ready=="true",()=>{this.resize(u)}),m.on("enterfullscreen",Pi),m.on("exitfullscreen",Pi)})}function Pi(u){const e=Qe(u.target,".gslide-media");u.type==="enterfullscreen"&&ge(e,"fullscreen"),u.type==="exitfullscreen"&&$e(e,"fullscreen")}function zs(u,e,i,s){const t=u.querySelector(".gslide-media"),n=He(e,"href")&&e.href?e.href.split("#").pop().trim():!1,r=He(e,"content")&&e.content?e.content:!1;let a;if(r&&(ft(r)&&(a=nt(`<div class="ginlined-content">${r}</div>`)),tt(r))){r.style.display=="none"&&(r.style.display="block");const l=document.createElement("div");l.className="ginlined-content",l.appendChild(r),a=l}if(n){let l=document.getElementById(n);if(!l)return!1;const c=l.cloneNode(!0);c.style.height=e.height,c.style.maxWidth=e.width,ge(c,"ginlined-content"),a=c}if(!a)return console.error("Unable to append inline slide content",e),!1;t.style.height=e.height,t.style.width=e.width,t.appendChild(a),this.events["inlineclose"+n]=Ge("click",{onElement:t.querySelectorAll(".gtrigger-close"),withCallback:l=>{l.preventDefault(),this.close()}}),Te(s)&&s()}function Vs(u,e,i,s){const t=u.querySelector(".gslide-media"),n=Os({url:e.href,callback:s});t.parentNode.style.maxWidth=e.width,t.parentNode.style.height=e.height,t.appendChild(n)}class Bs{constructor(e={}){this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},ut(e)&&(this.defaults=et(this.defaults,e))}sourceType(e){let i=e;return e=e.toLowerCase(),e.match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)!==null?"image":e.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||e.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)||e.match(/\.(mp4|ogg|webm|mov)/)!==null?"video":e.match(/\.(mp3|wav|wma|aac|ogg)/)!==null?"audio":e.indexOf("#")>-1&&i.split("#").pop().trim()!==""?"inline":e.indexOf("goajax=true")>-1?"ajax":"external"}parseConfig(e,i){let s=et({descPosition:i.descPosition},this.defaults);if(ut(e)&&!tt(e)){He(e,"type")||(He(e,"content")&&e.content?e.type="inline":He(e,"href")&&(e.type=this.sourceType(e.href)));let a=et(s,e);return this.setSize(a,i),a}let t="",n=e.getAttribute("data-glightbox"),r=e.nodeName.toLowerCase();if(r==="a"&&(t=e.href),r==="img"&&(t=e.src,s.alt=e.alt),s.href=t,Ne(s,(a,l)=>{He(i,l)&&l!=="width"&&(s[l]=i[l]);const c=e.dataset[l];We(c)||(s[l]=this.sanitizeValue(c))}),s.content&&(s.type="inline"),!s.type&&t&&(s.type=this.sourceType(t)),We(n)){if(!s.title&&r=="a"){let a=e.title;!We(a)&&a!==""&&(s.title=a)}if(!s.title&&r=="img"){let a=e.alt;!We(a)&&a!==""&&(s.title=a)}}else{let a=[];Ne(s,(l,c)=>{a.push(";\\s?"+c)}),a=a.join("\\s?:|"),n.trim()!==""&&Ne(s,(l,c)=>{const d=n,o="s?"+c+"s?:s?(.*?)("+a+"s?:|$)",h=new RegExp(o),f=d.match(h);if(f&&f.length&&f[1]){const m=f[1].trim().replace(/;\s*$/,"");s[c]=this.sanitizeValue(m)}})}if(s.description&&s.description.substring(0,1)==="."){let a;try{a=document.querySelector(s.description).innerHTML}catch(l){if(!(l instanceof DOMException))throw l}a&&(s.description=a)}if(!s.description){let a=e.querySelector(".glightbox-desc");a&&(s.description=a.innerHTML)}return this.setSize(s,i,e),this.slideConfig=s,s}setSize(e,i,s=null){const t=e.type=="video"?this.checkSize(i.videosWidth):this.checkSize(i.width),n=this.checkSize(i.height);return e.width=He(e,"width")&&e.width!==""?this.checkSize(e.width):t,e.height=He(e,"height")&&e.height!==""?this.checkSize(e.height):n,s&&e.type=="image"&&(e._hasCustomWidth=!!s.dataset.width,e._hasCustomHeight=!!s.dataset.height),e}checkSize(e){return xt(e)?`${e}px`:e}sanitizeValue(e){return e!=="true"&&e!=="false"?e:e==="true"}}class _t{constructor(e,i,s){this.element=e,this.instance=i,this.index=s}setContent(e=null,i=!1){if(Ue(e,"loaded"))return!1;const s=this.instance.settings,t=this.slideConfig,n=ii();Te(s.beforeSlideLoad)&&s.beforeSlideLoad({index:this.index,slide:e,player:!1});let r=t.type,a=t.descPosition,l=e.querySelector(".gslide-media"),c=e.querySelector(".gslide-title"),d=e.querySelector(".gslide-desc"),o=e.querySelector(".gdesc-inner"),h=i,f="gSlideTitle_"+this.index,m="gSlideDesc_"+this.index;if(Te(s.afterSlideLoad)&&(h=()=>{Te(i)&&i(),s.afterSlideLoad({index:this.index,slide:e,player:this.instance.getSlidePlayerInstance(this.index)})}),t.title==""&&t.description==""?o&&o.parentNode.parentNode.removeChild(o.parentNode):(c&&t.title!==""?(c.id=f,c.innerHTML=t.title):c.parentNode.removeChild(c),d&&t.description!==""?(d.id=m,n&&s.moreLength>0?(t.smallDescription=this.slideShortDesc(t.description,s.moreLength,s.moreText),d.innerHTML=t.smallDescription,this.descriptionEvents(d,t)):d.innerHTML=t.description):d.parentNode.removeChild(d),ge(l.parentNode,`desc-${a}`),ge(o.parentNode,`description-${a}`)),ge(l,`gslide-${r}`),ge(e,"loaded"),r==="video"){Hs.apply(this.instance,[e,t,this.index,h]);return}if(r==="external"){Vs.apply(this,[e,t,this.index,h]);return}if(r==="inline"){zs.apply(this.instance,[e,t,this.index,h]),t.draggable&&new Di({dragEl:e.querySelector(".gslide-inline"),toleranceX:s.dragToleranceX,toleranceY:s.dragToleranceY,slide:e,instance:this.instance});return}if(r==="image"){$s(e,t,this.index,()=>{const w=e.querySelector("img");t.draggable&&new Di({dragEl:w,toleranceX:s.dragToleranceX,toleranceY:s.dragToleranceY,slide:e,instance:this.instance}),t.zoomable&&w.naturalWidth>w.offsetWidth&&(ge(w,"zoomable"),new Ps(w,e,()=>{this.instance.resize()})),Te(h)&&h()});return}Te(h)&&h()}slideShortDesc(e,i=50,s=!1){let t=document.createElement("div");t.innerHTML=e;let n=t.innerText,r=s;if(e=n.trim(),e.length<=i)return e;let a=e.substr(0,i-1);return r?(t=null,a+'... <a href="#" class="desc-more">'+s+"</a>"):a}descriptionEvents(e,i){let s=e.querySelector(".desc-more");if(!s)return!1;Ge("click",{onElement:s,withCallback:(t,n)=>{t.preventDefault();const r=document.body;let a=Qe(n,".gslide-desc");if(!a)return!1;a.innerHTML=i.description,ge(r,"gdesc-open");let l=Ge("click",{onElement:[r,Qe(a,".gslide-description")],withCallback:(c,d)=>{c.target.nodeName.toLowerCase()!=="a"&&($e(r,"gdesc-open"),ge(r,"gdesc-closed"),a.innerHTML=i.smallDescription,this.descriptionEvents(a,i),setTimeout(()=>{$e(r,"gdesc-closed")},400),l.destroy())}})}})}create(){return nt(this.instance.settings.slideHTML)}getConfig(){!tt(this.element)&&!this.element.hasOwnProperty("draggable")&&(this.element.draggable=this.instance.settings.draggable);const e=new Bs(this.instance.settings.slideExtraAttributes);return this.slideConfig=e.parseConfig(this.element,this.instance.settings),this.slideConfig}}const Us="3.2.0",$i=ii(),Hi=Ls();let ni;typeof document>"u"||(ni=document.getElementsByTagName("html")[0]);const ri={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>'}};ri.slideHTML=`<div class="gslide">
|
|
27
27
|
<div class="gslide-inner-content">
|
|
28
28
|
<div class="ginner-container">
|
|
29
29
|
<div class="gslide-media">
|
|
@@ -36,7 +36,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
|
-
</div>`,lightboxHTML
|
|
39
|
+
</div>`,ri.lightboxHTML=`<div id="glightbox-body" class="glightbox-container" tabindex="-1" role="dialog" aria-hidden="false">
|
|
40
40
|
<div class="gloader visible"></div>
|
|
41
41
|
<div class="goverlay"></div>
|
|
42
42
|
<div class="gcontainer">
|
|
@@ -45,55 +45,55 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
|
|
46
46
|
<button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
|
|
47
47
|
</div>
|
|
48
|
-
</div>`},Me=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.customOptions=p,this.settings=u(ne,p),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}),[{key:"init",value:function(){var l=this,p=this.getSelector();p&&(this.baseEvents=o("click",{onElement:p,withCallback:function(x,T){x.preventDefault(),l.open(T)}})),this.elements=this.getElements()}},{key:"open",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var x=N(p)?p:this.settings.startAt;if(G(l)){var T=l.getAttribute("data-gallery");T&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,T)),L(x)&&(x=this.getElementIndex(l))<0&&(x=0)}N(x)||(x=0),this.build(),R(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);var O=document.body,D=window.innerWidth-document.documentElement.clientWidth;if(D>0){var H=document.createElement("style");H.type="text/css",H.className="gcss-styles",H.innerText=".gscrollbar-fixer {margin-right: ".concat(D,"px}"),document.head.appendChild(H),h(O,"gscrollbar-fixer")}h(O,"glightbox-open"),h(he,"glightbox-open"),ye&&(h(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(x,!0),this.elements.length===1?(h(this.prevButton,"glightbox-button-hidden"),h(this.nextButton,"glightbox-button-hidden")):(f(this.prevButton,"glightbox-button-hidden"),f(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),I(this.settings.onOpen)&&this.settings.onOpen(),fe&&this.settings.touchNavigation&&Oe(this),this.settings.keyboardNavigation&&Q(this)}},{key:"openAt",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.open(null,l)}},{key:"showSlide",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];E(this.loader),this.index=parseInt(p);var T=this.slidesContainer.querySelector(".current");T&&f(T,"current"),this.slideAnimateOut();var O=this.slidesContainer.querySelectorAll(".gslide")[p];if(v(O,"loaded"))this.slideAnimateIn(O,x),b(this.loader);else{E(this.loader);var D=this.elements[p],H={index:this.index,slide:O,slideNode:O,slideConfig:D.slideConfig,slideIndex:this.index,trigger:D.node,player:null};this.trigger("slide_before_load",H),D.instance.setContent(O,(function(){b(l.loader),l.resize(),l.slideAnimateIn(O,x),l.trigger("slide_after_load",H)}))}this.slideDescription=O.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&v(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(p+1),this.preloadSlide(p-1)),this.updateNavigationClasses(),this.activeSlide=O}},{key:"preloadSlide",value:function(l){var p=this;if(l<0||l>this.elements.length-1||L(this.elements[l]))return!1;var x=this.slidesContainer.querySelectorAll(".gslide")[l];if(v(x,"loaded"))return!1;var T=this.elements[l],O=T.type,D={index:l,slide:x,slideNode:x,slideConfig:T.slideConfig,slideIndex:l,trigger:T.node,player:null};this.trigger("slide_before_load",D),O==="video"||O==="external"?setTimeout((function(){T.instance.setContent(x,(function(){p.trigger("slide_after_load",D)}))}),200):T.instance.setContent(x,(function(){p.trigger("slide_after_load",D)}))}},{key:"prevSlide",value:function(){this.goToSlide(this.index-1)}},{key:"nextSlide",value:function(){this.goToSlide(this.index+1)}},{key:"goToSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(l<0||l>this.elements.length-1))return!1;l<0?l=this.elements.length-1:l>=this.elements.length&&(l=0),this.showSlide(l)}},{key:"insertSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;p<0&&(p=this.elements.length);var x=new qe(l,this,p),T=x.getConfig(),O=u({},T),D=x.create(),H=this.elements.length-1;O.index=p,O.node=!1,O.instance=x,O.slideConfig=T,this.elements.splice(p,0,O);var $=null,A=null;if(this.slidesContainer){if(p>H)this.slidesContainer.appendChild(D);else{var j=this.slidesContainer.querySelectorAll(".gslide")[p];this.slidesContainer.insertBefore(D,j)}(this.settings.preload&&this.index==0&&p==0||this.index-1==p||this.index+1==p)&&this.preloadSlide(p),this.index===0&&p===0&&(this.index=1),this.updateNavigationClasses(),$=this.slidesContainer.querySelectorAll(".gslide")[p],A=this.getSlidePlayerInstance(p),O.slideNode=$}this.trigger("slide_inserted",{index:p,slide:$,slideNode:$,slideConfig:T,slideIndex:p,trigger:null,player:A}),I(this.settings.slideInserted)&&this.settings.slideInserted({index:p,slide:$,player:A})}},{key:"removeSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;if(l<0||l>this.elements.length-1)return!1;var p=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[l];p&&(this.getActiveSlideIndex()==l&&(l==this.elements.length-1?this.prevSlide():this.nextSlide()),p.parentNode.removeChild(p)),this.elements.splice(l,1),this.trigger("slide_removed",l),I(this.settings.slideRemoved)&&this.settings.slideRemoved(l)}},{key:"slideAnimateIn",value:function(l,p){var x=this,T=l.querySelector(".gslide-media"),O=l.querySelector(".gslide-description"),D={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},H={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(T.offsetWidth>0&&O&&(b(O),O.style.display=""),f(l,this.effectsClasses),p)R(l,this.settings.cssEfects[this.settings.openEffect].in,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:D,current:H}),I(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[D,H])}));else{var $=this.settings.slideEffect,A=$!=="none"?this.settings.cssEfects[$].in:$;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(A=this.settings.cssEfects.slideBack.in),R(l,A,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:D,current:H}),I(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[D,H])}))}setTimeout((function(){x.resize(l)}),100),h(l,"current")}},{key:"slideAnimateOut",value:function(){if(!this.prevActiveSlide)return!1;var l=this.prevActiveSlide;f(l,this.effectsClasses),h(l,"prev");var p=this.settings.slideEffect,x=p!=="none"?this.settings.cssEfects[p].out:p;this.slidePlayerPause(l),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),I(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(x=this.settings.cssEfects.slideBack.out),R(l,x,(function(){var T=l.querySelector(".ginner-container"),O=l.querySelector(".gslide-media"),D=l.querySelector(".gslide-description");T.style.transform="",O.style.transform="",f(O,"greset"),O.style.opacity="",D&&(D.style.opacity=""),f(l,"prev")}))}},{key:"getAllPlayers",value:function(){return this.videoPlayers}},{key:"getSlidePlayerInstance",value:function(l){var p="gvideo"+l,x=this.getAllPlayers();return!(!P(x,p)||!x[p])&&x[p]}},{key:"stopSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"slidePlayerPause",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"playSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");var x=this.getSlidePlayerInstance(l);x&&!x.playing&&x.play()}},{key:"slidePlayerPlay",value:function(l){var p;if(!ye||(p=this.settings.plyr.config)!==null&&p!==void 0&&p.muted){if(G(l)){var x=l.querySelector(".gvideo-wrapper");x&&(l=x.getAttribute("data-index"))}var T=this.getSlidePlayerInstance(l);T&&!T.playing&&(T.play(),this.settings.autofocusVideos&&T.elements.container.focus())}}},{key:"setElements",value:function(l){var p=this;this.settings.elements=!1;var x=[];l&&l.length&&c(l,(function(T,O){var D=new qe(T,p,O),H=D.getConfig(),$=u({},H);$.slideConfig=H,$.instance=D,$.index=O,x.push($)})),this.elements=x,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(c(this.elements,(function(){var T=k(p.settings.slideHTML);p.slidesContainer.appendChild(T)})),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(l){var p=!1;return c(this.elements,(function(x,T){if(P(x,"node")&&x.node==l)return p=T,!0})),p}},{key:"getElements",value:function(){var l=this,p=[];this.elements=this.elements?this.elements:[],!L(this.settings.elements)&&B(this.settings.elements)&&this.settings.elements.length&&c(this.settings.elements,(function(T,O){var D=new qe(T,l,O),H=D.getConfig(),$=u({},H);$.node=!1,$.index=O,$.instance=D,$.slideConfig=H,p.push($)}));var x=!1;return this.getSelector()&&(x=document.querySelectorAll(this.getSelector())),x&&c(x,(function(T,O){var D=new qe(T,l,O),H=D.getConfig(),$=u({},H);$.node=T,$.index=O,$.instance=D,$.slideConfig=H,$.gallery=T.getAttribute("data-gallery"),p.push($)})),p}},{key:"getGalleryElements",value:function(l,p){return l.filter((function(x){return x.gallery==p}))}},{key:"getSelector",value:function(){return!this.settings.elements&&(this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getActiveSlide",value:function(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}},{key:"getActiveSlideIndex",value:function(){return this.index}},{key:"getAnimationClasses",value:function(){var l=[];for(var p in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(p)){var x=this.settings.cssEfects[p];l.push("g".concat(x.in)),l.push("g".concat(x.out))}return l.join(" ")}},{key:"build",value:function(){var l=this;if(this.built)return!1;var p=document.body.childNodes,x=[];c(p,(function(j){j.parentNode==document.body&&j.nodeName.charAt(0)!=="#"&&j.hasAttribute&&!j.hasAttribute("aria-hidden")&&(x.push(j),j.setAttribute("aria-hidden","true"))}));var T=P(this.settings.svg,"next")?this.settings.svg.next:"",O=P(this.settings.svg,"prev")?this.settings.svg.prev:"",D=P(this.settings.svg,"close")?this.settings.svg.close:"",H=this.settings.lightboxHTML;H=k(H=(H=(H=H.replace(/{nextSVG}/g,T)).replace(/{prevSVG}/g,O)).replace(/{closeSVG}/g,D)),document.body.appendChild(H);var $=document.getElementById("glightbox-body");this.modal=$;var A=$.querySelector(".gclose");this.prevButton=$.querySelector(".gprev"),this.nextButton=$.querySelector(".gnext"),this.overlay=$.querySelector(".goverlay"),this.loader=$.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=x,this.events={},h(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&A&&(this.events.close=o("click",{onElement:A,withCallback:function(j,U){j.preventDefault(),l.close()}})),A&&!this.settings.closeButton&&A.parentNode.removeChild(A),this.nextButton&&(this.events.next=o("click",{onElement:this.nextButton,withCallback:function(j,U){j.preventDefault(),l.nextSlide()}})),this.prevButton&&(this.events.prev=o("click",{onElement:this.prevButton,withCallback:function(j,U){j.preventDefault(),l.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=o("click",{onElement:$,withCallback:function(j,U){l.preventOutsideClick||v(document.body,"glightbox-mobile")||S(j.target,".ginner-container")||S(j.target,".gbtn")||v(j.target,"gnext")||v(j.target,"gprev")||l.close()}})),c(this.elements,(function(j,U){l.slidesContainer.appendChild(j.instance.create()),j.slideNode=l.slidesContainer.querySelectorAll(".gslide")[U]})),fe&&h(document.body,"glightbox-touch"),this.events.resize=o("resize",{onElement:window,withCallback:function(){l.resize()}}),this.built=!0}},{key:"resize",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if((l=l||this.activeSlide)&&!v(l,"zoomed")){var p=C(),x=l.querySelector(".gvideo-wrapper"),T=l.querySelector(".gslide-image"),O=this.slideDescription,D=p.width,H=p.height;if(D<=768?h(document.body,"glightbox-mobile"):f(document.body,"glightbox-mobile"),x||T){var $=!1;if(O&&(v(O,"description-bottom")||v(O,"description-top"))&&!v(O,"gabsolute")&&($=!0),T){if(D<=768)T.querySelector("img");else if($){var A,j,U=O.offsetHeight,Y=T.querySelector("img"),Z=(A=this.elements[this.index])===null||A===void 0?void 0:A.node,ee="100vh";Z&&(ee=(j=Z.getAttribute("data-height"))!==null&&j!==void 0?j:ee),Y.setAttribute("style","max-height: calc(".concat(ee," - ").concat(U,"px)")),O.setAttribute("style","max-width: ".concat(Y.offsetWidth,"px;"))}}if(x){var te=P(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!te){var K=x.clientWidth,me=x.clientHeight,le=K/me;te="".concat(K/le,":").concat(me/le)}var Ce=te.split(":"),pe=this.settings.videosWidth,xe=this.settings.videosWidth,Le=(xe=N(pe)||pe.indexOf("px")!==-1?parseInt(pe):pe.indexOf("vw")!==-1?D*parseInt(pe)/100:pe.indexOf("vh")!==-1?H*parseInt(pe)/100:pe.indexOf("%")!==-1?D*parseInt(pe)/100:parseInt(x.clientWidth))/(parseInt(Ce[0])/parseInt(Ce[1]));if(Le=Math.floor(Le),$&&(H-=O.offsetHeight),xe>D||Le>H||H<Le&&D>xe){var $e=x.offsetWidth,Ne=x.offsetHeight,Pe=H/Ne,ke={width:$e*Pe,height:Ne*Pe};x.parentNode.setAttribute("style","max-width: ".concat(ke.width,"px")),$&&O.setAttribute("style","max-width: ".concat(ke.width,"px;"))}else x.parentNode.style.maxWidth="".concat(pe),$&&O.setAttribute("style","max-width: ".concat(pe,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updateNavigationClasses",value:function(){var l=this.loop();f(this.nextButton,"disabled"),f(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(h(this.prevButton,"disabled"),h(this.nextButton,"disabled")):this.index!==0||l?this.index!==this.elements.length-1||l||h(this.nextButton,"disabled"):h(this.prevButton,"disabled")}},{key:"loop",value:function(){var l=P(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return l=P(this.settings,"loop")?this.settings.loop:l,l}},{key:"close",value:function(){var l=this;if(!this.lightboxOpen){if(this.events){for(var p in this.events)this.events.hasOwnProperty(p)&&this.events[p].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&c(this.bodyHiddenChildElms,(function(x){x.removeAttribute("aria-hidden")})),h(this.modal,"glightbox-closing"),R(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),R(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,(function(){if(l.activeSlide=null,l.prevActiveSlideIndex=null,l.prevActiveSlide=null,l.built=!1,l.events){for(var x in l.events)l.events.hasOwnProperty(x)&&l.events[x].destroy();l.events=null}var T=document.body;f(he,"glightbox-open"),f(T,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),l.modal.parentNode.removeChild(l.modal),l.trigger("close"),I(l.settings.onClose)&&l.settings.onClose();var O=document.querySelector(".gcss-styles");O&&O.parentNode.removeChild(O),l.lightboxOpen=!1,l.closing=null}))}},{key:"destroy",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:"on",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||!I(p))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:l,once:x,callback:p})}},{key:"once",value:function(l,p){this.on(l,p,!0)}},{key:"trigger",value:function(l){var p=this,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,T=[];c(this.apiEvents,(function(O,D){var H=O.evt,$=O.once,A=O.callback;H==l&&(A(x),$&&T.push(D))})),T.length&&c(T,(function(O){return p.apiEvents.splice(O,1)}))}},{key:"clearAllEvents",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:"version",value:function(){return"3.3.1"}}]);return function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=new Me(l);return p.init(),p}}))})(pt)),pt.exports}var Ui=Vi();const si=dt(Ui);class Bi{constructor(e={}){this.animationTime=e.animationTime??800,this.frameRate=e.frameRate??150,this.stepSize=e.stepSize??120,this.accelerationDelta=e.accelerationDelta??300,this.accelerationMax=e.accelerationMax??2,this.pulseScale=e.pulseScale??4,this.pulseNormalize=1/this._pulseRaw(1),this.queue=[],this.pending=!1,this.lastScrollTime=0,this.direction={x:0,y:0},this._init()}_init(){window.addEventListener("wheel",this._onWheel.bind(this),{passive:!1})}destroy(){window.removeEventListener("wheel",this._onWheel.bind(this)),this.queue=[],this.pending=!1}_onWheel(e){if(e.ctrlKey||e.defaultPrevented)return;let i=e.deltaX,s=e.deltaY;!i&&!s&&(s=-e.wheelDelta||0),e.deltaMode===1&&(i*=40,s*=40),Math.abs(i)>1.2&&(i=i/120*this.stepSize),Math.abs(s)>1.2&&(s=s/120*this.stepSize);const t=e.target,n=this._findScrollableAncestor(t);if(!n)return;const r=Date.now(),a=r-this.lastScrollTime;let u=1;a<this.accelerationDelta&&(u=Math.min(1+50/a,this.accelerationMax),i*=u,s*=u),this.lastScrollTime=r;const c=Math.sign(i),d=Math.sign(s);(c!==this.direction.x||d!==this.direction.y)&&(this.direction={x:c,y:d},this.queue=[]),this._enqueueScroll(n,i,s),e.preventDefault()}_findScrollableAncestor(e){const i=document.scrollingElement||document.documentElement;let s=e;for(;s&&s!==document.body;){const n=window.getComputedStyle(s).overflowY,r=["auto","scroll"].includes(n),a=s.scrollHeight>s.clientHeight;if(r&&a)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(e,i,s){this.queue.push({element:e,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(e),this.pending=!0)}_animate(e){const i=Date.now();let s=0,t=0;for(let n=this.queue.length-1;n>=0;n--){const r=this.queue[n],a=i-r.start,u=a>=this.animationTime,c=u?1:a/this.animationTime,d=this._pulse(c),o=r.x*d-r.lastX|0,h=r.y*d-r.lastY|0;s+=o,t+=h,r.lastX+=o,r.lastY+=h,u&&this.queue.splice(n,1)}e===document.scrollingElement||e===document.documentElement?window.scrollBy(s,t):(s&&(e.scrollLeft+=s),t&&(e.scrollTop+=t)),this.queue.length>0?(1e3/this.frameRate,requestAnimationFrame(()=>this._animate(e))):this.pending=!1}_pulseRaw(e){if(e*=this.pulseScale,e<1)return e-(1-Math.exp(-e));{const i=Math.exp(-1),s=1-Math.exp(-(e-1));return i+s*(1-i)}}_pulse(e){return e<=0?0:e>=1?1:this._pulseRaw(e)*this.pulseNormalize}}/*!
|
|
48
|
+
</div>`;class zi{constructor(e={}){this.customOptions=e,this.settings=et(ri,e),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}init(){const e=this.getSelector();e&&(this.baseEvents=Ge("click",{onElement:e,withCallback:(i,s)=>{i.preventDefault(),this.open(s)}})),this.elements=this.getElements()}open(e=null,i=null){if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;let s=xt(i)?i:this.settings.startAt;if(tt(e)){const a=e.getAttribute("data-gallery");a&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,a)),We(s)&&(s=this.getElementIndex(e),s<0&&(s=0))}xt(s)||(s=0),this.build(),ct(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);const t=document.body,n=window.innerWidth-document.documentElement.clientWidth;if(n>0){var r=document.createElement("style");r.type="text/css",r.className="gcss-styles",r.innerText=`.gscrollbar-fixer {margin-right: ${n}px}`,document.head.appendChild(r),ge(t,"gscrollbar-fixer")}ge(t,"glightbox-open"),ge(ni,"glightbox-open"),$i&&(ge(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(ge(this.prevButton,"glightbox-button-hidden"),ge(this.nextButton,"glightbox-button-hidden")):($e(this.prevButton,"glightbox-button-hidden"),$e(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),Te(this.settings.onOpen)&&this.settings.onOpen(),Hi&&this.settings.touchNavigation&&Ds(this),this.settings.keyboardNavigation&&As(this)}openAt(e=0){this.open(null,e)}showSlide(e=0,i=!1){Ai(this.loader),this.index=parseInt(e);let s=this.slidesContainer.querySelector(".current");s&&$e(s,"current"),this.slideAnimateOut();let t=this.slidesContainer.querySelectorAll(".gslide")[e];if(Ue(t,"loaded"))this.slideAnimateIn(t,i),ei(this.loader);else{Ai(this.loader);const n=this.elements[e],r={index:this.index,slide:t,slideNode:t,slideConfig:n.slideConfig,slideIndex:this.index,trigger:n.node,player:null};this.trigger("slide_before_load",r),n.instance.setContent(t,()=>{ei(this.loader),this.resize(),this.slideAnimateIn(t,i),this.trigger("slide_after_load",r)})}this.slideDescription=t.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&Ue(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(e+1),this.preloadSlide(e-1)),this.updateNavigationClasses(),this.activeSlide=t}preloadSlide(e){if(e<0||e>this.elements.length-1||We(this.elements[e]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[e];if(Ue(i,"loaded"))return!1;const s=this.elements[e],t=s.type,n={index:e,slide:i,slideNode:i,slideConfig:s.slideConfig,slideIndex:e,trigger:s.node,player:null};this.trigger("slide_before_load",n),t==="video"||t==="external"?setTimeout(()=>{s.instance.setContent(i,()=>{this.trigger("slide_after_load",n)})},200):s.instance.setContent(i,()=>{this.trigger("slide_after_load",n)})}prevSlide(){this.goToSlide(this.index-1)}nextSlide(){this.goToSlide(this.index+1)}goToSlide(e=!1){if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(e<0||e>this.elements.length-1))return!1;e<0?e=this.elements.length-1:e>=this.elements.length&&(e=0),this.showSlide(e)}insertSlide(e={},i=-1){i<0&&(i=this.elements.length);const s=new _t(e,this,i),t=s.getConfig(),n=et({},t),r=s.create(),a=this.elements.length-1;n.index=i,n.node=!1,n.instance=s,n.slideConfig=t,this.elements.splice(i,0,n);let l=null,c=null;if(this.slidesContainer){if(i>a)this.slidesContainer.appendChild(r);else{let d=this.slidesContainer.querySelectorAll(".gslide")[i];this.slidesContainer.insertBefore(r,d)}(this.settings.preload&&this.index==0&&i==0||this.index-1==i||this.index+1==i)&&this.preloadSlide(i),this.index===0&&i===0&&(this.index=1),this.updateNavigationClasses(),l=this.slidesContainer.querySelectorAll(".gslide")[i],c=this.getSlidePlayerInstance(i),n.slideNode=l}this.trigger("slide_inserted",{index:i,slide:l,slideNode:l,slideConfig:t,slideIndex:i,trigger:null,player:c}),Te(this.settings.slideInserted)&&this.settings.slideInserted({index:i,slide:l,player:c})}removeSlide(e=-1){if(e<0||e>this.elements.length-1)return!1;const i=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[e];i&&(this.getActiveSlideIndex()==e&&(e==this.elements.length-1?this.prevSlide():this.nextSlide()),i.parentNode.removeChild(i)),this.elements.splice(e,1),this.trigger("slide_removed",e),Te(this.settings.slideRemoved)&&this.settings.slideRemoved(e)}slideAnimateIn(e,i){let s=e.querySelector(".gslide-media"),t=e.querySelector(".gslide-description"),n={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:We(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:We(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},r={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(s.offsetWidth>0&&t&&(ei(t),t.style.display=""),$e(e,this.effectsClasses),i)ct(e,this.settings.cssEfects[this.settings.openEffect].in,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(e),this.trigger("slide_changed",{prev:n,current:r}),Te(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[n,r])});else{let a=this.settings.slideEffect,l=a!=="none"?this.settings.cssEfects[a].in:a;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(l=this.settings.cssEfects.slideBack.in),ct(e,l,()=>{this.settings.autoplayVideos&&this.slidePlayerPlay(e),this.trigger("slide_changed",{prev:n,current:r}),Te(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[n,r])})}setTimeout(()=>{this.resize(e)},100),ge(e,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let e=this.prevActiveSlide;$e(e,this.effectsClasses),ge(e,"prev");let i=this.settings.slideEffect,s=i!=="none"?this.settings.cssEfects[i].out:i;this.slidePlayerPause(e),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:We(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:We(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),Te(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(s=this.settings.cssEfects.slideBack.out),ct(e,s,()=>{let t=e.querySelector(".ginner-container"),n=e.querySelector(".gslide-media"),r=e.querySelector(".gslide-description");t.style.transform="",n.style.transform="",$e(n,"greset"),n.style.opacity="",r&&(r.style.opacity=""),$e(e,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(e){const i="gvideo"+e,s=this.getAllPlayers();return He(s,i)&&s[i]?s[i]:!1}stopSlideVideo(e){if(tt(e)){let s=e.querySelector(".gvideo-wrapper");s&&(e=s.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");const i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}slidePlayerPause(e){if(tt(e)){let s=e.querySelector(".gvideo-wrapper");s&&(e=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}playSlideVideo(e){if(tt(e)){let s=e.querySelector(".gvideo-wrapper");s&&(e=s.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");const i=this.getSlidePlayerInstance(e);i&&!i.playing&&i.play()}slidePlayerPlay(e){if($i&&!this.settings.plyr.config?.muted)return;if(tt(e)){let s=e.querySelector(".gvideo-wrapper");s&&(e=s.getAttribute("data-index"))}const i=this.getSlidePlayerInstance(e);i&&!i.playing&&(i.play(),this.settings.autofocusVideos&&i.elements.container.focus())}setElements(e){this.settings.elements=!1;const i=[];e&&e.length&&Ne(e,(s,t)=>{const n=new _t(s,this,t),r=n.getConfig(),a=et({},r);a.slideConfig=r,a.instance=n,a.index=t,i.push(a)}),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(Ne(this.elements,()=>{let s=nt(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(e){let i=!1;return Ne(this.elements,(s,t)=>{if(He(s,"node")&&s.node==e)return i=t,!0}),i}getElements(){let e=[];this.elements=this.elements?this.elements:[],!We(this.settings.elements)&&Mi(this.settings.elements)&&this.settings.elements.length&&Ne(this.settings.elements,(t,n)=>{const r=new _t(t,this,n),a=r.getConfig(),l=et({},a);l.node=!1,l.index=n,l.instance=r,l.slideConfig=a,e.push(l)});let i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i&&Ne(i,(t,n)=>{const r=new _t(t,this,n),a=r.getConfig(),l=et({},a);l.node=t,l.index=n,l.instance=r,l.slideConfig=a,l.gallery=t.getAttribute("data-gallery"),e.push(l)}),e}getGalleryElements(e,i){return e.filter(s=>s.gallery==i)}getSelector(){return this.settings.elements?!1:this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?`*[${this.settings.selector}]`:this.settings.selector}getActiveSlide(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}getActiveSlideIndex(){return this.index}getAnimationClasses(){let e=[];for(let i in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(i)){let s=this.settings.cssEfects[i];e.push(`g${s.in}`),e.push(`g${s.out}`)}return e.join(" ")}build(){if(this.built)return!1;const e=document.body.childNodes,i=[];Ne(e,c=>{c.parentNode==document.body&&c.nodeName.charAt(0)!=="#"&&c.hasAttribute&&!c.hasAttribute("aria-hidden")&&(i.push(c),c.setAttribute("aria-hidden","true"))});const s=He(this.settings.svg,"next")?this.settings.svg.next:"",t=He(this.settings.svg,"prev")?this.settings.svg.prev:"",n=He(this.settings.svg,"close")?this.settings.svg.close:"";let r=this.settings.lightboxHTML;r=r.replace(/{nextSVG}/g,s),r=r.replace(/{prevSVG}/g,t),r=r.replace(/{closeSVG}/g,n),r=nt(r),document.body.appendChild(r);const a=document.getElementById("glightbox-body");this.modal=a;let l=a.querySelector(".gclose");this.prevButton=a.querySelector(".gprev"),this.nextButton=a.querySelector(".gnext"),this.overlay=a.querySelector(".goverlay"),this.loader=a.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},ge(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&l&&(this.events.close=Ge("click",{onElement:l,withCallback:(c,d)=>{c.preventDefault(),this.close()}})),l&&!this.settings.closeButton&&l.parentNode.removeChild(l),this.nextButton&&(this.events.next=Ge("click",{onElement:this.nextButton,withCallback:(c,d)=>{c.preventDefault(),this.nextSlide()}})),this.prevButton&&(this.events.prev=Ge("click",{onElement:this.prevButton,withCallback:(c,d)=>{c.preventDefault(),this.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Ge("click",{onElement:a,withCallback:(c,d)=>{!this.preventOutsideClick&&!Ue(document.body,"glightbox-mobile")&&!Qe(c.target,".ginner-container")&&!Qe(c.target,".gbtn")&&!Ue(c.target,"gnext")&&!Ue(c.target,"gprev")&&this.close()}})),Ne(this.elements,(c,d)=>{this.slidesContainer.appendChild(c.instance.create()),c.slideNode=this.slidesContainer.querySelectorAll(".gslide")[d]}),Hi&&ge(document.body,"glightbox-touch"),this.events.resize=Ge("resize",{onElement:window,withCallback:()=>{this.resize()}}),this.built=!0}resize(e=null){if(e=e||this.activeSlide,!e||Ue(e,"zoomed"))return;const i=Ri(),s=e.querySelector(".gvideo-wrapper"),t=e.querySelector(".gslide-image"),n=this.slideDescription;let r=i.width,a=i.height;if(r<=768?ge(document.body,"glightbox-mobile"):$e(document.body,"glightbox-mobile"),!s&&!t)return;let l=!1;if(n&&(Ue(n,"description-bottom")||Ue(n,"description-top"))&&!Ue(n,"gabsolute")&&(l=!0),t){if(r<=768)t.querySelector("img");else if(l){let c=n.offsetHeight,d=t.querySelector("img");const h=this.elements[this.index].node.getAttribute("data-height")??"100vh";d.setAttribute("style",`max-height: calc(${h} - ${c}px)`),n.setAttribute("style",`max-width: ${d.offsetWidth}px;`)}}if(s){let c=He(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!c){const m=s.clientWidth,w=s.clientHeight,E=m/w;c=`${m/E}:${w/E}`}let d=c.split(":"),o=this.settings.videosWidth,h=this.settings.videosWidth;xt(o)||o.indexOf("px")!==-1?h=parseInt(o):o.indexOf("vw")!==-1?h=r*parseInt(o)/100:o.indexOf("vh")!==-1?h=a*parseInt(o)/100:o.indexOf("%")!==-1?h=r*parseInt(o)/100:h=parseInt(s.clientWidth);let f=h/(parseInt(d[0])/parseInt(d[1]));if(f=Math.floor(f),l&&(a=a-n.offsetHeight),h>r||f>a||a<f&&r>h){let m=s.offsetWidth,w=s.offsetHeight,E=a/w,b={width:m*E};s.parentNode.setAttribute("style",`max-width: ${b.width}px`),l&&n.setAttribute("style",`max-width: ${b.width}px;`)}else s.parentNode.style.maxWidth=`${o}`,l&&n.setAttribute("style",`max-width: ${o};`)}}reload(){this.init()}updateNavigationClasses(){const e=this.loop();$e(this.nextButton,"disabled"),$e(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(ge(this.prevButton,"disabled"),ge(this.nextButton,"disabled")):this.index===0&&!e?ge(this.prevButton,"disabled"):this.index===this.elements.length-1&&!e&&ge(this.nextButton,"disabled")}loop(){let e=He(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return e=He(this.settings,"loop")?this.settings.loop:e,e}close(){if(!this.lightboxOpen){if(this.events){for(let e in this.events)this.events.hasOwnProperty(e)&&this.events[e].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&Ne(this.bodyHiddenChildElms,e=>{e.removeAttribute("aria-hidden")}),ge(this.modal,"glightbox-closing"),ct(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),ct(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,()=>{if(this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null,this.built=!1,this.events){for(let s in this.events)this.events.hasOwnProperty(s)&&this.events[s].destroy();this.events=null}const e=document.body;$e(ni,"glightbox-open"),$e(e,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),Te(this.settings.onClose)&&this.settings.onClose();const i=document.querySelector(".gcss-styles");i&&i.parentNode.removeChild(i),this.lightboxOpen=!1,this.closing=null})}destroy(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}on(e,i,s=!1){if(!e||!Te(i))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:e,once:s,callback:i})}once(e,i){this.on(e,i,!0)}trigger(e,i=null){const s=[];Ne(this.apiEvents,(t,n)=>{const{evt:r,once:a,callback:l}=t;r==e&&(l(i),a&&s.push(n))}),s.length&&Ne(s,t=>this.apiEvents.splice(t,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return Us}}var ai={exports:{}},Vi;function Fs(){return Vi||(Vi=1,(function(u,e){(function(){var i={frameRate:150,animationTime:400,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},s=i,t=!1,n={x:0,y:0},r=!1,a=document.documentElement,l,c,d,o=[],h,f=/^Mac/.test(navigator.platform);function m(){s.keyboardSupport&&U("keydown",p)}function w(){if(!(r||!document.body)){r=!0;var C=document.body,H=document.documentElement,W=window.innerHeight,ce=C.scrollHeight;if(a=document.compatMode.indexOf("CSS")>=0?H:C,l=C,m(),top!=self)t=!0;else if(ne&&ce>W&&(C.offsetHeight<=W||H.offsetHeight<=W)){var fe=document.createElement("div");fe.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+a.scrollHeight+"px",document.body.appendChild(fe);var R;d=function(){R||(R=setTimeout(function(){fe.style.height="0",fe.style.height=a.scrollHeight+"px",R=null},500))},setTimeout(d,10),U("resize",d);var P={attributes:!0,childList:!0,characterData:!1};if(c=new Re(d),c.observe(C,P),a.offsetHeight<=W){var B=document.createElement("div");B.style.clear="both",C.appendChild(B)}}s.fixedBackground||(C.style.backgroundAttachment="scroll",H.style.backgroundAttachment="scroll")}}function E(){c&&c.disconnect(),Y(Me,_),Y("mousedown",y),Y("keydown",p),Y("resize",d),Y("load",w)}var b=[],k=!1,g=Date.now();function v(C,H,W){if(K(H,W),s.accelerationMax!=1){var ce=Date.now(),fe=ce-g;if(fe<s.accelerationDelta){var R=(1+50/fe)/2;R>1&&(R=Math.min(R,s.accelerationMax),H*=R,W*=R)}g=Date.now()}if(b.push({x:H,y:W,lastX:H<0?.99:-.99,lastY:W<0?.99:-.99,start:Date.now()}),!k){var P=Se(),B=C===P||C===document.body;C.$scrollBehavior==null&&V(C)&&(C.$scrollBehavior=C.style.scrollBehavior,C.style.scrollBehavior="auto");var F=function(Z){for(var _e=Date.now(),pe=0,Q=0,ye=0;ye<b.length;ye++){var oe=b[ye],Ie=_e-oe.start,Ee=Ie>=s.animationTime,Ce=Ee?1:Ie/s.animationTime;s.pulseAlgorithm&&(Ce=z(Ce));var je=oe.x*Ce-oe.lastX>>0,Ve=oe.y*Ce-oe.lastY>>0;pe+=je,Q+=Ve,oe.lastX+=je,oe.lastY+=Ve,Ee&&(b.splice(ye,1),ye--)}B?window.scrollBy(pe,Q):(pe&&(C.scrollLeft+=pe),Q&&(C.scrollTop+=Q)),!H&&!W&&(b=[]),b.length?ke(F,C,1e3/s.frameRate+1):(k=!1,C.$scrollBehavior!=null&&(C.style.scrollBehavior=C.$scrollBehavior,C.$scrollBehavior=null))};ke(F,C,0),k=!0}}function _(C){r||w();var H=T(C);if(C.defaultPrevented||C.ctrlKey||G(l,"embed")||G(H,"embed")&&/\.pdf/i.test(H.src)||G(l,"object"))return!0;var W=-C.wheelDeltaX||C.deltaX||0,ce=-C.wheelDeltaY||C.deltaY||0;f&&(C.wheelDeltaX&&ee(C.wheelDeltaX,120)&&(W=-120*(C.wheelDeltaX/Math.abs(C.wheelDeltaX))),C.wheelDeltaY&&ee(C.wheelDeltaY,120)&&(ce=-120*(C.wheelDeltaY/Math.abs(C.wheelDeltaY)))),!W&&!ce&&(ce=-C.wheelDelta||0),C.deltaMode===1&&(W*=40,ce*=40);var fe=S(H);if(!fe)return t&&de?(Object.defineProperty(C,"target",{value:window.frameElement}),parent.wheel(C)):!0;if(ie(ce))return!0;Math.abs(W)>1.2&&(W*=s.stepSize/120),Math.abs(ce)>1.2&&(ce*=s.stepSize/120),v(fe,W,ce),C.preventDefault(),j()}function p(C){var H=T(C),W=C.ctrlKey||C.altKey||C.metaKey||C.shiftKey&&C.code!=="Space";document.body.contains(l)||(l=document.activeElement);var ce=/^(textarea|select|embed|object)$/i,fe=/^(button|submit|radio|checkbox|file|color|image)$/i;if(C.defaultPrevented||ce.test(H.nodeName)||G(H,"input")&&!fe.test(H.type)||G(l,"video")||Ae(C)||H.isContentEditable||W||(G(H,"button")||G(H,"input")&&fe.test(H.type))&&C.code==="Space"||G(H,"input")&&H.type=="radio"&&(C.code==="ArrowUp"||C.code==="ArrowDown"||C.code==="ArrowLeft"||C.code==="ArrowRight"))return!0;var R,P=0,B=0,F=S(l);if(!F)return t&&de?parent.keydown(C):!0;var Z=F.clientHeight;switch(F==document.body&&(Z=window.innerHeight),C.code){case"ArrowUp":B=-s.arrowScroll;break;case"ArrowDown":B=s.arrowScroll;break;case"Space":R=C.shiftKey?1:-1,B=-R*Z*.9;break;case"PageUp":B=-Z*.9;break;case"PageDown":B=Z*.9;break;case"Home":F==document.body&&document.scrollingElement&&(F=document.scrollingElement),B=-F.scrollTop;break;case"End":var _e=F.scrollHeight-F.scrollTop,pe=_e-Z;B=pe>0?pe+10:0;break;case"ArrowLeft":P=-s.arrowScroll;break;case"ArrowRight":P=s.arrowScroll;break;default:return!0}v(F,P,B),C.preventDefault(),j()}function y(C){l=T(C)}function T(C){return C.composedPath?C.composedPath()[0]:C.target}var M=(function(){var C=0;return function(H){return H.uniqueID||(H.uniqueID=C++)}})(),q={},D,$={};function j(){clearTimeout(D),D=setInterval(function(){q=$={}},1e3)}function O(C,H,W){for(var ce=q,fe=C.length;fe--;)ce[M(C[fe])]=H;return H}function x(C,H){return q[M(C)]}function S(C){for(var H=[],W=document.body,ce=a.scrollHeight;C;){var fe=x(C);if(fe)return O(H,fe);if(H.push(C),ce===C.scrollHeight){var R=N(a)&&N(W),P=R||L(a);if(t&&A(a)||!t&&P)return O(H,Se())}else if(A(C)&&L(C))return O(H,C);C=C.parentElement||C.getRootNode&&C.getRootNode().host}}function A(C){return C.clientHeight+10<C.scrollHeight}function N(C){var H=getComputedStyle(C,"").getPropertyValue("overflow-y");return H!=="hidden"}function L(C){var H=getComputedStyle(C,"").getPropertyValue("overflow-y");return H==="scroll"||H==="auto"}function V(C){var H=M(C);if($[H]==null){var W=getComputedStyle(C,"")["scroll-behavior"];$[H]=W=="smooth"}return $[H]}function U(C,H,W){window.addEventListener(C,H,W||!1)}function Y(C,H,W){window.removeEventListener(C,H,!1)}function G(C,H){return C&&(C.nodeName||"").toLowerCase()===H.toLowerCase()}function K(C,H){C=C>0?1:-1,H=H>0?1:-1,(n.x!==C||n.y!==H)&&(n.x=C,n.y=H,b=[],g=0)}try{localStorage.SS_deltaBuffer&&(o=localStorage.SS_deltaBuffer.split(","))}catch{}function ie(C){if(C){o.length||(o=[C,C,C]),C=Math.abs(C),o.push(C),o.shift(),clearTimeout(h),h=setTimeout(function(){try{localStorage.SS_deltaBuffer=o.join(",")}catch{}},1e3);var H=C>120&&be(C),W=!be(120)&&!be(100)&&!H;return C<50?!0:W}}function ee(C,H){return Math.floor(C/H)==C/H}function be(C){return ee(o[0],C)&&ee(o[1],C)&&ee(o[2],C)}function Ae(C){var H=T(C),W=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(W=H.classList&&H.classList.contains("html5-video-controls"),W)break;while(H=H.parentNode);return W}var ke=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(C,H,W){window.setTimeout(C,W||1e3/60)}})(),Re=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,Se=(function(){var C=document.scrollingElement;return function(){if(!C){var H=document.createElement("div");H.style.cssText="height:10000px;width:1px;",document.body.appendChild(H);var W=document.body.scrollTop;document.documentElement.scrollTop,window.scrollBy(0,3),document.body.scrollTop!=W?C=document.body:C=document.documentElement,window.scrollBy(0,-3),document.body.removeChild(H)}return C}})();function ue(C){var H,W,ce;return C=C*s.pulseScale,C<1?H=C-(1-Math.exp(-C)):(W=Math.exp(-1),C-=1,ce=1-Math.exp(-C),H=W+ce*(1-W)),H*s.pulseNormalize}function z(C){return C>=1?1:C<=0?0:(s.pulseNormalize==1&&(s.pulseNormalize/=ue(1)),ue(C))}var X=window.navigator.userAgent,ae=/Edge/.test(X),de=/chrome/i.test(X)&&!ae,we=/safari/i.test(X)&&!ae,he=/mobile/i.test(X),le=/Windows NT 6.1/i.test(X)&&/rv:11/i.test(X),ne=we&&(/Version\/8/i.test(X)||/Version\/9/i.test(X)),J=(de||we||le)&&!he,Oe=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){Oe=!0}}))}catch{}var xe=Oe?{passive:!1}:!1,Me="onwheel"in document.createElement("div")?"wheel":"mousewheel";J&&(U(Me,_,xe),U("mousedown",y),U("load",w));function re(C){for(var H in C)i.hasOwnProperty(H)&&(s[H]=C[H])}re.destroy=E,window.SmoothScrollOptions&&re(window.SmoothScrollOptions),u.exports=re})()})(ai)),ai.exports}var Ys=Fs();const Ws=yt(Ys);/*!
|
|
49
49
|
* Glide.js v3.7.1
|
|
50
50
|
* (c) 2013-2024 Jędrzej Chałubek (https://github.com/jedrzejchalubek/)
|
|
51
51
|
* Released under the MIT License.
|
|
52
|
-
*/function ni(m,e){var i=Object.keys(m);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(m);e&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(m,t).enumerable})),i.push.apply(i,s)}return i}function ri(m){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?ni(Object(i),!0).forEach(function(s){Fi(m,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(i)):ni(Object(i)).forEach(function(s){Object.defineProperty(m,s,Object.getOwnPropertyDescriptor(i,s))})}return m}function ft(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ft=function(e){return typeof e}:ft=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(m)}function gt(m,e){if(!(m instanceof e))throw new TypeError("Cannot call a class as a function")}function Yi(m,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(m,s.key,s)}}function mt(m,e,i){return e&&Yi(m.prototype,e),m}function Fi(m,e,i){return e in m?Object.defineProperty(m,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):m[e]=i,m}function Wi(m,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(e&&e.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),e&&It(m,e)}function tt(m){return tt=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},tt(m)}function It(m,e){return It=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},It(m,e)}function Gi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xi(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function Ji(m,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xi(m)}function Zi(m){var e=Gi();return function(){var s=tt(m),t;if(e){var n=tt(this).constructor;t=Reflect.construct(s,arguments,n)}else t=s.apply(this,arguments);return Ji(this,t)}}function Qi(m,e){for(;!Object.prototype.hasOwnProperty.call(m,e)&&(m=tt(m),m!==null););return m}function bt(){return typeof Reflect<"u"&&Reflect.get?bt=Reflect.get:bt=function(e,i,s){var t=Qi(e,i);if(t){var n=Object.getOwnPropertyDescriptor(t,i);return n.get?n.get.call(arguments.length<3?e:s):n.value}},bt.apply(this,arguments)}var Ki={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function We(m){console.error("[Glide warn]: ".concat(m))}function ze(m){return parseInt(m)}function es(m){return parseFloat(m)}function Nt(m){return typeof m=="string"}function it(m){var e=ft(m);return e==="function"||e==="object"&&!!m}function vt(m){return typeof m=="function"}function ai(m){return typeof m>"u"}function Pt(m){return m.constructor===Array}function ts(m,e,i){var s={};for(var t in e)vt(e[t])?s[t]=e[t](m,s,i):We("Extension must be a function");for(var n in s)vt(s[n].mount)&&s[n].mount();return s}function je(m,e,i){Object.defineProperty(m,e,i)}function is(m){return Object.keys(m).sort().reduce(function(e,i){return e[i]=m[i],e[i],e},{})}function Dt(m,e){var i=Object.assign({},m,e);if(e.hasOwnProperty("classes")){i.classes=Object.assign({},m.classes,e.classes);var s=["direction","type","slide","arrow","nav"];s.forEach(function(t){e.classes.hasOwnProperty(t)&&(i.classes[t]=ri(ri({},m.classes[t]),e.classes[t]))})}return e.hasOwnProperty("breakpoints")&&(i.breakpoints=Object.assign({},m.breakpoints,e.breakpoints)),i}var ss=(function(){function m(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,m),this.events=e,this.hop=e.hasOwnProperty}return mt(m,[{key:"on",value:function(i,s){if(Pt(i)){for(var t=0;t<i.length;t++)this.on(i[t],s);return}this.hop.call(this.events,i)||(this.events[i]=[]);var n=this.events[i].push(s)-1;return{remove:function(){delete this.events[i][n]}}}},{key:"emit",value:function(i,s){if(Pt(i)){for(var t=0;t<i.length;t++)this.emit(i[t],s);return}this.hop.call(this.events,i)&&this.events[i].forEach(function(n){n(s||{})})}}]),m})(),ns=(function(){function m(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gt(this,m),this._c={},this._t=[],this._e=new ss,this.disabled=!1,this.selector=e,this.settings=Dt(Ki,i),this.index=this.settings.startAt}return mt(m,[{key:"mount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),it(i)?this._c=ts(this,i,this._e):We("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Pt(i)?this._t=i:We("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=Dt(this.settings,i),i.hasOwnProperty("startAt")&&(this.index=i.startAt),this._e.emit("update"),this}},{key:"go",value:function(i){return this._c.Run.make(i),this}},{key:"move",value:function(i){return this._c.Transition.disable(),this._c.Move.make(i),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i&&(this.settings.autoplay=i),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(i,s){return this._e.on(i,s),this}},{key:"isType",value:function(i){return this.settings.type===i}},{key:"settings",get:function(){return this._o},set:function(i){it(i)?this._o=i:We("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(i){this._i=ze(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(i){this._d=!!i}}]),m})();function rs(m,e,i){var s={mount:function(){this._o=!1},make:function(c){var d=this;m.disabled||(!m.settings.waitForTransition||m.disable(),this.move=c,i.emit("run.before",this.move),this.calculate(),i.emit("run",this.move),e.Transition.after(function(){d.isStart()&&i.emit("run.start",d.move),d.isEnd()&&i.emit("run.end",d.move),d.isOffset()&&(d._o=!1,i.emit("run.offset",d.move)),i.emit("run.after",d.move),m.enable()}))},calculate:function(){var c=this.move,d=this.length,o=c.steps,h=c.direction,f=1;if(h==="="){if(m.settings.bound&&ze(o)>d){m.index=d;return}m.index=o;return}if(h===">"&&o===">"){m.index=d;return}if(h==="<"&&o==="<"){m.index=0;return}if(h==="|"&&(f=m.settings.perView||1),h===">"||h==="|"&&o===">"){var v=t(f);v>d&&(this._o=!0),m.index=n(v,f);return}if(h==="<"||h==="|"&&o==="<"){var S=r(f);S<0&&(this._o=!0),m.index=a(S,f);return}We("Invalid direction pattern [".concat(h).concat(o,"] has been used"))},isStart:function(){return m.index<=0},isEnd:function(){return m.index>=this.length},isOffset:function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return c?this._o?c==="|>"?this.move.direction==="|"&&this.move.steps===">":c==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===c:!1:this._o},isBound:function(){return m.isType("slider")&&m.settings.focusAt!=="center"&&m.settings.bound}};function t(u){var c=m.index;return m.isType("carousel")?c+u:c+(u-c%u)}function n(u,c){var d=s.length;return u<=d?u:m.isType("carousel")?u-(d+1):m.settings.rewind?s.isBound()&&!s.isEnd()?d:0:s.isBound()?d:Math.floor(d/c)*c}function r(u){var c=m.index;if(m.isType("carousel"))return c-u;var d=Math.ceil(c/u);return(d-1)*u}function a(u,c){var d=s.length;return u>=0?u:m.isType("carousel")?u+(d+1):m.settings.rewind?s.isBound()&&s.isStart()?d:Math.floor(d/c)*c:0}return je(s,"move",{get:function(){return this._m},set:function(c){var d=c.substr(1);this._m={direction:c.substr(0,1),steps:d?ze(d)?ze(d):d:0}}}),je(s,"length",{get:function(){var c=m.settings,d=e.Html.slides.length;return this.isBound()?d-1-(ze(c.perView)-1)+ze(c.focusAt):d-1}}),je(s,"offset",{get:function(){return this._o}}),s}function oi(){return new Date().getTime()}function yt(m,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,t,n,r,a=0,u=function(){a=i.leading===!1?0:oi(),s=null,r=m.apply(t,n),s||(t=n=null)},c=function(){var o=oi();!a&&i.leading===!1&&(a=o);var h=e-(o-a);return t=this,n=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=o,r=m.apply(t,n),s||(t=n=null)):!s&&i.trailing!==!1&&(s=setTimeout(u,h)),r};return c.cancel=function(){clearTimeout(s),a=0,s=t=n=null},c}var wt={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function as(m,e,i){var s={apply:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style,c=e.Direction.value;r!==0?u[wt[c][0]]="".concat(this.value/2,"px"):u[wt[c][0]]="",r!==n.length-1?u[wt[c][1]]="".concat(this.value/2,"px"):u[wt[c][1]]=""}},remove:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style;u.marginLeft="",u.marginRight=""}}};return je(s,"value",{get:function(){return ze(m.settings.gap)}}),je(s,"grow",{get:function(){return s.value*e.Sizes.length}}),je(s,"reductor",{get:function(){var n=m.settings.perView;return s.value*(n-1)/n}}),i.on(["build.after","update"],yt(function(){s.apply(e.Html.wrapper.children)},30)),i.on("destroy",function(){s.remove(e.Html.wrapper.children)}),s}function li(m){if(m&&m.parentNode){for(var e=m.parentNode.firstChild,i=[];e;e=e.nextSibling)e.nodeType===1&&e!==m&&i.push(e);return i}return[]}function Ht(m){return Array.prototype.slice.call(m)}var os='[data-glide-el="track"]';function ls(m,e,i){var s={mount:function(){this.root=m.selector,this.track=this.root.querySelector(os),this.collectSlides()},collectSlides:function(){this.slides=Ht(this.wrapper.children).filter(function(n){return!n.classList.contains(m.settings.classes.slide.clone)})}};return je(s,"root",{get:function(){return s._r},set:function(n){Nt(n)&&(n=document.querySelector(n)),n!==null?s._r=n:We("Root element must be a existing Html node")}}),je(s,"track",{get:function(){return s._t},set:function(n){s._t=n}}),je(s,"wrapper",{get:function(){return s.track.children[0]}}),i.on("update",function(){s.collectSlides()}),s}function cs(m,e,i){var s={mount:function(){this.value=m.settings.peek}};return je(s,"value",{get:function(){return s._v},set:function(n){it(n)?(n.before=ze(n.before),n.after=ze(n.after)):n=ze(n),s._v=n}}),je(s,"reductor",{get:function(){var n=s.value,r=m.settings.perView;return it(n)?n.before/r+n.after/r:n*2/r}}),i.on(["resize","update"],function(){s.mount()}),s}function us(m,e,i){var s={mount:function(){this._o=0},make:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=r,i.emit("move",{movement:this.value}),e.Transition.after(function(){i.emit("move.after",{movement:n.value})})}};return je(s,"offset",{get:function(){return s._o},set:function(n){s._o=ai(n)?0:ze(n)}}),je(s,"translate",{get:function(){return e.Sizes.slideWidth*m.index}}),je(s,"value",{get:function(){var n=this.offset,r=this.translate;return e.Direction.is("rtl")?r+n:r-n}}),i.on(["build.before","run"],function(){s.make()}),s}function ds(m,e,i){var s={setupSlides:function(){for(var n="".concat(this.slideWidth,"px"),r=e.Html.slides,a=0;a<r.length;a++)r[a].style.width=n},setupWrapper:function(){e.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var n=e.Html.slides,r=0;r<n.length;r++)n[r].style.width="";e.Html.wrapper.style.width=""}};return je(s,"length",{get:function(){return e.Html.slides.length}}),je(s,"width",{get:function(){return e.Html.track.offsetWidth}}),je(s,"wrapperSize",{get:function(){return s.slideWidth*s.length+e.Gaps.grow+e.Clones.grow}}),je(s,"slideWidth",{get:function(){return s.width/m.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),i.on(["build.before","resize","update"],function(){s.setupSlides(),s.setupWrapper()}),i.on("destroy",function(){s.remove()}),s}function hs(m,e,i){var s={mount:function(){i.emit("build.before"),this.typeClass(),this.activeClass(),i.emit("build.after")},typeClass:function(){e.Html.root.classList.add(m.settings.classes.type[m.settings.type])},activeClass:function(){var n=m.settings.classes,r=e.Html.slides[m.index];r&&(r.classList.add(n.slide.active),li(r).forEach(function(a){a.classList.remove(n.slide.active)}))},removeClasses:function(){var n=m.settings.classes,r=n.type,a=n.slide;e.Html.root.classList.remove(r[m.settings.type]),e.Html.slides.forEach(function(u){u.classList.remove(a.active)})}};return i.on(["destroy","update"],function(){s.removeClasses()}),i.on(["resize","update"],function(){s.mount()}),i.on("move.after",function(){s.activeClass()}),s}function ps(m,e,i){var s={mount:function(){this.items=[],m.isType("carousel")&&(this.items=this.collect())},collect:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=e.Html.slides,a=m.settings,u=a.perView,c=a.classes,d=a.cloningRatio;if(r.length>0)for(var o=+!!m.settings.peek,h=u+o+Math.round(u/2),f=r.slice(0,h).reverse(),v=r.slice(h*-1),S=0;S<Math.max(d,Math.floor(u/r.length));S++){for(var R=0;R<f.length;R++){var y=f[R].cloneNode(!0);y.classList.add(c.slide.clone),n.push(y)}for(var E=0;E<v.length;E++){var b=v[E].cloneNode(!0);b.classList.add(c.slide.clone),n.unshift(b)}}return n},append:function(){for(var n=this.items,r=e.Html,a=r.wrapper,u=r.slides,c=Math.floor(n.length/2),d=n.slice(0,c).reverse(),o=n.slice(c*-1).reverse(),h="".concat(e.Sizes.slideWidth,"px"),f=0;f<o.length;f++)a.appendChild(o[f]);for(var v=0;v<d.length;v++)a.insertBefore(d[v],u[0]);for(var S=0;S<n.length;S++)n[S].style.width=h},remove:function(){for(var n=this.items,r=0;r<n.length;r++)e.Html.wrapper.removeChild(n[r])}};return je(s,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*s.items.length}}),i.on("update",function(){s.remove(),s.mount(),s.append()}),i.on("build.before",function(){m.isType("carousel")&&s.append()}),i.on("destroy",function(){s.remove()}),s}var Je=(function(){function m(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,m),this.listeners=e}return mt(m,[{key:"on",value:function(i,s,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Nt(i)&&(i=[i]);for(var r=0;r<i.length;r++)this.listeners[i[r]]=t,s.addEventListener(i[r],this.listeners[i[r]],n)}},{key:"off",value:function(i,s){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Nt(i)&&(i=[i]);for(var n=0;n<i.length;n++)s.removeEventListener(i[n],this.listeners[i[n]],t)}},{key:"destroy",value:function(){delete this.listeners}}]),m})();function fs(m,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("resize",window,yt(function(){i.emit("resize")},m.settings.throttle))},unbind:function(){s.off("resize",window)}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}var gs=["ltr","rtl"],ms={">":"<","<":">","=":"="};function bs(m,e,i){var s={mount:function(){this.value=m.settings.direction},resolve:function(n){var r=n.slice(0,1);return this.is("rtl")?n.split(r).join(ms[r]):n},is:function(n){return this.value===n},addClass:function(){e.Html.root.classList.add(m.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(m.settings.classes.direction[this.value])}};return je(s,"value",{get:function(){return s._v},set:function(n){gs.indexOf(n)>-1?s._v=n:We("Direction value must be `ltr` or `rtl`")}}),i.on(["destroy","update"],function(){s.removeClass()}),i.on("update",function(){s.mount()}),i.on(["build.before","update"],function(){s.addClass()}),s}function vs(m,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function ys(m,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function ws(m,e){return{modify:function(s){return s+e.Clones.grow/2}}}function xs(m,e){return{modify:function(s){if(m.settings.focusAt>=0){var t=e.Peek.value;return it(t)?s-t.before:s-t}return s}}}function ks(m,e){return{modify:function(s){var t=e.Gaps.value,n=e.Sizes.width,r=m.settings.focusAt,a=e.Sizes.slideWidth;return r==="center"?s-(n/2-a/2):s-a*r-t*r}}}function _s(m,e,i){var s=[ys,ws,xs,ks].concat(m._t,[vs]);return{mutate:function(n){for(var r=0;r<s.length;r++){var a=s[r];vt(a)&&vt(a().modify)?n=a(m,e,i).modify(n):We("Transformer should be a function that returns an object with `modify()` method")}return n}}}function Ss(m,e,i){var s={set:function(n){var r=_s(m,e).mutate(n),a="translate3d(".concat(-1*r,"px, 0px, 0px)");e.Html.wrapper.style.mozTransform=a,e.Html.wrapper.style.webkitTransform=a,e.Html.wrapper.style.transform=a},remove:function(){e.Html.wrapper.style.transform=""},getStartIndex:function(){var n=e.Sizes.length,r=m.index,a=m.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n+(r-a):(r+a)%n},getTravelDistance:function(){var n=e.Sizes.slideWidth*m.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n*-1:n}};return i.on("move",function(t){if(!m.isType("carousel")||!e.Run.isOffset())return s.set(t.movement);e.Transition.after(function(){i.emit("translate.jump"),s.set(e.Sizes.slideWidth*m.index)});var n=e.Sizes.slideWidth*e.Translate.getStartIndex();return s.set(n-e.Translate.getTravelDistance())}),i.on("destroy",function(){s.remove()}),s}function Ts(m,e,i){var s=!1,t={compose:function(r){var a=m.settings;return s?"".concat(r," 0ms ").concat(a.animationTimingFunc):"".concat(r," ").concat(this.duration,"ms ").concat(a.animationTimingFunc)},set:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(r)},remove:function(){e.Html.wrapper.style.transition=""},after:function(r){setTimeout(function(){r()},this.duration)},enable:function(){s=!1,this.set()},disable:function(){s=!0,this.set()}};return je(t,"duration",{get:function(){var r=m.settings;return m.isType("slider")&&e.Run.offset?r.rewindDuration:r.animationDuration}}),i.on("move",function(){t.set()}),i.on(["build.before","resize","translate.jump"],function(){t.disable()}),i.on("run",function(){t.enable()}),i.on("destroy",function(){t.remove()}),t}var ci=!1;try{var ui=Object.defineProperty({},"passive",{get:function(){ci=!0}});window.addEventListener("testPassive",null,ui),window.removeEventListener("testPassive",null,ui)}catch{}var $t=ci,xt=["touchstart","mousedown"],di=["touchmove","mousemove"],hi=["touchend","touchcancel","mouseup","mouseleave"],pi=["mousedown","mousemove","mouseup","mouseleave"];function Es(m,e,i){var s=new Je,t=0,n=0,r=0,a=!1,u=$t?{passive:!0}:!1,c={mount:function(){this.bindSwipeStart()},start:function(o){if(!a&&!m.disabled){this.disable();var h=this.touches(o);t=null,n=ze(h.pageX),r=ze(h.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),i.emit("swipe.start")}},move:function(o){if(!m.disabled){var h=m.settings,f=h.touchAngle,v=h.touchRatio,S=h.classes,R=this.touches(o),y=ze(R.pageX)-n,E=ze(R.pageY)-r,b=Math.abs(y<<2),k=Math.abs(E<<2),C=Math.sqrt(b+k),g=Math.sqrt(k);if(t=Math.asin(g/C),t*180/Math.PI<f)o.stopPropagation(),e.Move.make(y*es(v)),e.Html.root.classList.add(S.dragging),i.emit("swipe.move");else return!1}},end:function(o){if(!m.disabled){var h=m.settings,f=h.perSwipe,v=h.touchAngle,S=h.classes,R=this.touches(o),y=this.threshold(o),E=R.pageX-n,b=t*180/Math.PI;this.enable(),E>y&&b<v?e.Run.make(e.Direction.resolve("".concat(f,"<"))):E<-y&&b<v?e.Run.make(e.Direction.resolve("".concat(f,">"))):e.Move.make(),e.Html.root.classList.remove(S.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),i.emit("swipe.end")}},bindSwipeStart:function(){var o=this,h=m.settings,f=h.swipeThreshold,v=h.dragThreshold;f&&s.on(xt[0],e.Html.wrapper,function(S){o.start(S)},u),v&&s.on(xt[1],e.Html.wrapper,function(S){o.start(S)},u)},unbindSwipeStart:function(){s.off(xt[0],e.Html.wrapper,u),s.off(xt[1],e.Html.wrapper,u)},bindSwipeMove:function(){var o=this;s.on(di,e.Html.wrapper,yt(function(h){o.move(h)},m.settings.throttle),u)},unbindSwipeMove:function(){s.off(di,e.Html.wrapper,u)},bindSwipeEnd:function(){var o=this;s.on(hi,e.Html.wrapper,function(h){o.end(h)})},unbindSwipeEnd:function(){s.off(hi,e.Html.wrapper)},touches:function(o){return pi.indexOf(o.type)>-1?o:o.touches[0]||o.changedTouches[0]},threshold:function(o){var h=m.settings;return pi.indexOf(o.type)>-1?h.dragThreshold:h.swipeThreshold},enable:function(){return a=!1,e.Transition.enable(),this},disable:function(){return a=!0,e.Transition.disable(),this}};return i.on("build.after",function(){e.Html.root.classList.add(m.settings.classes.swipeable)}),i.on("destroy",function(){c.unbindSwipeStart(),c.unbindSwipeMove(),c.unbindSwipeEnd(),s.destroy()}),c}function Cs(m,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){s.off("dragstart",e.Html.wrapper)},dragstart:function(r){r.preventDefault()}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}function Ls(m,e,i){var s=new Je,t=!1,n=!1,r={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){s.on("click",e.Html.wrapper,this.click)},unbind:function(){s.off("click",e.Html.wrapper)},click:function(u){n&&(u.stopPropagation(),u.preventDefault())},detach:function(){if(n=!0,!t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!1;t=!0}return this},attach:function(){if(n=!1,t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!0;t=!1}return this}};return je(r,"items",{get:function(){return r._a}}),i.on("swipe.move",function(){r.detach()}),i.on("swipe.end",function(){e.Transition.after(function(){r.attach()})}),i.on("destroy",function(){r.attach(),r.unbind(),s.destroy()}),r}var Os='[data-glide-el="controls[nav]"]',zt='[data-glide-el^="controls"]',As="".concat(zt,' [data-glide-dir*="<"]'),qs="".concat(zt,' [data-glide-dir*=">"]');function Rs(m,e,i){var s=new Je,t=$t?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(Os),this._c=e.Html.root.querySelectorAll(zt),this._arrowControls={previous:e.Html.root.querySelectorAll(As),next:e.Html.root.querySelectorAll(qs)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var u=m.settings,c=a[m.index];c&&(c.classList.add(u.classes.nav.active),li(c).forEach(function(d){d.classList.remove(u.classes.nav.active)}))},removeClass:function(a){var u=a[m.index];u?.classList.remove(m.settings.classes.nav.active)},setArrowState:function(){if(!m.settings.rewind){var a=n._arrowControls.next,u=n._arrowControls.previous;this.resetArrowState(a,u),m.index===0&&this.disableArrow(u),m.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=m.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){Ht(o).forEach(function(h){h.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=m.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){Ht(o).forEach(function(h){h.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var u=0;u<a.length;u++)s.on("click",a[u],this.click),s.on("touchstart",a[u],this.click,t)},unbind:function(a){for(var u=0;u<a.length;u++)s.off(["click","touchstart"],a[u])},click:function(a){!$t&&a.type==="touchstart"&&a.preventDefault();var u=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(u))}};return je(n,"items",{get:function(){return n._c}}),i.on(["mount.after","move.after"],function(){n.setActive()}),i.on(["mount.after","run"],function(){n.setArrowState()}),i.on("destroy",function(){n.removeBindings(),n.removeActive(),s.destroy()}),n}function Ms(m,e,i){var s=new Je,t={mount:function(){m.settings.keyboard&&this.bind()},bind:function(){s.on("keyup",document,this.press)},unbind:function(){s.off("keyup",document)},press:function(r){var a=m.settings.perSwipe,u={ArrowRight:">",ArrowLeft:"<"};["ArrowRight","ArrowLeft"].includes(r.code)&&e.Run.make(e.Direction.resolve("".concat(a).concat(u[r.code])))}};return i.on(["destroy","update"],function(){t.unbind()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function js(m,e,i){var s=new Je,t={mount:function(){this.enable(),this.start(),m.settings.hoverpause&&this.bind()},enable:function(){this._e=!0},disable:function(){this._e=!1},start:function(){var r=this;this._e&&(this.enable(),m.settings.autoplay&&ai(this._i)&&(this._i=setInterval(function(){r.stop(),e.Run.make(">"),r.start(),i.emit("autoplay")},this.time)))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var r=this;s.on("mouseover",e.Html.root,function(){r._e&&r.stop()}),s.on("mouseout",e.Html.root,function(){r._e&&r.start()})},unbind:function(){s.off(["mouseover","mouseout"],e.Html.root)}};return je(t,"time",{get:function(){var r=e.Html.slides[m.index].getAttribute("data-glide-autoplay");return ze(r||m.settings.autoplay)}}),i.on(["destroy","update"],function(){t.unbind()}),i.on(["run.before","swipe.start","update"],function(){t.stop()}),i.on(["pause","destroy"],function(){t.disable(),t.stop()}),i.on(["run.after","swipe.end"],function(){t.start()}),i.on(["play"],function(){t.enable(),t.start()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function fi(m){return it(m)?is(m):(We("Breakpoints option must be an object"),{})}function Is(m,e,i){var s=new Je,t=m.settings,n=fi(t.breakpoints),r=Object.assign({},t),a={match:function(c){if(typeof window.matchMedia<"u"){for(var d in c)if(c.hasOwnProperty(d)&&window.matchMedia("(max-width: ".concat(d,"px)")).matches)return c[d]}return r}};return Object.assign(t,a.match(n)),s.on("resize",window,yt(function(){m.settings=Dt(t,a.match(n))},m.settings.throttle)),i.on("update",function(){n=fi(n),r=Object.assign({},t)}),i.on("destroy",function(){s.off("resize",window)}),a}var Ns={Html:ls,Translate:Ss,Transition:Ts,Direction:bs,Peek:cs,Sizes:ds,Gaps:as,Move:us,Clones:ps,Resize:fs,Build:hs,Run:rs,Swipe:Es,Images:Cs,Anchors:Ls,Controls:Rs,Keyboard:Ms,Autoplay:js,Breakpoints:Is},Ps=(function(m){Wi(i,m);var e=Zi(i);function i(){return gt(this,i),e.apply(this,arguments)}return mt(i,[{key:"mount",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return bt(tt(i.prototype),"mount",this).call(this,Object.assign({},Ns,t))}}]),i})(ns);function Vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ze=Vt();function gi(m){Ze=m}const ot={exec:()=>null};function Te(m,e=""){let i=typeof m=="string"?m:m.source;const s={replace:(t,n)=>{let r=typeof n=="string"?n:n.source;return r=r.replace(Ve.caret,"$1"),i=i.replace(t,r),s},getRegex:()=>new RegExp(i,e)};return s}const Ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:m=>new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}#`),htmlBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}<(?:[a-z].*>|!--)`,"i")},Ds=/^(?:[ \t]*(?:\n|$))+/,Hs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$s=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ut=/(?:[*+-]|\d{1,9}[.)])/,mi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bi=Te(mi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vs=Te(mi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Us=/^[^\n]+/,Yt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Bs=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ys=Te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ut).getRegex(),kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ft=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fs=Te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ft).replace("tag",kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vi=Te(Bt).replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Wt={blockquote:Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vi).getRegex(),code:Hs,def:Bs,fences:$s,heading:zs,hr:lt,html:Fs,lheading:bi,list:Ys,newline:Ds,paragraph:vi,table:ot,text:Us},yi=Te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Ws={...Wt,lheading:Vs,table:yi,paragraph:Te(Bt).replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex()},Gs={...Wt,html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ft).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ot,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Te(Bt).replace("hr",lt).replace("heading",` *#{1,6} *[^
|
|
53
|
-
]`).replace("lheading",
|
|
52
|
+
*/function Bi(u,e){var i=Object.keys(u);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(u);e&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(u,t).enumerable})),i.push.apply(i,s)}return i}function Ui(u){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(i),!0).forEach(function(s){Xs(u,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):Bi(Object(i)).forEach(function(s){Object.defineProperty(u,s,Object.getOwnPropertyDescriptor(i,s))})}return u}function St(u){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?St=function(e){return typeof e}:St=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},St(u)}function Tt(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function Gs(u,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function Et(u,e,i){return e&&Gs(u.prototype,e),u}function Xs(u,e,i){return e in u?Object.defineProperty(u,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):u[e]=i,u}function Js(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),e&&oi(u,e)}function dt(u){return dt=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},dt(u)}function oi(u,e){return oi=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},oi(u,e)}function Zs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qs(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Ks(u,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qs(u)}function en(u){var e=Zs();return function(){var s=dt(u),t;if(e){var n=dt(this).constructor;t=Reflect.construct(s,arguments,n)}else t=s.apply(this,arguments);return Ks(this,t)}}function tn(u,e){for(;!Object.prototype.hasOwnProperty.call(u,e)&&(u=dt(u),u!==null););return u}function Ct(){return typeof Reflect<"u"&&Reflect.get?Ct=Reflect.get:Ct=function(e,i,s){var t=tn(e,i);if(t){var n=Object.getOwnPropertyDescriptor(t,i);return n.get?n.get.call(arguments.length<3?e:s):n.value}},Ct.apply(this,arguments)}var sn={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function it(u){console.error("[Glide warn]: ".concat(u))}function ze(u){return parseInt(u)}function nn(u){return parseFloat(u)}function li(u){return typeof u=="string"}function ht(u){var e=St(u);return e==="function"||e==="object"&&!!u}function Ot(u){return typeof u=="function"}function Fi(u){return typeof u>"u"}function ci(u){return u.constructor===Array}function rn(u,e,i){var s={};for(var t in e)Ot(e[t])?s[t]=e[t](u,s,i):it("Extension must be a function");for(var n in s)Ot(s[n].mount)&&s[n].mount();return s}function Le(u,e,i){Object.defineProperty(u,e,i)}function an(u){return Object.keys(u).sort().reduce(function(e,i){return e[i]=u[i],e[i],e},{})}function ui(u,e){var i=Object.assign({},u,e);if(e.hasOwnProperty("classes")){i.classes=Object.assign({},u.classes,e.classes);var s=["direction","type","slide","arrow","nav"];s.forEach(function(t){e.classes.hasOwnProperty(t)&&(i.classes[t]=Ui(Ui({},u.classes[t]),e.classes[t]))})}return e.hasOwnProperty("breakpoints")&&(i.breakpoints=Object.assign({},u.breakpoints,e.breakpoints)),i}var on=(function(){function u(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tt(this,u),this.events=e,this.hop=e.hasOwnProperty}return Et(u,[{key:"on",value:function(i,s){if(ci(i)){for(var t=0;t<i.length;t++)this.on(i[t],s);return}this.hop.call(this.events,i)||(this.events[i]=[]);var n=this.events[i].push(s)-1;return{remove:function(){delete this.events[i][n]}}}},{key:"emit",value:function(i,s){if(ci(i)){for(var t=0;t<i.length;t++)this.emit(i[t],s);return}this.hop.call(this.events,i)&&this.events[i].forEach(function(n){n(s||{})})}}]),u})(),ln=(function(){function u(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Tt(this,u),this._c={},this._t=[],this._e=new on,this.disabled=!1,this.selector=e,this.settings=ui(sn,i),this.index=this.settings.startAt}return Et(u,[{key:"mount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),ht(i)?this._c=rn(this,i,this._e):it("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ci(i)?this._t=i:it("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=ui(this.settings,i),i.hasOwnProperty("startAt")&&(this.index=i.startAt),this._e.emit("update"),this}},{key:"go",value:function(i){return this._c.Run.make(i),this}},{key:"move",value:function(i){return this._c.Transition.disable(),this._c.Move.make(i),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i&&(this.settings.autoplay=i),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(i,s){return this._e.on(i,s),this}},{key:"isType",value:function(i){return this.settings.type===i}},{key:"settings",get:function(){return this._o},set:function(i){ht(i)?this._o=i:it("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(i){this._i=ze(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(i){this._d=!!i}}]),u})();function cn(u,e,i){var s={mount:function(){this._o=!1},make:function(c){var d=this;u.disabled||(!u.settings.waitForTransition||u.disable(),this.move=c,i.emit("run.before",this.move),this.calculate(),i.emit("run",this.move),e.Transition.after(function(){d.isStart()&&i.emit("run.start",d.move),d.isEnd()&&i.emit("run.end",d.move),d.isOffset()&&(d._o=!1,i.emit("run.offset",d.move)),i.emit("run.after",d.move),u.enable()}))},calculate:function(){var c=this.move,d=this.length,o=c.steps,h=c.direction,f=1;if(h==="="){if(u.settings.bound&&ze(o)>d){u.index=d;return}u.index=o;return}if(h===">"&&o===">"){u.index=d;return}if(h==="<"&&o==="<"){u.index=0;return}if(h==="|"&&(f=u.settings.perView||1),h===">"||h==="|"&&o===">"){var m=t(f);m>d&&(this._o=!0),u.index=n(m,f);return}if(h==="<"||h==="|"&&o==="<"){var w=r(f);w<0&&(this._o=!0),u.index=a(w,f);return}it("Invalid direction pattern [".concat(h).concat(o,"] has been used"))},isStart:function(){return u.index<=0},isEnd:function(){return u.index>=this.length},isOffset:function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return c?this._o?c==="|>"?this.move.direction==="|"&&this.move.steps===">":c==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===c:!1:this._o},isBound:function(){return u.isType("slider")&&u.settings.focusAt!=="center"&&u.settings.bound}};function t(l){var c=u.index;return u.isType("carousel")?c+l:c+(l-c%l)}function n(l,c){var d=s.length;return l<=d?l:u.isType("carousel")?l-(d+1):u.settings.rewind?s.isBound()&&!s.isEnd()?d:0:s.isBound()?d:Math.floor(d/c)*c}function r(l){var c=u.index;if(u.isType("carousel"))return c-l;var d=Math.ceil(c/l);return(d-1)*l}function a(l,c){var d=s.length;return l>=0?l:u.isType("carousel")?l+(d+1):u.settings.rewind?s.isBound()&&s.isStart()?d:Math.floor(d/c)*c:0}return Le(s,"move",{get:function(){return this._m},set:function(c){var d=c.substr(1);this._m={direction:c.substr(0,1),steps:d?ze(d)?ze(d):d:0}}}),Le(s,"length",{get:function(){var c=u.settings,d=e.Html.slides.length;return this.isBound()?d-1-(ze(c.perView)-1)+ze(c.focusAt):d-1}}),Le(s,"offset",{get:function(){return this._o}}),s}function Yi(){return new Date().getTime()}function Lt(u,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,t,n,r,a=0,l=function(){a=i.leading===!1?0:Yi(),s=null,r=u.apply(t,n),s||(t=n=null)},c=function(){var o=Yi();!a&&i.leading===!1&&(a=o);var h=e-(o-a);return t=this,n=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=o,r=u.apply(t,n),s||(t=n=null)):!s&&i.trailing!==!1&&(s=setTimeout(l,h)),r};return c.cancel=function(){clearTimeout(s),a=0,s=t=n=null},c}var At={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function un(u,e,i){var s={apply:function(n){for(var r=0,a=n.length;r<a;r++){var l=n[r].style,c=e.Direction.value;r!==0?l[At[c][0]]="".concat(this.value/2,"px"):l[At[c][0]]="",r!==n.length-1?l[At[c][1]]="".concat(this.value/2,"px"):l[At[c][1]]=""}},remove:function(n){for(var r=0,a=n.length;r<a;r++){var l=n[r].style;l.marginLeft="",l.marginRight=""}}};return Le(s,"value",{get:function(){return ze(u.settings.gap)}}),Le(s,"grow",{get:function(){return s.value*e.Sizes.length}}),Le(s,"reductor",{get:function(){var n=u.settings.perView;return s.value*(n-1)/n}}),i.on(["build.after","update"],Lt(function(){s.apply(e.Html.wrapper.children)},30)),i.on("destroy",function(){s.remove(e.Html.wrapper.children)}),s}function Wi(u){if(u&&u.parentNode){for(var e=u.parentNode.firstChild,i=[];e;e=e.nextSibling)e.nodeType===1&&e!==u&&i.push(e);return i}return[]}function di(u){return Array.prototype.slice.call(u)}var dn='[data-glide-el="track"]';function hn(u,e,i){var s={mount:function(){this.root=u.selector,this.track=this.root.querySelector(dn),this.collectSlides()},collectSlides:function(){this.slides=di(this.wrapper.children).filter(function(n){return!n.classList.contains(u.settings.classes.slide.clone)})}};return Le(s,"root",{get:function(){return s._r},set:function(n){li(n)&&(n=document.querySelector(n)),n!==null?s._r=n:it("Root element must be a existing Html node")}}),Le(s,"track",{get:function(){return s._t},set:function(n){s._t=n}}),Le(s,"wrapper",{get:function(){return s.track.children[0]}}),i.on("update",function(){s.collectSlides()}),s}function fn(u,e,i){var s={mount:function(){this.value=u.settings.peek}};return Le(s,"value",{get:function(){return s._v},set:function(n){ht(n)?(n.before=ze(n.before),n.after=ze(n.after)):n=ze(n),s._v=n}}),Le(s,"reductor",{get:function(){var n=s.value,r=u.settings.perView;return ht(n)?n.before/r+n.after/r:n*2/r}}),i.on(["resize","update"],function(){s.mount()}),s}function pn(u,e,i){var s={mount:function(){this._o=0},make:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=r,i.emit("move",{movement:this.value}),e.Transition.after(function(){i.emit("move.after",{movement:n.value})})}};return Le(s,"offset",{get:function(){return s._o},set:function(n){s._o=Fi(n)?0:ze(n)}}),Le(s,"translate",{get:function(){return e.Sizes.slideWidth*u.index}}),Le(s,"value",{get:function(){var n=this.offset,r=this.translate;return e.Direction.is("rtl")?r+n:r-n}}),i.on(["build.before","run"],function(){s.make()}),s}function gn(u,e,i){var s={setupSlides:function(){for(var n="".concat(this.slideWidth,"px"),r=e.Html.slides,a=0;a<r.length;a++)r[a].style.width=n},setupWrapper:function(){e.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var n=e.Html.slides,r=0;r<n.length;r++)n[r].style.width="";e.Html.wrapper.style.width=""}};return Le(s,"length",{get:function(){return e.Html.slides.length}}),Le(s,"width",{get:function(){return e.Html.track.offsetWidth}}),Le(s,"wrapperSize",{get:function(){return s.slideWidth*s.length+e.Gaps.grow+e.Clones.grow}}),Le(s,"slideWidth",{get:function(){return s.width/u.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),i.on(["build.before","resize","update"],function(){s.setupSlides(),s.setupWrapper()}),i.on("destroy",function(){s.remove()}),s}function mn(u,e,i){var s={mount:function(){i.emit("build.before"),this.typeClass(),this.activeClass(),i.emit("build.after")},typeClass:function(){e.Html.root.classList.add(u.settings.classes.type[u.settings.type])},activeClass:function(){var n=u.settings.classes,r=e.Html.slides[u.index];r&&(r.classList.add(n.slide.active),Wi(r).forEach(function(a){a.classList.remove(n.slide.active)}))},removeClasses:function(){var n=u.settings.classes,r=n.type,a=n.slide;e.Html.root.classList.remove(r[u.settings.type]),e.Html.slides.forEach(function(l){l.classList.remove(a.active)})}};return i.on(["destroy","update"],function(){s.removeClasses()}),i.on(["resize","update"],function(){s.mount()}),i.on("move.after",function(){s.activeClass()}),s}function bn(u,e,i){var s={mount:function(){this.items=[],u.isType("carousel")&&(this.items=this.collect())},collect:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=e.Html.slides,a=u.settings,l=a.perView,c=a.classes,d=a.cloningRatio;if(r.length>0)for(var o=+!!u.settings.peek,h=l+o+Math.round(l/2),f=r.slice(0,h).reverse(),m=r.slice(h*-1),w=0;w<Math.max(d,Math.floor(l/r.length));w++){for(var E=0;E<f.length;E++){var b=f[E].cloneNode(!0);b.classList.add(c.slide.clone),n.push(b)}for(var k=0;k<m.length;k++){var g=m[k].cloneNode(!0);g.classList.add(c.slide.clone),n.unshift(g)}}return n},append:function(){for(var n=this.items,r=e.Html,a=r.wrapper,l=r.slides,c=Math.floor(n.length/2),d=n.slice(0,c).reverse(),o=n.slice(c*-1).reverse(),h="".concat(e.Sizes.slideWidth,"px"),f=0;f<o.length;f++)a.appendChild(o[f]);for(var m=0;m<d.length;m++)a.insertBefore(d[m],l[0]);for(var w=0;w<n.length;w++)n[w].style.width=h},remove:function(){for(var n=this.items,r=0;r<n.length;r++)e.Html.wrapper.removeChild(n[r])}};return Le(s,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*s.items.length}}),i.on("update",function(){s.remove(),s.mount(),s.append()}),i.on("build.before",function(){u.isType("carousel")&&s.append()}),i.on("destroy",function(){s.remove()}),s}var st=(function(){function u(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tt(this,u),this.listeners=e}return Et(u,[{key:"on",value:function(i,s,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;li(i)&&(i=[i]);for(var r=0;r<i.length;r++)this.listeners[i[r]]=t,s.addEventListener(i[r],this.listeners[i[r]],n)}},{key:"off",value:function(i,s){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;li(i)&&(i=[i]);for(var n=0;n<i.length;n++)s.removeEventListener(i[n],this.listeners[i[n]],t)}},{key:"destroy",value:function(){delete this.listeners}}]),u})();function yn(u,e,i){var s=new st,t={mount:function(){this.bind()},bind:function(){s.on("resize",window,Lt(function(){i.emit("resize")},u.settings.throttle))},unbind:function(){s.off("resize",window)}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}var vn=["ltr","rtl"],wn={">":"<","<":">","=":"="};function xn(u,e,i){var s={mount:function(){this.value=u.settings.direction},resolve:function(n){var r=n.slice(0,1);return this.is("rtl")?n.split(r).join(wn[r]):n},is:function(n){return this.value===n},addClass:function(){e.Html.root.classList.add(u.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(u.settings.classes.direction[this.value])}};return Le(s,"value",{get:function(){return s._v},set:function(n){vn.indexOf(n)>-1?s._v=n:it("Direction value must be `ltr` or `rtl`")}}),i.on(["destroy","update"],function(){s.removeClass()}),i.on("update",function(){s.mount()}),i.on(["build.before","update"],function(){s.addClass()}),s}function kn(u,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function _n(u,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function Sn(u,e){return{modify:function(s){return s+e.Clones.grow/2}}}function Tn(u,e){return{modify:function(s){if(u.settings.focusAt>=0){var t=e.Peek.value;return ht(t)?s-t.before:s-t}return s}}}function En(u,e){return{modify:function(s){var t=e.Gaps.value,n=e.Sizes.width,r=u.settings.focusAt,a=e.Sizes.slideWidth;return r==="center"?s-(n/2-a/2):s-a*r-t*r}}}function Cn(u,e,i){var s=[_n,Sn,Tn,En].concat(u._t,[kn]);return{mutate:function(n){for(var r=0;r<s.length;r++){var a=s[r];Ot(a)&&Ot(a().modify)?n=a(u,e,i).modify(n):it("Transformer should be a function that returns an object with `modify()` method")}return n}}}function On(u,e,i){var s={set:function(n){var r=Cn(u,e).mutate(n),a="translate3d(".concat(-1*r,"px, 0px, 0px)");e.Html.wrapper.style.mozTransform=a,e.Html.wrapper.style.webkitTransform=a,e.Html.wrapper.style.transform=a},remove:function(){e.Html.wrapper.style.transform=""},getStartIndex:function(){var n=e.Sizes.length,r=u.index,a=u.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n+(r-a):(r+a)%n},getTravelDistance:function(){var n=e.Sizes.slideWidth*u.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n*-1:n}};return i.on("move",function(t){if(!u.isType("carousel")||!e.Run.isOffset())return s.set(t.movement);e.Transition.after(function(){i.emit("translate.jump"),s.set(e.Sizes.slideWidth*u.index)});var n=e.Sizes.slideWidth*e.Translate.getStartIndex();return s.set(n-e.Translate.getTravelDistance())}),i.on("destroy",function(){s.remove()}),s}function Ln(u,e,i){var s=!1,t={compose:function(r){var a=u.settings;return s?"".concat(r," 0ms ").concat(a.animationTimingFunc):"".concat(r," ").concat(this.duration,"ms ").concat(a.animationTimingFunc)},set:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(r)},remove:function(){e.Html.wrapper.style.transition=""},after:function(r){setTimeout(function(){r()},this.duration)},enable:function(){s=!1,this.set()},disable:function(){s=!0,this.set()}};return Le(t,"duration",{get:function(){var r=u.settings;return u.isType("slider")&&e.Run.offset?r.rewindDuration:r.animationDuration}}),i.on("move",function(){t.set()}),i.on(["build.before","resize","translate.jump"],function(){t.disable()}),i.on("run",function(){t.enable()}),i.on("destroy",function(){t.remove()}),t}var Gi=!1;try{var Xi=Object.defineProperty({},"passive",{get:function(){Gi=!0}});window.addEventListener("testPassive",null,Xi),window.removeEventListener("testPassive",null,Xi)}catch{}var hi=Gi,Rt=["touchstart","mousedown"],Ji=["touchmove","mousemove"],Zi=["touchend","touchcancel","mouseup","mouseleave"],Qi=["mousedown","mousemove","mouseup","mouseleave"];function An(u,e,i){var s=new st,t=0,n=0,r=0,a=!1,l=hi?{passive:!0}:!1,c={mount:function(){this.bindSwipeStart()},start:function(o){if(!a&&!u.disabled){this.disable();var h=this.touches(o);t=null,n=ze(h.pageX),r=ze(h.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),i.emit("swipe.start")}},move:function(o){if(!u.disabled){var h=u.settings,f=h.touchAngle,m=h.touchRatio,w=h.classes,E=this.touches(o),b=ze(E.pageX)-n,k=ze(E.pageY)-r,g=Math.abs(b<<2),v=Math.abs(k<<2),_=Math.sqrt(g+v),p=Math.sqrt(v);if(t=Math.asin(p/_),t*180/Math.PI<f)o.stopPropagation(),e.Move.make(b*nn(m)),e.Html.root.classList.add(w.dragging),i.emit("swipe.move");else return!1}},end:function(o){if(!u.disabled){var h=u.settings,f=h.perSwipe,m=h.touchAngle,w=h.classes,E=this.touches(o),b=this.threshold(o),k=E.pageX-n,g=t*180/Math.PI;this.enable(),k>b&&g<m?e.Run.make(e.Direction.resolve("".concat(f,"<"))):k<-b&&g<m?e.Run.make(e.Direction.resolve("".concat(f,">"))):e.Move.make(),e.Html.root.classList.remove(w.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),i.emit("swipe.end")}},bindSwipeStart:function(){var o=this,h=u.settings,f=h.swipeThreshold,m=h.dragThreshold;f&&s.on(Rt[0],e.Html.wrapper,function(w){o.start(w)},l),m&&s.on(Rt[1],e.Html.wrapper,function(w){o.start(w)},l)},unbindSwipeStart:function(){s.off(Rt[0],e.Html.wrapper,l),s.off(Rt[1],e.Html.wrapper,l)},bindSwipeMove:function(){var o=this;s.on(Ji,e.Html.wrapper,Lt(function(h){o.move(h)},u.settings.throttle),l)},unbindSwipeMove:function(){s.off(Ji,e.Html.wrapper,l)},bindSwipeEnd:function(){var o=this;s.on(Zi,e.Html.wrapper,function(h){o.end(h)})},unbindSwipeEnd:function(){s.off(Zi,e.Html.wrapper)},touches:function(o){return Qi.indexOf(o.type)>-1?o:o.touches[0]||o.changedTouches[0]},threshold:function(o){var h=u.settings;return Qi.indexOf(o.type)>-1?h.dragThreshold:h.swipeThreshold},enable:function(){return a=!1,e.Transition.enable(),this},disable:function(){return a=!0,e.Transition.disable(),this}};return i.on("build.after",function(){e.Html.root.classList.add(u.settings.classes.swipeable)}),i.on("destroy",function(){c.unbindSwipeStart(),c.unbindSwipeMove(),c.unbindSwipeEnd(),s.destroy()}),c}function Rn(u,e,i){var s=new st,t={mount:function(){this.bind()},bind:function(){s.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){s.off("dragstart",e.Html.wrapper)},dragstart:function(r){r.preventDefault()}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}function qn(u,e,i){var s=new st,t=!1,n=!1,r={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){s.on("click",e.Html.wrapper,this.click)},unbind:function(){s.off("click",e.Html.wrapper)},click:function(l){n&&(l.stopPropagation(),l.preventDefault())},detach:function(){if(n=!0,!t){for(var l=0;l<this.items.length;l++)this.items[l].draggable=!1;t=!0}return this},attach:function(){if(n=!1,t){for(var l=0;l<this.items.length;l++)this.items[l].draggable=!0;t=!1}return this}};return Le(r,"items",{get:function(){return r._a}}),i.on("swipe.move",function(){r.detach()}),i.on("swipe.end",function(){e.Transition.after(function(){r.attach()})}),i.on("destroy",function(){r.attach(),r.unbind(),s.destroy()}),r}var Mn='[data-glide-el="controls[nav]"]',fi='[data-glide-el^="controls"]',In="".concat(fi,' [data-glide-dir*="<"]'),jn="".concat(fi,' [data-glide-dir*=">"]');function Nn(u,e,i){var s=new st,t=hi?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(Mn),this._c=e.Html.root.querySelectorAll(fi),this._arrowControls={previous:e.Html.root.querySelectorAll(In),next:e.Html.root.querySelectorAll(jn)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var l=u.settings,c=a[u.index];c&&(c.classList.add(l.classes.nav.active),Wi(c).forEach(function(d){d.classList.remove(l.classes.nav.active)}))},removeClass:function(a){var l=a[u.index];l?.classList.remove(u.settings.classes.nav.active)},setArrowState:function(){if(!u.settings.rewind){var a=n._arrowControls.next,l=n._arrowControls.previous;this.resetArrowState(a,l),u.index===0&&this.disableArrow(l),u.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=u.settings,l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];c.forEach(function(o){di(o).forEach(function(h){h.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=u.settings,l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];c.forEach(function(o){di(o).forEach(function(h){h.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var l=0;l<a.length;l++)s.on("click",a[l],this.click),s.on("touchstart",a[l],this.click,t)},unbind:function(a){for(var l=0;l<a.length;l++)s.off(["click","touchstart"],a[l])},click:function(a){!hi&&a.type==="touchstart"&&a.preventDefault();var l=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(l))}};return Le(n,"items",{get:function(){return n._c}}),i.on(["mount.after","move.after"],function(){n.setActive()}),i.on(["mount.after","run"],function(){n.setArrowState()}),i.on("destroy",function(){n.removeBindings(),n.removeActive(),s.destroy()}),n}function Dn(u,e,i){var s=new st,t={mount:function(){u.settings.keyboard&&this.bind()},bind:function(){s.on("keyup",document,this.press)},unbind:function(){s.off("keyup",document)},press:function(r){var a=u.settings.perSwipe,l={ArrowRight:">",ArrowLeft:"<"};["ArrowRight","ArrowLeft"].includes(r.code)&&e.Run.make(e.Direction.resolve("".concat(a).concat(l[r.code])))}};return i.on(["destroy","update"],function(){t.unbind()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function Pn(u,e,i){var s=new st,t={mount:function(){this.enable(),this.start(),u.settings.hoverpause&&this.bind()},enable:function(){this._e=!0},disable:function(){this._e=!1},start:function(){var r=this;this._e&&(this.enable(),u.settings.autoplay&&Fi(this._i)&&(this._i=setInterval(function(){r.stop(),e.Run.make(">"),r.start(),i.emit("autoplay")},this.time)))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var r=this;s.on("mouseover",e.Html.root,function(){r._e&&r.stop()}),s.on("mouseout",e.Html.root,function(){r._e&&r.start()})},unbind:function(){s.off(["mouseover","mouseout"],e.Html.root)}};return Le(t,"time",{get:function(){var r=e.Html.slides[u.index].getAttribute("data-glide-autoplay");return ze(r||u.settings.autoplay)}}),i.on(["destroy","update"],function(){t.unbind()}),i.on(["run.before","swipe.start","update"],function(){t.stop()}),i.on(["pause","destroy"],function(){t.disable(),t.stop()}),i.on(["run.after","swipe.end"],function(){t.start()}),i.on(["play"],function(){t.enable(),t.start()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function Ki(u){return ht(u)?an(u):(it("Breakpoints option must be an object"),{})}function $n(u,e,i){var s=new st,t=u.settings,n=Ki(t.breakpoints),r=Object.assign({},t),a={match:function(c){if(typeof window.matchMedia<"u"){for(var d in c)if(c.hasOwnProperty(d)&&window.matchMedia("(max-width: ".concat(d,"px)")).matches)return c[d]}return r}};return Object.assign(t,a.match(n)),s.on("resize",window,Lt(function(){u.settings=ui(t,a.match(n))},u.settings.throttle)),i.on("update",function(){n=Ki(n),r=Object.assign({},t)}),i.on("destroy",function(){s.off("resize",window)}),a}var Hn={Html:hn,Translate:On,Transition:Ln,Direction:xn,Peek:fn,Sizes:gn,Gaps:un,Move:pn,Clones:bn,Resize:yn,Build:mn,Run:cn,Swipe:An,Images:Rn,Anchors:qn,Controls:Nn,Keyboard:Dn,Autoplay:Pn,Breakpoints:$n},zn=(function(u){Js(i,u);var e=en(i);function i(){return Tt(this,i),e.apply(this,arguments)}return Et(i,[{key:"mount",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ct(dt(i.prototype),"mount",this).call(this,Object.assign({},Hn,t))}}]),i})(ln);function pi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let rt=pi();function es(u){rt=u}const pt={exec:()=>null};function ve(u,e=""){let i=typeof u=="string"?u:u.source;const s={replace:(t,n)=>{let r=typeof n=="string"?n:n.source;return r=r.replace(Ye.caret,"$1"),i=i.replace(t,r),s},getRegex:()=>new RegExp(i,e)};return s}const Ye={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},Vn=/^(?:[ \t]*(?:\n|$))+/,Bn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Un=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gi=/(?:[*+-]|\d{1,9}[.)])/,ts=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,is=ve(ts).replace(/bull/g,gi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Yn=ve(ts).replace(/bull/g,gi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wn=/^[^\n]+/,bi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Gn=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xn=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gi).getRegex(),qt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",yi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jn=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",yi).replace("tag",qt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ss=ve(mi).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex(),vi={blockquote:ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ss).getRegex(),code:Bn,def:Gn,fences:Un,heading:Fn,hr:gt,html:Jn,lheading:is,list:Xn,newline:Vn,paragraph:ss,table:pt,text:Wn},ns=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex(),Zn={...vi,lheading:Yn,table:ns,paragraph:ve(mi).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ns).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qt).getRegex()},Qn={...vi,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",yi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(mi).replace("hr",gt).replace("heading",` *#{1,6} *[^
|
|
53
|
+
]`).replace("lheading",is).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Kn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,er=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rs=/^( {2,}|\\)\n(?!\s*$)/,tr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mt=/[\p{P}\p{S}]/u,wi=/[\s\p{P}\p{S}]/u,as=/[^\s\p{P}\p{S}]/u,ir=ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wi).getRegex(),os=/(?!~)[\p{P}\p{S}]/u,sr=/(?!~)[\s\p{P}\p{S}]/u,nr=/(?:[^\s\p{P}\p{S}]|~)/u,rr=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ls=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ar=ve(ls,"u").replace(/punct/g,Mt).getRegex(),or=ve(ls,"u").replace(/punct/g,os).getRegex(),cs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lr=ve(cs,"gu").replace(/notPunctSpace/g,as).replace(/punctSpace/g,wi).replace(/punct/g,Mt).getRegex(),cr=ve(cs,"gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,sr).replace(/punct/g,os).getRegex(),ur=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,as).replace(/punctSpace/g,wi).replace(/punct/g,Mt).getRegex(),dr=ve(/\\(punct)/,"gu").replace(/punct/g,Mt).getRegex(),hr=ve(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fr=ve(yi).replace("(?:-->|$)","-->").getRegex(),pr=ve("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),It=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,gr=ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",It).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),us=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",It).replace("ref",bi).getRegex(),ds=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",bi).getRegex(),mr=ve("reflink|nolink(?!\\()","g").replace("reflink",us).replace("nolink",ds).getRegex(),xi={_backpedal:pt,anyPunctuation:dr,autolink:hr,blockSkip:rr,br:rs,code:er,del:pt,emStrongLDelim:ar,emStrongRDelimAst:lr,emStrongRDelimUnd:ur,escape:Kn,link:gr,nolink:ds,punctuation:ir,reflink:us,reflinkSearch:mr,tag:pr,text:tr,url:pt},br={...xi,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",It).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",It).getRegex()},ki={...xi,emStrongRDelimAst:cr,emStrongLDelim:or,url:ve(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},yr={...ki,br:ve(rs).replace("{2,}","*").getRegex(),text:ve(ki.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jt={normal:vi,gfm:Zn,pedantic:Qn},mt={normal:xi,gfm:ki,breaks:yr,pedantic:br},vr={"&":"&","<":"<",">":">",'"':""","'":"'"},hs=u=>vr[u];function Ke(u,e){if(e){if(Ye.escapeTest.test(u))return u.replace(Ye.escapeReplace,hs)}else if(Ye.escapeTestNoEncode.test(u))return u.replace(Ye.escapeReplaceNoEncode,hs);return u}function fs(u){try{u=encodeURI(u).replace(Ye.percentDecode,"%")}catch{return null}return u}function ps(u,e){const i=u.replace(Ye.findPipe,(n,r,a)=>{let l=!1,c=r;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=i.split(Ye.splitPipe);let t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(Ye.slashPipe,"|");return s}function bt(u,e,i){const s=u.length;if(s===0)return"";let t=0;for(;t<s&&u.charAt(s-t-1)===e;)t++;return u.slice(0,s-t)}function wr(u,e){if(u.indexOf(e[1])===-1)return-1;let i=0;for(let s=0;s<u.length;s++)if(u[s]==="\\")s++;else if(u[s]===e[0])i++;else if(u[s]===e[1]&&(i--,i<0))return s;return i>0?-2:-1}function gs(u,e,i,s,t){const n=e.href,r=e.title||null,a=u[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;const l={type:u[0].charAt(0)==="!"?"image":"link",raw:i,href:n,title:r,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function xr(u,e,i){const s=u.match(i.other.indentCodeCompensation);if(s===null)return e;const t=s[1];return e.split(`
|
|
54
54
|
`).map(n=>{const r=n.match(i.other.beginningSpace);if(r===null)return n;const[a]=r;return a.length>=t.length?n.slice(t.length):n}).join(`
|
|
55
|
-
`)}class
|
|
56
|
-
`)}}}fences(e){const i=this.rules.block.fences.exec(e);if(i){const s=i[0],t=
|
|
57
|
-
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=
|
|
55
|
+
`)}class Nt{options;rules;lexer;constructor(e){this.options=e||rt}space(e){const i=this.rules.block.newline.exec(e);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(e){const i=this.rules.block.code.exec(e);if(i){const s=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?s:bt(s,`
|
|
56
|
+
`)}}}fences(e){const i=this.rules.block.fences.exec(e);if(i){const s=i[0],t=xr(s,i[3]||"",this.rules);return{type:"code",raw:s,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:t}}}heading(e){const i=this.rules.block.heading.exec(e);if(i){let s=i[2].trim();if(this.rules.other.endingHash.test(s)){const t=bt(s,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(s=t.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const i=this.rules.block.hr.exec(e);if(i)return{type:"hr",raw:bt(i[0],`
|
|
57
|
+
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=bt(i[0],`
|
|
58
58
|
`).split(`
|
|
59
|
-
`),t="",n="";const r=[];for(;s.length>0;){let a=!1;const
|
|
59
|
+
`),t="",n="";const r=[];for(;s.length>0;){let a=!1;const l=[];let c;for(c=0;c<s.length;c++)if(this.rules.other.blockquoteStart.test(s[c]))l.push(s[c]),a=!0;else if(!a)l.push(s[c]);else break;s=s.slice(c);const d=l.join(`
|
|
60
60
|
`),o=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
61
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}
|
|
62
62
|
${d}`:d,n=n?`${n}
|
|
63
|
-
${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,r,!0),this.lexer.state.top=h,s.length===0)break;const f=r.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){const
|
|
63
|
+
${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,r,!0),this.lexer.state.top=h,s.length===0)break;const f=r.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){const m=f,w=m.raw+`
|
|
64
64
|
`+s.join(`
|
|
65
|
-
`),
|
|
65
|
+
`),E=this.blockquote(w);r[r.length-1]=E,t=t.substring(0,t.length-m.raw.length)+E.raw,n=n.substring(0,n.length-m.text.length)+E.text;break}else if(f?.type==="list"){const m=f,w=m.raw+`
|
|
66
66
|
`+s.join(`
|
|
67
|
-
`),
|
|
67
|
+
`),E=this.list(w);r[r.length-1]=E,t=t.substring(0,t.length-f.raw.length)+E.raw,n=n.substring(0,n.length-m.raw.length)+E.raw,s=w.substring(r.at(-1).raw.length).split(`
|
|
68
68
|
`);continue}}return{type:"blockquote",raw:t,tokens:r,text:n}}}list(e){let i=this.rules.block.list.exec(e);if(i){let s=i[1].trim();const t=s.length>1,n={type:"list",raw:"",ordered:t,start:t?+s.slice(0,-1):"",loose:!1,items:[]};s=t?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=t?s:"[*+-]");const r=this.rules.other.listItemRegex(s);let a=!1;for(;e;){let c=!1,d="",o="";if(!(i=r.exec(e))||this.rules.block.hr.test(e))break;d=i[0],e=e.substring(d.length);let h=i[2].split(`
|
|
69
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
70
|
-
`,1)[0],
|
|
71
|
-
`,e=e.substring(f.length+1),c=!0),!c){const
|
|
72
|
-
`,1)[0];let
|
|
73
|
-
`+
|
|
74
|
-
`+f}!
|
|
75
|
-
`,e=e.substring(
|
|
76
|
-
`):[],r={type:"table",raw:i[0],header:[],align:[],rows:[]};if(s.length===t.length){for(const a of t)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<s.length;a++)r.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:r.align[a]});for(const a of n)r.rows.push(
|
|
77
|
-
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){const i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){const i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){const i=this.rules.inline.link.exec(e);if(i){const s=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const r=
|
|
78
|
-
`),this.blockTokens(e,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,i=[],s=!1){for(this.options.pedantic&&(e=e.replace(
|
|
69
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),f=e.split(`
|
|
70
|
+
`,1)[0],m=!h.trim(),w=0;if(this.options.pedantic?(w=2,o=h.trimStart()):m?w=i[1].length+1:(w=i[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,o=h.slice(w),w+=i[1].length),m&&this.rules.other.blankLine.test(f)&&(d+=f+`
|
|
71
|
+
`,e=e.substring(f.length+1),c=!0),!c){const k=this.rules.other.nextBulletRegex(w),g=this.rules.other.hrRegex(w),v=this.rules.other.fencesBeginRegex(w),_=this.rules.other.headingBeginRegex(w),p=this.rules.other.htmlBeginRegex(w);for(;e;){const y=e.split(`
|
|
72
|
+
`,1)[0];let T;if(f=y,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),v.test(f)||_.test(f)||p.test(f)||k.test(f)||g.test(f))break;if(T.search(this.rules.other.nonSpaceChar)>=w||!f.trim())o+=`
|
|
73
|
+
`+T.slice(w);else{if(m||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(h)||_.test(h)||g.test(h))break;o+=`
|
|
74
|
+
`+f}!m&&!f.trim()&&(m=!0),d+=y+`
|
|
75
|
+
`,e=e.substring(y.length+1),h=T.slice(w)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let E=null,b;this.options.gfm&&(E=this.rules.other.listIsTask.exec(o),E&&(b=E[0]!=="[ ] ",o=o.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!E,checked:b,loose:!1,text:o,tokens:[]}),n.raw+=d}const l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){const d=n.items[c].tokens.filter(h=>h.type==="space"),o=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));n.loose=o}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(e){const i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){const i=this.rules.block.def.exec(e);if(i){const s=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:s,raw:i[0],href:t,title:n}}}table(e){const i=this.rules.block.table.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;const s=ps(i[1]),t=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
76
|
+
`):[],r={type:"table",raw:i[0],header:[],align:[],rows:[]};if(s.length===t.length){for(const a of t)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<s.length;a++)r.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:r.align[a]});for(const a of n)r.rows.push(ps(a,r.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[c]})));return r}}lheading(e){const i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){const i=this.rules.block.paragraph.exec(e);if(i){const s=i[1].charAt(i[1].length-1)===`
|
|
77
|
+
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){const i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){const i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){const i=this.rules.inline.link.exec(e);if(i){const s=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const r=bt(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{const r=wr(i[2],"()");if(r===-2)return;if(r>-1){const l=(i[0].indexOf("!")===0?5:4)+i[1].length+r;i[2]=i[2].substring(0,r),i[0]=i[0].substring(0,l).trim(),i[3]=""}}let t=i[2],n="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(t);r&&(t=r[1],n=r[3])}else n=i[3]?i[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?t=t.slice(1):t=t.slice(1,-1)),gs(i,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(e,i){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const t=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=i[t.toLowerCase()];if(!n){const r=s[0].charAt(0);return{type:"text",raw:r,text:r}}return gs(s,n,s[0],this.lexer,this.rules)}}emStrong(e,i,s=""){let t=this.rules.inline.emStrongLDelim.exec(e);if(!t||t[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(t[1]||t[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const r=[...t[0]].length-1;let a,l,c=r,d=0;const o=t[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,i=i.slice(-1*e.length+r);(t=o.exec(i))!=null;){if(a=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!a)continue;if(l=[...a].length,t[3]||t[4]){c+=l;continue}else if((t[5]||t[6])&&r%3&&!((r+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);const h=[...t[0]][0].length,f=e.slice(0,r+t.index+h+l);if(Math.min(r,l)%2){const w=f.slice(1,-1);return{type:"em",raw:f,text:w,tokens:this.lexer.inlineTokens(w)}}const m=f.slice(2,-2);return{type:"strong",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const i=this.rules.inline.code.exec(e);if(i){let s=i[2].replace(this.rules.other.newLineCharGlobal," ");const t=this.rules.other.nonSpaceChar.test(s),n=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return t&&n&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:i[0],text:s}}}br(e){const i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e){const i=this.rules.inline.del.exec(e);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(e){const i=this.rules.inline.autolink.exec(e);if(i){let s,t;return i[2]==="@"?(s=i[1],t="mailto:"+s):(s=i[1],t=s),{type:"link",raw:i[0],text:s,href:t,tokens:[{type:"text",raw:s,text:s}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let s,t;if(i[2]==="@")s=i[0],t="mailto:"+s;else{let n;do n=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(n!==i[0]);s=i[0],i[1]==="www."?t="http://"+i[0]:t=i[0]}return{type:"link",raw:i[0],text:s,href:t,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const i=this.rules.inline.text.exec(e);if(i){const s=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:s}}}}class Xe{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||rt,this.options.tokenizer=this.options.tokenizer||new Nt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:Ye,block:jt.normal,inline:mt.normal};this.options.pedantic?(i.block=jt.pedantic,i.inline=mt.pedantic):this.options.gfm&&(i.block=jt.gfm,this.options.breaks?i.inline=mt.breaks:i.inline=mt.gfm),this.tokenizer.rules=i}static get rules(){return{block:jt,inline:mt}}static lex(e,i){return new Xe(i).lex(e)}static lexInline(e,i){return new Xe(i).inlineTokens(e)}lex(e){e=e.replace(Ye.carriageReturn,`
|
|
78
|
+
`),this.blockTokens(e,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,i=[],s=!1){for(this.options.pedantic&&(e=e.replace(Ye.tabCharGlobal," ").replace(Ye.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(r=>(t=r.call({lexer:this},e,i))?(e=e.substring(t.raw.length),i.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);const r=i.at(-1);t.raw.length===1&&r!==void 0?r.raw+=`
|
|
79
79
|
`:i.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);const r=i.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=`
|
|
80
80
|
`+t.raw,r.text+=`
|
|
81
81
|
`+t.text,this.inlineQueue.at(-1).src=r.text):i.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);const r=i.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=`
|
|
82
82
|
`+t.raw,r.text+=`
|
|
83
|
-
`+t.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),i.push(t);continue}let n=e;if(this.options.extensions?.startBlock){let r=1/0;const a=e.slice(1);let
|
|
83
|
+
`+t.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),i.push(t);continue}let n=e;if(this.options.extensions?.startBlock){let r=1/0;const a=e.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(r=Math.min(r,l))}),r<1/0&&r>=0&&(n=e.substring(0,r+1))}if(this.state.top&&(t=this.tokenizer.paragraph(n))){const r=i.at(-1);s&&r?.type==="paragraph"?(r.raw+=`
|
|
84
84
|
`+t.raw,r.text+=`
|
|
85
85
|
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t),s=n.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);const r=i.at(-1);r?.type==="text"?(r.raw+=`
|
|
86
86
|
`+t.raw,r.text+=`
|
|
87
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){let s=e,t=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let n=!1,r="";for(;e;){n||(r=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,i))?(e=e.substring(a.raw.length),i.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const c=i.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),i.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),i.push(a);continue}let
|
|
88
|
-
`;return t?'<pre><code class="language-'+
|
|
89
|
-
`:"<pre><code>"+(s?n:
|
|
87
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){let s=e,t=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let n=!1,r="";for(;e;){n||(r=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,i))?(e=e.substring(a.raw.length),i.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const c=i.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),i.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),i.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0;const d=e.slice(1);let o;this.options.extensions.startInline.forEach(h=>{o=h.call({lexer:this},d),typeof o=="number"&&o>=0&&(c=Math.min(c,o))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),n=!0;const c=i.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return i}}class Dt{options;parser;constructor(e){this.options=e||rt}space(e){return""}code({text:e,lang:i,escaped:s}){const t=(i||"").match(Ye.notSpaceStart)?.[0],n=e.replace(Ye.endingNewline,"")+`
|
|
88
|
+
`;return t?'<pre><code class="language-'+Ke(t)+'">'+(s?n:Ke(n,!0))+`</code></pre>
|
|
89
|
+
`:"<pre><code>"+(s?n:Ke(n,!0))+`</code></pre>
|
|
90
90
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
91
91
|
${this.parser.parse(e)}</blockquote>
|
|
92
92
|
`}html({text:e}){return e}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
|
93
93
|
`}hr(e){return`<hr>
|
|
94
|
-
`}list(e){const i=e.ordered,s=e.start;let t="";for(let a=0;a<e.items.length;a++){const
|
|
94
|
+
`}list(e){const i=e.ordered,s=e.start;let t="";for(let a=0;a<e.items.length;a++){const l=e.items[a];t+=this.listitem(l)}const n=i?"ol":"ul",r=i&&s!==1?' start="'+s+'"':"";return"<"+n+r+`>
|
|
95
95
|
`+t+"</"+n+`>
|
|
96
|
-
`}listitem(e){let i="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+
|
|
96
|
+
`}listitem(e){let i="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+Ke(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):i+=s+" "}return i+=this.parser.parse(e.tokens,!!e.loose),`<li>${i}</li>
|
|
97
97
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
98
98
|
`}table(e){let i="",s="";for(let n=0;n<e.header.length;n++)s+=this.tablecell(e.header[n]);i+=this.tablerow({text:s});let t="";for(let n=0;n<e.rows.length;n++){const r=e.rows[n];s="";for(let a=0;a<r.length;a++)s+=this.tablecell(r[a]);t+=this.tablerow({text:s})}return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
99
99
|
<thead>
|
|
@@ -102,13 +102,13 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
102
102
|
`}tablerow({text:e}){return`<tr>
|
|
103
103
|
${e}</tr>
|
|
104
104
|
`}tablecell(e){const i=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+i+`</${s}>
|
|
105
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
106
|
-
`+this.renderer.text(a);i?s+=this.renderer.paragraph({type:"paragraph",raw:
|
|
107
|
-
Please report this to https://github.com/markedjs/marked.`,e){const t="<p>An error occurred:</p><pre>"+
|
|
105
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ke(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:s}){const t=this.parser.parseInline(s),n=fs(e);if(n===null)return t;e=n;let r='<a href="'+e+'"';return i&&(r+=' title="'+Ke(i)+'"'),r+=">"+t+"</a>",r}image({href:e,title:i,text:s,tokens:t}){t&&(s=this.parser.parseInline(t,this.parser.textRenderer));const n=fs(e);if(n===null)return Ke(s);e=n;let r=`<img src="${e}" alt="${s}"`;return i&&(r+=` title="${Ke(i)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ke(e.text)}}class _i{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Je{options;renderer;textRenderer;constructor(e){this.options=e||rt,this.options.renderer=this.options.renderer||new Dt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _i}static parse(e,i){return new Je(i).parse(e)}static parseInline(e,i){return new Je(i).parseInline(e)}parse(e,i=!0){let s="";for(let t=0;t<e.length;t++){const n=e[t];if(this.options.extensions?.renderers?.[n.type]){const a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){s+=l||"";continue}}const r=n;switch(r.type){case"space":{s+=this.renderer.space(r);continue}case"hr":{s+=this.renderer.hr(r);continue}case"heading":{s+=this.renderer.heading(r);continue}case"code":{s+=this.renderer.code(r);continue}case"table":{s+=this.renderer.table(r);continue}case"blockquote":{s+=this.renderer.blockquote(r);continue}case"list":{s+=this.renderer.list(r);continue}case"html":{s+=this.renderer.html(r);continue}case"paragraph":{s+=this.renderer.paragraph(r);continue}case"text":{let a=r,l=this.renderer.text(a);for(;t+1<e.length&&e[t+1].type==="text";)a=e[++t],l+=`
|
|
106
|
+
`+this.renderer.text(a);i?s+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):s+=l;continue}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,i=this.renderer){let s="";for(let t=0;t<e.length;t++){const n=e[t];if(this.options.extensions?.renderers?.[n.type]){const a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}const r=n;switch(r.type){case"escape":{s+=i.text(r);break}case"html":{s+=i.html(r);break}case"link":{s+=i.link(r);break}case"image":{s+=i.image(r);break}case"strong":{s+=i.strong(r);break}case"em":{s+=i.em(r);break}case"codespan":{s+=i.codespan(r);break}case"br":{s+=i.br(r);break}case"del":{s+=i.del(r);break}case"text":{s+=i.text(r);break}default:{const a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}}class Pt{options;block;constructor(e){this.options=e||rt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Xe.lex:Xe.lexInline}provideParser(){return this.block?Je.parse:Je.parseInline}}class kr{defaults=pi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Je;Renderer=Dt;TextRenderer=_i;Lexer=Xe;Tokenizer=Nt;Hooks=Pt;constructor(...e){this.use(...e)}walkTokens(e,i){let s=[];for(const t of e)switch(s=s.concat(i.call(this,t)),t.type){case"table":{const n=t;for(const r of n.header)s=s.concat(this.walkTokens(r.tokens,i));for(const r of n.rows)for(const a of r)s=s.concat(this.walkTokens(a.tokens,i));break}case"list":{const n=t;s=s.concat(this.walkTokens(n.items,i));break}default:{const n=t;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(r=>{const a=n[r].flat(1/0);s=s.concat(this.walkTokens(a,i))}):n.tokens&&(s=s.concat(this.walkTokens(n.tokens,i)))}}return s}use(...e){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const t={...s};if(t.async=this.defaults.async||t.async||!1,s.extensions&&(s.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const r=i.renderers[n.name];r?i.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:i.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=i[n.level];r?r.unshift(n.tokenizer):i[n.level]=[n.tokenizer],n.start&&(n.level==="block"?i.startBlock?i.startBlock.push(n.start):i.startBlock=[n.start]:n.level==="inline"&&(i.startInline?i.startInline.push(n.start):i.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(i.childTokens[n.name]=n.childTokens)}),t.extensions=i),s.renderer){const n=this.defaults.renderer||new Dt(this.defaults);for(const r in s.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=s.renderer[a],c=n[a];n[a]=(...d)=>{let o=l.apply(n,d);return o===!1&&(o=c.apply(n,d)),o||""}}t.renderer=n}if(s.tokenizer){const n=this.defaults.tokenizer||new Nt(this.defaults);for(const r in s.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=s.tokenizer[a],c=n[a];n[a]=(...d)=>{let o=l.apply(n,d);return o===!1&&(o=c.apply(n,d)),o}}t.tokenizer=n}if(s.hooks){const n=this.defaults.hooks||new Pt;for(const r in s.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const a=r,l=s.hooks[a],c=n[a];Pt.passThroughHooks.has(r)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(n,d)).then(h=>c.call(n,h));const o=l.call(n,d);return c.call(n,o)}:n[a]=(...d)=>{let o=l.apply(n,d);return o===!1&&(o=c.apply(n,d)),o}}t.hooks=n}if(s.walkTokens){const n=this.defaults.walkTokens,r=s.walkTokens;t.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...t}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,i){return Xe.lex(e,i??this.defaults)}parser(e,i){return Je.parse(e,i??this.defaults)}parseMarkdown(e){return(s,t)=>{const n={...t},r={...this.defaults,...n},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const l=r.hooks?r.hooks.provideLexer():e?Xe.lex:Xe.lexInline,c=r.hooks?r.hooks.provideParser():e?Je.parse:Je.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(s):s).then(d=>l(d,r)).then(d=>r.hooks?r.hooks.processAllTokens(d):d).then(d=>r.walkTokens?Promise.all(this.walkTokens(d,r.walkTokens)).then(()=>d):d).then(d=>c(d,r)).then(d=>r.hooks?r.hooks.postprocess(d):d).catch(a);try{r.hooks&&(s=r.hooks.preprocess(s));let d=l(s,r);r.hooks&&(d=r.hooks.processAllTokens(d)),r.walkTokens&&this.walkTokens(d,r.walkTokens);let o=c(d,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(d){return a(d)}}}onError(e,i){return s=>{if(s.message+=`
|
|
107
|
+
Please report this to https://github.com/markedjs/marked.`,e){const t="<p>An error occurred:</p><pre>"+Ke(s.message+"",!0)+"</pre>";return i?Promise.resolve(t):t}if(i)return Promise.reject(s);throw s}}}const at=new kr;function me(u,e){return at.parse(u,e)}me.options=me.setOptions=function(u){return at.setOptions(u),me.defaults=at.defaults,es(me.defaults),me},me.getDefaults=pi,me.defaults=rt,me.use=function(...u){return at.use(...u),me.defaults=at.defaults,es(me.defaults),me},me.walkTokens=function(u,e){return at.walkTokens(u,e)},me.parseInline=at.parseInline,me.Parser=Je,me.parser=Je.parse,me.Renderer=Dt,me.TextRenderer=_i,me.Lexer=Xe,me.lexer=Xe.lex,me.Tokenizer=Nt,me.Hooks=Pt,me.parse=me,me.options,me.setOptions,me.use,me.walkTokens,me.parseInline,Je.parse,Xe.lex;class _r{constructor(e={},i){const s={lang:[]};this.builder=i,this.opts=Object.assign({},s,e)}async checkIntent(e,i,s){let t="You are an assistant",n="",r=`This is the user's request:
|
|
108
108
|
|
|
109
|
-
${e}`,a,
|
|
109
|
+
${e}`,a,l,c;if(s.image&&i==="openai")return r+=`
|
|
110
110
|
Extract some information.
|
|
111
|
-
`,a=[{name:"check_request",description:"Check request and extract information.",parameters:{type:"object",properties:{prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},size:{type:"string",description:"Choose specified size: auto, 1024x1024, 1536x1024, 1024x1536"},quality:{type:"string",description:"Choose: auto, low, medium, high"},background:{type:"string",description:"Choose: auto, transparent, opaque"},output_format:{type:"string",description:"Choose: png, jpeg, webp"}},required:[]}}],
|
|
111
|
+
`,a=[{name:"check_request",description:"Check request and extract information.",parameters:{type:"object",properties:{prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},size:{type:"string",description:"Choose specified size: auto, 1024x1024, 1536x1024, 1024x1536"},quality:{type:"string",description:"Choose: auto, low, medium, high"},background:{type:"string",description:"Choose: auto, transparent, opaque"},output_format:{type:"string",description:"Choose: png, jpeg, webp"}},required:[]}}],l=await this.builder.send(r,n,t,"",a),l?(c=JSON.parse(l),c):!1;if(s.image){if(r+=`
|
|
112
112
|
|
|
113
113
|
Check the type of the request:
|
|
114
114
|
- Text/Prompt to Image Generation
|
|
@@ -124,148 +124,148 @@ Check the type of the request:
|
|
|
124
124
|
- Edit Area in Image
|
|
125
125
|
- Generate Variation of an Image
|
|
126
126
|
- Describe an image or ask questions about the image
|
|
127
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_image_generation:{type:"boolean",description:"Check if the request asks to create or generate an image based on the prompt."},text_to_2d_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a 2D illustration based on the prompt."},text_to_digital_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a digital illustration based on the prompt."},text_to_book_cover_generation:{type:"boolean",description:"Check if the request asks to create or generate a book cover based on the prompt."},upscale_image:{type:"boolean",description:"Check if the request asks to upscale or enlarge an image."},minimize_image:{type:"boolean",description:"Check if the request asks to minimize (compress) the size of an image."},edit_area_in_image:{type:"boolean",description:"Check if the request asks to edit an image."},describe_image:{type:"boolean",description:"Check if the request is asking to describe an image or asking questions about the image."}},required:[]}}],
|
|
127
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_image_generation:{type:"boolean",description:"Check if the request asks to create or generate an image based on the prompt."},text_to_2d_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a 2D illustration based on the prompt."},text_to_digital_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a digital illustration based on the prompt."},text_to_book_cover_generation:{type:"boolean",description:"Check if the request asks to create or generate a book cover based on the prompt."},upscale_image:{type:"boolean",description:"Check if the request asks to upscale or enlarge an image."},minimize_image:{type:"boolean",description:"Check if the request asks to minimize (compress) the size of an image."},edit_area_in_image:{type:"boolean",description:"Check if the request asks to edit an image."},describe_image:{type:"boolean",description:"Check if the request is asking to describe an image or asking questions about the image."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}else if(s.video){if(r+=`
|
|
128
128
|
|
|
129
129
|
Check the type of the request:
|
|
130
130
|
- Image to Video Generation (generate a video based on image)
|
|
131
131
|
- Prompt/text to Video Generation (generate a video based on prompt)
|
|
132
132
|
- Upscale video
|
|
133
133
|
- Add sound to video
|
|
134
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{image_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on image, not prompt."},text_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on prompt, not image."}},required:[]}}],
|
|
134
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{image_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on image, not prompt."},text_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on prompt, not image."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}else if(s.audio){if(r+=`
|
|
135
135
|
|
|
136
136
|
Check the type of the request:
|
|
137
137
|
- Prompt/text to Audio Generation (generate sound or audio based on prompt)
|
|
138
138
|
- Text to Speech (generate speech from text)
|
|
139
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_speech:{type:"boolean",description:"heck if the request is asking to generate speech from text."}},required:[]}}],
|
|
139
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_speech:{type:"boolean",description:"heck if the request is asking to generate speech from text."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}return this.builder.settings.consoleLog&&console.log(c),this.extractInfo(c,i,e)}async extractInfo(e,i,s){const t=this.builder.settings.defaultModels;if(e.text_to_image_generation){const n="You are an assistant",a=`
|
|
140
140
|
Thie is the list of models:
|
|
141
141
|
- ${t.text_to_image_generation[i].join(`
|
|
142
142
|
- `)}
|
|
143
|
-
`,
|
|
143
|
+
`,l=`This is user's request:
|
|
144
144
|
|
|
145
145
|
${s}
|
|
146
146
|
|
|
147
147
|
Check the request and return the details.
|
|
148
|
-
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},width:{type:"number",description:"Return image width to generate, only if specified."},height:{type:"number",description:"Return image height to generate, only if specified."},aspect_ratio:{type:"string",description:"Return the aspect ration, only if specified. Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
148
|
+
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},width:{type:"number",description:"Return image width to generate, only if specified."},height:{type:"number",description:"Return image height to generate, only if specified."},aspect_ratio:{type:"string",description:"Return the aspect ration, only if specified. Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.image_to_video_generation){const n="You are an assistant",a=`
|
|
149
149
|
Thie is the list of models:
|
|
150
150
|
- ${t.image_to_video_generation[i].join(`
|
|
151
151
|
- `)}
|
|
152
|
-
`,
|
|
152
|
+
`,l=`This is user's request:
|
|
153
153
|
|
|
154
154
|
${s}
|
|
155
155
|
|
|
156
156
|
Check the request and return the details.
|
|
157
|
-
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},duration:{type:"number",description:"Return duration of the video to generate."}},required:[]}}],d=await this.builder.send(
|
|
157
|
+
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},duration:{type:"number",description:"Return duration of the video to generate."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_video_generation){const n="You are an assistant",a=`
|
|
158
158
|
Thie is the list of models:
|
|
159
159
|
- ${t.text_to_video_generation[i].join(`
|
|
160
160
|
- `)}
|
|
161
|
-
`;let
|
|
161
|
+
`;let l=`This is user's request:
|
|
162
162
|
|
|
163
163
|
${s}
|
|
164
164
|
|
|
165
165
|
Check the request and return the details.
|
|
166
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},duration:{type:"number",description:"Return duration of the video to generate. If not explicitely specified, return 5"}},required:[]}}],d=await this.builder.send(
|
|
166
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},duration:{type:"number",description:"Return duration of the video to generate. If not explicitely specified, return 5"}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.minimize_image){let n="You are an assistant",r="",a=`This is user's request:
|
|
167
167
|
|
|
168
168
|
${s}
|
|
169
169
|
|
|
170
170
|
Check the request and return the details.
|
|
171
|
-
`,
|
|
171
|
+
`,l=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:["image_url"]}}],c=await this.builder.send(a,r,n,"",l);if(!c)return!1;let d=JSON.parse(c);return{...e,...d}}else if(e.upscale_image){const n="You are an assistant",a=`
|
|
172
172
|
Thie is the list of models:
|
|
173
173
|
- ${t.upscale_image[i].join(`
|
|
174
174
|
- `)}
|
|
175
|
-
`;let
|
|
175
|
+
`;let l=`This is user's request:
|
|
176
176
|
|
|
177
177
|
${s}
|
|
178
178
|
|
|
179
179
|
Check the request and return the details.
|
|
180
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:[]}}],d=await this.builder.send(
|
|
180
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.describe_image){const n="You are an assistant",a=`
|
|
181
181
|
Thie is the list of models:
|
|
182
182
|
- ${t.describe_image[i].join(`
|
|
183
183
|
- `)}
|
|
184
|
-
`;let
|
|
184
|
+
`;let l=`This is user's request:
|
|
185
185
|
|
|
186
186
|
${s}
|
|
187
187
|
|
|
188
188
|
Check the request and return the details.
|
|
189
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."}},required:["image_url","prompt"]}}],d=await this.builder.send(
|
|
189
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."}},required:["image_url","prompt"]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.edit_area_in_image){const n="You are an assistant",r=t.edit_area_in_image[i];let a="";r&&(a=`
|
|
190
190
|
Thie is the list of models:
|
|
191
191
|
- ${r.join(`
|
|
192
192
|
- `)}
|
|
193
|
-
`);let
|
|
193
|
+
`);let l=`This is user's request:
|
|
194
194
|
|
|
195
195
|
${s}
|
|
196
196
|
|
|
197
197
|
Check the request and return the details.
|
|
198
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},num_images:{type:"number",description:"The number of images to generate."}},required:[]}}],d=await this.builder.send(
|
|
198
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},num_images:{type:"number",description:"The number of images to generate."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_2d_illustration_generation){const n="You are an assistant",a=`
|
|
199
199
|
Thie is the list of models:
|
|
200
200
|
- ${t.text_to_2d_illustration_generation[i].join(`
|
|
201
201
|
- `)}
|
|
202
|
-
`;let
|
|
202
|
+
`;let l=`This is user's request:
|
|
203
203
|
|
|
204
204
|
${s}
|
|
205
205
|
|
|
206
206
|
Check the request and return the details.
|
|
207
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
207
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_digital_illustration_generation){const n="You are an assistant",a=`
|
|
208
208
|
Thie is the list of models:
|
|
209
209
|
- ${t.text_to_digital_illustration_generation[i].join(`
|
|
210
210
|
- `)}
|
|
211
|
-
`;let
|
|
211
|
+
`;let l=`This is user's request:
|
|
212
212
|
|
|
213
213
|
${s}
|
|
214
214
|
|
|
215
215
|
Check the request and return the details.
|
|
216
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
216
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_book_cover_generation){const n="You are an assistant",a=`
|
|
217
217
|
Thie is the list of models:
|
|
218
218
|
- ${t.text_to_book_cover_generation[i].join(`
|
|
219
219
|
- `)}
|
|
220
|
-
`;let
|
|
220
|
+
`;let l=`This is user's request:
|
|
221
221
|
|
|
222
222
|
${s}
|
|
223
223
|
|
|
224
224
|
Check the request and return the details.
|
|
225
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration/cover"'},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
225
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration/cover"'},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_speech){const n="You are an assistant",a=`
|
|
226
226
|
Thie is the list of models:
|
|
227
227
|
- ${t.text_to_speech[i].join(`
|
|
228
228
|
- `)}
|
|
229
|
-
`;let
|
|
229
|
+
`;let l=`This is user's request:
|
|
230
230
|
|
|
231
231
|
${s}
|
|
232
232
|
|
|
233
233
|
Check the request and return the details.
|
|
234
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},text:{type:"string",description:"Return text or prompt to convert to speech."},voice:{type:"string",description:"Return the voice reference to use."},speed:{type:"string",description:"Return the speed."}},required:["text"]}}],d=await this.builder.send(
|
|
234
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},text:{type:"string",description:"Return text or prompt to convert to speech."},voice:{type:"string",description:"Return the voice reference to use."},speed:{type:"string",description:"Return the speed."}},required:["text"]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}return!1}async checkModel(e){let i="You are an assistant",s="",t=`This is the information:
|
|
235
235
|
|
|
236
236
|
${e}
|
|
237
237
|
|
|
238
238
|
Check the information and return the details.
|
|
239
|
-
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let
|
|
239
|
+
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let l={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Fal,{signal:this.builder.mediaSignal,method:"POST",headers:l,body:JSON.stringify(e)});let c=await n.text();try{r=JSON.parse(c)}catch{return{mediaGenerated:!1,status:"error",message:c}}if(this.builder.output.push(r),r.error)return this.builder.settings.consoleLog&&console.log(r.error),{mediaGenerated:!1,status:"error",message:r.error};{const d=r.data;let o="",h="",f,m=!1,w=[],E=[];return d.entries&&d.entries.forEach(b=>{f=b.url.split(".").pop().toLowerCase(),f==="mp4"?(o+=`
|
|
240
240
|
<p class="responsive-video">
|
|
241
241
|
<video controls>
|
|
242
|
-
<source src="${
|
|
242
|
+
<source src="${b.url}" type="video/mp4">
|
|
243
243
|
Your browser does not support the video tag.
|
|
244
244
|
</video>
|
|
245
245
|
</p>
|
|
246
|
-
`,h+=``):f==="wav"||f==="mp3"?(o+=`
|
|
247
247
|
<p class="responsive-audio">
|
|
248
248
|
<audio controls>
|
|
249
|
-
<source src="${
|
|
249
|
+
<source src="${b.url}" type="audio/mpeg">
|
|
250
250
|
Your browser does not support the audio tag.
|
|
251
251
|
</audio>
|
|
252
252
|
</p>
|
|
253
|
-
`,h+=``):(o+=`
|
|
254
254
|
<div>
|
|
255
|
-
<img src="${
|
|
255
|
+
<img src="${b.url}" />
|
|
256
256
|
<div>
|
|
257
|
-
<a class="link-view" href="${
|
|
258
|
-
<a class="link-download" href="${
|
|
257
|
+
<a class="link-view" href="${b.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
258
|
+
<a class="link-download" href="${b.url}" download>${this.out("Download")}</a>
|
|
259
259
|
</div>
|
|
260
260
|
</div>
|
|
261
|
-
`,h+=``,m=!0),w.push(b.url),E.push(b.file_url)}),m&&(o=`<div class="image-container">${o}</div>`),typeof d=="string"&&(o=d,h=d),t?(s.innerHTML="",s.remove()):(s.innerHTML=o,this.builder.outputHtml+=`<div class="result-container">${o}</div>`),{mediaGenerated:!0,status:"success",markdown:h,output:w,output2:E}}}async waitingResultReplicate(e,i,s,t){let n,r;e.request_id=i;let a=this.builder.settings.replicateStatusEndpoint;a=a.replace("{REQUEST_ID}",i),e.endpoint=a;let l={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Replicate,{signal:this.builder.mediaSignal,method:"POST",headers:l,body:JSON.stringify(e)});let c=await n.text();try{r=JSON.parse(c)}catch{return{mediaGenerated:!1,status:"error",message:c}}if(this.builder.output.push(r),r.error)return this.builder.settings.consoleLog&&console.log(r.error),{mediaGenerated:!1,status:"error",message:r.error};{const d=r.data;let o=this.renderResult(d,s,t);return{mediaGenerated:!0,status:"success",markdown:o.markdown,output:o.output,output2:o.output2}}}async waitingReplicate(e,i,s,t){let n,r,a,l=e.model,c=this.builder.settings.replicateStatusEndpoint;c=c.replace("{REQUEST_ID}",i);let d={"Content-Type":"application/json",...this.builder.settings.headers},o={model:l,endpoint:c,request_id:i};do{if(r=await fetch(this.builder.settings.checkRequestStatusUrl_Replicate,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(o)}),a=await r.json(),a.ok&&(n=a.data.status),!n)return{mediaGenerated:!1,status:"error",result:a,message:a.error||a.data&&JSON.stringify(a.data)||this.out("Request failed.")};n==="succeeded"||n==="failed"||n==="canceled"||(this.builder.settings.consoleLog&&console.log(n),await new Promise(h=>setTimeout(h,5e3)))}while(!(n==="succeeded"||n==="failed"||n==="canceled"));return n==="succeeded"?await this.waitingResultReplicate(e,i,s,t):{mediaGenerated:!1,status:"error",result:a,message:a.data&&a.data.error||this.out("Request failed.")}}async waitingFal(e,i,s,t){let n,r,a,l=e.model;const c=this.getEndpoint(l,i,this.builder.settings.falStatusEndpoint);let d={"Content-Type":"application/json",...this.builder.settings.headers},o={model:l,endpoint:c,request_id:i};do{if(r=await fetch(this.builder.settings.checkRequestStatusUrl_Fal,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(o)}),a=await r.json(),a.ok&&a.status)n=a.status;else if(a.data){let h=a.data;h.image||h.audio||h.audio_file||h.video?n="COMPLETED":h.detail&&typeof h.detail=="string"&&h.detail.startsWith("Request is still in progress")?n="IN_PROGRESS":h.status&&!h.error&&(n=h.status)}if(!n)return{mediaGenerated:!1,status:"error",result:a,message:a.error||a.data&&JSON.stringify(a.data)||this.out("Request failed.")};n!=="COMPLETED"&&(this.builder.settings.consoleLog&&console.log(n),this.builder.settings.consoleLog&&console.log(a),await new Promise(h=>setTimeout(h,5e3)))}while(n!=="COMPLETED");if(n==="COMPLETED")return await this.waitingResultFal(e,i,s,t)}renderResult(e,i,s){let t="",n="",r=[],a=[];if(e.entries){let l,c=!1;e.entries.forEach(d=>{l=d.url.split(".").pop().toLowerCase(),l==="mp4"?(t+=`
|
|
262
262
|
<p class="responsive-video">
|
|
263
263
|
<video controls>
|
|
264
264
|
<source src="${d.url}" type="video/mp4">
|
|
265
265
|
Your browser does not support the video tag.
|
|
266
266
|
</video>
|
|
267
267
|
</p>
|
|
268
|
-
`,n+=``,r.push(d.url),a.push(d.file_url)):
|
|
268
|
+
`,n+=``,r.push(d.url),a.push(d.file_url)):l==="wav"||l==="mp3"?(t+=`
|
|
269
269
|
<p class="responsive-audio">
|
|
270
270
|
<audio controls>
|
|
271
271
|
<source src="${d.url}" type="audio/mpeg">
|
|
@@ -283,22 +283,22 @@ Check the information and return the details.
|
|
|
283
283
|
`,n+=``,r.push(d.url),a.push(d.file_url),c=!0)}),c&&(t=`<div class="image-container">${t}</div>`)}else typeof e=="string"&&(t=`
|
|
284
284
|
<p>
|
|
285
285
|
${e}
|
|
286
|
-
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let u=this.validateModel(e.model,r,"text_to_image_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.aspect_ratio||"16:9",o=e.num_images||1;o>4&&(o=4),t={prompt:c,aspect_ratio:d,num_outputs:o},n.model=u,n.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let u=this.validateModel(e.model,o,"edit_area_in_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o,!0);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url],v=h[e.image_url+"_mask"];if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Image mask not found.")};t={prompt:c,image:f,mask:v},n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let u=this.validateModel(e.model,r,"text_to_digital_illustration_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.width||1280,o=e.height||768;e.num_images,t={prompt:c,size:`${d}x${o}`,style:"digital_illustration"},n.model=u,n.customData=this.builder.settings.customData}else if(e.upscale_image){let u=this.validateModel(e.model,d,"upscale_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let d="replicate";const o=await this.builder.upload.getInputURLs(d);if(o.error)return{mediaGenerated:!1,status:"error",message:o.error};let h=o[e.image_url];if(!h)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:h},n.model=u,n.customData=this.builder.settings.customData}else if(e.describe_image){let u=this.validateModel(e.model,o,"describe_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:f,prompt:`${c}. No talk. Answer only.`},n.model=u,n.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let u=this.validateModel(e.model,o,"image_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt||"stunning video",d=e.duration||5;d>10&&(d=5);let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};u==="kwaivgi/kling-v1.6-pro"&&(t={start_image:f,prompt:c,duration:d}),u==="kwaivgi/kling-v1.6-standard"&&(t={start_image:f,prompt:c,duration:d}),u==="minimax/video-01-live"&&(t={first_frame_image:f,prompt:c}),u==="luma/ray"&&(t={start_image_url:f,prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let u=this.validateModel(e.model,r,"text_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.duration||5;d>10&&(d=5),u==="kwaivgi/kling-v1.6-standard"&&(t={prompt:c,duration:d}),u==="minimax/video-01"&&(t={prompt:c}),u==="luma/ray"&&(t={prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_speech){let u=this.validateModel(e.model,r,"text_to_speech");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};t={text:e.text,voice:e.voice||"af_nicole",speed:parseFloat(e.speed)||1},n.model=u,n.customData=this.builder.settings.customData}if(n.model.indexOf(":")!==-1){const c=n.model.split(":")[1];n.version=c;let d=this.builder.settings.replicateEndpoint1;n.endpoint=d,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 1")}else{let u=this.builder.settings.replicateEndpoint2;u=u.replace("{MODEL}",n.model),n.endpoint=u,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 2")}this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);let a=!1;if(this.builder.settings.generateMediaUrl_Replicate&&(a=!0),a){let u=this.builder.settings.generateMediaUrl_Replicate;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(n)})).json();if(h.ok){if(c=h.data.id,!c)return{mediaGenerated:!1,status:"error",message:h.data&&h.data.detail}}else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingReplicate(n,c,i,s);return this.builder.isMediaGenerating=!1,f}else{let u=this.builder.settings.generateMediaUrl;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl.")};let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(n)})).json();if(this.builder.isMediaGenerating=!1,o.error)return this.builder.settings.consoleLog&&console.log(o.error),{mediaGenerated:!1,status:"error",message:o.error};{const h=o.data;let f=this.renderResult(h,i,s);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}}}async generateOpenAI(e,i,s){let t,n={},a=this.validateModel(e.model,"openai","image_generation"),u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};const c=new FormData;c.append("customData",JSON.stringify(this.builder.settings.customData)),c.append("model",a),c.append("prompt",u);let d=!1,o=this.builder.getFormValues();for(const b of o){if(b.value instanceof FileList&&b.type==="multifile"){const k=b.value;if(k.length>0)for(const C of k)c.append("file[]",C),d=!0}if(b.value instanceof FileList&&b.type==="file"){const k=b.value;if(k.length>0){const C=k[0];c.append("file[]",C),d=!0}}if(typeof b.value=="string"&&b.value.indexOf("base64")!==-1){let k=b.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/,"");c.append("mask",k)}}if(this.builder.selectedFiles&&this.builder.selectedFiles.length>0)for(let b=0;b<this.builder.selectedFiles.length;b++){const k=this.builder.selectedFiles[b];c.append("file[]",k),d=!0}let h,f=e.size||"auto",v=e.quality||"auto",S=e.num_images||1;if(d){c.append("size",f),c.append("n",S),c.append("quality",v),t={prompt:u,size:f,quality:v,n:S},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n);let b=this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;h=await fetch(b,{method:"POST",body:c})}else{let b=e.background||"auto",k=e.output_format||"png";t={prompt:u,background:b,output_format:k,size:f,quality:v,n:S},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const C=this.builder.settings.generateMediaUrl_OpenAI_CreateImage;let g={"Content-Type":"application/json",...this.builder.settings.headers};h=await fetch(C,{signal:this.builder.mediaSignal,method:"POST",headers:g,body:JSON.stringify(n)})}const R=await h.json();this.builder.settings.consoleLog&&console.log(R),this.builder.isMediaGenerating=!1;const y=R.data;this.builder.output.push(R);let E=this.renderResult(y,i,s);return{mediaGenerated:!0,status:"success",markdown:E.markdown,output:E.output,output2:E.output2}}async generateGoogle(e,i,s){let t,n={},a=this.validateModel(e.model,"google","edit_area_in_image");if(!a)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let c=[];c.push({text:u});let d=this.builder.getFormValues();if(!(d&&Object.keys(d).length===0)){for(const y of d)if(y.value instanceof FileList&&y.type==="multifile"){const E=y.value;if(E.length>0)for(const b of E){const k=await new Promise((C,g)=>{const w=new FileReader;w.onload=q=>{const V=q.target.result.split(",")[1];C(V)},w.onerror=g,w.readAsDataURL(b)});c.push({inlineData:{mimeType:"image/png",data:k}})}}}t={contents:c},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const o=this.builder.settings.generateMediaUrl_Google;let h={"Content-Type":"application/json",...this.builder.settings.headers};const v=await(await fetch(o,{signal:this.builder.mediaSignal,method:"POST",headers:h,body:JSON.stringify(n)})).json();this.builder.settings.consoleLog&&console.log(v),this.builder.isMediaGenerating=!1;const S=v.data;let R=this.renderResult(S,i,s);return{mediaGenerated:!0,status:"success",markdown:R.markdown,output:R.output,output2:R.output2}}async generateFal(e,i,s){let t="fal",n,r={};if(e.text_to_image_generation){let v=this.validateModel(e.model,t,"text_to_image_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.aspect_ratio,b=e.num_images||1;if(b>4&&(b=4),E){let{w:se,h:re}=this.getDimension(E);R=se,y=re}let k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W});let Q=await(async()=>{let se=[],re=this.builder.getFormValues();for(const ae of re)if(ae.value instanceof FileList&&ae.type==="multifile"){const de=ae.value;if(de.length>0){let ue=0;for(const Se of de){ue++;const Ie=new FormData;Ie.append("file",Se),Ie.append("customData",this.builder.settings.customData);let Ae=this.builder.settings.uploadMediaUrl_Fal;const Ee=await(await fetch(Ae,{method:"POST",body:Ie})).json();if(Ee.ok){const be=Ee.url;se.push(be),this.builder.filesUploaded["file_"+ue]=be}}}}return se})();n={prompt:S,image_size:{width:R,height:y},num_images:b},v.indexOf("gemini")!==-1&&(n={prompt:S,input_image_urls:Q}),v==="fal-ai/ideogram/v2a"&&(E=this.getClosestAspectRatio(R,y),n={prompt:S,aspect_ratio:E,num_images:b}),v.indexOf("recraft")!==-1&&(n={prompt:S,image_size:{width:R,height:y},num_images:b,colors:N}),r.model=v,r.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let v=this.validateModel(e.model,t,"edit_area_in_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url],b=y[e.image_url+"_mask"];if(n={image_url:E,mask_url:b,prompt:S},r.model=v,!b){n={image_url:E,prompt:S};let k=this.validateModel(e.model,t,"edit_image");r.model=k}r.customData=this.builder.settings.customData}else if(e.text_to_2d_illustration_generation){let v=this.validateModel(e.model,t,"text_to_2d_illustration_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.num_images||1;E>4&&(E=4);let b=e.style||"any",k=e.style_id||this.builder.settings._2dIllustrationStyleId,C=e.color1_red,g=e.color1_green,w=e.color1_blue,q=e.color2_red,V=e.color2_green,I=e.color2_blue,F=e.color3_red,G=e.color3_green,B=e.color3_blue,M=e.color4_red,_=e.color4_green,L=e.color4_blue,P=e.color5_red,W=e.color5_green,N=e.color5_blue,J=[];C&&g&&w&&!(C==="0"&&g==="0"&&w==="0")&&J.push({r:C,g,b:w}),q&&V&&I&&!(q==="0"&&V==="0"&&I==="0")&&J.push({r:q,g:V,b:I}),F&&G&&B&&!(F==="0"&&G==="0"&&B==="0")&&J.push({r:F,g:G,b:B}),M&&_&&L&&!(M==="0"&&_==="0"&&L==="0")&&J.push({r:M,g:_,b:L}),P&&W&&N&&!(P==="0"&&W==="0"&&N==="0")&&J.push({r:P,g:W,b:N}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,style_id:k,colors:J},r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let v=this.validateModel(e.model,t,"text_to_digital_illustration_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.num_images||1;E>4&&(E=4);let b=e.style||"digital_illustration",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,colors:N},r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_book_cover_generation){let v=this.validateModel(e.model,t,"text_to_book_cover_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1024,y=e.height||1365,E=e.num_images||1;E>4&&(E=1);let b="digital_illustration/cover",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,colors:N},r.model=v,r.customData=this.builder.settings.customData}else if(e.upscale_image){let v=this.validateModel(e.model,t,"upscale_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const R=await this.builder.upload.getInputURLs(t);if(R.error)return{mediaGenerated:!1,status:"error",message:R.error};let y=R[e.image_url];if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:y,upscale_factor:2},r.model=v,r.customData=this.builder.settings.customData}else if(e.describe_image){let v=this.validateModel(e.model,t,"describe_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url];if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:E,prompt:`${S}. No talk. Answer only.`},r.model=v,r.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let v=this.validateModel(e.model,t,"image_to_video_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;S=e.prompt||"stunning video";let R=e.duration||5;R>10&&(R=5);const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url];if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};n={prompt:S,image_url:E,duration:R,aspect_ratio:"16:9"},v.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let v=this.validateModel(e.model,t,"text_to_video_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.duration||5;R>10&&(R=5),n={prompt:S,duration:R,aspect_ratio:"16:9"},v.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_speech){let v=this.validateModel(e.model,t,"text_to_speech");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};n={text:e.text,voice:e.voice||"Matilda"},r.model=v,r.customData=this.builder.settings.customData}let a=`https://queue.fal.run/${r.model}`;r.endpoint=a,r.payload=n,this.builder.payloads.push(r),this.builder.settings.consoleLog&&console.log(r);let u=this.builder.settings.generateMediaUrl_Fal;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Fal.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(r)})).json();if(h.ok)c=h.request_id;else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingFal(r,c,i,s);return this.builder.isMediaGenerating=!1,f}validateModel(e,i,s){const n=this.builder.settings.defaultModels[s][i];return this.builder.settings.modelFallback?n.length===1?(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0]):e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):n.length>=1?(this.builder.settings.consoleLog&&console.log("Use default: "+n[0]),n[0]):!1:e?e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):!1:(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0])}async generate_GoogleMediaByJSON(e,i,s,t){this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let n;if(e.trim().startsWith("{"))try{n=JSON.parse(e)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}let r=i.trim();if(!r)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let a={};a.model=r,a.customData=this.builder.settings.customData,a.payload=n,this.builder.payloads.push(a),this.builder.settings.consoleLog&&console.log(a);const u=this.builder.settings.generateMediaUrl_Google;let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(a)})).json();this.builder.settings.consoleLog&&console.log(o);const h=o.data;let f=this.renderResult(h,s,t);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}async uploadMultiple(){let e=[],i=this.builder.getFormValues();for(const s of i)if(s.value instanceof FileList&&s.type==="multifile"){const t={};if(t.name=s.name,t.files=[],this.builder.selectedFiles&&this.builder.selectedFiles.length>0){const r=[];for(let a=0;a<this.builder.selectedFiles.length;a++){const u=this.builder.selectedFiles[a],c=new FormData;c.append("file",u),c.append("customData",this.builder.settings.customData);let d=this.builder.settings.uploadMediaUrl_Fal;const h=await(await fetch(d,{method:"POST",body:c})).json();if(h.ok){const f=h.url;t.files.push(f),this.builder.filesUploaded["file_"+a]=f}r.push(t)}return r}const n=s.value;if(n.length>0){let r=0;for(const a of n){r++;const u=new FormData;u.append("file",a),u.append("customData",this.builder.settings.customData);let c=this.builder.settings.uploadMediaUrl_Fal;const o=await(await fetch(c,{method:"POST",body:u})).json();if(o.ok){const h=o.url;t.files.push(h),this.builder.filesUploaded["file_"+r]=h}}}e.push(t)}return e}async generate(e,i,s,t,n,r,a){if(s=s||this.builder.settings.defaultMediaGenerationProvider,s==="google"&&e.trim().startsWith("{"))return this.generate_GoogleMediaByJSON(e,i,r,a);this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let u,c=!1,d;if(e.trim().startsWith("{"))try{d=JSON.parse(e),d&&typeof d=="object"&&(c=!0)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}if(c){let o=i.trim();if(!o)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let h=await this.uploadMultiple();((y,E)=>{const b=k=>{if(Array.isArray(k)){const C=k[0],g=E.find(w=>w.name===C);if(g&&k.every(w=>w===C))return g.files;for(let w=0;w<k.length;w++)k[w]=b(k[w])}else if(typeof k=="object"&&k!==null)for(let C in k)k[C]=b(k[C]);return k};return b(y)})(d,h),s||(o.startsWith("fal")?s="fal":s="replicate");const v=y=>typeof y=="object"&&y!==null&&!Array.isArray(y),S=await this.builder.upload.getInputURLs(s);if(S.error)return{mediaGenerated:!1,status:"error",message:S.error};Object.keys(d).forEach(y=>{Object.keys(S).forEach(E=>{if(d[y]===E){let b=S[E];d[y]=b}if(Array.isArray(d[y])){for(let b=0;b<d[y].length;b++)if(d[y][b]===E){let k=S[E];d[y][b]=k}}})}),Object.keys(d).forEach(y=>{let E=d[y];if(v(E))for(const b in E)Object.prototype.hasOwnProperty.call(E,b)&&Object.keys(S).forEach(k=>{if(E[b]===k){let C=S[k];E[b]=C,k===C&&!C.startsWith("http")&&(E[b]="")}});if(Array.isArray(E)){for(let b=0;b<E.length;b++)if(v(E[b]))for(const k in E[b])Object.prototype.hasOwnProperty.call(E[b],k)&&Object.keys(S).forEach(C=>{if(E[b][k]===C){let g=S[C];E[b][k]=g,C===g&&!g.startsWith("http")&&(E[b][k]="")}});d[y]=[...E.filter(b=>b!=="")]}});let R={};if(R.model=o,R.customData=this.builder.settings.customData,s==="replicate"&&o.indexOf(":")!==-1){const y=o.split(":");R.version=y[1]}if(s==="replicate")if(o.indexOf(":")!==-1){let y=this.builder.settings.replicateEndpoint1;R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 1")}else{let y=this.builder.settings.replicateEndpoint2;y=y.replace("{MODEL}",R.model),R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 2")}else if(s==="fal"){let y=`https://queue.fal.run/${R.model}`;R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD")}return this.builder.payloads.push(R),this.builder.settings.consoleLog&&console.log(R),this.generateMediaByJSON(R,s,r,a)}try{if(u=await this.checkIntent(e,s,n),this.builder.settings.consoleLog&&console.log(u),!u)return{mediaGenerated:!1,status:"aborted",message:this.out("Request aborted.")};if(u.minimize_image){if(!u.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const h=await this.builder.upload.getInputURLs();if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let v={image_url:h[u.image_url]||u.image_url,customData:this.builder.settings.customData};this.builder.payloads.push(v),this.builder.settings.consoleLog&&console.log(v);let S={"Content-Type":"application/json",...this.builder.settings.headers};const y=await(await fetch(this.builder.settings.minimizeImageUrl,{signal:this.builder.mediaSignal,method:"POST",headers:S,body:JSON.stringify(v)})).json();if(this.builder.output.push(y),y.error)return this.builder.settings.consoleLog&&console.log(y.error),this.builder.isMediaGenerating=!1,{mediaGenerated:!1,status:"error",message:y.error};{const E=y.url,b=`
|
|
286
|
+
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let l=this.validateModel(e.model,r,"text_to_image_generation");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.aspect_ratio||"16:9",o=e.num_images||1;o>4&&(o=4),t={prompt:c,aspect_ratio:d,num_outputs:o},n.model=l,n.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let l=this.validateModel(e.model,o,"edit_area_in_image");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o,!0);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url],m=h[e.image_url+"_mask"];if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Image mask not found.")};t={prompt:c,image:f,mask:m},n.model=l,n.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let l=this.validateModel(e.model,r,"text_to_digital_illustration_generation");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.width||1280,o=e.height||768;e.num_images,t={prompt:c,size:`${d}x${o}`,style:"digital_illustration"},n.model=l,n.customData=this.builder.settings.customData}else if(e.upscale_image){let l=this.validateModel(e.model,d,"upscale_image");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let d="replicate";const o=await this.builder.upload.getInputURLs(d);if(o.error)return{mediaGenerated:!1,status:"error",message:o.error};let h=o[e.image_url];if(!h)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:h},n.model=l,n.customData=this.builder.settings.customData}else if(e.describe_image){let l=this.validateModel(e.model,o,"describe_image");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:f,prompt:`${c}. No talk. Answer only.`},n.model=l,n.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let l=this.validateModel(e.model,o,"image_to_video_generation");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt||"stunning video",d=e.duration||5;d>10&&(d=5);let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};l==="kwaivgi/kling-v1.6-pro"&&(t={start_image:f,prompt:c,duration:d}),l==="kwaivgi/kling-v1.6-standard"&&(t={start_image:f,prompt:c,duration:d}),l==="minimax/video-01-live"&&(t={first_frame_image:f,prompt:c}),l==="luma/ray"&&(t={start_image_url:f,prompt:c}),n.model=l,n.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let l=this.validateModel(e.model,r,"text_to_video_generation");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.duration||5;d>10&&(d=5),l==="kwaivgi/kling-v1.6-standard"&&(t={prompt:c,duration:d}),l==="minimax/video-01"&&(t={prompt:c}),l==="luma/ray"&&(t={prompt:c}),n.model=l,n.customData=this.builder.settings.customData}else if(e.text_to_speech){let l=this.validateModel(e.model,r,"text_to_speech");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};t={text:e.text,voice:e.voice||"af_nicole",speed:parseFloat(e.speed)||1},n.model=l,n.customData=this.builder.settings.customData}if(n.model.indexOf(":")!==-1){const c=n.model.split(":")[1];n.version=c;let d=this.builder.settings.replicateEndpoint1;n.endpoint=d,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 1")}else{let l=this.builder.settings.replicateEndpoint2;l=l.replace("{MODEL}",n.model),n.endpoint=l,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 2")}this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);let a=!1;if(this.builder.settings.generateMediaUrl_Replicate&&(a=!0),a){let l=this.builder.settings.generateMediaUrl_Replicate;if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(l,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(n)})).json();if(h.ok){if(c=h.data.id,!c)return{mediaGenerated:!1,status:"error",message:h.data&&h.data.detail}}else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingReplicate(n,c,i,s);return this.builder.isMediaGenerating=!1,f}else{let l=this.builder.settings.generateMediaUrl;if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl.")};let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(l,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(n)})).json();if(this.builder.isMediaGenerating=!1,o.error)return this.builder.settings.consoleLog&&console.log(o.error),{mediaGenerated:!1,status:"error",message:o.error};{const h=o.data;let f=this.renderResult(h,i,s);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}}}async generateOpenAI(e,i,s){let t,n={},a=this.validateModel(e.model,"openai","image_generation"),l=e.prompt;if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};const c=new FormData;c.append("customData",JSON.stringify(this.builder.settings.customData)),c.append("model",a),c.append("prompt",l);let d=!1,o=this.builder.getFormValues();for(const g of o){if(g.value instanceof FileList&&g.type==="multifile"){const v=g.value;if(v.length>0)for(const _ of v)c.append("file[]",_),d=!0}if(g.value instanceof FileList&&g.type==="file"){const v=g.value;if(v.length>0){const _=v[0];c.append("file[]",_),d=!0}}if(typeof g.value=="string"&&g.value.indexOf("base64")!==-1){let v=g.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/,"");c.append("mask",v)}}if(this.builder.selectedFiles&&this.builder.selectedFiles.length>0)for(let g=0;g<this.builder.selectedFiles.length;g++){const v=this.builder.selectedFiles[g];c.append("file[]",v),d=!0}let h,f=e.size||"auto",m=e.quality||"auto",w=e.num_images||1;if(d){c.append("size",f),c.append("n",w),c.append("quality",m),t={prompt:l,size:f,quality:m,n:w},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n);let g=this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;h=await fetch(g,{method:"POST",body:c})}else{let g=e.background||"auto",v=e.output_format||"png";t={prompt:l,background:g,output_format:v,size:f,quality:m,n:w},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const _=this.builder.settings.generateMediaUrl_OpenAI_CreateImage;let p={"Content-Type":"application/json",...this.builder.settings.headers};h=await fetch(_,{signal:this.builder.mediaSignal,method:"POST",headers:p,body:JSON.stringify(n)})}const E=await h.json();this.builder.settings.consoleLog&&console.log(E),this.builder.isMediaGenerating=!1;const b=E.data;this.builder.output.push(E);let k=this.renderResult(b,i,s);return{mediaGenerated:!0,status:"success",markdown:k.markdown,output:k.output,output2:k.output2}}async generateGoogle(e,i,s){let t,n={},a=this.validateModel(e.model,"google","edit_area_in_image");if(!a)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let l=e.prompt;if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let c=[];c.push({text:l});let d=this.builder.getFormValues();if(!(d&&Object.keys(d).length===0)){for(const b of d)if(b.value instanceof FileList&&b.type==="multifile"){const k=b.value;if(k.length>0)for(const g of k){const v=await new Promise((_,p)=>{const y=new FileReader;y.onload=T=>{const M=T.target.result.split(",")[1];_(M)},y.onerror=p,y.readAsDataURL(g)});c.push({inlineData:{mimeType:"image/png",data:v}})}}}t={contents:c},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const o=this.builder.settings.generateMediaUrl_Google;let h={"Content-Type":"application/json",...this.builder.settings.headers};const m=await(await fetch(o,{signal:this.builder.mediaSignal,method:"POST",headers:h,body:JSON.stringify(n)})).json();this.builder.settings.consoleLog&&console.log(m),this.builder.isMediaGenerating=!1;const w=m.data;let E=this.renderResult(w,i,s);return{mediaGenerated:!0,status:"success",markdown:E.markdown,output:E.output,output2:E.output2}}async generateFal(e,i,s){let t="fal",n,r={};if(e.text_to_image_generation){let m=this.validateModel(e.model,t,"text_to_image_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let E=e.width||1280,b=e.height||768,k=e.aspect_ratio,g=e.num_images||1;if(g>4&&(g=4),k){let{w:Y,h:G}=this.getDimension(k);E=Y,b=G}let v=e.color1_red,_=e.color1_green,p=e.color1_blue,y=e.color2_red,T=e.color2_green,M=e.color2_blue,q=e.color3_red,D=e.color3_green,$=e.color3_blue,j=e.color4_red,O=e.color4_green,x=e.color4_blue,S=e.color5_red,A=e.color5_green,N=e.color5_blue,L=[];v&&_&&p&&!(v==="0"&&_==="0"&&p==="0")&&L.push({r:v,g:_,b:p}),y&&T&&M&&!(y==="0"&&T==="0"&&M==="0")&&L.push({r:y,g:T,b:M}),q&&D&&$&&!(q==="0"&&D==="0"&&$==="0")&&L.push({r:q,g:D,b:$}),j&&O&&x&&!(j==="0"&&O==="0"&&x==="0")&&L.push({r:j,g:O,b:x}),S&&A&&N&&!(S==="0"&&A==="0"&&N==="0")&&L.push({r:S,g:A,b:N});let U=await(async()=>{let Y=[],G=this.builder.getFormValues();for(const K of G)if(K.value instanceof FileList&&K.type==="multifile"){const ie=K.value;if(ie.length>0){let ee=0;for(const be of ie){ee++;const Ae=new FormData;Ae.append("file",be),Ae.append("customData",this.builder.settings.customData);let ke=this.builder.settings.uploadMediaUrl_Fal;const Se=await(await fetch(ke,{method:"POST",body:Ae})).json();if(Se.ok){const ue=Se.url;Y.push(ue),this.builder.filesUploaded["file_"+ee]=ue}}}}return Y})();n={prompt:w,image_size:{width:E,height:b},num_images:g},m.indexOf("gemini")!==-1&&(n={prompt:w,input_image_urls:U}),m==="fal-ai/ideogram/v2a"&&(k=this.getClosestAspectRatio(E,b),n={prompt:w,aspect_ratio:k,num_images:g}),m.indexOf("recraft")!==-1&&(n={prompt:w,image_size:{width:E,height:b},num_images:g,colors:L}),r.model=m,r.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let m=this.validateModel(e.model,t,"edit_area_in_image");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const b=await this.builder.upload.getInputURLs(t);if(b.error)return{mediaGenerated:!1,status:"error",message:b.error};let k=b[e.image_url],g=b[e.image_url+"_mask"];if(n={image_url:k,mask_url:g,prompt:w},r.model=m,!g){n={image_url:k,prompt:w};let v=this.validateModel(e.model,t,"edit_image");r.model=v}r.customData=this.builder.settings.customData}else if(e.text_to_2d_illustration_generation){let m=this.validateModel(e.model,t,"text_to_2d_illustration_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let E=e.width||1280,b=e.height||768,k=e.num_images||1;k>4&&(k=4);let g=e.style||"any",v=e.style_id||this.builder.settings._2dIllustrationStyleId,_=e.color1_red,p=e.color1_green,y=e.color1_blue,T=e.color2_red,M=e.color2_green,q=e.color2_blue,D=e.color3_red,$=e.color3_green,j=e.color3_blue,O=e.color4_red,x=e.color4_green,S=e.color4_blue,A=e.color5_red,N=e.color5_green,L=e.color5_blue,V=[];_&&p&&y&&!(_==="0"&&p==="0"&&y==="0")&&V.push({r:_,g:p,b:y}),T&&M&&q&&!(T==="0"&&M==="0"&&q==="0")&&V.push({r:T,g:M,b:q}),D&&$&&j&&!(D==="0"&&$==="0"&&j==="0")&&V.push({r:D,g:$,b:j}),O&&x&&S&&!(O==="0"&&x==="0"&&S==="0")&&V.push({r:O,g:x,b:S}),A&&N&&L&&!(A==="0"&&N==="0"&&L==="0")&&V.push({r:A,g:N,b:L}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:g,style_id:v,colors:V},r.model=m,r.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let m=this.validateModel(e.model,t,"text_to_digital_illustration_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let E=e.width||1280,b=e.height||768,k=e.num_images||1;k>4&&(k=4);let g=e.style||"digital_illustration",v=e.color1_red,_=e.color1_green,p=e.color1_blue,y=e.color2_red,T=e.color2_green,M=e.color2_blue,q=e.color3_red,D=e.color3_green,$=e.color3_blue,j=e.color4_red,O=e.color4_green,x=e.color4_blue,S=e.color5_red,A=e.color5_green,N=e.color5_blue,L=[];v&&_&&p&&!(v==="0"&&_==="0"&&p==="0")&&L.push({r:v,g:_,b:p}),y&&T&&M&&!(y==="0"&&T==="0"&&M==="0")&&L.push({r:y,g:T,b:M}),q&&D&&$&&!(q==="0"&&D==="0"&&$==="0")&&L.push({r:q,g:D,b:$}),j&&O&&x&&!(j==="0"&&O==="0"&&x==="0")&&L.push({r:j,g:O,b:x}),S&&A&&N&&!(S==="0"&&A==="0"&&N==="0")&&L.push({r:S,g:A,b:N}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:g,colors:L},r.model=m,r.customData=this.builder.settings.customData}else if(e.text_to_book_cover_generation){let m=this.validateModel(e.model,t,"text_to_book_cover_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let E=e.width||1024,b=e.height||1365,k=e.num_images||1;k>4&&(k=1);let g="digital_illustration/cover",v=e.color1_red,_=e.color1_green,p=e.color1_blue,y=e.color2_red,T=e.color2_green,M=e.color2_blue,q=e.color3_red,D=e.color3_green,$=e.color3_blue,j=e.color4_red,O=e.color4_green,x=e.color4_blue,S=e.color5_red,A=e.color5_green,N=e.color5_blue,L=[];v&&_&&p&&!(v==="0"&&_==="0"&&p==="0")&&L.push({r:v,g:_,b:p}),y&&T&&M&&!(y==="0"&&T==="0"&&M==="0")&&L.push({r:y,g:T,b:M}),q&&D&&$&&!(q==="0"&&D==="0"&&$==="0")&&L.push({r:q,g:D,b:$}),j&&O&&x&&!(j==="0"&&O==="0"&&x==="0")&&L.push({r:j,g:O,b:x}),S&&A&&N&&!(S==="0"&&A==="0"&&N==="0")&&L.push({r:S,g:A,b:N}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:g,colors:L},r.model=m,r.customData=this.builder.settings.customData}else if(e.upscale_image){let m=this.validateModel(e.model,t,"upscale_image");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const E=await this.builder.upload.getInputURLs(t);if(E.error)return{mediaGenerated:!1,status:"error",message:E.error};let b=E[e.image_url];if(!b)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:b,upscale_factor:2},r.model=m,r.customData=this.builder.settings.customData}else if(e.describe_image){let m=this.validateModel(e.model,t,"describe_image");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const b=await this.builder.upload.getInputURLs(t);if(b.error)return{mediaGenerated:!1,status:"error",message:b.error};let k=b[e.image_url];if(!k)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:k,prompt:`${w}. No talk. Answer only.`},r.model=m,r.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let m=this.validateModel(e.model,t,"image_to_video_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;w=e.prompt||"stunning video";let E=e.duration||5;E>10&&(E=5);const b=await this.builder.upload.getInputURLs(t);if(b.error)return{mediaGenerated:!1,status:"error",message:b.error};let k=b[e.image_url];if(!k)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};n={prompt:w,image_url:k,duration:E,aspect_ratio:"16:9"},m.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=m,r.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let m=this.validateModel(e.model,t,"text_to_video_generation");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let w=e.prompt;if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let E=e.duration||5;E>10&&(E=5),n={prompt:w,duration:E,aspect_ratio:"16:9"},m.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=m,r.customData=this.builder.settings.customData}else if(e.text_to_speech){let m=this.validateModel(e.model,t,"text_to_speech");if(!m)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};n={text:e.text,voice:e.voice||"Matilda"},r.model=m,r.customData=this.builder.settings.customData}let a=`https://queue.fal.run/${r.model}`;r.endpoint=a,r.payload=n,this.builder.payloads.push(r),this.builder.settings.consoleLog&&console.log(r);let l=this.builder.settings.generateMediaUrl_Fal;if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Fal.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(l,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(r)})).json();if(h.ok)c=h.request_id;else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingFal(r,c,i,s);return this.builder.isMediaGenerating=!1,f}validateModel(e,i,s){const n=this.builder.settings.defaultModels[s][i];return this.builder.settings.modelFallback?n.length===1?(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0]):e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):n.length>=1?(this.builder.settings.consoleLog&&console.log("Use default: "+n[0]),n[0]):!1:e?e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):!1:(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0])}async generate_GoogleMediaByJSON(e,i,s,t){this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let n;if(e.trim().startsWith("{"))try{n=JSON.parse(e)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}let r=i.trim();if(!r)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let a={};a.model=r,a.customData=this.builder.settings.customData,a.payload=n,this.builder.payloads.push(a),this.builder.settings.consoleLog&&console.log(a);const l=this.builder.settings.generateMediaUrl_Google;let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(l,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(a)})).json();this.builder.settings.consoleLog&&console.log(o);const h=o.data;let f=this.renderResult(h,s,t);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}async uploadMultiple(){let e=[],i=this.builder.getFormValues();for(const s of i)if(s.value instanceof FileList&&s.type==="multifile"){const t={};if(t.name=s.name,t.files=[],this.builder.selectedFiles&&this.builder.selectedFiles.length>0){const r=[];for(let a=0;a<this.builder.selectedFiles.length;a++){const l=this.builder.selectedFiles[a],c=new FormData;c.append("file",l),c.append("customData",this.builder.settings.customData);let d=this.builder.settings.uploadMediaUrl_Fal;const h=await(await fetch(d,{method:"POST",body:c})).json();if(h.ok){const f=h.url;t.files.push(f),this.builder.filesUploaded["file_"+a]=f}r.push(t)}return r}const n=s.value;if(n.length>0){let r=0;for(const a of n){r++;const l=new FormData;l.append("file",a),l.append("customData",this.builder.settings.customData);let c=this.builder.settings.uploadMediaUrl_Fal;const o=await(await fetch(c,{method:"POST",body:l})).json();if(o.ok){const h=o.url;t.files.push(h),this.builder.filesUploaded["file_"+r]=h}}}e.push(t)}return e}async generate(e,i,s,t,n,r,a){if(s=s||this.builder.settings.defaultMediaGenerationProvider,s==="google"&&e.trim().startsWith("{"))return this.generate_GoogleMediaByJSON(e,i,r,a);this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let l,c=!1,d;if(e.trim().startsWith("{"))try{d=JSON.parse(e),d&&typeof d=="object"&&(c=!0)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}if(c){let o=i.trim();if(!o)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let h=await this.uploadMultiple();((b,k)=>{const g=v=>{if(Array.isArray(v)){const _=v[0],p=k.find(y=>y.name===_);if(p&&v.every(y=>y===_))return p.files;for(let y=0;y<v.length;y++)v[y]=g(v[y])}else if(typeof v=="object"&&v!==null)for(let _ in v)v[_]=g(v[_]);return v};return g(b)})(d,h),s||(o.startsWith("fal")?s="fal":s="replicate");const m=b=>typeof b=="object"&&b!==null&&!Array.isArray(b),w=await this.builder.upload.getInputURLs(s);if(w.error)return{mediaGenerated:!1,status:"error",message:w.error};Object.keys(d).forEach(b=>{Object.keys(w).forEach(k=>{if(d[b]===k){let g=w[k];d[b]=g}if(Array.isArray(d[b])){for(let g=0;g<d[b].length;g++)if(d[b][g]===k){let v=w[k];d[b][g]=v}}})}),Object.keys(d).forEach(b=>{let k=d[b];if(m(k))for(const g in k)Object.prototype.hasOwnProperty.call(k,g)&&Object.keys(w).forEach(v=>{if(k[g]===v){let _=w[v];k[g]=_,v===_&&!_.startsWith("http")&&(k[g]="")}});if(Array.isArray(k)){for(let g=0;g<k.length;g++)if(m(k[g]))for(const v in k[g])Object.prototype.hasOwnProperty.call(k[g],v)&&Object.keys(w).forEach(_=>{if(k[g][v]===_){let p=w[_];k[g][v]=p,_===p&&!p.startsWith("http")&&(k[g][v]="")}});d[b]=[...k.filter(g=>g!=="")]}});let E={};if(E.model=o,E.customData=this.builder.settings.customData,s==="replicate"&&o.indexOf(":")!==-1){const b=o.split(":");E.version=b[1]}if(s==="replicate")if(o.indexOf(":")!==-1){let b=this.builder.settings.replicateEndpoint1;E.endpoint=b,E.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 1")}else{let b=this.builder.settings.replicateEndpoint2;b=b.replace("{MODEL}",E.model),E.endpoint=b,E.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 2")}else if(s==="fal"){let b=`https://queue.fal.run/${E.model}`;E.endpoint=b,E.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD")}return this.builder.payloads.push(E),this.builder.settings.consoleLog&&console.log(E),this.generateMediaByJSON(E,s,r,a)}try{if(l=await this.checkIntent(e,s,n),this.builder.settings.consoleLog&&console.log(l),!l)return{mediaGenerated:!1,status:"aborted",message:this.out("Request aborted.")};if(l.minimize_image){if(!l.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const h=await this.builder.upload.getInputURLs();if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let m={image_url:h[l.image_url]||l.image_url,customData:this.builder.settings.customData};this.builder.payloads.push(m),this.builder.settings.consoleLog&&console.log(m);let w={"Content-Type":"application/json",...this.builder.settings.headers};const b=await(await fetch(this.builder.settings.minimizeImageUrl,{signal:this.builder.mediaSignal,method:"POST",headers:w,body:JSON.stringify(m)})).json();if(this.builder.output.push(b),b.error)return this.builder.settings.consoleLog&&console.log(b.error),this.builder.isMediaGenerating=!1,{mediaGenerated:!1,status:"error",message:b.error};{const k=b.url,g=`
|
|
287
287
|
<div class="image-container">
|
|
288
288
|
<div>
|
|
289
|
-
<img src="${
|
|
289
|
+
<img src="${k}" />
|
|
290
290
|
<div>
|
|
291
|
-
<a class="link-view" href="${
|
|
292
|
-
<a class="link-download" href="${
|
|
291
|
+
<a class="link-view" href="${k}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
292
|
+
<a class="link-download" href="${k}" download>${this.out("Download")}</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
</div>`;let
|
|
295
|
+
</div>`;let v=``;return a?(r.innerHTML="",r.remove()):(r.innerHTML=g,this.builder.outputHtml+=`<div class="result-container">${g}</div>`),this.builder.isMediaGenerating=!1,{mediaGenerated:!0,status:"success",markdown:v,output:[k]}}}else{if(s==="fal")return this.generateFal(l,r,a);if(s==="replicate")return this.generateReplicate(l,r,a);if(s==="google")return this.generateGoogle(l,r,a);if(s==="openai")return this.generateOpenAI(l,r,a)}}catch(o){return this.builder.settings.consoleLog&&console.log(o),this.builder.isMediaGenerating=!1,o.name==="AbortError"?{mediaGenerated:!1,status:"aborted",message:this.out("Request aborted.")}:{mediaGenerated:!1,status:"error",message:this.out("Request failed.")}}return this.builder.isMediaGenerating=!1,{mediaGenerated:!1,status:"error",message:this.out("Request failed.")}}async generateMediaByJSON(e,i,s,t){let n,r=!1;if(i==="replicate"&&this.builder.settings.generateMediaUrl){if(n=this.builder.settings.generateMediaUrl,!n)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl.")}}else if(i==="replicate"&&this.builder.settings.generateMediaUrl_Replicate){if(n=this.builder.settings.generateMediaUrl_Replicate,!n)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Replicate.")};r=!0}else if(i==="fal"&&(n=this.builder.settings.generateMediaUrl_Fal,!n))return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Fal.")};let a={"Content-Type":"application/json",...this.builder.settings.headers};const c=await(await fetch(n,{signal:this.builder.mediaSignal,method:"POST",headers:a,body:JSON.stringify(e)})).json();if(this.builder.isMediaGenerating=!1,i==="fal"){let d=c.request_id;return this.waitingFal(e,d,s,t)}if(c.error)return this.builder.settings.consoleLog&&console.log(c.error),{mediaGenerated:!1,status:"error",message:c.error};if(r){let d;if(c.ok){if(d=c.data.id,!d)return{mediaGenerated:!1,status:"error",message:c.data&&c.data.detail}}else return{mediaGenerated:!1,status:"error",message:c.error};return this.waitingReplicate(e,d,s,t)}else{const d=c.data;let o=this.renderResult(d,s,t);return{mediaGenerated:!0,status:"success",markdown:o.markdown,output:o.output,output2:o.output2}}}getClosestAspectRatio(e,i){if(i===0)return"3:2";const s=e/i,t=[{aspect:"10:16",ratio:10/16},{aspect:"16:10",ratio:16/10},{aspect:"9:16",ratio:9/16},{aspect:"16:9",ratio:16/9},{aspect:"4:3",ratio:4/3},{aspect:"3:4",ratio:3/4},{aspect:"1:1",ratio:1},{aspect:"1:3",ratio:1/3},{aspect:"3:1",ratio:3},{aspect:"3:2",ratio:3/2},{aspect:"2:3",ratio:2/3}];let n=t[0],r=Math.abs(s-t[0].ratio);for(let a=1;a<t.length;a++){const l=Math.abs(s-t[a].ratio);l<r&&(r=l,n=t[a])}return n.aspect}out(e){if(this.opts.lang){let i=this.opts.lang[e];return i||e}else return e}}class Sr{constructor(e={},i){const s={lang:[]};this.builder=i,this.opts=Object.assign({},s,e)}async getInputURLs(e){let i=this.builder.getFormValues();const s=this.builder.filesUploaded;if(Object.keys(s).length!==0)return s;for(const t of i)if(t.value instanceof FileList){let n=await this.processMediaInput(t.name,e),r=n.url;t.name===n.url&&(r=""),s[t.name]=r}else{if(t.name.indexOf("_mask")!==-1){let n=await this.processMaskInput(t.name,e);if(n.error)return{error:n.error};{let r=n.url;s[t.name]=r}}if(t.name.indexOf("__url")!==-1){let n;this.builder.settings.isBuilder?n=document.querySelector(this.builder.settings.previewSelector):n=this.builder.element;const r=n.querySelector(`input[name="${t.name}"]`);if(r){const a=r.value;s[t.name]=a}}}return Object.keys(s).forEach(t=>{if(t.endsWith("__url")){const n=t.replace("__url","");Object.prototype.hasOwnProperty.call(s,n)&&(s[n]=s[t]),delete s[t]}}),s}async processMaskInput(e,i){let s;if(this.builder.settings.isBuilder){if(!this.builder.settings.previewSelector)return{error:this.out("previewSelector not set.")};s=document.querySelector(this.builder.settings.previewSelector)}else s=this.builder.element;const t=s.querySelector(`input[type="hidden"][name="${e}"]`);if(!t)return{error:this.out("Unable to perform the request.")};if(t.value==="")return{error:this.out("Please brush the area you want to edit.")};let n=t.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/,"");if(n==="")return{error:this.out("Please brush over the areas to remove objects before continuing.")};let r,a=this.builder.getId(),l={image:n,filename:`${e}_${a}.png`,customData:this.builder.settings.customData},c;i==="replicate"?c=this.builder.settings.uploadBase64Url:i==="fal"?c=this.builder.settings.uploadBase64Url_Fal:c=this.builder.settings.uploadBase64Url_Fal||this.builder.settings.uploadBase64Url;let d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(c,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(l)})).json();return h.ok&&(r=h.url),r?{url:r}:{error:this.out("Upload mask failed.")}}async processMediaInput(e,i){if(!e)return!1;let s;if(!this.isFullUrl(e)){let r=e;s=this.getFileInput(r)||this.getFileInput()}let t="",n;if(this.builder.photoBlob[e]){let r=this.builder.getId();const a=new FormData;a.append("file",this.builder.photoBlob[e],`photo_${r}.jpg`),a.append("customData",this.builder.settings.customData);let l;i==="replicate"?l=this.builder.settings.uploadMediaUrl:i==="fal"?l=this.builder.settings.uploadMediaUrl_Fal:l=this.builder.settings.uploadMediaUrl_Fal||this.builder.settings.uploadMediaUrl;const d=await(await fetch(l,{method:"POST",body:a})).json();return d.ok?(n=d.url,t=d.filename,{filename:t,url:n}):{error:this.out("Upload file failed.")}}if(this.builder.selectedFiles&&this.builder.selectedFiles.length>0){const r=new FormData;r.append("file",this.builder.selectedFiles[0]),r.append("customData",this.builder.settings.customData);let a;i==="replicate"?a=this.builder.settings.uploadMediaUrl:i==="fal"?a=this.builder.settings.uploadMediaUrl_Fal:a=this.builder.settings.uploadMediaUrl_Fal||this.builder.settings.uploadMediaUrl;const c=await(await fetch(a,{method:"POST",body:r})).json();return c.ok?(n=c.url,t=c.filename,{filename:t,url:n}):{error:this.out("Upload file failed.")}}if(s){const r=s.files[0];if(r){t=r.name;const a=new FormData;a.append("file",r),a.append("customData",this.builder.settings.customData);let l;i==="replicate"?l=this.builder.settings.uploadMediaUrl:i==="fal"?l=this.builder.settings.uploadMediaUrl_Fal:l=this.builder.settings.uploadMediaUrl_Fal||this.builder.settings.uploadMediaUrl;const d=await(await fetch(l,{method:"POST",body:a})).json();if(d.ok)n=d.url,t=d.filename;else return{error:this.out("Upload file failed.")}}else n=e}else n=e;return{filename:t,url:n}}getFileInput(e){let i;if(this.builder.settings.isBuilder){if(!this.builder.settings.previewSelector)return console.log("previewSelector not set."),null;i=document.querySelector(this.builder.settings.previewSelector)}else i=this.builder.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}isFullUrl(e){return e.indexOf("/")!==-1}out(e){if(this.opts.lang){let i=this.opts.lang[e];return i||e}else return e}}class Tr{constructor(e,i={}){const s={lang:[]};this.settings=Object.assign({},s,i),this.empty=!0,this.element=e,this.init()}loadUrl(e){const i=this.element.querySelector("img");i.src=e,this.loaded()}loadImage(e){if(e){const i=new FileReader;i.onload=s=>{this.element.querySelector("img").setAttribute("src",s.target.result)},i.readAsDataURL(e)}}setImage(e){if(e){const i=this.element.querySelector("img");i.src=e}}clearImage(){this.element.style.display=""}out(e){let i=this.settings.lang[e];return i||e}init(){const e=this.element;e.className="imagemask-wrapper";const i=document.createElement("div");i.className="imagemask-overlay",e.appendChild(i);const s=document.createElement("button");s.className="btn-close-imagemask",s.title=this.out("Close"),s.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
296
296
|
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"
|
|
297
297
|
stroke-linejoin="round" class="icon-close">
|
|
298
298
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
|
299
299
|
<path d="M18 6l-12 12" /><path d="M6 6l12 12" />
|
|
300
300
|
</svg>`,e.appendChild(s);const t=document.createElement("div");t.className="imagemask-body",e.appendChild(t);const n=document.createElement("div");n.className="imagemask-container",t.appendChild(n);const r=document.createElement("div");r.className="imagemask-controls",t.appendChild(r);const a=document.createElement("label");r.appendChild(a),a.innerHTML=`${this.out("Brush Size")}:
|
|
301
|
-
<input type="range" class="brush-size" min="5" max="100" value="30">`;const
|
|
301
|
+
<input type="range" class="brush-size" min="5" max="100" value="30">`;const l=a.querySelector(".brush-size"),c=document.createElement("button");c.className="btn-undobrush",c.title=this.out("Undo"),c.innerHTML=`
|
|
302
302
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
303
303
|
class="icon-undo">
|
|
304
304
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
@@ -325,10 +325,10 @@ Check the information and return the details.
|
|
|
325
325
|
<path d="M8 20l-4 0l0 -4" /><path d="M4 20l6 -6" />
|
|
326
326
|
<path d="M16 20l4 0l0 -4" /><path d="M14 14l6 6" />
|
|
327
327
|
<path d="M8 4l-4 0l0 4" /><path d="M4 4l6 6" />
|
|
328
|
-
</svg>`,r.appendChild(h);const f=document.createElement("input");f.type="hidden",f.name=this.settings.name,f.className="inp-imagemask",f.value="",t.appendChild(f);const v=document.createElement("canvas");v.className="imagemask";const S=v.getContext("2d",{willReadFrequently:!0}),R=document.createElement("canvas"),y=R.getContext("2d",{willReadFrequently:!0}),E=this.element.querySelector(".inp-imagemask"),b=N=>{const J=document.createElement("canvas"),Q=J.getContext("2d",{willReadFrequently:!0});J.width=N.width,J.height=N.height,Q.clearRect(0,0,N.width,N.height),Q.fillStyle="black",Q.fillRect(0,0,N.width,N.height),Q.drawImage(N,0,0);const se=J.toDataURL("image/png");let re=document.querySelector(".imagemask-output");re||(re=document.createElement("img"),re.className="imagemask-output",document.body.appendChild(re)),re.src=se,this.empty||(E.value=se)};let k=[],C=[];const g=()=>{k.push(R.toDataURL()),k.length>10&&k.shift(),C=[]},w=N=>{const J=new Image;J.src=N,J.onload=()=>{S.clearRect(0,0,v.width,v.height),S.drawImage(J,0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),y.drawImage(J,0,0,R.width,R.height),b(R)}};v.addEventListener("mousedown",()=>{g()}),c.addEventListener("click",N=>{N.preventDefault(),k.length>0&&(C.push(v.toDataURL()),w(k.pop()))}),d.addEventListener("click",N=>{N.preventDefault(),C.length>0&&(k.push(v.toDataURL()),w(C.pop()))});const q=document.createElement("img");n.appendChild(q),n.appendChild(v),this.loaded=()=>{n.style.display="flex";const N=document.querySelector(".imagemask-controls");N.style.display="flex",e.style.display="flex",F(),k=[],C=[],S.clearRect(0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),this.empty=!0,E.value="";try{b(R)}catch{}},q.onload=()=>{this.loaded()};let V=null,I=null;const F=()=>{v.width>0&&v.height>0&&(V=S.getImageData(0,0,v.width,v.height),I=y.getImageData(0,0,R.width,R.height));const N=q.offsetWidth,J=q.offsetHeight,Q=window.devicePixelRatio||1;v.width=N*Q,v.height=J*Q,S.scale(Q,Q),v.style.width=`${N}px`,v.style.height=`${J}px`;const se=q.naturalWidth,re=q.naturalHeight;if(R.width=se*Q,R.height=re*Q,y.scale(Q,Q),R.style.width=`${se}px`,R.style.height=`${re}px`,V){const ae=document.createElement("canvas");ae.width=V.width,ae.height=V.height,ae.getContext("2d").putImageData(V,0,0);const ue=document.createElement("canvas");ue.width=I.width,ue.height=I.height,ue.getContext("2d").putImageData(I,0,0),S.drawImage(ae,0,0,V.width,V.height,0,0,v.width,v.height),y.drawImage(ue,0,0,I.width,I.height,0,0,R.width,R.height)}};let G=!1,B=parseInt(u.value,10);u.addEventListener("input",N=>{B=parseInt(N.target.value,10)});const M=N=>{const J=v.getBoundingClientRect();if(N.touches){const Q=N.touches[0];return{x:Q.clientX-J.left,y:Q.clientY-J.top}}return{x:N.clientX-J.left,y:N.clientY-J.top}},_=N=>{G=!0,P(N)},L=()=>{G=!1,S.beginPath(),this.empty=!1,b(R)},P=N=>{if(!G)return;const{x:J,y:Q}=M(N),se=R.width/v.width,re=R.height/v.height,ae=J*se,de=Q*re;S.fillStyle="rgb(255, 255, 255)",S.beginPath(),S.arc(J,Q,B/2,0,Math.PI*2),S.fill(),y.fillStyle="rgb(255, 255, 255)",y.beginPath(),y.arc(ae,de,B/2*se,0,Math.PI*2),y.fill()};v.addEventListener("mousedown",_),v.addEventListener("mouseup",L),v.addEventListener("mousemove",P),v.addEventListener("touchstart",N=>{_(N),N.preventDefault()},{passive:!1}),v.addEventListener("touchend",N=>{L(),N.preventDefault()}),v.addEventListener("touchmove",N=>{P(N),N.preventDefault()},{passive:!1}),o.addEventListener("click",N=>{N.preventDefault(),g(),S.clearRect(0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),this.empty=!0,E.value="",b(R)}),window.addEventListener("resize",F);const W=N=>{N?(e.setAttribute("aria-modal","true"),e.setAttribute("role","dialog"),e.classList.add("fullscreen"),i.style.display="block",s.style.display="flex",h.style.display="none"):(e.removeAttribute("aria-modal"),e.removeAttribute("role"),e.classList.remove("fullscreen"),i.style.display="none",s.style.display="none",h.style.display=""),F()};h.addEventListener("click",N=>{N.preventDefault(),W(!0)}),s.addEventListener("click",N=>{N.preventDefault(),W(!1)}),document.addEventListener("keydown",N=>{N.key==="Escape"&&W(!1)})}}class _n{constructor(e,i={}){const s={lang:[],headers:{},fileUploadText:"Drag and drop your file here.",multiFileUploadText:"Drag and drop your files here.",model:"gpt-4o-mini",model2:"gpt-4o-mini",sendCommandUrl:"/sendcommand",sendCommandStreamUrl:"/getstream",consoleLog:!1,saveResults:!1,disableMediaGeneration:!1,disableMediaGenerationTitle:"Demo Info",disableMediaGenerationMessage:"This is an online demo and media generation is currently disabled. Get the full version for complete functionality.",submitText:"Submit",resetText:"Reset",scrapeProvider:"firecrawl",scrapeLimit:6,scrapeExclude:["youtube.com","reddit.com","microsoft.com","mozilla.org"],inputCost:.15,outputCost:.6,_2dIllustrationStyleId:"bcaa0104-98ef-4cb8-a012-124dad015756",templateFilters:["all","image","video","audio","text"],templatesConfig:{fal:!0,replicate:!1,web:!1},defaultMediaGenerationProvider:"fal",replicateEndpoint1:"https://api.replicate.com/v1/predictions",replicateEndpoint2:"https://api.replicate.com/v1/models/{MODEL}/predictions",falStatusEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}/status",falResultEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}",replicateStatusEndpoint:"https://api.replicate.com/v1/predictions/{REQUEST_ID}",modelFallback:!1,defaultModels:{image_generation:{openai:["gpt-image-1"]},image_variation_generation:{openai:["gpt-image-1"]},text_to_image_generation:{fal:["fal-ai/flux-1/schnell","fal-ai/flux-1/dev","fal-ai/flux-pro/v1.1","fal-ai/flux-pro/v1.1-ultra","fal-ai/recraft-v3","fal-ai/recraft-20b","fal-ai/ideogram/v2a","fal-ai/hidream-i1-fast","fal-ai/hidream-i1-dev","fal-ai/hidream-i1-full","fal-ai/gemini-flash-edit/multi"],replicate:["black-forest-labs/flux-schnell","black-forest-labs/flux-dev","black-forest-labs/flux-1.1-pro","black-forest-labs/flux-1.1-pro-ultra","recraft-ai/recraft-v3","ideogram-ai/ideogram-v2a"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},image_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/image-to-video","fal-ai/kling-video/v1.6/pro/image-to-video","fal-ai/kling-video/v2.1/standard/image-to-video","fal-ai/kling-video/v2.1/pro/image-to-video","fal-ai/kling-video/v2.1/master/image-to-video","fal-ai/minimax/video-01-live/image-to-video","fal-ai/luma-dream-machine/ray-2/image-to-video"],replicate:["kwaivgi/kling-v1.6-standard","kwaivgi/kling-v1.6-pro","minimax/video-01-live","luma/ray"]},text_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/text-to-video","fal-ai/kling-video/v2.1/master/text-to-video","fal-ai/minimax/video-01-live ","fal-ai/luma-dream-machine/ray-2"],replicate:["kwaivgi/kling-v1.6-standard","minimax/video-01","luma/ray"]},upscale_image:{fal:["fal-ai/clarity-upscaler"],replicate:["recraft-ai/recraft-crisp-upscale"]},describe_image:{fal:["fal-ai/any-llm/vision"],replicate:[]},edit_area_in_image:{fal:["fal-ai/flux-pro/v1/fill"],replicate:["black-forest-labs/flux-fill-pro"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},edit_image:{fal:["fal-ai/gemini-flash-edit"],replicate:[],openai:["gpt-image-1"]},text_to_2d_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_digital_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:["recraft-ai/recraft-v3"]},text_to_book_cover_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_speech:{fal:["fal-ai/elevenlabs/tts/multilingual-v2"],replicate:["jaaari/kokoro-82m:f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13"]}},ttsMaxCharacters:3e3,alwaysVisibleSubmit:!1};this.settings=Object.assign({},s,i),this.listeners={},window._txt&&(this.settings.lang=window._txt),this.steps=[];let t=this.settings.onChange;if(this.settings.onChange=n=>{t&&t.call(this,n)},!e)throw new Error("A valid DOM element is required.");e.classList.add("formview-container"),e.classList.add("fb-ui"),this.element=e,this.media=new wn({lang:this.settings.lang},this),this.upload=new xn({lang:this.settings.lang},this)}on(e,i){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(i),this}off(e,i){this.listeners[e]&&this.listeners[e].delete(i)}trigger(e,i){this.listeners[e]&&this.listeners[e].forEach(s=>s(i))}async loadTemplates(){if(!this.settings.templatesUrl){console.log(this.out("Template URL is not set."));return}let e=document.querySelector(this.settings.templatesSelector);if(e){e.classList.remove("hidden"),e.classList.add("formtemplates-container"),e.classList.add("fb-ui");let t=(await(await fetch(this.settings.templatesUrl,{method:"GET"})).json()).data;e.innerHTML="",t=t.filter(o=>{const h=o.supports||[];if(h.length===0)return!0;const{fal:f,replicate:v,web:S,openai:R,google:y}=this.settings.templatesConfig;return!S&&h.includes("web")||!y&&h.includes("google")||!R&&h.includes("openai")?!1:!f&&!v?!(h.includes("fal")||h.includes("replicate")):!f&&h.includes("fal")?h.includes("replicate"):!v&&h.includes("replicate")?h.includes("fal"):!0});const r=this.settings.templateFilters,a={all:{desc:this.out("All")},image:{desc:this.out("Image")},video:{desc:this.out("Video")},audio:{desc:this.out("Audio")},web:{desc:this.out("Web")},text:{desc:this.out("Text")}},u=document.createElement("div");u.className="app-filters",e.appendChild(u);const c=document.createElement("ul");c.className="app-list",e.appendChild(c);const d=o=>{let h=t.filter(v=>o==="all"||v.categories.includes(o));const f=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(v=>v.categories.every(S=>f.includes(S))),this.renderList(h,c)};r.forEach(o=>{const h=document.createElement("button");h.textContent=a[o].desc,h.setAttribute("data-value",o),o==="all"&&h.classList.add("active"),h.addEventListener("click",()=>{u.querySelectorAll("button").forEach(v=>v.classList.remove("active")),h.classList.add("active"),d(o)}),u.appendChild(h)}),d("all")}}async selectFile(e){const i=this.element.querySelector(".file-input-wrapper");if(!i)return;const s=i.querySelector('input[type="file"]');if(!s||!this.acceptsImagesOnly(s))return;let t;e.startsWith("http")?t=this.settings.viewFileUrl+"?url="+e:t=e;const r=await(await fetch(t)).blob(),a=new File([r],e.split("/").pop(),{type:r.type});this.element.querySelector(".div-selected-preview")||(this.selectedFiles=[]),s&&s.hasAttribute("multiple")?this.selectedFiles.some(d=>d.name===a.name)||this.selectedFiles.push(a):this.selectedFiles=[a],this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),i.closest(".image-mask")&&this.objImageMask&&this.objImageMask.loadImage(a)}setSelectedFiles(e){this.selectedFiles=e;const i=this.element.querySelector('input[type="file"]');i&&i.removeAttribute("required")}renderSelectedFiles(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;let i=this.element.querySelector(".div-selected-preview");i?i.innerHTML="":(i=document.createElement("div"),i.classList.add("div-selected-preview"),e.appendChild(i)),this.clearFileInput(),this.selectedFiles&&this.selectedFiles.forEach((s,t)=>{const n=document.createElement("div"),r=document.createElement("img");r.src=URL.createObjectURL(s);const a=document.createElement("button");a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
328
|
+
</svg>`,r.appendChild(h);const f=document.createElement("input");f.type="hidden",f.name=this.settings.name,f.className="inp-imagemask",f.value="",t.appendChild(f);const m=document.createElement("canvas");m.className="imagemask";const w=m.getContext("2d",{willReadFrequently:!0}),E=document.createElement("canvas"),b=E.getContext("2d",{willReadFrequently:!0}),k=this.element.querySelector(".inp-imagemask"),g=L=>{const V=document.createElement("canvas"),U=V.getContext("2d",{willReadFrequently:!0});V.width=L.width,V.height=L.height,U.clearRect(0,0,L.width,L.height),U.fillStyle="black",U.fillRect(0,0,L.width,L.height),U.drawImage(L,0,0);const Y=V.toDataURL("image/png");let G=document.querySelector(".imagemask-output");G||(G=document.createElement("img"),G.className="imagemask-output",document.body.appendChild(G)),G.src=Y,this.empty||(k.value=Y)};let v=[],_=[];const p=()=>{v.push(E.toDataURL()),v.length>10&&v.shift(),_=[]},y=L=>{const V=new Image;V.src=L,V.onload=()=>{w.clearRect(0,0,m.width,m.height),w.drawImage(V,0,0,m.width,m.height),b.clearRect(0,0,E.width,E.height),b.drawImage(V,0,0,E.width,E.height),g(E)}};m.addEventListener("mousedown",()=>{p()}),c.addEventListener("click",L=>{L.preventDefault(),v.length>0&&(_.push(m.toDataURL()),y(v.pop()))}),d.addEventListener("click",L=>{L.preventDefault(),_.length>0&&(v.push(m.toDataURL()),y(_.pop()))});const T=document.createElement("img");n.appendChild(T),n.appendChild(m),this.loaded=()=>{n.style.display="flex";const L=document.querySelector(".imagemask-controls");L.style.display="flex",e.style.display="flex",D(),v=[],_=[],w.clearRect(0,0,m.width,m.height),b.clearRect(0,0,E.width,E.height),this.empty=!0,k.value="";try{g(E)}catch{}},T.onload=()=>{this.loaded()};let M=null,q=null;const D=()=>{m.width>0&&m.height>0&&(M=w.getImageData(0,0,m.width,m.height),q=b.getImageData(0,0,E.width,E.height));const L=T.offsetWidth,V=T.offsetHeight,U=window.devicePixelRatio||1;m.width=L*U,m.height=V*U,w.scale(U,U),m.style.width=`${L}px`,m.style.height=`${V}px`;const Y=T.naturalWidth,G=T.naturalHeight;if(E.width=Y*U,E.height=G*U,b.scale(U,U),E.style.width=`${Y}px`,E.style.height=`${G}px`,M){const K=document.createElement("canvas");K.width=M.width,K.height=M.height,K.getContext("2d").putImageData(M,0,0);const ee=document.createElement("canvas");ee.width=q.width,ee.height=q.height,ee.getContext("2d").putImageData(q,0,0),w.drawImage(K,0,0,M.width,M.height,0,0,m.width,m.height),b.drawImage(ee,0,0,q.width,q.height,0,0,E.width,E.height)}};let $=!1,j=parseInt(l.value,10);l.addEventListener("input",L=>{j=parseInt(L.target.value,10)});const O=L=>{const V=m.getBoundingClientRect();if(L.touches){const U=L.touches[0];return{x:U.clientX-V.left,y:U.clientY-V.top}}return{x:L.clientX-V.left,y:L.clientY-V.top}},x=L=>{$=!0,A(L)},S=()=>{$=!1,w.beginPath(),this.empty=!1,g(E)},A=L=>{if(!$)return;const{x:V,y:U}=O(L),Y=E.width/m.width,G=E.height/m.height,K=V*Y,ie=U*G;w.fillStyle="rgb(255, 255, 255)",w.beginPath(),w.arc(V,U,j/2,0,Math.PI*2),w.fill(),b.fillStyle="rgb(255, 255, 255)",b.beginPath(),b.arc(K,ie,j/2*Y,0,Math.PI*2),b.fill()};m.addEventListener("mousedown",x),m.addEventListener("mouseup",S),m.addEventListener("mousemove",A),m.addEventListener("touchstart",L=>{x(L),L.preventDefault()},{passive:!1}),m.addEventListener("touchend",L=>{S(),L.preventDefault()}),m.addEventListener("touchmove",L=>{A(L),L.preventDefault()},{passive:!1}),o.addEventListener("click",L=>{L.preventDefault(),p(),w.clearRect(0,0,m.width,m.height),b.clearRect(0,0,E.width,E.height),this.empty=!0,k.value="",g(E)}),window.addEventListener("resize",D);const N=L=>{L?(e.setAttribute("aria-modal","true"),e.setAttribute("role","dialog"),e.classList.add("fullscreen"),i.style.display="block",s.style.display="flex",h.style.display="none"):(e.removeAttribute("aria-modal"),e.removeAttribute("role"),e.classList.remove("fullscreen"),i.style.display="none",s.style.display="none",h.style.display=""),D()};h.addEventListener("click",L=>{L.preventDefault(),N(!0)}),s.addEventListener("click",L=>{L.preventDefault(),N(!1)}),document.addEventListener("keydown",L=>{L.key==="Escape"&&N(!1)})}}class Er{constructor(e,i={}){const s={lang:[],headers:{},fileUploadText:"Drag and drop your file here.",multiFileUploadText:"Drag and drop your files here.",model:"gpt-4o-mini",model2:"gpt-4o-mini",sendCommandUrl:"/sendcommand",sendCommandStreamUrl:"/getstream",consoleLog:!1,saveResults:!1,disableMediaGeneration:!1,disableMediaGenerationTitle:"Demo Info",disableMediaGenerationMessage:"This is an online demo and media generation is currently disabled. Get the full version for complete functionality.",submitText:"Submit",resetText:"Reset",scrapeProvider:"firecrawl",scrapeLimit:6,scrapeExclude:["youtube.com","reddit.com","microsoft.com","mozilla.org"],inputCost:.15,outputCost:.6,_2dIllustrationStyleId:"bcaa0104-98ef-4cb8-a012-124dad015756",templateFilters:["all","image","video","audio","text"],templatesConfig:{fal:!0,replicate:!1,web:!1},defaultMediaGenerationProvider:"fal",replicateEndpoint1:"https://api.replicate.com/v1/predictions",replicateEndpoint2:"https://api.replicate.com/v1/models/{MODEL}/predictions",falStatusEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}/status",falResultEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}",replicateStatusEndpoint:"https://api.replicate.com/v1/predictions/{REQUEST_ID}",modelFallback:!1,defaultModels:{image_generation:{openai:["gpt-image-1"]},image_variation_generation:{openai:["gpt-image-1"]},text_to_image_generation:{fal:["fal-ai/flux-1/schnell","fal-ai/flux-1/dev","fal-ai/flux-pro/v1.1","fal-ai/flux-pro/v1.1-ultra","fal-ai/recraft-v3","fal-ai/recraft-20b","fal-ai/ideogram/v2a","fal-ai/hidream-i1-fast","fal-ai/hidream-i1-dev","fal-ai/hidream-i1-full","fal-ai/gemini-flash-edit/multi"],replicate:["black-forest-labs/flux-schnell","black-forest-labs/flux-dev","black-forest-labs/flux-1.1-pro","black-forest-labs/flux-1.1-pro-ultra","recraft-ai/recraft-v3","ideogram-ai/ideogram-v2a"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},image_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/image-to-video","fal-ai/kling-video/v1.6/pro/image-to-video","fal-ai/kling-video/v2.1/standard/image-to-video","fal-ai/kling-video/v2.1/pro/image-to-video","fal-ai/kling-video/v2.1/master/image-to-video","fal-ai/minimax/video-01-live/image-to-video","fal-ai/luma-dream-machine/ray-2/image-to-video"],replicate:["kwaivgi/kling-v1.6-standard","kwaivgi/kling-v1.6-pro","minimax/video-01-live","luma/ray"]},text_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/text-to-video","fal-ai/kling-video/v2.1/master/text-to-video","fal-ai/minimax/video-01-live ","fal-ai/luma-dream-machine/ray-2"],replicate:["kwaivgi/kling-v1.6-standard","minimax/video-01","luma/ray"]},upscale_image:{fal:["fal-ai/clarity-upscaler"],replicate:["recraft-ai/recraft-crisp-upscale"]},describe_image:{fal:["fal-ai/any-llm/vision"],replicate:[]},edit_area_in_image:{fal:["fal-ai/flux-pro/v1/fill"],replicate:["black-forest-labs/flux-fill-pro"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},edit_image:{fal:["fal-ai/gemini-flash-edit"],replicate:[],openai:["gpt-image-1"]},text_to_2d_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_digital_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:["recraft-ai/recraft-v3"]},text_to_book_cover_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_speech:{fal:["fal-ai/elevenlabs/tts/multilingual-v2"],replicate:["jaaari/kokoro-82m:f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13"]}},ttsMaxCharacters:3e3,alwaysVisibleSubmit:!1};this.settings=Object.assign({},s,i),this.listeners={},window._txt&&(this.settings.lang=window._txt),this.steps=[];let t=this.settings.onChange;if(this.settings.onChange=n=>{t&&t.call(this,n)},!e)throw new Error("A valid DOM element is required.");e.classList.add("formview-container"),e.classList.add("fb-ui"),this.element=e,this.media=new _r({lang:this.settings.lang},this),this.upload=new Sr({lang:this.settings.lang},this)}on(e,i){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(i),this}off(e,i){this.listeners[e]&&this.listeners[e].delete(i)}trigger(e,i){this.listeners[e]&&this.listeners[e].forEach(s=>s(i))}async loadTemplates(){if(!this.settings.templatesUrl){console.log(this.out("Template URL is not set."));return}let e=document.querySelector(this.settings.templatesSelector);if(e){e.classList.remove("hidden"),e.classList.add("formtemplates-container"),e.classList.add("fb-ui");let t=(await(await fetch(this.settings.templatesUrl,{method:"GET"})).json()).data;e.innerHTML="",t=t.filter(o=>{const h=o.supports||[];if(h.length===0)return!0;const{fal:f,replicate:m,web:w,openai:E,google:b}=this.settings.templatesConfig;return!w&&h.includes("web")||!b&&h.includes("google")||!E&&h.includes("openai")?!1:!f&&!m?!(h.includes("fal")||h.includes("replicate")):!f&&h.includes("fal")?h.includes("replicate"):!m&&h.includes("replicate")?h.includes("fal"):!0});const r=this.settings.templateFilters,a={all:{desc:this.out("All")},image:{desc:this.out("Image")},video:{desc:this.out("Video")},audio:{desc:this.out("Audio")},web:{desc:this.out("Web")},text:{desc:this.out("Text")}},l=document.createElement("div");l.className="app-filters",e.appendChild(l);const c=document.createElement("ul");c.className="app-list",e.appendChild(c);const d=o=>{let h=t.filter(m=>o==="all"||m.categories.includes(o));const f=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(m=>m.categories.every(w=>f.includes(w))),this.renderList(h,c)};r.forEach(o=>{const h=document.createElement("button");h.textContent=a[o].desc,h.setAttribute("data-value",o),o==="all"&&h.classList.add("active"),h.addEventListener("click",()=>{l.querySelectorAll("button").forEach(m=>m.classList.remove("active")),h.classList.add("active"),d(o)}),l.appendChild(h)}),d("all")}}async selectFile(e){const i=this.element.querySelector(".file-input-wrapper");if(!i)return;const s=i.querySelector('input[type="file"]');if(!s||!this.acceptsImagesOnly(s))return;let t;e.startsWith("http")?t=this.settings.viewFileUrl+"?url="+e:t=e;const r=await(await fetch(t)).blob(),a=new File([r],e.split("/").pop(),{type:r.type});this.element.querySelector(".div-selected-preview")||(this.selectedFiles=[]),s&&s.hasAttribute("multiple")?this.selectedFiles.some(d=>d.name===a.name)||this.selectedFiles.push(a):this.selectedFiles=[a],this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),i.closest(".image-mask")&&this.objImageMask&&this.objImageMask.loadImage(a)}setSelectedFiles(e){this.selectedFiles=e;const i=this.element.querySelector('input[type="file"]');i&&i.removeAttribute("required")}renderSelectedFiles(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;let i=this.element.querySelector(".div-selected-preview");i?i.innerHTML="":(i=document.createElement("div"),i.classList.add("div-selected-preview"),e.appendChild(i)),this.clearFileInput(),this.selectedFiles&&this.selectedFiles.forEach((s,t)=>{const n=document.createElement("div"),r=document.createElement("img");r.src=URL.createObjectURL(s);const a=document.createElement("button");a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
329
329
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
|
|
330
|
-
</svg>`,a.addEventListener("click",()=>{this.selectedFiles.splice(t,1),this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),e.closest(".image-mask")&&this.objImageMask&&this.objImageMask.clearImage()}),n.appendChild(r),n.appendChild(a),i.appendChild(n)})}clearSelectedFiles(){this.selectedFiles=[],this.setSelectedFiles(this.selectedFiles);let e=this.element.querySelector(".div-selected-preview");e&&(e.innerHTML="")}clearFileInput(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;const i=e.querySelector('input[type="file"]');if(!i)return;try{if(i.value="",i.files&&i.files.length>0){const
|
|
331
|
-
${
|
|
330
|
+
</svg>`,a.addEventListener("click",()=>{this.selectedFiles.splice(t,1),this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),e.closest(".image-mask")&&this.objImageMask&&this.objImageMask.clearImage()}),n.appendChild(r),n.appendChild(a),i.appendChild(n)})}clearSelectedFiles(){this.selectedFiles=[],this.setSelectedFiles(this.selectedFiles);let e=this.element.querySelector(".div-selected-preview");e&&(e.innerHTML="")}clearFileInput(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;const i=e.querySelector('input[type="file"]');if(!i)return;try{if(i.value="",i.files&&i.files.length>0){const l=new DataTransfer;i.files=l.files}}catch{}const s=e.querySelector(".file-drop-info-highlight");s&&(s.innerHTML="");const t=e.querySelector(".img-preview");t&&t.remove();const n=e.querySelector(".file-preview-container");n&&(n.innerHTML="");const r=e.querySelector(".btn-clearphoto");r&&r.click();const a=this.element.querySelector('input[type="file"]');a&&a.removeAttribute("required")}acceptsImagesOnly(e){const i=(e.getAttribute("accept")||"").split(",").map(s=>s.trim());return i.length===0?!1:i.every(s=>s.startsWith("image/")||s==="image/*")}renderList(e,i){i.innerHTML="",e.forEach(s=>{if(s.name){const t=document.createElement("li");i.appendChild(t);const n=document.createElement("a");n.setAttribute("href","#");let r=this.settings.assetsFolder,a=s.form.thumbnail,l="";if(r&&a){let h=r+a;l=`<img class="thumbnail" src="${h}" alt="${s.name}" />`,s.form.thumbnailFit&&(l=`<img class="thumbnail" style="object-fit:${s.form.thumbnailFit}" src="${h}" alt="${s.name}" />`)}const c=document.createElement("div");c.className="div-template-buttons";let d=!1,o=!1;if(this.settings.templateButtons&&this.settings.templateButtons.viewButton&&this.settings.templateButtons.viewButton.text){const h=document.createElement("button");h.className="btn-template-view",h.innerText=this.out(this.settings.templateButtons.viewButton.text),c.appendChild(h),h.addEventListener("click",f=>{if(f.preventDefault(),this.isGenerating){alert(this.out("Please wait until generation is complete."));return}this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateView",s)}),d=!0}if(this.settings.templateButtons&&this.settings.templateButtons.useButton&&this.settings.templateButtons.useButton.text){const h=document.createElement("button");h.className="btn-template-use",h.innerText=this.out(this.settings.templateButtons.useButton.text),c.appendChild(h),h.addEventListener("click",f=>{f.preventDefault(),this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateUse",s)}),o=!0}n.innerHTML=`
|
|
331
|
+
${l}
|
|
332
332
|
<div class="card-text">
|
|
333
333
|
<div class="title">${s.name}</div>
|
|
334
334
|
<div class="description">${s.form.description}</div>
|
|
@@ -344,7 +344,7 @@ Check the information and return the details.
|
|
|
344
344
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
|
|
345
345
|
</svg>
|
|
346
346
|
<span>${this.out("Clear")}</span>
|
|
347
|
-
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const f=e.cloneNode(!0),
|
|
347
|
+
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const f=e.cloneNode(!0),m=f.querySelector(".result-tool");m&&m.remove(),f.querySelectorAll(".link-view, .link-download").forEach(b=>{b.remove()}),f.style.position="fixed",f.style.left="-9999px",document.body.appendChild(f);const E=f.innerText.trim();document.body.removeChild(f),navigator.clipboard.writeText(E),d.innerHTML=`
|
|
348
348
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
|
|
349
349
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path stroke="none" d="M0 0h24v24H0z" /><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2 2 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" /><path d="M11 14l2 2l4 -4" />
|
|
350
350
|
</svg>
|
|
@@ -354,25 +354,25 @@ Check the information and return the details.
|
|
|
354
354
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
|
|
355
355
|
</svg>
|
|
356
356
|
<span>${this.out("Copy")}</span>
|
|
357
|
-
`},600)}),o.addEventListener("click",h=>{h.preventDefault(),localStorage.removeItem("_results"),localStorage.removeItem("_results_html"),e.innerHTML=""})}getScrollableParent(e){for(;e.parentElement;){const s=window.getComputedStyle(e.parentElement).overflowY;if((s==="auto"||s==="scroll")&&e.parentElement.scrollHeight>e.parentElement.clientHeight)return e.parentElement;e=e.parentElement}return null}stickyElement(e){if(!this.settings.alwaysVisibleSubmit)return;const i=this.getScrollableParent(e);this._scrollListener&&(i?i.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._resizeListener));let s;const t=()=>{e.style.position="",i?s=e.offsetTop+e.offsetHeight-i.offsetTop:s=e.offsetTop+e.offsetHeight},n=()=>{if(i)if(i.offsetHeight+i.scrollTop>s)e.style.position="",e.style.top="";else{const u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}else if(window.innerHeight+window.scrollY>s)e.style.position="",e.style.top="";else{const u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}e.parentNode.offsetWidth!==0&&(e.style.width=`${e.parentNode.offsetWidth}px`)};this._scrollListener=n;let r;this._resizeListener=()=>{r&&clearTimeout(r),r=setTimeout(()=>{let a=null;const u=()=>{const c=e.offsetTop;c===a?(t(),n()):(a=c,requestAnimationFrame(u))};u()},200)},t(),n(),i?i.addEventListener("scroll",n):window.addEventListener("scroll",n),window.addEventListener("resize",this._resizeListener)}view(e){if(!e)return;let i;try{i=JSON.parse(e)}catch{console.log("Invalid JSON Form.");return}this.json=i,this.inputListener=()=>{clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)},300)},this.changeListener=()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)};let s;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}s=document.querySelector(this.settings.previewSelector)}else s=this.element;if(s){if(s.classList.remove("hidden"),s.classList.add("formview-container"),s.classList.add("fb-ui"),s.innerHTML="",!(i.hideHeader||!1)){const o=document.createElement("div");o.className="form-header",s.appendChild(o);const h=document.createElement("h1");h.className="form-title",h.innerText=i.title||this.out("Your Form Title Here"),o.appendChild(h);const f=document.createElement("p");f.className="form-desc",f.innerText=i.description||this.out("Your Description Here"),o.appendChild(f)}let r;this.settings.isBuilder?r=document.createElement("form"):r=document.createElement("div"),r.className="form-wrapper",r.style.flexFlow="wrap",s.appendChild(r);let a=1;i.elements&&i.elements.forEach(o=>{if(o.type==="spacer"){const y=document.createElement("div");y.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(y.style.height=o.spacerHeight+"px"),o.displayInOutput||r.appendChild(y);return}if(o.type==="separator"){const y=document.createElement("hr");y.style.borderTopColor=o.color,o.displayInOutput||r.appendChild(y);return}if(o.type==="html"){if(o.html){const y=document.createElement("div");y.innerHTML=o.html,o.displayInOutput||r.appendChild(y)}return}if(o.type==="heading"){const y=document.createElement(o.heading||"h2");y.innerHTML=o.headingText||this.out("Your Heading Here!"),o.displayInOutput||r.appendChild(y);return}if(o.type==="paragraph"){const y=document.createElement("p");y.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),o.displayInOutput||r.appendChild(y);return}if(o.type==="media"){if(o.tag==="video"){const y=document.createElement("video");y.style.width="100%",y.style.height="auto",y.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",y.appendChild(h),o.displayInOutput||r.appendChild(y)}else if(o.tag==="audio"){const y=document.createElement("audio");y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="audio/mp3",y.appendChild(E),o.displayInOutput||r.appendChild(y)}else if(o.tag==="img"){const y=document.createElement("img");y.src=o.url,y.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(y)}return}if(o.type==="image"){const y=document.createElement("img");y.src=o.url,y.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(y);return}if(o.type==="video"){const y=document.createElement("video");y.style.width="100%",y.style.height="auto",y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="video/mp4",y.appendChild(E),o.displayInOutput||r.appendChild(y);return}if(o.type==="audio"){const y=document.createElement("audio");y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="audio/mp3",y.appendChild(E),o.displayInOutput||r.appendChild(y);return}const f=document.createElement("div");f.className="form-field",o.type==="hidden"&&(f.className="hidden"),o.displayInOutput||r.appendChild(f),o.type==="color"&&f.classList.add("field-color");const v=o.type;let S=o.name;if(r.querySelector(`[name="${S}"]`)&&(a++,S=S+"_"+a),v==="short-text"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`short_text_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`short_text_label_${y}`,b.type="text",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="long-text"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`long_text_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("textarea");b.id=`long_text_label_${y}`,b.name=S,b.value=o.value||"",b.className="inp-base",b.style.height=o.height+"px",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="number"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`number_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`number_label_${y}`,b.type="number",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="slider"){f.classList.add("input-slider");let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`number_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const V=document.createElement("div");V.className="field-note",V.innerHTML=o.fieldNote,f.appendChild(V)}const b=document.createElement("div");b.className="slider-container",f.appendChild(b);const k=document.createElement("div");k.className="slider-values",b.appendChild(k);const C=document.createElement("span");k.appendChild(C),C.innerText=o.minValue;const g=document.createElement("span");k.appendChild(g),g.innerText=o.maxValue;const w=document.createElement("input");w.id=`number_label_${y}`,w.type="range",w.name=S,w.setAttribute("min",o.minValue),w.setAttribute("max",o.maxValue),w.setAttribute("step",o.step),w.setAttribute("value",o.value||0),b.appendChild(w);const q=document.createElement("div");q.className="current-value",b.appendChild(q),b.querySelector(".current-value").textContent=o.value||0,w.addEventListener("input",()=>{b.querySelector(".current-value").textContent=w.value})}if(v==="select"){let y=this.getId();const E=document.createElement("div");if(E.id=`radio_group_label_${y}`,E.className="field-label-normal",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`radio_group_label_${y}`),b.setAttribute("role","group"),b.className="div-options",f.appendChild(b),o.choices&&o.choices.forEach((k,C)=>{let g=k;o.choicesText&&(g=o.choicesText[C]||k);const w=document.createElement("label");w.setAttribute("for",`${y}_${C}`),w.className="option-label",b.appendChild(w);const q=document.createElement("input");q.type="radio",q.className="peer",q.id=`${y}_${C}`,q.name=S,q.value=k,w.appendChild(q),C===o.selected&&(q.checked=!0);const V=document.createElement("span");V.className="peer-span-rounded",w.appendChild(V);const I='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';V.innerHTML=I,C===0&&o.isRequired&&q.setAttribute("required","required");const F=document.createElement("span");F.innerText=g,w.appendChild(F),q.addEventListener("change",this.changeListener)}),o.showOtherItem){const k=document.createElement("label");k.setAttribute("for",y+"_other"),k.className="option-label",b.appendChild(k);const C=document.createElement("input");C.type="radio",C.className="peer",C.id=y+"_other",C.name=S,C.value="other",k.appendChild(C);const g=document.createElement("span");g.className="peer-span-rounded",k.appendChild(g);const w='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';g.innerHTML=w;const q=document.createElement("span");q.innerText=o.otherText,k.appendChild(q);const V=document.createElement("div");f.appendChild(V);const I=document.createElement("input");I.type="text",I.name=S+"_other",I.className="inp-base",V.appendChild(I),C.addEventListener("change",this.changeListener),I.addEventListener("input",this.inputListener)}}if(v==="multi-select"){let y=this.getId();const E=document.createElement("div");if(E.id=`checkbox_group_label_${y}`,E.className="field-label-normal",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`checkbox_group_label_${y}`),b.setAttribute("role","group"),b.className="div-options",f.appendChild(b),o.choices&&o.choices.forEach((k,C)=>{let g=k;o.choicesText&&(g=o.choicesText[C]||k);const w=document.createElement("label");w.setAttribute("for",`${y}_${C}`),w.className="option-label",b.appendChild(w);const q=document.createElement("input");q.type="checkbox",q.className="peer",q.id=`${y}_${C}`,q.name=S+"[]",q.value=k,w.appendChild(q);const V=document.createElement("span");V.className="peer-span-square",w.appendChild(V);const I=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
|
|
357
|
+
`},600)}),o.addEventListener("click",h=>{h.preventDefault(),localStorage.removeItem("_results"),localStorage.removeItem("_results_html"),e.innerHTML=""})}getScrollableParent(e){for(;e.parentElement;){const s=window.getComputedStyle(e.parentElement).overflowY;if((s==="auto"||s==="scroll")&&e.parentElement.scrollHeight>e.parentElement.clientHeight)return e.parentElement;e=e.parentElement}return null}stickyElement(e){if(!this.settings.alwaysVisibleSubmit)return;const i=this.getScrollableParent(e);this._scrollListener&&(i?i.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._resizeListener));let s;const t=()=>{e.style.position="",i?s=e.offsetTop+e.offsetHeight-i.offsetTop:s=e.offsetTop+e.offsetHeight},n=()=>{if(i)if(i.offsetHeight+i.scrollTop>s)e.style.position="",e.style.top="";else{const l=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${l}px`}else if(window.innerHeight+window.scrollY>s)e.style.position="",e.style.top="";else{const l=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${l}px`}e.parentNode.offsetWidth!==0&&(e.style.width=`${e.parentNode.offsetWidth}px`)};this._scrollListener=n;let r;this._resizeListener=()=>{r&&clearTimeout(r),r=setTimeout(()=>{let a=null;const l=()=>{const c=e.offsetTop;c===a?(t(),n()):(a=c,requestAnimationFrame(l))};l()},200)},t(),n(),i?i.addEventListener("scroll",n):window.addEventListener("scroll",n),window.addEventListener("resize",this._resizeListener)}view(e){if(!e)return;let i;try{i=JSON.parse(e)}catch{console.log("Invalid JSON Form.");return}this.json=i,this.inputListener=()=>{clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)},300)},this.changeListener=()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)};let s;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}s=document.querySelector(this.settings.previewSelector)}else s=this.element;if(s){if(s.classList.remove("hidden"),s.classList.add("formview-container"),s.classList.add("fb-ui"),s.innerHTML="",!(i.hideHeader||!1)){const o=document.createElement("div");o.className="form-header",s.appendChild(o);const h=document.createElement("h1");h.className="form-title",h.innerText=i.title||this.out("Your Form Title Here"),o.appendChild(h);const f=document.createElement("p");f.className="form-desc",f.innerText=i.description||this.out("Your Description Here"),o.appendChild(f)}let r;this.settings.isBuilder?r=document.createElement("form"):r=document.createElement("div"),r.className="form-wrapper",r.style.flexFlow="wrap",s.appendChild(r);let a=1;i.elements&&i.elements.forEach(o=>{if(o.type==="spacer"){const b=document.createElement("div");b.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(b.style.height=o.spacerHeight+"px"),o.displayInOutput||r.appendChild(b);return}if(o.type==="separator"){const b=document.createElement("hr");b.style.borderTopColor=o.color,o.displayInOutput||r.appendChild(b);return}if(o.type==="html"){if(o.html){const b=document.createElement("div");b.innerHTML=o.html,o.displayInOutput||r.appendChild(b)}return}if(o.type==="heading"){const b=document.createElement(o.heading||"h2");b.innerHTML=o.headingText||this.out("Your Heading Here!"),o.displayInOutput||r.appendChild(b);return}if(o.type==="paragraph"){const b=document.createElement("p");b.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),o.displayInOutput||r.appendChild(b);return}if(o.type==="media"){if(o.tag==="video"){const b=document.createElement("video");b.style.width="100%",b.style.height="auto",b.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",b.appendChild(h),o.displayInOutput||r.appendChild(b)}else if(o.tag==="audio"){const b=document.createElement("audio");b.controls=!0;let k=document.createElement("source");k.src=o.url,k.type="audio/mp3",b.appendChild(k),o.displayInOutput||r.appendChild(b)}else if(o.tag==="img"){const b=document.createElement("img");b.src=o.url,b.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(b)}return}if(o.type==="image"){const b=document.createElement("img");b.src=o.url,b.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(b);return}if(o.type==="video"){const b=document.createElement("video");b.style.width="100%",b.style.height="auto",b.controls=!0;let k=document.createElement("source");k.src=o.url,k.type="video/mp4",b.appendChild(k),o.displayInOutput||r.appendChild(b);return}if(o.type==="audio"){const b=document.createElement("audio");b.controls=!0;let k=document.createElement("source");k.src=o.url,k.type="audio/mp3",b.appendChild(k),o.displayInOutput||r.appendChild(b);return}const f=document.createElement("div");f.className="form-field",o.type==="hidden"&&(f.className="hidden"),o.displayInOutput||r.appendChild(f),o.type==="color"&&f.classList.add("field-color");const m=o.type;let w=o.name;if(r.querySelector(`[name="${w}"]`)&&(a++,w=w+"_"+a),m==="short-text"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`short_text_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`short_text_label_${b}`,g.type="text",g.name=w,g.value=o.value||"",g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="long-text"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`long_text_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("textarea");g.id=`long_text_label_${b}`,g.name=w,g.value=o.value||"",g.className="inp-base",g.style.height=o.height+"px",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="number"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`number_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`number_label_${b}`,g.type="number",g.name=w,g.value=o.value||"",g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="slider"){f.classList.add("input-slider");let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`number_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const M=document.createElement("div");M.className="field-note",M.innerHTML=o.fieldNote,f.appendChild(M)}const g=document.createElement("div");g.className="slider-container",f.appendChild(g);const v=document.createElement("div");v.className="slider-values",g.appendChild(v);const _=document.createElement("span");v.appendChild(_),_.innerText=o.minValue;const p=document.createElement("span");v.appendChild(p),p.innerText=o.maxValue;const y=document.createElement("input");y.id=`number_label_${b}`,y.type="range",y.name=w,y.setAttribute("min",o.minValue),y.setAttribute("max",o.maxValue),y.setAttribute("step",o.step),y.setAttribute("value",o.value||0),g.appendChild(y);const T=document.createElement("div");T.className="current-value",g.appendChild(T),g.querySelector(".current-value").textContent=o.value||0,y.addEventListener("input",()=>{g.querySelector(".current-value").textContent=y.value})}if(m==="select"){let b=this.getId();const k=document.createElement("div");if(k.id=`radio_group_label_${b}`,k.className="field-label-normal",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("div");if(g.setAttribute("aria-labelledby",`radio_group_label_${b}`),g.setAttribute("role","group"),g.className="div-options",f.appendChild(g),o.choices&&o.choices.forEach((v,_)=>{let p=v;o.choicesText&&(p=o.choicesText[_]||v);const y=document.createElement("label");y.setAttribute("for",`${b}_${_}`),y.className="option-label",g.appendChild(y);const T=document.createElement("input");T.type="radio",T.className="peer",T.id=`${b}_${_}`,T.name=w,T.value=v,y.appendChild(T),_===o.selected&&(T.checked=!0);const M=document.createElement("span");M.className="peer-span-rounded",y.appendChild(M);const q='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';M.innerHTML=q,_===0&&o.isRequired&&T.setAttribute("required","required");const D=document.createElement("span");D.innerText=p,y.appendChild(D),T.addEventListener("change",this.changeListener)}),o.showOtherItem){const v=document.createElement("label");v.setAttribute("for",b+"_other"),v.className="option-label",g.appendChild(v);const _=document.createElement("input");_.type="radio",_.className="peer",_.id=b+"_other",_.name=w,_.value="other",v.appendChild(_);const p=document.createElement("span");p.className="peer-span-rounded",v.appendChild(p);const y='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';p.innerHTML=y;const T=document.createElement("span");T.innerText=o.otherText,v.appendChild(T);const M=document.createElement("div");f.appendChild(M);const q=document.createElement("input");q.type="text",q.name=w+"_other",q.className="inp-base",M.appendChild(q),_.addEventListener("change",this.changeListener),q.addEventListener("input",this.inputListener)}}if(m==="multi-select"){let b=this.getId();const k=document.createElement("div");if(k.id=`checkbox_group_label_${b}`,k.className="field-label-normal",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("div");if(g.setAttribute("aria-labelledby",`checkbox_group_label_${b}`),g.setAttribute("role","group"),g.className="div-options",f.appendChild(g),o.choices&&o.choices.forEach((v,_)=>{let p=v;o.choicesText&&(p=o.choicesText[_]||v);const y=document.createElement("label");y.setAttribute("for",`${b}_${_}`),y.className="option-label",g.appendChild(y);const T=document.createElement("input");T.type="checkbox",T.className="peer",T.id=`${b}_${_}`,T.name=w+"[]",T.value=v,y.appendChild(T);const M=document.createElement("span");M.className="peer-span-square",y.appendChild(M);const q=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
|
|
358
358
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />
|
|
359
|
-
</svg>`;
|
|
359
|
+
</svg>`;M.innerHTML=q;const D=document.createElement("span");D.innerText=p,y.appendChild(D),T.addEventListener("change",this.changeListener)}),o.showOtherItem){const v=document.createElement("label");v.setAttribute("for",b+"_other"),v.className="option-label",g.appendChild(v);const _=document.createElement("input");_.type="checkbox",_.className="peer",_.id=b+"_other",_.name=w,_.value="other",v.appendChild(_);const p=document.createElement("span");p.className="peer-span-square",v.appendChild(p);const y=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
|
|
360
360
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />
|
|
361
|
-
</svg>`;
|
|
361
|
+
</svg>`;p.innerHTML=y;const T=document.createElement("span");T.innerText=o.otherText,v.appendChild(T);const M=document.createElement("div");f.appendChild(M);const q=document.createElement("input");q.type="text",q.name=w+"_other",q.className="inp-base",M.appendChild(q),_.addEventListener("change",this.changeListener),q.addEventListener("input",this.inputListener)}}if(m==="switch"){let b=this.getId();const k=document.createElement("label");if(k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),k.id=`switch_${b}`,f.appendChild(k),o.fieldNote){const y=document.createElement("div");y.className="field-note",y.innerHTML=o.fieldNote,f.appendChild(y)}const g=document.createElement("div");g.className="switch",g.tabIndex=0,g.role="switch",g.setAttribute("aria-labelledby",`switch_${b}`),g.setAttribute("aria-checked","false"),g.setAttribute("data-checked","false"),f.appendChild(g);const v=document.createElement("div");v.className="switch-thumb",g.appendChild(v);const _=document.createElement("input");_.id=`switch_${b}`,_.type="text",_.name=w,_.style.cssText="opacity:0.01;width:1px;height:1px;position:absolute;bottom:0px;left:25px;",_.setAttribute("tabindex","-1"),o.isRequired&&(_.setAttribute("required","required"),_.setCustomValidity(this.out("Please toggle this switch to proceed."))),g.appendChild(_),o.value==="true"?(g.setAttribute("aria-checked","true"),g.setAttribute("data-checked","true"),_.value="true",o.isRequired&&_.setCustomValidity("")):(g.setAttribute("aria-checked","false"),g.setAttribute("data-checked","false"),_.value="false",o.isRequired&&_.setCustomValidity(this.out("Please toggle this switch to proceed."))),k.addEventListener("click",()=>{g.focus()});const p=()=>{const y=g.getAttribute("aria-checked")==="true";g.setAttribute("aria-checked",!y),g.setAttribute("data-checked",!y),y?(_.value="false",o.isRequired&&_.setCustomValidity(this.out("Please toggle this switch to proceed."))):(_.value="true",o.isRequired&&_.setCustomValidity(""));const T=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(T)};g.addEventListener("keydown",y=>{(y.key===" "||y.key==="Enter")&&(y.preventDefault(),p())}),g.addEventListener("click",()=>{p()})}if(m==="dropdown"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`dropdown_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const D=document.createElement("div");D.className="field-note",D.innerHTML=o.fieldNote,f.appendChild(D)}const g=document.createElement("div");g.className="relative",f.appendChild(g);const v=document.createElement("div");v.className="relative inline-block",g.appendChild(v);const _=document.createElement("select");_.id=`dropdown_${b}`,_.name=w,o.isRequired&&_.setAttribute("required","required"),v.appendChild(_);const p=document.createElement("option");if(p.setAttribute("selected","selected"),p.setAttribute("disabled","disabled"),p.value="",p.innerText=o.placeholder,_.appendChild(p),o.choices&&o.choices.forEach((D,$)=>{let j=D;o.choicesText&&(j=o.choicesText[$]||D);const O=document.createElement("option");O.value=D,O.innerText=j,_.appendChild(O),$===o.selected&&(p.remove(),O.setAttribute("selected","selected"))}),o.showOtherItem){const D=document.createElement("option");D.value="other",D.innerText=o.otherText,_.appendChild(D)}const y=document.createElement("div");y.className="select-arrow",v.appendChild(y),this.appendHtml(y,`
|
|
362
362
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
363
363
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
364
364
|
</svg>
|
|
365
|
-
`);const
|
|
365
|
+
`);const T=document.createElement("input");T.type="text",T.id=`input_other_${b}`,T.name=w+"_other",T.className="input-other hidden inp-base",f.appendChild(T);const M=f.querySelector(`#dropdown_${b}`),q=f.querySelector(`#input_other_${b}`);M.addEventListener("change",()=>{M.value==="other"?(q.classList.remove("hidden"),q.focus()):q.classList.add("hidden");const D=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(D)}),T.addEventListener("input",this.inputListener)}if(m==="date"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`date_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`date_${b}`,g.type="date",g.name=w,g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("change",this.changeListener)}if(m==="time"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`time_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`time_${b}`,g.type="time",g.name=w,g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("change",this.changeListener)}if(m==="datetime"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`datetime_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`datetime_${b}`,g.type="datetime-local",g.name=w,g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("change",this.changeListener)}if(m==="color"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`color_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`color_${b}`,g.type="color",g.name=w,g.value=o.value||"",g.className="input-color",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="file"||m==="multifile"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`file_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const z=document.createElement("div");z.className="field-note",z.innerHTML=o.fieldNote,f.appendChild(z)}const g=document.createElement("div");g.className="file-input-wrapper",m==="file"&&g.setAttribute("aria-label",this.out(this.settings.fileUploadText)),m==="multifile"&&g.setAttribute("aria-label",this.out(this.settings.multiFileUploadText)),f.appendChild(g);const v=document.createElement("input");v.id=`input_url_label_${b}`,v.type="text",v.name=w+"__url",v.value=o.value||"",v.className="inp-base input-file-url",v.placeholder=o.placeholder||this.out("Enter URL."),f.appendChild(v),v.addEventListener("input",()=>{const z=f.querySelector(".btn-clearfile");z&&z.click(),this.inputListener(),v.value!==""?o.isRequired&&_.removeAttribute("required"):o.isRequired&&_.setAttribute("required","required"),Re(v.value),this.clearSelectedFiles()}),o.useURL?v.style.display="":v.style.display="none";const _=document.createElement("input");_.id=`file_${b}`,_.type="file",m==="multifile"&&(_.multiple=!0),_.name=w,o.isRequired&&_.setAttribute("required","required"),_.className="peer",g.appendChild(_);const p=document.createElement("div");p.className="file-drop-area",g.appendChild(p);const y=document.createElement("div");y.className="file-controls",y.id=`drag_message_${b}`,g.appendChild(y);let T;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(T=document.createElement("div"),T.className="file-drop-info",m==="file"&&(T.innerHTML=this.out(this.settings.fileUploadText)),m==="multifile"&&(T.innerHTML=this.out(this.settings.multiFileUploadText)),y.appendChild(T));let M;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(M=document.createElement("button"),M.className="btn-selectfile",M.innerHTML=`
|
|
366
366
|
<svg style="fill:none"xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="icon-folder-open"><path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
|
367
367
|
<path d="M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2" />
|
|
368
368
|
</svg>
|
|
369
369
|
${this.out("Select File")}
|
|
370
|
-
`,
|
|
370
|
+
`,y.appendChild(M));let q;(o.source&&o.source==="camera"||o.source&&o.source==="local_and_camera")&&(q=document.createElement("button"),q.className="btn-takephoto",q.innerHTML=`
|
|
371
371
|
<svg style="fill:none"xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="icon-camera">
|
|
372
372
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2" /><path d="M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
|
|
373
373
|
</svg>
|
|
374
374
|
${this.out("Take Photo")}
|
|
375
|
-
`,
|
|
375
|
+
`,y.appendChild(q));const D=document.createElement("div");D.className="file-preview-container",g.appendChild(D);const $=document.createElement("div");$.className="file-drop-info-highlight",$.id=`file_name_${b}`,g.appendChild($),M&&M.addEventListener("click",z=>{z.preventDefault(),_.click()}),g.classList.add("disabledrop"),(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(g.classList.remove("disabledrop"),g.addEventListener("dragover",z=>{z.preventDefault(),Array.from(z.dataTransfer.items).some(ae=>ae.kind==="file")&&g.classList.add("drag-over")}),g.addEventListener("dragleave",()=>{g.classList.remove("drag-over")}),m==="file"?g.addEventListener("drop",z=>{if(z.preventDefault(),z.dataTransfer.files&&z.dataTransfer.files.length>0){g.classList.remove("drag-over");const X=z.dataTransfer.files[0];X&&(_.files=z.dataTransfer.files,Se(X),this.clearSelectedFiles())}}):m==="multifile"&&g.addEventListener("drop",z=>{if(z.preventDefault(),z.dataTransfer.files&&z.dataTransfer.files.length>0){g.classList.remove("drag-over"),D.innerHTML="";const X=z.dataTransfer.files;X.length>0&&(_.files=X,Array.from(X).forEach(ae=>{ue(ae)}),this.clearSelectedFiles())}})),m==="file"?_.addEventListener("change",()=>{const z=_.files[0];z&&(Se(z),this.clearSelectedFiles())}):m==="multifile"&&_.addEventListener("change",()=>{D.innerHTML="";const z=_.files;Array.from(z).forEach(X=>{X&&(ue(X),this.clearSelectedFiles())})});const j={images:[{type:"image/jpeg",extensions:".jpg, .jpeg"},{type:"image/png",extensions:".png"},{type:"image/gif",extensions:".gif"},{type:"image/webp",extensions:".webp"}],videos:[{type:"video/mp4",extensions:".mp4"},{type:"video/webm",extensions:".webm"},{type:"video/ogg",extensions:".ogg"},{type:"video/quicktime",extensions:".mov"}],audio:[{type:"audio/mpeg",extensions:".mp3"},{type:"audio/wav",extensions:".wav"}],documents:[{type:"application/pdf",extensions:".pdf"},{type:"application/json",extensions:".json"},{type:"text/plain",extensions:".txt"},{type:"text/csv",extensions:".csv"},{type:"application/msword",extensions:".doc"},{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:".docx"},{type:"application/vnd.ms-excel",extensions:".xls"},{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extensions:".xlsx"}],others:[{type:"application/zip",extensions:".zip"},{type:"application/x-rar-compressed",extensions:".rar"}]};let O=[];(o.allowedFileTypes||["images","videos","audio","documents","others"]).forEach(z=>{switch(z){case"images":O=O.concat(j.images);break;case"videos":O=O.concat(j.videos);break;case"audio":O=O.concat(j.audio);break;case"documents":O=O.concat(j.documents);break;case"others":O=O.concat(j.others);break}});const S=O.map(z=>z.type).join(",");_.setAttribute("accept",S);let A;if(o.useImageMask){f.classList.add("image-mask");const z=document.createElement("div");f.appendChild(z),A=new Tr(z,{lang:this.settings.lang,name:w+"_mask"}),this.objImageMask=A}o.largePreview&&f.classList.add("large-preview");const N=()=>{const z=g.querySelector(".img-preview");z&&(z.remove(),o.useImageMask&&A.clearImage())};let L=`
|
|
376
376
|
<div class="div-livevideo">
|
|
377
377
|
<video class="livevideo" autoplay playsinline style="display:none"></video>
|
|
378
378
|
<canvas class="photo-captured" style="display:none"></canvas>
|
|
@@ -404,19 +404,19 @@ Check the information and return the details.
|
|
|
404
404
|
</svg>
|
|
405
405
|
</button>
|
|
406
406
|
</div>
|
|
407
|
-
`;this.appendHtml(
|
|
407
|
+
`;this.appendHtml(g,L);const V=f.querySelector(".livevideo"),U=f.querySelector(".photo-captured"),Y=f.querySelector(".btn-selectfile2"),G=f.querySelector(".btn-takephoto2"),K=f.querySelector(".btn-capturephoto"),ie=f.querySelector(".btn-clearphoto"),ee=f.querySelector(".btn-stopcamera");this.photoBlob={};let be;Y&&Y.addEventListener("click",z=>{z.preventDefault(),M.click()});const Ae=async()=>{const z=f.querySelector(".btn-clearfile");z&&z.click();try{be=await navigator.mediaDevices.getUserMedia({video:!0}),V.srcObject=be}catch{alert("Unable to access the camera."),V.style.display="none",K.style.display="none",ee.style.display="none",y.style.display="none",$.style.display="none"}setTimeout(()=>{G.style.display="none",U.style.display="none",V.style.display="",K.style.display="",ie.style.display="none",Y&&(Y.style.display="none"),G.style.display="none",ee.style.display="",y.style.display="none",$.style.display="none"},100)};q&&q.addEventListener("click",async z=>{z.preventDefault(),Ae()}),G.addEventListener("click",async z=>{z.preventDefault(),Ae()}),ee.addEventListener("click",()=>{be&&be.getTracks().forEach(z=>z.stop()),V.style.display="none",K.style.display="none",ee.style.display="none",G.style.display="none",y.style.display="",$.style.display=""}),K.addEventListener("click",z=>{if(z.preventDefault(),U.style.display="",U.width=V.videoWidth,U.height=V.videoHeight,U.getContext("2d").drawImage(V,0,0,U.width,U.height),be.getTracks().forEach(X=>X.stop()),V.style.display="none",K.style.display="none",ie.style.display="",Y&&(Y.style.display=""),G.style.display="",ee.style.display="none",U.toBlob(X=>{this.photoBlob[w]=X,_.removeAttribute("required")},"image/jpeg"),G.style.display="",o.useImageMask){const X=U.toDataURL("image/jpeg");A.setImage(X)}this.clearSelectedFiles()});const ke=()=>{this.photoBlob[w]=null,U.style.display="none",U.getContext("2d").clearRect(0,0,U.width,U.height),v.value!==""?o.isRequired&&_.removeAttribute("required"):o.isRequired&&_.setAttribute("required","required"),ie.style.display="none",Y&&(Y.style.display="none"),G.style.display="none",y.style.display="",$.style.display=""};ie.addEventListener("click",()=>{ke()});const Re=(z,X)=>{const ae=`.${z.split(".").pop().toLowerCase()}`;if(!O.some(J=>J.extensions.split(", ").includes(ae)))return;let we=j.images.some(J=>J.extensions.split(", ").includes(ae));if(o.useImageMask){if(!we)return;A.loadUrl(z)}ke(),$.innerHTML="";const he=document.createElement("div");$.appendChild(he);const le=document.createElement("button");if(le.className="btn-clearfile",le.innerHTML=`
|
|
408
408
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">
|
|
409
409
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3" /><path d="M18 13.3l-6.3 -6.3" />
|
|
410
410
|
</svg>
|
|
411
|
-
|
|
411
|
+
`,$.appendChild(le),le.addEventListener("click",J=>{let xe=le.closest(".form-field").querySelector(".img-preview");xe&&xe.remove(),v.value="",_.value="",$.innerHTML="",T.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&A.clearImage();const Me=document.querySelector(".formview-container .submit-container");Me&&setTimeout(()=>{this.stickyElement(Me)},1e3),J.preventDefault(),J.stopImmediatePropagation()}),we){let J=g.querySelector(".formview-container .img-preview");J||(J=document.createElement("img"),J.className="img-preview",g.appendChild(J)),J.src=z}else N();if(!X){const J=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(J)}const ne=document.querySelector(".formview-container .submit-container");ne&&setTimeout(()=>{this.stickyElement(ne)},1e3)};o.value&&Re(o.value,!0);const Se=z=>{if(z){if(!O.some(le=>le.type===z.type)){alert(this.out("Invalid file type."));return}if(o.useImageMask){if(!["image/jpeg","image/png","image/webp"].includes(z.type)){alert(this.out("Invalid file type."));return}A.loadImage(z)}ke(),v.value="",$.innerHTML="";const ae=document.createElement("div");ae.innerText=z.name,$.appendChild(ae);const de=document.createElement("button");if(de.className="btn-clearfile",de.innerHTML=`
|
|
412
412
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
413
413
|
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
|
|
414
414
|
</svg>
|
|
415
|
-
|
|
415
|
+
`,$.appendChild(de),de.addEventListener("click",le=>{let J=de.closest(".form-field").querySelector(".img-preview");J&&J.remove(),_.value="",$.innerHTML="",T.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&A.clearImage();const Oe=document.querySelector(".formview-container .submit-container");Oe&&setTimeout(()=>{this.stickyElement(Oe)},1e3),le.preventDefault(),le.stopImmediatePropagation()}),z.type.startsWith("image/")){const le=new FileReader;le.onload=function(ne){let J=g.querySelector(".formview-container .img-preview");J||(J=document.createElement("img"),J.className="img-preview",g.appendChild(J)),J.src=ne.target.result},le.readAsDataURL(z)}else N();const we=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(we);const he=document.querySelector(".formview-container .submit-container");he&&setTimeout(()=>{this.stickyElement(he)},1e3)}},ue=z=>{if(z){if(O=O.concat(j.images),!O.some(J=>J.type===z.type)){alert(this.out("Invalid file type."));return}const ae=document.createElement("div");ae.className="image-item",D.appendChild(ae);const de=document.createElement("div");de.className="file-drop-info-highlight",ae.appendChild(de);const we=document.createElement("div");we.innerText=z.name,de.appendChild(we);const he=document.createElement("button");if(he.className="btn-clearfile",he.innerHTML=`
|
|
416
416
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
417
417
|
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
|
|
418
418
|
</svg>
|
|
419
|
-
`,ve.appendChild(ye),ye.addEventListener("click",ne=>{const Me=ye.closest(".image-item");Me&&Me.remove(),(x=>{const T=new DataTransfer,O=C.files;Array.from(O).forEach(D=>{D!==x&&T.items.add(D)}),C.files=T.files})(X);const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),ne.preventDefault(),ne.stopImmediatePropagation()}),X.type.startsWith("image/")){const ne=new FileReader;ne.onload=function(Me){let l=document.createElement("img");l.className="img-preview",ge.appendChild(l),l.src=Me.target.result},ne.readAsDataURL(X)}const fe=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(fe);const he=document.querySelector(".formview-container .submit-container");he&&setTimeout(()=>{this.stickyElement(he)},1e3)}}}if(v==="email"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`email_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`email_label_${y}`,b.type="email",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="phone"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`phone_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`phone_label_${y}`,b.type="tel",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="url"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`url_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`url_label_${y}`,b.type="url",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="hidden"){let y=this.getId();const E=document.createElement("label");E.setAttribute("for",`hidden_label_${y}`),E.className="field-label hidden",E.innerText=o.title,f.appendChild(E);const b=document.createElement("input");b.id=`hidden_label_${y}`,b.type="hidden",b.name=S,b.value=o.value,f.appendChild(b)}});const u=r.closest("[data-site-token]");if(u){const o=u.getAttribute("data-site-token"),h=document.createElement("input");h.type="hidden",h.name="form_token",h.value=o,r.appendChild(h)}if(this.settings.isBuilder){const o=document.createElement("div");o.className="submit-container",r.appendChild(o);let h=!0;if("hideReset"in i&&(h=i.hideReset),!h){const R=document.createElement("button");R.className="btn-resetform";const y=i.resetText||this.settings.resetText;R.innerText=y,o.appendChild(R),R.addEventListener("click",b=>{b.preventDefault();const k=R.closest("form");k&&(k.reset(),k.querySelectorAll(".btn-clearfile").forEach(w=>{w.click()}),k.querySelectorAll(".slider-container").forEach(w=>{const q=w.querySelector("input");w.querySelector(".current-value").textContent=q.value}))}),(i.fullWidthButton||!1)&&R.classList.add("w-full")}const f=document.createElement("button");f.className="btn-submitform";const v=i.submitText||this.settings.submitText;f.innerText=v,o.appendChild(f),(i.fullWidthButton||!1)&&f.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&o.classList.add("always-visible"),this.stickyElement(o),r.addEventListener("submit",async R=>{R.preventDefault(),this.steps&&this.steps.length>0&&this.process()})}else{let o="Reference Code:",h="reference_code",f="reference_code";const v=document.createElement("div");v.className="form-field ",v.classList.add(f),r.appendChild(v);let S=this.getId();const R=document.createElement("label");R.setAttribute("for",`short_text_label_${S}`),R.className="field-label",R.innerHTML=o,v.appendChild(R);const y=document.createElement("input");if(y.id=`short_text_label_${S}`,y.type="text",y.name=h,y.autocomplete="off",y.setAttribute("aria-hidden","true"),y.setAttribute("tabindex","-1"),y.className="inp-base",v.appendChild(y),this.settings.captchaContainer){const E=this.settings.captchaContainerClassName,b=document.createElement("div");b.className="captcha-container",E&&b.classList.add(E),r.appendChild(b)}if(i.useSubmitButton){const E=document.createElement("div");E.className="submit-container",r.appendChild(E);let b=!0;if("hideReset"in i&&(b=i.hideReset),!b){const q=document.createElement("button");q.className="btn-resetform";const V=i.resetText||this.settings.resetText;q.innerText=V,E.appendChild(q),q.addEventListener("click",F=>{F.preventDefault();const G=q.closest("form");G&&(G.reset(),G.querySelectorAll(".btn-clearfile").forEach(_=>{_.click()}),G.querySelectorAll(".slider-container").forEach(_=>{const L=_.querySelector("input");_.querySelector(".current-value").textContent=L.value}))}),(i.fullWidthButton||!1)&&q.classList.add("w-full")}const k=document.createElement("button");k.className="btn-submitform";const C=i.submitText;k.innerText=C,E.appendChild(k),(i.fullWidthButton||!1)&&k.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&E.classList.add("always-visible"),this.stickyElement(E),k.addEventListener("click",async q=>{this.trigger("submit",q)});const w=r.closest("form");w?w.addEventListener("submit",async q=>{this.steps&&this.steps.length>0&&(q.preventDefault(),q.stopImmediatePropagation(),this.process())}):k.addEventListener("click",async q=>{this.steps&&this.steps.length>0&&(q.preventDefault(),this.process())})}}let c,d;this.settings.resultSelector&&(c=document.querySelector(this.settings.resultSelector),c.classList.add("result-wrapper"),c.innerHTML="",d=document.createElement("div"),d.classList.add("result-container"),c.appendChild(d)),i.elements&&c&&i.elements.forEach(o=>{if(o.displayInOutput){if(o.type==="spacer"){const f=document.createElement("div");f.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(f.style.height=o.spacerHeight+"px"),d.appendChild(f);return}if(o.type==="separator"){const f=document.createElement("hr");f.style.borderTopColor=o.color,d.appendChild(f);return}if(o.type==="html"){if(o.html){const f=document.createElement("div");f.innerHTML=o.html,d.appendChild(f)}return}if(o.type==="heading"){const f=document.createElement(o.heading||"h2");f.innerHTML=o.headingText||this.out("Your Heading Here!"),d.appendChild(f);return}if(o.type==="paragraph"){const f=document.createElement("p");f.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),d.appendChild(f);return}if(o.type==="media"){if(o.tag==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",f.appendChild(h),d.appendChild(f)}else if(o.tag==="audio"){const f=document.createElement("audio");f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="audio/mp3",f.appendChild(v),d.appendChild(f)}else if(o.tag==="img"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f)}return}if(o.type==="image"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f);return}if(o.type==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="video/mp4",f.appendChild(v),d.appendChild(f);return}if(o.type==="audio"){const f=document.createElement("audio");f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="audio/mp3",f.appendChild(v),d.appendChild(f);return}}})}if(this.settings.resultSelector&&document.querySelector(this.settings.resultSelector).classList.add("result-wrapper"),this.settings.saveResults&&this.settings.resultSelector&&localStorage.getItem("_results"))try{this.previousResults=JSON.parse(localStorage.getItem("_results"));let n=localStorage.getItem("_results_html");const r=document.querySelector(this.settings.resultSelector);r.innerHTML=n,this.addResultTool(),r.querySelectorAll(".link-download").forEach(u=>{u.addEventListener("click",async c=>{c.preventDefault();const d=c.target.href;try{const o=await fetch(d,{mode:"cors"});if(!o.ok)throw new Error("Failed to fetch the image.");const h=await o.blob(),f=d.substring(d.lastIndexOf("/")+1),v=document.createElement("a");v.href=URL.createObjectURL(h),v.download=f,v.click(),URL.revokeObjectURL(v.href)}catch(o){console.error("Error downloading the image:",o)}})})}catch{}const t=document.querySelector(".formview-container .submit-container");t&&setTimeout(()=>{this.stickyElement(t)},1e3)}abort(){this.controller&&this.controller.abort()}async search(e){let i={"Content-Type":"application/json",...this.settings.headers};try{const s=await fetch(this.settings.searchUrl,{method:"POST",headers:i,body:JSON.stringify({query:e,customData:this.settings.customData})});if(!s.ok)throw new Error("Failed to fetch data");const t=await s.json(),n=t.organic_results?"organic_results":"organic";return(t[n]||[]).map(r=>({title:r.title,link:r.link,snippet:r.snippet||r.description}))}catch(s){return console.error("Error in search:",s.message||s),[]}}async scrapeUrls(e){if(e.length===0)return{data:"",urls:[],failed:[]};this.settings.consoleLog&&console.log(e);let i={"Content-Type":"application/json",...this.settings.headers};const s=await fetch(this.settings.scrapeUrl,{method:"POST",headers:i,body:JSON.stringify({urls:e,customData:this.settings.customData})});if(!s.ok)throw new Error(`Error: ${s.statusText}`);let t="";const n=await s.json();if(this.settings.consoleLog&&console.log(n),n.error)return this.settings.consoleLog&&console.log(n.error),{data:"",urls:[],failed:[]};let r=[],a=[];if(this.settings.scrapeProvider==="firecrawl"&&n.forEach(u=>{if(u.success){const c=u.metadata.title,d=u.markdown,o=u.metadata.url;r.push(o),t+=`
|
|
419
|
+
`,de.appendChild(he),he.addEventListener("click",J=>{const Oe=he.closest(".image-item");Oe&&Oe.remove(),(re=>{const C=new DataTransfer,H=_.files;Array.from(H).forEach(W=>{W!==re&&C.items.add(W)}),_.files=C.files})(z);const Me=document.querySelector(".formview-container .submit-container");Me&&setTimeout(()=>{this.stickyElement(Me)},1e3),J.preventDefault(),J.stopImmediatePropagation()}),z.type.startsWith("image/")){const J=new FileReader;J.onload=function(Oe){let xe=document.createElement("img");xe.className="img-preview",ae.appendChild(xe),xe.src=Oe.target.result},J.readAsDataURL(z)}const le=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(le);const ne=document.querySelector(".formview-container .submit-container");ne&&setTimeout(()=>{this.stickyElement(ne)},1e3)}}}if(m==="email"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`email_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`email_label_${b}`,g.type="email",g.name=w,g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="phone"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`phone_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`phone_label_${b}`,g.type="tel",g.name=w,g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="url"){let b=this.getId();const k=document.createElement("label");if(k.setAttribute("for",`url_label_${b}`),k.className="field-label",k.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,f.appendChild(v)}const g=document.createElement("input");g.id=`url_label_${b}`,g.type="url",g.name=w,g.value=o.value||"",g.className="inp-base",g.placeholder=o.placeholder,o.isRequired&&g.setAttribute("required","required"),f.appendChild(g),g.addEventListener("input",this.inputListener)}if(m==="hidden"){let b=this.getId();const k=document.createElement("label");k.setAttribute("for",`hidden_label_${b}`),k.className="field-label hidden",k.innerText=o.title,f.appendChild(k);const g=document.createElement("input");g.id=`hidden_label_${b}`,g.type="hidden",g.name=w,g.value=o.value,f.appendChild(g)}});const l=r.closest("[data-site-token]");if(l){const o=l.getAttribute("data-site-token"),h=document.createElement("input");h.type="hidden",h.name="form_token",h.value=o,r.appendChild(h)}if(this.settings.isBuilder){const o=document.createElement("div");o.className="submit-container",r.appendChild(o);let h=!0;if("hideReset"in i&&(h=i.hideReset),!h){const E=document.createElement("button");E.className="btn-resetform";const b=i.resetText||this.settings.resetText;E.innerText=b,o.appendChild(E),E.addEventListener("click",g=>{g.preventDefault();const v=E.closest("form");v&&(v.reset(),v.querySelectorAll(".btn-clearfile").forEach(y=>{y.click()}),v.querySelectorAll(".slider-container").forEach(y=>{const T=y.querySelector("input");y.querySelector(".current-value").textContent=T.value}))}),(i.fullWidthButton||!1)&&E.classList.add("w-full")}const f=document.createElement("button");f.className="btn-submitform";const m=i.submitText||this.settings.submitText;f.innerText=m,o.appendChild(f),(i.fullWidthButton||!1)&&f.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&o.classList.add("always-visible"),this.stickyElement(o),r.addEventListener("submit",async E=>{E.preventDefault(),this.steps&&this.steps.length>0&&this.process()})}else{let o="Reference Code:",h="reference_code",f="reference_code";const m=document.createElement("div");m.className="form-field ",m.classList.add(f),r.appendChild(m);let w=this.getId();const E=document.createElement("label");E.setAttribute("for",`short_text_label_${w}`),E.className="field-label",E.innerHTML=o,m.appendChild(E);const b=document.createElement("input");if(b.id=`short_text_label_${w}`,b.type="text",b.name=h,b.autocomplete="off",b.setAttribute("aria-hidden","true"),b.setAttribute("tabindex","-1"),b.className="inp-base",m.appendChild(b),this.settings.captchaContainer){const k=this.settings.captchaContainerClassName,g=document.createElement("div");g.className="captcha-container",k&&g.classList.add(k),r.appendChild(g)}if(i.useSubmitButton){const k=document.createElement("div");k.className="submit-container",r.appendChild(k);let g=!0;if("hideReset"in i&&(g=i.hideReset),!g){const T=document.createElement("button");T.className="btn-resetform";const M=i.resetText||this.settings.resetText;T.innerText=M,k.appendChild(T),T.addEventListener("click",D=>{D.preventDefault();const $=T.closest("form");$&&($.reset(),$.querySelectorAll(".btn-clearfile").forEach(x=>{x.click()}),$.querySelectorAll(".slider-container").forEach(x=>{const S=x.querySelector("input");x.querySelector(".current-value").textContent=S.value}))}),(i.fullWidthButton||!1)&&T.classList.add("w-full")}const v=document.createElement("button");v.className="btn-submitform";const _=i.submitText;v.innerText=_,k.appendChild(v),(i.fullWidthButton||!1)&&v.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&k.classList.add("always-visible"),this.stickyElement(k),v.addEventListener("click",async T=>{this.trigger("submit",T)});const y=r.closest("form");y?y.addEventListener("submit",async T=>{this.steps&&this.steps.length>0&&(T.preventDefault(),T.stopImmediatePropagation(),this.process())}):v.addEventListener("click",async T=>{this.steps&&this.steps.length>0&&(T.preventDefault(),this.process())})}}let c,d;this.settings.resultSelector&&(c=document.querySelector(this.settings.resultSelector),c.classList.add("result-wrapper"),c.innerHTML="",d=document.createElement("div"),d.classList.add("result-container"),c.appendChild(d)),i.elements&&c&&i.elements.forEach(o=>{if(o.displayInOutput){if(o.type==="spacer"){const f=document.createElement("div");f.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(f.style.height=o.spacerHeight+"px"),d.appendChild(f);return}if(o.type==="separator"){const f=document.createElement("hr");f.style.borderTopColor=o.color,d.appendChild(f);return}if(o.type==="html"){if(o.html){const f=document.createElement("div");f.innerHTML=o.html,d.appendChild(f)}return}if(o.type==="heading"){const f=document.createElement(o.heading||"h2");f.innerHTML=o.headingText||this.out("Your Heading Here!"),d.appendChild(f);return}if(o.type==="paragraph"){const f=document.createElement("p");f.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),d.appendChild(f);return}if(o.type==="media"){if(o.tag==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",f.appendChild(h),d.appendChild(f)}else if(o.tag==="audio"){const f=document.createElement("audio");f.controls=!0;let m=document.createElement("source");m.src=o.url,m.type="audio/mp3",f.appendChild(m),d.appendChild(f)}else if(o.tag==="img"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f)}return}if(o.type==="image"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f);return}if(o.type==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;let m=document.createElement("source");m.src=o.url,m.type="video/mp4",f.appendChild(m),d.appendChild(f);return}if(o.type==="audio"){const f=document.createElement("audio");f.controls=!0;let m=document.createElement("source");m.src=o.url,m.type="audio/mp3",f.appendChild(m),d.appendChild(f);return}}})}if(this.settings.resultSelector&&document.querySelector(this.settings.resultSelector).classList.add("result-wrapper"),this.settings.saveResults&&this.settings.resultSelector&&localStorage.getItem("_results"))try{this.previousResults=JSON.parse(localStorage.getItem("_results"));let n=localStorage.getItem("_results_html");const r=document.querySelector(this.settings.resultSelector);r.innerHTML=n,this.addResultTool(),r.querySelectorAll(".link-download").forEach(l=>{l.addEventListener("click",async c=>{c.preventDefault();const d=c.target.href;try{const o=await fetch(d,{mode:"cors"});if(!o.ok)throw new Error("Failed to fetch the image.");const h=await o.blob(),f=d.substring(d.lastIndexOf("/")+1),m=document.createElement("a");m.href=URL.createObjectURL(h),m.download=f,m.click(),URL.revokeObjectURL(m.href)}catch(o){console.error("Error downloading the image:",o)}})})}catch{}const t=document.querySelector(".formview-container .submit-container");t&&setTimeout(()=>{this.stickyElement(t)},1e3)}abort(){this.controller&&this.controller.abort()}async search(e){let i={"Content-Type":"application/json",...this.settings.headers};try{const s=await fetch(this.settings.searchUrl,{method:"POST",headers:i,body:JSON.stringify({query:e,customData:this.settings.customData})});if(!s.ok)throw new Error("Failed to fetch data");const t=await s.json(),n=t.organic_results?"organic_results":"organic";return(t[n]||[]).map(r=>({title:r.title,link:r.link,snippet:r.snippet||r.description}))}catch(s){return console.error("Error in search:",s.message||s),[]}}async scrapeUrls(e){if(e.length===0)return{data:"",urls:[],failed:[]};this.settings.consoleLog&&console.log(e);let i={"Content-Type":"application/json",...this.settings.headers};const s=await fetch(this.settings.scrapeUrl,{method:"POST",headers:i,body:JSON.stringify({urls:e,customData:this.settings.customData})});if(!s.ok)throw new Error(`Error: ${s.statusText}`);let t="";const n=await s.json();if(this.settings.consoleLog&&console.log(n),n.error)return this.settings.consoleLog&&console.log(n.error),{data:"",urls:[],failed:[]};let r=[],a=[];if(this.settings.scrapeProvider==="firecrawl"&&n.forEach(l=>{if(l.success){const c=l.metadata.title,d=l.markdown,o=l.metadata.url;r.push(o),t+=`
|
|
420
420
|
|
|
421
421
|
|
|
422
422
|
## ${c}
|
|
@@ -429,7 +429,7 @@ Check the information and return the details.
|
|
|
429
429
|
----------------
|
|
430
430
|
|
|
431
431
|
|
|
432
|
-
`}else{let c=
|
|
432
|
+
`}else{let c=l.url;if(c){const d=l.url;a.push(d)}else c=l.url.link,a.push(c)}}),this.settings.scrapeProvider==="scrapingbee")for(let l=0;l<n.length;l++){let c=e[l];r.push(c);let d=n[l];t+=`
|
|
433
433
|
|
|
434
434
|
|
|
435
435
|
## ${c}
|
|
@@ -451,7 +451,7 @@ Check if the request requires checking certain URLs. If so, returns the URLs.
|
|
|
451
451
|
Also check if the request requires search to find answers by searching on the web to get the current relevant information.
|
|
452
452
|
`,n=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{needscrape:{type:"boolean",description:"Check the if request requires search on the web or not."},url:{type:"string",description:"If request need to check certail URL, return the URL."},url2:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url3:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url4:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url5:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url6:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url7:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url8:{type:"string",description:"If the request needs to check a certail URL, return the URL."},needsearch:{type:"boolean",description:"Check the if request requires search on the web or not."}},required:["needsearch","needscrape"]}}],r=await this.send(t,s,i,n);return r?JSON.parse(r):!1}async getRelevantInfo(e,i,s){if(!this.settings.searchUrl&&!this.settings.scrapeUrl)return{data:"",urls:[],failed:[]};const t=document.createElement("div");t.classList.add("status"),s.appendChild(t);let n="",r=await this.checkPrompt(`${i}
|
|
453
453
|
|
|
454
|
-
${e}`);this.settings.consoleLog&&console.log(r);let a=[],
|
|
454
|
+
${e}`);this.settings.consoleLog&&console.log(r);let a=[],l=[];if(r.url&&r.needscrape&&this.settings.scrapeUrl){let c=document.createElement("p");c.innerHTML=this.out("Fetching data from the web..."),t.appendChild(c);let d=[];r.url&&d.push(r.url),r.url2&&d.push(r.url2),r.url3&&d.push(r.url3),r.url4&&d.push(r.url4),r.url5&&d.push(r.url5),r.url6&&d.push(r.url6),r.url7&&d.push(r.url7),r.url8&&d.push(r.url8);let o=await this.scrapeUrls(d);n+=o.data,a=o.urls,l=o.failed}else if(this.settings.searchUrl&&this.settings.scrapeUrl){let c=document.createElement("p");c.innerHTML=this.out("Searching the web.."),t.appendChild(c);let d=await this.search(e);const o=this.settings.scrapeExclude;let h=d.filter(b=>{let k=new URL(b.link).hostname;return!o.some(g=>k.includes(g))});const f=this.settings.scrapeLimit,m=h.slice(0,f);t.innerHTML="",c=document.createElement("p"),c.innerHTML=this.out("Getting more information..."),t.appendChild(c);let w=[];for(let b=0;b<m.length;b++)w.push(d[b].link);let E=await this.scrapeUrls(w);n+=E.data,a=E.urls,l=E.failed}return{data:n,urls:a,failed:l}}showDemoInfo(e){if(!this.settings.resultSelector){this.settings.consoleLog&&console.log("resultSelector not set.");return}const i=document.querySelector(this.settings.resultSelector);i.innerHTML="";const s=document.createElement("div");s.classList.add("result-container"),i.appendChild(s),s.innerHTML=`
|
|
455
455
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 20" width="27" height="20" fill="currentColor">
|
|
456
456
|
<circle cx="15" cy="15" r="10">
|
|
457
457
|
<animate attributeName="cy" dur="0.6s" values="15;5;15" repeatCount="indefinite"></animate>
|
|
@@ -471,7 +471,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
471
471
|
</svg>
|
|
472
472
|
</span>
|
|
473
473
|
|
|
474
|
-
`,setTimeout(()=>{s.innerHTML=e,n.innerHTML=r},400)}async process(e){if(this.trigger("generate"),this.payloads=[],this.output=[],this.mediaGenerated=[],this.needCleanup=!1,this.outputHtml="",!this.settings.resultSelector){this.settings.consoleLog&&console.log("resultSelector not set.");return}const i=document.querySelector(this.settings.resultSelector);if(!i){console.log("resultElement not found.");return}let s=!1,t=!1;this.steps.forEach(
|
|
474
|
+
`,setTimeout(()=>{s.innerHTML=e,n.innerHTML=r},400)}async process(e){if(this.trigger("generate"),this.payloads=[],this.output=[],this.mediaGenerated=[],this.needCleanup=!1,this.outputHtml="",!this.settings.resultSelector){this.settings.consoleLog&&console.log("resultSelector not set.");return}const i=document.querySelector(this.settings.resultSelector);if(!i){console.log("resultElement not found.");return}let s=!1,t=!1;this.steps.forEach(v=>{v.prompt.trim().startsWith("{")&&(s=!0),v.tools&&(v.tools.image||v.tools.video||v.tools.audio)&&(s=!0),v.tools&&v.tools.search&&(t=!0)});let n;if(s&&this.settings.disableMediaGeneration){n=`
|
|
475
475
|
<div class="form-info">
|
|
476
476
|
<h3>${this.out(this.settings.disableMediaGenerationTitle)}</h3>
|
|
477
477
|
<p>
|
|
@@ -488,7 +488,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
488
488
|
<p>
|
|
489
489
|
<b>Web searching and scraping are currently disabled, so your request cannot be processed.</b>
|
|
490
490
|
</p>
|
|
491
|
-
</div>`,this.showDemoInfo(n);return}let r;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}r=document.querySelector(this.settings.previewSelector)}else r=this.element;let a=r.querySelector(".btn-submitform"),
|
|
491
|
+
</div>`,this.showDemoInfo(n);return}let r;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}r=document.querySelector(this.settings.previewSelector)}else r=this.element;let a=r.querySelector(".btn-submitform"),l=a.innerHTML;this.tokenInput=0,this.tokenOutput=0;let c=!1;if(e!=null&&(c=!0),this.singleStep=c,c||(this.filesUploaded={}),this.isNormal&&!c){if(this.isMediaGenerating){alert(this.out("The media generation process cannot be aborted."));return}this.abort(),a.innerHTML=l,a.removeAttribute("disabled"),this.isGenerating=!1;return}if(this.isNormal&&c||this.isSingle&&!c||this.isSingle&&c)return;this.isNormal=!1,this.isSingle=!1,c?(a.innerHTML=`
|
|
492
492
|
<span class="loading-icon">
|
|
493
493
|
<svg class="animate-spin" style="margin: 0;margin-right: 0.6rem;width: 1rem;height: 1rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
494
494
|
<circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
@@ -503,7 +503,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
503
503
|
</svg>
|
|
504
504
|
</span>
|
|
505
505
|
${this.out("Abort")}
|
|
506
|
-
`,this.isNormal=!0),this.isGenerating=!0;let d=(
|
|
506
|
+
`,this.isNormal=!0),this.isGenerating=!0;let d=(v,_)=>{if(v===void 0)return"";if(!isNaN(v))return v;let p=v;return _&&_.trim().startsWith("{")&&(p=JSON.stringify(v).slice(1,-1)),p};i.innerHTML="";let o=JSON.parse(JSON.stringify(this.steps)),h=this.getFormValues();if(!h)return;if(!(h&&Object.keys(h).length===0)){for(const v of o){let _=v.prompt;if(v.provider==="google"){for(const y of h)if(y.value instanceof FileList&&y.value.length>0){const M=y.value[0];if(!M)continue;const q=await new Promise((D,$)=>{const j=new FileReader;j.onload=O=>{const x=O.target.result.split(",")[1];D(x)},j.onerror=$,j.readAsDataURL(M)});_=_.replaceAll(`{{${y.name}}}`,q),_=_.replaceAll(`{{${y.name.toUpperCase()}}}`,q)}}v.prompt=_}o.forEach(v=>{let _=v.prompt;h.forEach(p=>{if(p.value===void 0&&(p.value=""),typeof p.value=="object"&&Array.isArray(p.value)){const y=p.value.join(", ");_=_.replaceAll(`{{${p.name}}}`,y),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,y)}else p.value instanceof FileList||typeof p.value=="string"&&p.value.indexOf("base64")!==-1?(_=_.replaceAll(`{{${p.name}}}`,p.name),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,p.name)):(_=_.replaceAll(`{{${p.name}}}`,d(p.value,v.prompt)),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,d(p.value,v.prompt)))}),v.prompt=_}),o.forEach(v=>{let _=v.context;h.forEach(p=>{if(p.value||(p.value=""),typeof p.value=="object"&&Array.isArray(p.value)){const y=p.value.join(", ");_=_.replaceAll(`{{${p.name}}}`,y),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,y)}else p.value instanceof FileList||typeof p.value=="string"&&p.value.indexOf("base64")!==-1?(_=_.replaceAll(`{{${p.name}}}`,p.name),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,p.name)):(_=_.replaceAll(`{{${p.name}}}`,d(p.value,v.prompt)),_=_.replaceAll(`{{${p.name.toUpperCase()}}}`,d(p.value,v.prompt)))}),v.context=_})}const f=async(v,_,p,y,T,M,q,D)=>{const $=document.createElement("div");$.classList.add("result-container"),i.appendChild($),$.innerHTML=`
|
|
507
507
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 20" width="27" height="20" fill="currentColor">
|
|
508
508
|
<circle cx="15" cy="15" r="10">
|
|
509
509
|
<animate attributeName="cy" dur="0.6s" values="15;5;15" repeatCount="indefinite"></animate>
|
|
@@ -515,7 +515,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
515
515
|
<animate attributeName="cy" begin="0.4s" dur="0.6s" values="15;5;15" repeatCount="indefinite"></animate>
|
|
516
516
|
</circle>
|
|
517
517
|
</svg>
|
|
518
|
-
`;let
|
|
518
|
+
`;let j=!1,O;if(v.trim().startsWith("{"))try{O=JSON.parse(v),O&&typeof O=="object"&&(j=!0)}catch{return $.innerHTML=`<p>${this.out("Incorrect JSON format.")}</p>`,!1}(q&&(q.image||q.video||q.audio)||j)&&(c||(a.innerHTML=`
|
|
519
519
|
<span class="loading-icon" style="width:60px;display:flex;align-items:center;justify-content:center">
|
|
520
520
|
<svg class="animate-spin" style="margin: 0;width: 1.25rem;height: 1.25rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
521
521
|
<circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
@@ -523,14 +523,14 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
523
523
|
</svg>
|
|
524
524
|
</span>
|
|
525
525
|
|
|
526
|
-
`,a.setAttribute("disabled","")));let
|
|
526
|
+
`,a.setAttribute("disabled","")));let x="",S="",A;if(q&&q.search&&(A=await this.getRelevantInfo(v,_,$),A.data!==""&&(_+=`
|
|
527
527
|
Use the following information to answer the request:
|
|
528
528
|
|
|
529
|
-
${
|
|
530
|
-
`)),I&&(I.image||I.video||I.audio)||B){const W=await this.media.generate(k,C,g,w,I,G,F);return this.needCleanup=!0,this.settings.consoleLog&&console.log(W),W.mediaGenerated?{media:W.output,media2:W.output2,markdown:W.markdown}:(G.innerHTML=`<p>${W.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(k,C,q,V,async W=>{if(!(W&&typeof W=="object")){if(_+=W,!F){const N=we.parse(_);G.innerHTML=N,L+=N}await new Promise(N=>setTimeout(N,50))}}),await new Promise(W=>{const N=setInterval(()=>{G.innerHTML===we.parse(_)&&(clearInterval(N),W())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`;else if(this.settings.assistantUrl){let W=await this.assistant(k,C,q,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}}else if(this.settings.sendCommandStreamUrl){let W="",N="",J="";const Q=async se=>{let re=0;for(;re<se.length;){if(J=W.slice(0,J.length+1),re++,!F){const ae=we.parse(J);G.innerHTML=ae,N=ae}await new Promise(ae=>setTimeout(ae,50))}};await this.sendStream(k,C,q,w,V,async se=>{_+=se,W+=se,await Q(se)}),await new Promise(se=>{const re=setInterval(()=>{J.length===W.length&&(clearInterval(re),se())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${N}</div>`}else{let W=await this.send(k,C,q,w,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}if(!F){let W="";if(P&&P.urls.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" href="${J}">${Q}</url></div>`}),P&&P.failed.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" style="opacity:0.5" href="${J}">${Q}</url></div>`}),W!==""){const J=document.createElement("div");J.classList.add("result-container"),i.appendChild(J),J.innerHTML=W}}return this.payloads.push({prompt:k,context:C}),this.output.push(_),{media:[],markdown:_}};c||await(async k=>{this.previousResults=[],this.outputHtml="";for(let C=0;C<k.length;C++){if(!this.isGenerating)return;let{prompt:g,context:w,provider:q,model:V,system:I,functs:F,tools:G,hideOutput:B}=k[C];q=q||"",w=w||"",I=I||"You are an assistant",F=F||[];let M=g;this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),g=M,g=g.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(g),M=w,this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),w=M,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let _=await f(g,w,q,V,I,F,G,B);if(!_)break;if(this.mediaGenerated.push(..._.media),_.media&&_.media.length===1){let L=_.media[0],P=_.media2&&_.media2.length===1&&_.media2[0];this.previousResults.push(P||L),B&&(this.filesUploaded[`output_step_${C}`]=L)}else this.previousResults.push(_.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(C,g)=>{if(!this.isGenerating)return;let{prompt:w,context:q,provider:V,model:I,system:F,functs:G,tools:B,hideOutput:M}=C[g];q=q||"",F=F||"You are an assistant",G=G||[];let _=w;this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),w=_,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(w),_=q,this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),q=_,q=q.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(q);let L=await f(w,q,V,I,F,G,B,M);if(L&&(this.mediaGenerated.push(...L.media),!!this.previousResults))if(L.media&&L.media.length===1){let P=L.media[0],W=L.media2&&L.media2.length===1&&L.media2[0];this.previousResults[g]=W||P,M&&(this.filesUploaded[`output_step_${g}`]=P)}else this.previousResults[g]=L.markdown})(o,e)),a.innerHTML=u,a.removeAttribute("disabled"),this.isGenerating=!1;const S=this.calculateCost();this.settings.onUsage&&this.settings.onUsage(S),this.trigger("usage",S),this.isNormal=!1,this.isSingle=!1;const R=(k,C=100)=>{const g=document.createElement("div");if(g.innerHTML=k,g.querySelector("video"))return"Video";if(g.querySelector("img"))return"Image";if(g.querySelector("audio"))return"Audio";const w=g.textContent.trim();return w.length>C?w.substring(0,C)+"...":w},y=Object.keys(this.filesUploaded).length===0&&this.filesUploaded.constructor===Object;if(this.needCleanup&&!y){this.settings.consoleLog&&(console.log("Cleanup"),console.log(this.filesUploaded));let k={"Content-Type":"application/json",...this.settings.headers};await fetch(this.settings.cleanup,{method:"POST",headers:k,body:JSON.stringify(this.filesUploaded)})}let E=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(k=>E.indexOf(k)!==-1),this.trigger("resultReady",{previewText:R(E),markdown:this.previousResults,html:E,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",E)),this.addResultTool(),i.querySelectorAll(".link-download").forEach(k=>{k.addEventListener("click",async C=>{C.preventDefault();const g=C.target.href;try{const w=await fetch(g,{mode:"cors"});if(!w.ok)throw new Error("Failed to fetch the image.");const q=await w.blob(),V=g.substring(g.lastIndexOf("/")+1),I=document.createElement("a");I.href=URL.createObjectURL(q),I.download=V,I.click(),URL.revokeObjectURL(I.href)}catch(w){console.error("Error downloading the image:",w)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:u,value:c,checked:d,files:o}=r;if(u==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(u==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(u==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(u==="file")s[a]=o;else if(u==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(f=>f.value)}else if(u==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,u=r.name,c=r.type;if(u==="")return;let d=s[u],o={questions:a,name:u,value:d,type:c};t.push(o);let h=u+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(u=u+"_mask",d=s[u],o={questions:a,name:u,value:d},t.push(o));let f=u+"_red";d=s[f],d!==void 0&&(o={questions:a,name:f,value:d},t.push(o));let v=u+"_green";d=s[v],d!==void 0&&(o={questions:a,name:v,value:d},t.push(o));let S=u+"_blue";d=s[S],d!==void 0&&(o={questions:a,name:S,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,u=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:u,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
-
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let f;return h.answer.choices.forEach(
|
|
532
|
-
`);
|
|
533
|
-
`}}this.tokenInput+=
|
|
534
|
-
`+h.error),!1):(h.usage&&(this.tokenInput+=h.usage.prompt_tokens,this.tokenOutput+=h.usage.completion_tokens),h.answer.content[0].text.value)}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async assistantStream(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,
|
|
535
|
-
`);
|
|
536
|
-
`}}else{const C=JSON.parse(k);this.tokenInput+=C.prompt_tokens,this.tokenOutput+=C.completion_tokens;break}}return!0}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}hexToRgb(e){const i=e.replace("#",""),s=parseInt(i,16),t=s>>16&255,n=s>>8&255,r=s&255;return{red:t,green:n,blue:r}}getId(e="id"){return`${e}-${Math.random().toString(36).substr(2,9)}`}appendHtml(e,i){e&&i&&e.insertAdjacentHTML("beforeend",i)}cleanup(){if(this.element){let e=this.element.querySelectorAll('input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], textarea');e.forEach(i=>{i.removeEventListener("input",this.inputListener)}),e=this.element.querySelectorAll('input[type="date"], input[type="radio"], input[type="checkbox"]'),e.forEach(i=>{i.removeEventListener("change",this.changeListener)}),this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null)}}destroy(){try{if(this._scrollListener){let e;this.settings.isBuilder?e=document.querySelector(this.settings.previewSelector):e=this.element;const i=e.querySelector(".submit-container"),s=this.getScrollableParent(i);s?s.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._scrollListener)}}catch{}this.element&&(this.cleanup(),this.element.innerHTML="",this.element=null);for(const e in this.listeners)this.listeners[e].clear();this.listeners={}}out(e){let i=this.settings.lang[e];return i||e}}class Sn{addClass(e,i){e&&(this.hasClass(e,i)||(e.classList.length===0?e.className=i:e.className=e.className+" "+i,e.className=e.className.replace(/ +/g," ")))}removeClass(e,i){if(e&&e.classList.length>0){let s,t,n,r,a=i.split(" ");for(s=0,n=a.length;s<n;++s){if(!a[s])continue;let u=a[s],c="",d=e.className.split(" ");for(t=0,r=d.length;t<r;++t)d[t]&&d[t]!==u&&(c+=d[t]+" ");e.className=c.trim()}e.className===""&&e.removeAttribute("class")}}hasClass(e,i){if(!e)return!1;try{let s=e.getAttribute("class");return new RegExp("\\b"+i+"\\b").test(s)}catch{}}}const oe=new Sn;class Tn{constructor(e={}){const i={};this.settings=Object.assign(this,i,e)}init(){const e=h=>{const f=h.parentNode,v=h.nextElementSibling;if(oe.hasClass(v,"is-menu-links")){let R=v.querySelectorAll("li");R.forEach(y=>{if(y!==f){const E=y.querySelector("ul");oe.removeClass(E,"active")}}),R=document.querySelectorAll(".is-menu > ul > li ul"),R.forEach(y=>{const E=y.querySelector("ul");oe.removeClass(E,"active")})}oe.hasClass(v,"active")&&!oe.hasClass(v,"is-menu-links")&&v.querySelectorAll("li").forEach(y=>{if(y!==f){const E=y.querySelector("ul");oe.removeClass(E,"active")}});const S=f.querySelector("ul");S&&oe.addClass(S,"active")},i=h=>{if(h.nextElementSibling){const f=h.nextElementSibling;if(f)if(oe.hasClass(f,"active"))oe.removeClass(f,"active"),h.focus();else{const S=h.parentNode.parentNode;oe.removeClass(S,"active"),S.previousElementSibling.focus()}else{const S=h.parentNode.parentNode;oe.removeClass(S,"active"),S.previousElementSibling.focus()}}else{const v=h.parentNode.parentNode;oe.removeClass(v,"active"),v.previousElementSibling.focus()}},s=h=>{const f=h.target;if(h.keyCode===27)i(h.target);else if(h.keyCode===13)h.target.nextElementSibling&&(h.target.getAttribute("href")===""||h.target.getAttribute("href")==="javascript:")&&(e(h.target),h.preventDefault());else if(h.keyCode===32)h.target.nextElementSibling&&(e(h.target),h.preventDefault());else if(h.keyCode===40)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(h.keyCode===38)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.classList.remove("active");else{const v=f.parentNode.previousElementSibling;v&&v.querySelector("a").focus()}else if(f.parentNode.previousElementSibling)f.parentNode.previousElementSibling.querySelector("a").focus();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&S.classList.remove("active"),S.previousElementSibling.focus()}else if(h.which===9&&!h.shiftKey)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(h.which===9&&h.shiftKey){if(f.nextElementSibling)f.nextElementSibling.classList.contains("active")&&f.nextElementSibling.classList.remove("active");else if(!f.parentNode.previousElementSibling){const S=f.parentNode.parentNode;S.classList.contains("active")&&S.classList.remove("active")}}};document.querySelectorAll(".is-menu li a").forEach(h=>{h.addEventListener("keydown",s)}),document.querySelectorAll(".is-menu li").forEach(h=>{const f=h.querySelector("span");f&&f.addEventListener("click",v=>{if(window.innerWidth>=1024)return;const y=v.target.closest("li").querySelector("ul");y&&(oe.hasClass(y,"active")?(oe.removeClass(y,"active"),y.style.display=""):oe.addClass(y,"active")),v.preventDefault(),v.stopImmediatePropagation()}),h.addEventListener("click",v=>{const S=h.querySelector("ul"),R=window.innerWidth;let y=v.target.tagName.toLowerCase();if(R>1024){if((y==="a"||y==="i")&&!v.target.getAttribute("href")){v.preventDefault(),v.stopImmediatePropagation();return}}else{let E=!0;if((y==="a"||y==="i")&&(v.target.getAttribute("href")||(v.preventDefault(),E=!1)),E){const b=document.querySelector(".is-menu");if(b.style.right==="0px"){oe.removeClass(r,"active"),b.style.right="-1000px";const k=document.querySelector(".is-menu-overlay");oe.removeClass(k,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}}}S&&(oe.hasClass(S,"active")?(oe.removeClass(S,"active"),S.style.display=""):(oe.addClass(S,"active"),setTimeout(()=>{},0)))}),h.addEventListener("mouseleave",v=>{window.innerWidth<=1024||(this.timer=setTimeout(()=>{const R=h.querySelector("ul");R&&oe.removeClass(R,"active")},200),v.preventDefault(),v.stopImmediatePropagation())}),h.addEventListener("mouseenter",v=>{const S=window.innerWidth;if(S<=1024||this.staticClose)return;const R=document.querySelector(".is-menu-search-input");if(oe.hasClass(R,"active"))return;clearTimeout(this.timer);const y=h.closest("ul");if(!h.querySelector("ul"))return y.querySelectorAll("li").forEach(k=>{const C=k.querySelector("ul");oe.removeClass(C,"active")}),!0;if(oe.hasClass(y,"is-menu-links")){let b=y.querySelectorAll("li");b.forEach(k=>{if(k!==h){const C=k.querySelector("ul");oe.removeClass(C,"active")}}),b=document.querySelectorAll(".is-menu > ul > li ul"),b.forEach(k=>{const C=k.querySelector("ul");oe.removeClass(C,"active")})}oe.hasClass(y,"active")&&!oe.hasClass(y,"is-menu-links")&&y.querySelectorAll("li").forEach(k=>{if(k!==h){const C=k.querySelector("ul");oe.removeClass(C,"active")}});const E=h.querySelector("ul");if(E&&oe.addClass(E,"active"),E.style.right="",E.classList.contains("active")){const b=E.getBoundingClientRect();b.left+b.width>S&&(E.style.right=0)}v.preventDefault(),v.stopImmediatePropagation()})});const r=document.querySelector("#is-menu-toggle");r.addEventListener("click",h=>{const f=document.querySelector(".is-menu");if(f.style.right==="0px"){oe.removeClass(r,"active"),f.style.right="-1000px";const v=document.querySelector(".is-menu-overlay");oe.removeClass(v,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}else{oe.addClass(r,"active"),document.querySelector(".is-menu-links .is-menu-search")?(document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""):(document.querySelector(".is-menu-search-input").style.display="none",document.querySelector(".is-menu-links").style.marginTop="70px"),f.style.right="0px";const S=document.querySelector(".is-menu-overlay");oe.addClass(S,"active"),document.querySelector(".is-topbar-menu").style.paddingRight=this.getScrollbarWidth()+"px",document.body.style.overflowY="hidden"}h.stopImmediatePropagation(),h.preventDefault()}),document.querySelector(".is-menu-overlay").addEventListener("click",h=>{document.querySelector("#is-menu-toggle").click(),h.stopImmediatePropagation(),h.preventDefault()}),window.addEventListener("resize",()=>{document.body.style.overflowY="auto",document.querySelector(".is-topbar-menu").style.paddingRight="0px";const h=document.querySelector("#is-menu-toggle");oe.removeClass(h,"active"),document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")});const v=document.querySelector(".is-menu");if(v.style.transition="none",window.innerWidth>1024){v.style.right="0px",document.querySelectorAll(".is-menu li ul").forEach(E=>{E.style.display=""});const y=document.querySelector(".is-menu-overlay");oe.removeClass(y,"active"),document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""}else v.style.right="-1000px";setTimeout(()=>{v.style.transition=""},30)}),window.addEventListener("scroll",()=>{var h=100,f=this.getCurrentScroll();f>=h?oe.addClass(document.querySelector(".is-topbar"),"shrink"):oe.removeClass(document.querySelector(".is-topbar"),"shrink"),window.innerWidth>=1024&&document.querySelector(".is-topbar.static")&&(f>30?this.staticClose||(document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")}),this.staticClose=!0):this.staticClose=!1)});const u=h=>{const f=document.querySelector(".is-menu-search-input");oe.addClass(f,"active"),f.querySelector("input").focus(),document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")}),h.preventDefault(),h.stopImmediatePropagation()},c=document.querySelector(".is-menu-search");c&&(c.addEventListener("click",h=>{u(h)}),c.addEventListener("keydown",h=>{(h.keyCode===13||h.keyCode===32)&&u(h)})),document.addEventListener("click",h=>{const f=h.target;if(!oe.hasClass(f,"is-menu-search")&&f.getAttribute("id")!=="is_btnSearch"&&f.getAttribute("id")!=="is_txtSearch"){const v=document.querySelector(".is-menu-search-input");oe.removeClass(v,"active")}});const d=document.querySelector("#is_txtSearch");d.addEventListener("keydown",h=>{if(h.which==13&&this.settings.onSearch(d.value),h.which==27){const f=document.querySelector(".is-menu-search-input");oe.removeClass(f,"active"),document.querySelector(".is-menu-search").focus()}}),document.querySelector("#is_btnSearch").addEventListener("click",()=>{this.settings.onSearch(d.value)})}getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}getCurrentScroll(){return window.pageYOffset||document.documentElement.scrollTop}}class En{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=Ps,window.FormViewer=_n,window.NavBar=Tn,window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{ji.init({duration:1200})},300),new Bi}prepareContent(){const e=document.querySelector(".is-wrapper");e.classList.add("box-v2");const i=function(r){let a=r.nextElementSibling;return a?a.classList.contains("is-section")?a:i(a):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(a){let u=a.target.closest(".is-section");if(u){let c=i(u);c&&this.scrollIt(c,1e3,"easeInQuad")}a.preventDefault(),a.stopImmediatePropagation()})}),e&&(e.classList.contains("is-edit")||e.querySelectorAll("a").forEach(function(a){a.addEventListener("click",function(u){let c=a.getAttribute("href");if(c&&c.indexOf("#")===0)if(c.indexOf("#section")===0){let d=c.replace("#section","");if(!isNaN(parseInt(d))){let o=document.querySelectorAll(".is-section"),h,f=0;o.forEach(function(v){v.classList.contains("is-section-navbar")||(f===d-1&&(h=v),f++)}),h&&scrollIt(h,1e3,"easeInQuad"),u.preventDefault()}}else try{let d=document.querySelector(c);d&&(scrollIt(d,1e3,"easeInQuad"),u.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let n=document.querySelectorAll(".is-animated,.is-scale-animated");n.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),n=document.querySelectorAll(".is-container > div"),n.forEach(function(r){let a=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),u=0;a.length>1&&a.forEach(function(c){c.className.indexOf("delay-")===-1&&(u>0&&(c.style.transitionDelay=u+"s",c.style.animationDelay=u+"s"),u=u+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function e(s){var t;return function(n){t&&clearTimeout(t),t=setTimeout(s,100,n)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",e(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var e=document.querySelectorAll(".is-overlay-bg");e.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new Pi({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(e,i=0){const s=e.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(e,i=200,s="linear",t){_scrollTo(e)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(a=>{const u=a.firstElementChild;a.after(u),a.parentNode.removeChild(a)}),document.querySelectorAll(".is-section").forEach(a=>{a.hasAttribute("data-section-clone")&&a.parentNode.removeChild(a),a.hasAttribute("data-section-original")&&(a.style.display="",a.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(u=>{u.outerHTML=u.innerHTML});const t=window.self!==window.top;let n;t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.length>0&&window.scrollTo(0,0),n.forEach(function(a){s<=970&&a.querySelector(".is-box")&&(a.querySelectorAll(".is-box").forEach(c=>{const d=a.cloneNode(!1);c.getAttributeNames().map(o=>{o.indexOf("data-")!==-1&&d.setAttribute(o,c.getAttribute(o))}),d.classList.add("is-box"),c.classList.forEach(o=>{(o.indexOf("is-box-")!==-1||o.indexOf("is-content-")!==-1||o.indexOf("box-autofit")!==-1||o.indexOf("is-light-text")!==-1||o.indexOf("is-dark-text")!==-1||o.indexOf("is-align-")!==-1||o.indexOf("type-")!==-1||o.indexOf("block-click")!==-1||o.indexOf("hover-zoom")!==-1)&&d.classList.add(o)}),d.setAttribute("data-section-clone",""),d.innerHTML=c.innerHTML,a.parentNode.insertBefore(d,a)}),a.setAttribute("data-section-original",""),a.style.display="none")}),t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.forEach(function(a){if(a.parentNode.closest(".section-wrap")||s<=970&&a.hasAttribute("data-section-original"))return;const u=document.createElement("div");u.classList.add("pin-wrap"),a.classList.contains("m-skrollrr-off")&&u.classList.add("m-skrollrr-off"),a.classList.contains("pin-space-lg")&&u.classList.add("pin-space-lg"),a.classList.contains("pin-space-xl")&&u.classList.add("pin-space-xl"),a.classList.contains("xs-hidden")&&u.classList.add("xs-hidden"),a.classList.contains("sm-hidden")&&u.classList.add("sm-hidden"),a.classList.contains("desktop-hidden")&&u.classList.add("desktop-hidden"),a.after(u),u.appendChild(a)});const r=a=>{document.querySelectorAll(".is-section").forEach(c=>{const d=c.getBoundingClientRect().top;let o,h;c.parentNode.classList.contains("pin-wrap")?(o=c.parentNode.nextElementSibling,h=c.parentNode.previousElementSibling):(o=c.nextElementSibling,h=c.previousElementSibling),o&&o.classList.contains("pin-wrap")&&(o=o.querySelector(".is-section")),h&&h.classList.contains("pin-wrap")&&(h=h.querySelector(".is-section")),d<=0&&((c.classList.contains("no-spacing")||c.classList.contains("pin-overlap"))&&c.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(v=>{v!==c&&v.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||t)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const e=n=>{const r=document.createElement("div");r.style.backgroundPositionX=n.style.backgroundPositionX,r.style.backgroundPositionY=n.style.backgroundPositionY,r.style.backgroundSize=n.style.backgroundSize,n.hasAttribute("data-bg-ori")||n.setAttribute("data-bg-ori",r.style.cssText)},i=n=>{if(n.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=n.getAttribute("data-bg-ori"),n.style.backgroundPositionX=r.style.backgroundPositionX,n.style.backgroundPositionY=r.style.backgroundPositionY,n.style.backgroundSize=r.style.backgroundSize,n.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(n=>{e(n),s<=760&&(n.hasAttribute("data-bg-xs")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-xs"):i(n)),s>760&&s<=970&&(n.hasAttribute("data-bg-sm")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-sm"):i(n)),s>970&&s<=1280&&(n.hasAttribute("data-bg-md")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-md"):i(n)),s>1280&&(n.hasAttribute("data-bg-lg")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-lg"):i(n))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(t=>{t.querySelector("video.is-video-bg")&&t.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(t=>{t.parentNode.setAttribute("data-scroll","")});const s=new $i({trigger:{once:!0,offset:{element:{x:0,y:(t,n,r)=>.1},viewport:{x:0,y:(t,n,r)=>t.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:t=>{t.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let a=r.parentNode.querySelector(".video-bg-play");r.autoplay?a?a.innerHTML.indexOf("play")===-1&&r.play():r.play():a&&a.innerHTML.indexOf("play")===-1&&r.play()})},out:t=>{t.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let e;window.contentbox?e=window.contentbox.onRender:parent.contentbox&&(e=parent.contentbox.onRender);const i=()=>{e.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(t){t.classList.contains("once")?(t.removeAttribute("data-scroll",""),t.setAttribute("data-scroll-once","")):(t.removeAttribute("data-scroll-once",""),t.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(t){let n=t.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;n.length>1&&n.forEach(function(a){a.className.indexOf("delay-")===-1&&(r>0&&(a.style.transitionDelay=r+"s",a.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const e={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(e),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const t=n=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,e),n.preventDefault(),n.stopImmediatePropagation()};s.addEventListener("click",t),s._lightboxHandler=t})}refreshLightbox(e){this.glightbox&&this.glightbox.destroy(),this.glightbox=si(e),window.GLightbox=si}openLightbox(e,i,s){let t=[],n=0;if(i){const r=i.closest("[data-gallery]");let a=[];r?a=r.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(c=>{c.closest("[data-gallery]")||a.push(c)}),a.forEach((u,c)=>{let d=u.getAttribute("href");d||(d=u.getAttribute("data-modal-url")),t.push({href:d}),e===d&&(n=c)})}t.length>0?(this.glightbox.setElements(t),this.glightbox.openAt(n)):(this.glightbox.setElements([{href:e}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s)})}blockInit(){const e={start:()=>{document.querySelectorAll(".is-block").forEach(t=>{t.hasAttribute("data--t")||t.setAttribute("data--t",t.style.top),t.hasAttribute("data--l")||t.setAttribute("data--l",t.style.left),t.hasAttribute("data--b")||t.setAttribute("data--b",t.style.bottom),t.hasAttribute("data--r")||t.setAttribute("data--r",t.style.right),t.hasAttribute("data--w")||t.setAttribute("data--w",t.style.width),t.hasAttribute("data--h")||t.setAttribute("data--h",t.style.height),t.removeAttribute("data-prev"),t.removeAttribute("data-fluid"),t.removeAttribute("data-fluid-val"),t.classList.remove("fluid"),t.style.transition=""})},apply:(t,n,r)=>{if(n&&t.getAttribute("data-prev")!==n+""){if(r||(t.style.transition="all 0.35s ease"),n!==1e4){if(t.setAttribute("data-breakpoint",n),t.hasAttribute("data--t-"+n)){let a=t.getAttribute("data--t-"+n);t.style.top=a}if(t.hasAttribute("data--l-"+n)){let a=t.getAttribute("data--l-"+n);t.style.left=a}if(t.hasAttribute("data--b-"+n)){let a=t.getAttribute("data--b-"+n);t.style.bottom=a}if(t.hasAttribute("data--r-"+n)){let a=t.getAttribute("data--r-"+n);t.style.right=a}if(t.hasAttribute("data--w-"+n)){let a=t.getAttribute("data--w-"+n);t.style.width=a}if(t.hasAttribute("data--h-"+n)){let a=t.getAttribute("data--h-"+n);t.style.height=a}if(t.hasAttribute("data--transform-"+n)){let a=t.getAttribute("data--transform-"+n);t.style.transform=a,t.setAttribute("data--transform-val",n)}}else{if(t.removeAttribute("data-breakpoint"),t.hasAttribute("data--t")){let a=t.getAttribute("data--t");t.style.top=a}if(t.hasAttribute("data--l")){let a=t.getAttribute("data--l");t.style.left=a}if(t.hasAttribute("data--b")){let a=t.getAttribute("data--b");t.style.bottom=a}if(t.hasAttribute("data--r")){let a=t.getAttribute("data--r");t.style.right=a}if(t.hasAttribute("data--w")){let a=t.getAttribute("data--w");t.style.width=a}if(t.hasAttribute("data--h")){let a=t.getAttribute("data--h");t.style.height=a}if(t.hasAttribute("data--transform")){let a=t.getAttribute("data--transform");t.style.transform=a,t.setAttribute("data--transform-val","")}}t.setAttribute("data-prev",n),setTimeout(()=>{r||(t.style.transition="")},400)}},applyFluid:(t,n)=>{t.classList.toggle("fluid",n==="yes"),t.setAttribute("data-fluid",n)},resize:t=>{const n=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){let o=u[c].name.match(/^data--h-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0){if(n>d){let o=r.getAttribute("data--h");o?r.style.height=o:r.style.height=""}}else{const o=a[c-1];if(o>=n&&n>d){let h=r.getAttribute("data--h-"+o);h&&(r.style.height=h)}}}if(a.length>0&&a[a.length-1]>=n){const d=a[a.length-1];let o=r.getAttribute("data--h-"+d);o&&(r.style.height=o)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>n&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),e.applyFluid(r,"yes"));let c=r.getAttribute("data-fluid-val");c&&parseInt(c)+0<=n&&r.classList.contains("fluid")&&e.applyFluid(r,"no")}let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){const d=u[c].name;let o=d.match(/^data--t-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--w-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--transform-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0)n>d&&e.apply(r,1e4,t);else{const o=a[c-1];o>=n&&n>d&&e.apply(r,o,t)}}if(a.length>0){const c=a[a.length-1];c>=n&&e.apply(r,c,t)}})},render:()=>{e.start(),e.resize(!0)}},s=((t,n)=>{let r;return(...a)=>{clearTimeout(r),r=setTimeout(()=>t(...a),n)}})(()=>{e.resize()},0);window.addEventListener("resize",s),e.start(),e.resize(!0),this.Block=e}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return En})();
|
|
529
|
+
${A.data}
|
|
530
|
+
`)),q&&(q.image||q.video||q.audio)||j){const N=await this.media.generate(v,_,p,y,q,$,D);return this.needCleanup=!0,this.settings.consoleLog&&console.log(N),N.mediaGenerated?{media:N.output,media2:N.output2,markdown:N.markdown}:($.innerHTML=`<p>${N.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(v,_,T,M,async N=>{if(!(N&&typeof N=="object")){if(x+=N,!D){const L=me.parse(x);$.innerHTML=L,S+=L}await new Promise(L=>setTimeout(L,50))}}),await new Promise(N=>{const L=setInterval(()=>{$.innerHTML===me.parse(x)&&(clearInterval(L),N())},10)}),D&&($.innerHTML="",$.remove()),this.outputHtml+=`<div class="result-container">${S}</div>`;else if(this.settings.assistantUrl){let N=await this.assistant(v,_,T,M);if(!N)return!1;if(x=N,D)$.innerHTML="",$.remove();else{const L=me.parse(N);$.innerHTML=L,this.outputHtml+=`<div class="result-container">${L}</div>`}}}else if(this.settings.sendCommandStreamUrl){let N="",L="",V="";const U=async Y=>{let G=0;for(;G<Y.length;){if(V=N.slice(0,V.length+1),G++,!D){const K=me.parse(V);$.innerHTML=K,L=K}await new Promise(K=>setTimeout(K,50))}};await this.sendStream(v,_,T,y,M,async Y=>{x+=Y,N+=Y,await U(Y)}),await new Promise(Y=>{const G=setInterval(()=>{V.length===N.length&&(clearInterval(G),Y())},10)}),D&&($.innerHTML="",$.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`}else{let N=await this.send(v,_,T,y,M);if(!N)return!1;if(x=N,D)$.innerHTML="",$.remove();else{const L=me.parse(N);$.innerHTML=L,this.outputHtml+=`<div class="result-container">${L}</div>`}}if(!D){let N="";if(A&&A.urls.forEach(V=>{let U=V;U.length>75&&(U=U.slice(0,75)+"..."),N+=`<div><a class="source_url" href="${V}">${U}</url></div>`}),A&&A.failed.forEach(V=>{let U=V;U.length>75&&(U=U.slice(0,75)+"..."),N+=`<div><a class="source_url" style="opacity:0.5" href="${V}">${U}</url></div>`}),N!==""){const V=document.createElement("div");V.classList.add("result-container"),i.appendChild(V),V.innerHTML=N}}return this.payloads.push({prompt:v,context:_}),this.output.push(x),{media:[],markdown:x}};c||await(async v=>{this.previousResults=[],this.outputHtml="";for(let _=0;_<v.length;_++){if(!this.isGenerating)return;let{prompt:p,context:y,provider:T,model:M,system:q,functs:D,tools:$,hideOutput:j}=v[_];T=T||"",y=y||"",q=q||"You are an assistant",D=D||[];let O=p;this.previousResults.forEach((S,A)=>{const N=`{{output_step_${A+1}}}`;O=O.replace(new RegExp(N,"g"),d(S,p)),O=O.replace(new RegExp(N.toUpperCase(),"g"),d(S,p))}),p=O,p=p.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(p),O=y,this.previousResults.forEach((S,A)=>{const N=`{{output_step_${A+1}}}`;O=O.replace(new RegExp(N,"g"),d(S,p)),O=O.replace(new RegExp(N.toUpperCase(),"g"),d(S,p))}),y=O,y=y.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let x=await f(p,y,T,M,q,D,$,j);if(!x)break;if(this.mediaGenerated.push(...x.media),x.media&&x.media.length===1){let S=x.media[0],A=x.media2&&x.media2.length===1&&x.media2[0];this.previousResults.push(A||S),j&&(this.filesUploaded[`output_step_${_}`]=S)}else this.previousResults.push(x.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(_,p)=>{if(!this.isGenerating)return;let{prompt:y,context:T,provider:M,model:q,system:D,functs:$,tools:j,hideOutput:O}=_[p];T=T||"",D=D||"You are an assistant",$=$||[];let x=y;this.previousResults&&this.previousResults.forEach((A,N)=>{const L=`{{output_step_${N+1}}}`;x=x.replace(new RegExp(L,"g"),A),x=x.replace(new RegExp(L.toUpperCase(),"g"),A)}),y=x,y=y.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(y),x=T,this.previousResults&&this.previousResults.forEach((A,N)=>{const L=`{{output_step_${N+1}}}`;x=x.replace(new RegExp(L,"g"),A),x=x.replace(new RegExp(L.toUpperCase(),"g"),A)}),T=x,T=T.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(T);let S=await f(y,T,M,q,D,$,j,O);if(S&&(this.mediaGenerated.push(...S.media),!!this.previousResults))if(S.media&&S.media.length===1){let A=S.media[0],N=S.media2&&S.media2.length===1&&S.media2[0];this.previousResults[p]=N||A,O&&(this.filesUploaded[`output_step_${p}`]=A)}else this.previousResults[p]=S.markdown})(o,e)),a.innerHTML=l,a.removeAttribute("disabled"),this.isGenerating=!1;const w=this.calculateCost();this.settings.onUsage&&this.settings.onUsage(w),this.trigger("usage",w),this.isNormal=!1,this.isSingle=!1;const E=(v,_=100)=>{const p=document.createElement("div");if(p.innerHTML=v,p.querySelector("video"))return"Video";if(p.querySelector("img"))return"Image";if(p.querySelector("audio"))return"Audio";const y=p.textContent.trim();return y.length>_?y.substring(0,_)+"...":y},b=Object.keys(this.filesUploaded).length===0&&this.filesUploaded.constructor===Object;if(this.needCleanup&&!b){this.settings.consoleLog&&(console.log("Cleanup"),console.log(this.filesUploaded));let v={"Content-Type":"application/json",...this.settings.headers};await fetch(this.settings.cleanup,{method:"POST",headers:v,body:JSON.stringify(this.filesUploaded)})}let k=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(v=>k.indexOf(v)!==-1),this.trigger("resultReady",{previewText:E(k),markdown:this.previousResults,html:k,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",k)),this.addResultTool(),i.querySelectorAll(".link-download").forEach(v=>{v.addEventListener("click",async _=>{_.preventDefault();const p=_.target.href;try{const y=await fetch(p,{mode:"cors"});if(!y.ok)throw new Error("Failed to fetch the image.");const T=await y.blob(),M=p.substring(p.lastIndexOf("/")+1),q=document.createElement("a");q.href=URL.createObjectURL(T),q.download=M,q.click(),URL.revokeObjectURL(q.href)}catch(y){console.error("Error downloading the image:",y)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:l,value:c,checked:d,files:o}=r;if(l==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(l==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(l==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(l==="file")s[a]=o;else if(l==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(f=>f.value)}else if(l==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,l=r.name,c=r.type;if(l==="")return;let d=s[l],o={questions:a,name:l,value:d,type:c};t.push(o);let h=l+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(l=l+"_mask",d=s[l],o={questions:a,name:l,value:d},t.push(o));let f=l+"_red";d=s[f],d!==void 0&&(o={questions:a,name:f,value:d},t.push(o));let m=l+"_green";d=s[m],d!==void 0&&(o={questions:a,name:m,value:d},t.push(o));let w=l+"_blue";d=s[w],d!==void 0&&(o={questions:a,name:w,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,l=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:l,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
+
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let f;return h.answer.choices.forEach(m=>{f=m.message.content}),f}else return h.answer}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async sendStream(e,i,s,t,n,r){this.controller=new AbortController,this.signal=this.controller.signal;let a=.6,l=.9,c=1;n||(n=[]),t=t||this.settings.model;const d={question:e,context:i,system:s,functs:n,temperature:a,topP:l,num:c,model:t,customData:this.settings.customData};try{let o={"Content-Type":"application/json",...this.settings.headers};const h=await fetch(this.settings.sendCommandStreamUrl,{signal:this.signal,method:"POST",headers:o,body:JSON.stringify(d)});if(!h.ok)return console.error("Error:",h.statusText),!1;const f=h.body.getReader(),m=new TextDecoder;let w="",E=!1;for(;!E;){const{done:b,value:k}=await f.read();if(E=b,E)break;const g=m.decode(k,{stream:!0});w+=g;const v=w.split(`
|
|
532
|
+
`);w="";let _=0,p=0;for(const y of v)if(y.trim()!==""&&y.startsWith("data:")){const T=y.slice(5).trim();if(T==="[DONE]"){this.settings.consoleLog&&console.log("Stream completed.");break}try{const M=JSON.parse(T);if(M.usage&&(_=M.usage.prompt_tokens,p=M.usage.completion_tokens),M.choices&&M.choices[0].delta&&M.choices[0].delta.content){const q=M.choices[0].delta.content;r&&r(q)}}catch{w+=y+`
|
|
533
|
+
`}}this.tokenInput+=_,this.tokenOutput+=p}return!0}catch(o){return o.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",o),!1}}async assistant(e,i,s,t){this.controller=new AbortController,this.signal=this.controller.signal;let n=.6,r=.9,a=1;t||(t=[]);let l=this.settings.model;t.length>0&&(l=this.settings.model2);const c={assistantId:this.settings.assistantId,question:e,context:i,system:s,functs:t,temperature:n,topP:r,num:a,model:l,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.assistantUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();return h.error?(console.log(`Error:
|
|
534
|
+
`+h.error),!1):(h.usage&&(this.tokenInput+=h.usage.prompt_tokens,this.tokenOutput+=h.usage.completion_tokens),h.answer.content[0].text.value)}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async assistantStream(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,l=1;t||(t=[]);const c={assistantId:this.settings.assistantId,question:e,context:i,system:s,functs:t,temperature:r,topP:a,num:l,model:this.settings.model,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers};const o=await fetch(this.settings.assistantStreamUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)});if(!o.ok)return console.error("Error:",o.statusText),!1;const h=o.body.getReader(),f=new TextDecoder;let m="",w=!1;for(;!w;){const{done:E,value:b}=await h.read();if(w=E,w)break;const k=f.decode(b,{stream:!0});m+=k;const g=m.split(`
|
|
535
|
+
`);m="";for(const v of g)if(v.trim()!=="")if(v.startsWith("data:")){const _=v.slice(5).trim();_==="[DONE]"&&this.settings.consoleLog&&console.log("Stream completed.");try{const p=JSON.parse(_);if(p.choices&&p.choices[0].delta&&p.choices[0].delta.content){const y=p.choices[0].delta.content;n&&n(y)}}catch{m+=v+`
|
|
536
|
+
`}}else{const _=JSON.parse(v);this.tokenInput+=_.prompt_tokens,this.tokenOutput+=_.completion_tokens;break}}return!0}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}hexToRgb(e){const i=e.replace("#",""),s=parseInt(i,16),t=s>>16&255,n=s>>8&255,r=s&255;return{red:t,green:n,blue:r}}getId(e="id"){return`${e}-${Math.random().toString(36).substr(2,9)}`}appendHtml(e,i){e&&i&&e.insertAdjacentHTML("beforeend",i)}cleanup(){if(this.element){let e=this.element.querySelectorAll('input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], textarea');e.forEach(i=>{i.removeEventListener("input",this.inputListener)}),e=this.element.querySelectorAll('input[type="date"], input[type="radio"], input[type="checkbox"]'),e.forEach(i=>{i.removeEventListener("change",this.changeListener)}),this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null)}}destroy(){try{if(this._scrollListener){let e;this.settings.isBuilder?e=document.querySelector(this.settings.previewSelector):e=this.element;const i=e.querySelector(".submit-container"),s=this.getScrollableParent(i);s?s.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._scrollListener)}}catch{}this.element&&(this.cleanup(),this.element.innerHTML="",this.element=null);for(const e in this.listeners)this.listeners[e].clear();this.listeners={}}out(e){let i=this.settings.lang[e];return i||e}}class Cr{addClass(e,i){e&&(this.hasClass(e,i)||(e.classList.length===0?e.className=i:e.className=e.className+" "+i,e.className=e.className.replace(/ +/g," ")))}removeClass(e,i){if(e&&e.classList.length>0){let s,t,n,r,a=i.split(" ");for(s=0,n=a.length;s<n;++s){if(!a[s])continue;let l=a[s],c="",d=e.className.split(" ");for(t=0,r=d.length;t<r;++t)d[t]&&d[t]!==l&&(c+=d[t]+" ");e.className=c.trim()}e.className===""&&e.removeAttribute("class")}}hasClass(e,i){if(!e)return!1;try{let s=e.getAttribute("class");return new RegExp("\\b"+i+"\\b").test(s)}catch{}}}const te=new Cr;class Or{constructor(e={}){const i={};this.settings=Object.assign(this,i,e)}init(){const e=h=>{const f=h.parentNode,m=h.nextElementSibling;if(te.hasClass(m,"is-menu-links")){let E=m.querySelectorAll("li");E.forEach(b=>{if(b!==f){const k=b.querySelector("ul");te.removeClass(k,"active")}}),E=document.querySelectorAll(".is-menu > ul > li ul"),E.forEach(b=>{const k=b.querySelector("ul");te.removeClass(k,"active")})}te.hasClass(m,"active")&&!te.hasClass(m,"is-menu-links")&&m.querySelectorAll("li").forEach(b=>{if(b!==f){const k=b.querySelector("ul");te.removeClass(k,"active")}});const w=f.querySelector("ul");w&&te.addClass(w,"active")},i=h=>{if(h.nextElementSibling){const f=h.nextElementSibling;if(f)if(te.hasClass(f,"active"))te.removeClass(f,"active"),h.focus();else{const w=h.parentNode.parentNode;te.removeClass(w,"active"),w.previousElementSibling.focus()}else{const w=h.parentNode.parentNode;te.removeClass(w,"active"),w.previousElementSibling.focus()}}else{const m=h.parentNode.parentNode;te.removeClass(m,"active"),m.previousElementSibling.focus()}},s=h=>{const f=h.target;if(h.keyCode===27)i(h.target);else if(h.keyCode===13)h.target.nextElementSibling&&(h.target.getAttribute("href")===""||h.target.getAttribute("href")==="javascript:")&&(e(h.target),h.preventDefault());else if(h.keyCode===32)h.target.nextElementSibling&&(e(h.target),h.preventDefault());else if(h.keyCode===40)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=f.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=f.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(h.keyCode===38)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.classList.remove("active");else{const m=f.parentNode.previousElementSibling;m&&m.querySelector("a").focus()}else if(f.parentNode.previousElementSibling)f.parentNode.previousElementSibling.querySelector("a").focus();else{const w=f.parentNode.parentNode;w.classList.contains("active")&&w.classList.remove("active"),w.previousElementSibling.focus()}else if(h.which===9&&!h.shiftKey)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=f.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=f.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(h.which===9&&h.shiftKey){if(f.nextElementSibling)f.nextElementSibling.classList.contains("active")&&f.nextElementSibling.classList.remove("active");else if(!f.parentNode.previousElementSibling){const w=f.parentNode.parentNode;w.classList.contains("active")&&w.classList.remove("active")}}};document.querySelectorAll(".is-menu li a").forEach(h=>{h.addEventListener("keydown",s)}),document.querySelectorAll(".is-menu li").forEach(h=>{const f=h.querySelector("span");f&&f.addEventListener("click",m=>{if(window.innerWidth>=1024)return;const b=m.target.closest("li").querySelector("ul");b&&(te.hasClass(b,"active")?(te.removeClass(b,"active"),b.style.display=""):te.addClass(b,"active")),m.preventDefault(),m.stopImmediatePropagation()}),h.addEventListener("click",m=>{const w=h.querySelector("ul"),E=window.innerWidth;let b=m.target.tagName.toLowerCase();if(E>1024){if((b==="a"||b==="i")&&!m.target.getAttribute("href")){m.preventDefault(),m.stopImmediatePropagation();return}}else{let k=!0;if((b==="a"||b==="i")&&(m.target.getAttribute("href")||(m.preventDefault(),k=!1)),k){const g=document.querySelector(".is-menu");if(g.style.right==="0px"){te.removeClass(r,"active"),g.style.right="-1000px";const v=document.querySelector(".is-menu-overlay");te.removeClass(v,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}}}w&&(te.hasClass(w,"active")?(te.removeClass(w,"active"),w.style.display=""):(te.addClass(w,"active"),setTimeout(()=>{},0)))}),h.addEventListener("mouseleave",m=>{window.innerWidth<=1024||(this.timer=setTimeout(()=>{const E=h.querySelector("ul");E&&te.removeClass(E,"active")},200),m.preventDefault(),m.stopImmediatePropagation())}),h.addEventListener("mouseenter",m=>{const w=window.innerWidth;if(w<=1024||this.staticClose)return;const E=document.querySelector(".is-menu-search-input");if(te.hasClass(E,"active"))return;clearTimeout(this.timer);const b=h.closest("ul");if(!h.querySelector("ul"))return b.querySelectorAll("li").forEach(v=>{const _=v.querySelector("ul");te.removeClass(_,"active")}),!0;if(te.hasClass(b,"is-menu-links")){let g=b.querySelectorAll("li");g.forEach(v=>{if(v!==h){const _=v.querySelector("ul");te.removeClass(_,"active")}}),g=document.querySelectorAll(".is-menu > ul > li ul"),g.forEach(v=>{const _=v.querySelector("ul");te.removeClass(_,"active")})}te.hasClass(b,"active")&&!te.hasClass(b,"is-menu-links")&&b.querySelectorAll("li").forEach(v=>{if(v!==h){const _=v.querySelector("ul");te.removeClass(_,"active")}});const k=h.querySelector("ul");if(k&&te.addClass(k,"active"),k.style.right="",k.classList.contains("active")){const g=k.getBoundingClientRect();g.left+g.width>w&&(k.style.right=0)}m.preventDefault(),m.stopImmediatePropagation()})});const r=document.querySelector("#is-menu-toggle");r.addEventListener("click",h=>{const f=document.querySelector(".is-menu");if(f.style.right==="0px"){te.removeClass(r,"active"),f.style.right="-1000px";const m=document.querySelector(".is-menu-overlay");te.removeClass(m,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}else{te.addClass(r,"active"),document.querySelector(".is-menu-links .is-menu-search")?(document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""):(document.querySelector(".is-menu-search-input").style.display="none",document.querySelector(".is-menu-links").style.marginTop="70px"),f.style.right="0px";const w=document.querySelector(".is-menu-overlay");te.addClass(w,"active"),document.querySelector(".is-topbar-menu").style.paddingRight=this.getScrollbarWidth()+"px",document.body.style.overflowY="hidden"}h.stopImmediatePropagation(),h.preventDefault()}),document.querySelector(".is-menu-overlay").addEventListener("click",h=>{document.querySelector("#is-menu-toggle").click(),h.stopImmediatePropagation(),h.preventDefault()}),window.addEventListener("resize",()=>{document.body.style.overflowY="auto",document.querySelector(".is-topbar-menu").style.paddingRight="0px";const h=document.querySelector("#is-menu-toggle");te.removeClass(h,"active"),document.querySelectorAll(".is-menu li ul").forEach(E=>{te.removeClass(E,"active")});const m=document.querySelector(".is-menu");if(m.style.transition="none",window.innerWidth>1024){m.style.right="0px",document.querySelectorAll(".is-menu li ul").forEach(k=>{k.style.display=""});const b=document.querySelector(".is-menu-overlay");te.removeClass(b,"active"),document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""}else m.style.right="-1000px";setTimeout(()=>{m.style.transition=""},30)}),window.addEventListener("scroll",()=>{var h=100,f=this.getCurrentScroll();f>=h?te.addClass(document.querySelector(".is-topbar"),"shrink"):te.removeClass(document.querySelector(".is-topbar"),"shrink"),window.innerWidth>=1024&&document.querySelector(".is-topbar.static")&&(f>30?this.staticClose||(document.querySelectorAll(".is-menu li ul").forEach(E=>{te.removeClass(E,"active")}),this.staticClose=!0):this.staticClose=!1)});const l=h=>{const f=document.querySelector(".is-menu-search-input");te.addClass(f,"active"),f.querySelector("input").focus(),document.querySelectorAll(".is-menu li ul").forEach(E=>{te.removeClass(E,"active")}),h.preventDefault(),h.stopImmediatePropagation()},c=document.querySelector(".is-menu-search");c&&(c.addEventListener("click",h=>{l(h)}),c.addEventListener("keydown",h=>{(h.keyCode===13||h.keyCode===32)&&l(h)})),document.addEventListener("click",h=>{const f=h.target;if(!te.hasClass(f,"is-menu-search")&&f.getAttribute("id")!=="is_btnSearch"&&f.getAttribute("id")!=="is_txtSearch"){const m=document.querySelector(".is-menu-search-input");te.removeClass(m,"active")}});const d=document.querySelector("#is_txtSearch");d.addEventListener("keydown",h=>{if(h.which==13&&this.settings.onSearch(d.value),h.which==27){const f=document.querySelector(".is-menu-search-input");te.removeClass(f,"active"),document.querySelector(".is-menu-search").focus()}}),document.querySelector("#is_btnSearch").addEventListener("click",()=>{this.settings.onSearch(d.value)})}getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}getCurrentScroll(){return window.pageYOffset||document.documentElement.scrollTop}}class Lr{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=zn,window.FormViewer=Er,window.NavBar=Or,window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{vs.init({duration:1200})},300),Ws({frameRate:150,animationTime:800,stepSize:120,pulseAlgorithm:1,pulseScale:4,pulseNormalize:1,accelerationDelta:300,accelerationMax:2,keyboardSupport:1,arrowScroll:50,fixedBackground:0})}prepareContent(){const e=document.querySelector(".is-wrapper");e.classList.add("box-v2");const i=function(r){let a=r.nextElementSibling;return a?a.classList.contains("is-section")?a:i(a):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(a){let l=a.target.closest(".is-section");if(l){let c=i(l);c&&this.scrollIt(c,1e3,"easeInQuad")}a.preventDefault(),a.stopImmediatePropagation()})}),e&&(e.classList.contains("is-edit")||e.querySelectorAll("a").forEach(function(a){a.addEventListener("click",function(l){let c=a.getAttribute("href");if(c&&c.indexOf("#")===0)if(c.indexOf("#section")===0){let d=c.replace("#section","");if(!isNaN(parseInt(d))){let o=document.querySelectorAll(".is-section"),h,f=0;o.forEach(function(m){m.classList.contains("is-section-navbar")||(f===d-1&&(h=m),f++)}),h&&scrollIt(h,1e3,"easeInQuad"),l.preventDefault()}}else try{let d=document.querySelector(c);d&&(scrollIt(d,1e3,"easeInQuad"),l.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let n=document.querySelectorAll(".is-animated,.is-scale-animated");n.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),n=document.querySelectorAll(".is-container > div"),n.forEach(function(r){let a=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),l=0;a.length>1&&a.forEach(function(c){c.className.indexOf("delay-")===-1&&(l>0&&(c.style.transitionDelay=l+"s",c.style.animationDelay=l+"s"),l=l+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function e(s){var t;return function(n){t&&clearTimeout(t),t=setTimeout(s,100,n)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",e(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var e=document.querySelectorAll(".is-overlay-bg");e.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new ks({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(e,i=0){const s=e.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(e,i=200,s="linear",t){_scrollTo(e)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(a=>{const l=a.firstElementChild;a.after(l),a.parentNode.removeChild(a)}),document.querySelectorAll(".is-section").forEach(a=>{a.hasAttribute("data-section-clone")&&a.parentNode.removeChild(a),a.hasAttribute("data-section-original")&&(a.style.display="",a.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(l=>{l.outerHTML=l.innerHTML});const t=window.self!==window.top;let n;t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.length>0&&window.scrollTo(0,0),n.forEach(function(a){s<=970&&a.querySelector(".is-box")&&(a.querySelectorAll(".is-box").forEach(c=>{const d=a.cloneNode(!1);c.getAttributeNames().map(o=>{o.indexOf("data-")!==-1&&d.setAttribute(o,c.getAttribute(o))}),d.classList.add("is-box"),c.classList.forEach(o=>{(o.indexOf("is-box-")!==-1||o.indexOf("is-content-")!==-1||o.indexOf("box-autofit")!==-1||o.indexOf("is-light-text")!==-1||o.indexOf("is-dark-text")!==-1||o.indexOf("is-align-")!==-1||o.indexOf("type-")!==-1||o.indexOf("block-click")!==-1||o.indexOf("hover-zoom")!==-1)&&d.classList.add(o)}),d.setAttribute("data-section-clone",""),d.innerHTML=c.innerHTML,a.parentNode.insertBefore(d,a)}),a.setAttribute("data-section-original",""),a.style.display="none")}),t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.forEach(function(a){if(a.parentNode.closest(".section-wrap")||s<=970&&a.hasAttribute("data-section-original"))return;const l=document.createElement("div");l.classList.add("pin-wrap"),a.classList.contains("m-skrollrr-off")&&l.classList.add("m-skrollrr-off"),a.classList.contains("pin-space-lg")&&l.classList.add("pin-space-lg"),a.classList.contains("pin-space-xl")&&l.classList.add("pin-space-xl"),a.classList.contains("xs-hidden")&&l.classList.add("xs-hidden"),a.classList.contains("sm-hidden")&&l.classList.add("sm-hidden"),a.classList.contains("desktop-hidden")&&l.classList.add("desktop-hidden"),a.after(l),l.appendChild(a)});const r=a=>{document.querySelectorAll(".is-section").forEach(c=>{const d=c.getBoundingClientRect().top;let o,h;c.parentNode.classList.contains("pin-wrap")?(o=c.parentNode.nextElementSibling,h=c.parentNode.previousElementSibling):(o=c.nextElementSibling,h=c.previousElementSibling),o&&o.classList.contains("pin-wrap")&&(o=o.querySelector(".is-section")),h&&h.classList.contains("pin-wrap")&&(h=h.querySelector(".is-section")),d<=0&&((c.classList.contains("no-spacing")||c.classList.contains("pin-overlap"))&&c.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(m=>{m!==c&&m.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||t)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const e=n=>{const r=document.createElement("div");r.style.backgroundPositionX=n.style.backgroundPositionX,r.style.backgroundPositionY=n.style.backgroundPositionY,r.style.backgroundSize=n.style.backgroundSize,n.hasAttribute("data-bg-ori")||n.setAttribute("data-bg-ori",r.style.cssText)},i=n=>{if(n.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=n.getAttribute("data-bg-ori"),n.style.backgroundPositionX=r.style.backgroundPositionX,n.style.backgroundPositionY=r.style.backgroundPositionY,n.style.backgroundSize=r.style.backgroundSize,n.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(n=>{e(n),s<=760&&(n.hasAttribute("data-bg-xs")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-xs"):i(n)),s>760&&s<=970&&(n.hasAttribute("data-bg-sm")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-sm"):i(n)),s>970&&s<=1280&&(n.hasAttribute("data-bg-md")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-md"):i(n)),s>1280&&(n.hasAttribute("data-bg-lg")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-lg"):i(n))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(t=>{t.querySelector("video.is-video-bg")&&t.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(t=>{t.parentNode.setAttribute("data-scroll","")});const s=new Ts({trigger:{once:!0,offset:{element:{x:0,y:(t,n,r)=>.1},viewport:{x:0,y:(t,n,r)=>t.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:t=>{t.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let a=r.parentNode.querySelector(".video-bg-play");r.autoplay?a?a.innerHTML.indexOf("play")===-1&&r.play():r.play():a&&a.innerHTML.indexOf("play")===-1&&r.play()})},out:t=>{t.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let e;window.contentbox?e=window.contentbox.onRender:parent.contentbox&&(e=parent.contentbox.onRender);const i=()=>{e.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(t){t.classList.contains("once")?(t.removeAttribute("data-scroll",""),t.setAttribute("data-scroll-once","")):(t.removeAttribute("data-scroll-once",""),t.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(t){let n=t.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;n.length>1&&n.forEach(function(a){a.className.indexOf("delay-")===-1&&(r>0&&(a.style.transitionDelay=r+"s",a.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const e={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(e),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const t=n=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,e),n.preventDefault(),n.stopImmediatePropagation()};s.addEventListener("click",t),s._lightboxHandler=t})}refreshLightbox(e){this.glightbox&&this.glightbox.destroy(),this.glightbox=new zi(e),window.GLightbox=zi.default}openLightbox(e,i,s){let t=[],n=0;if(i){const a=i.closest("[data-gallery]");let l=[];a?l=a.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(d=>{d.closest("[data-gallery]")||l.push(d)}),l.forEach((c,d)=>{let o=c.getAttribute("href");o||(o=c.getAttribute("data-modal-url")),t.push({href:o}),e===o&&(n=d)})}const r=document.activeElement;r?.blur(),t.length>0?(this.glightbox.setElements(t),this.glightbox.openAt(n)):(this.glightbox.setElements([{href:e}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s),r?.focus()})}blockInit(){const e={start:()=>{document.querySelectorAll(".is-block").forEach(t=>{t.hasAttribute("data--t")||t.setAttribute("data--t",t.style.top),t.hasAttribute("data--l")||t.setAttribute("data--l",t.style.left),t.hasAttribute("data--b")||t.setAttribute("data--b",t.style.bottom),t.hasAttribute("data--r")||t.setAttribute("data--r",t.style.right),t.hasAttribute("data--w")||t.setAttribute("data--w",t.style.width),t.hasAttribute("data--h")||t.setAttribute("data--h",t.style.height),t.removeAttribute("data-prev"),t.removeAttribute("data-fluid"),t.removeAttribute("data-fluid-val"),t.classList.remove("fluid"),t.style.transition=""})},apply:(t,n,r)=>{if(n&&t.getAttribute("data-prev")!==n+""){if(r||(t.style.transition="all 0.35s ease"),n!==1e4){if(t.setAttribute("data-breakpoint",n),t.hasAttribute("data--t-"+n)){let a=t.getAttribute("data--t-"+n);t.style.top=a}if(t.hasAttribute("data--l-"+n)){let a=t.getAttribute("data--l-"+n);t.style.left=a}if(t.hasAttribute("data--b-"+n)){let a=t.getAttribute("data--b-"+n);t.style.bottom=a}if(t.hasAttribute("data--r-"+n)){let a=t.getAttribute("data--r-"+n);t.style.right=a}if(t.hasAttribute("data--w-"+n)){let a=t.getAttribute("data--w-"+n);t.style.width=a}if(t.hasAttribute("data--h-"+n)){let a=t.getAttribute("data--h-"+n);t.style.height=a}if(t.hasAttribute("data--transform-"+n)){let a=t.getAttribute("data--transform-"+n);t.style.transform=a,t.setAttribute("data--transform-val",n)}}else{if(t.removeAttribute("data-breakpoint"),t.hasAttribute("data--t")){let a=t.getAttribute("data--t");t.style.top=a}if(t.hasAttribute("data--l")){let a=t.getAttribute("data--l");t.style.left=a}if(t.hasAttribute("data--b")){let a=t.getAttribute("data--b");t.style.bottom=a}if(t.hasAttribute("data--r")){let a=t.getAttribute("data--r");t.style.right=a}if(t.hasAttribute("data--w")){let a=t.getAttribute("data--w");t.style.width=a}if(t.hasAttribute("data--h")){let a=t.getAttribute("data--h");t.style.height=a}if(t.hasAttribute("data--transform")){let a=t.getAttribute("data--transform");t.style.transform=a,t.setAttribute("data--transform-val","")}}t.setAttribute("data-prev",n),setTimeout(()=>{r||(t.style.transition="")},400)}},applyFluid:(t,n)=>{t.classList.toggle("fluid",n==="yes"),t.setAttribute("data-fluid",n)},resize:t=>{const n=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let a=[];const l=r.attributes;for(let c=0;c<l.length;c++){let o=l[c].name.match(/^data--h-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0){if(n>d){let o=r.getAttribute("data--h");o?r.style.height=o:r.style.height=""}}else{const o=a[c-1];if(o>=n&&n>d){let h=r.getAttribute("data--h-"+o);h&&(r.style.height=h)}}}if(a.length>0&&a[a.length-1]>=n){const d=a[a.length-1];let o=r.getAttribute("data--h-"+d);o&&(r.style.height=o)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>n&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),e.applyFluid(r,"yes"));let c=r.getAttribute("data-fluid-val");c&&parseInt(c)+0<=n&&r.classList.contains("fluid")&&e.applyFluid(r,"no")}let a=[];const l=r.attributes;for(let c=0;c<l.length;c++){const d=l[c].name;let o=d.match(/^data--t-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--w-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--transform-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0)n>d&&e.apply(r,1e4,t);else{const o=a[c-1];o>=n&&n>d&&e.apply(r,o,t)}}if(a.length>0){const c=a[a.length-1];c>=n&&e.apply(r,c,t)}})},render:()=>{e.start(),e.resize(!0)}},s=((t,n)=>{let r;return(...a)=>{clearTimeout(r),r=setTimeout(()=>t(...a),n)}})(()=>{e.resize()},0);window.addEventListener("resize",s),e.start(),e.resize(!0),this.Block=e}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return Lr})();
|