@innovastudio/contentbox-runtime 1.0.4 → 1.0.6
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 +1842 -2089
- package/dist/contentbox-runtime.min.js +57 -57
- package/package.json +2 -3
|
@@ -1,9 +1,9 @@
|
|
|
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(`
|
|
1
|
+
var ContentBoxRuntime=(function(){"use strict";var _i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var yt={exports:{}},fs=yt.exports,Si;function gs(){return Si||(Si=1,(function(u,e){(function(i,s){u.exports=s()})(fs,function(){var i=typeof window<"u"?window:typeof _i<"u"?_i: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,p=o||h||Function("return this")(),g=Object.prototype.toString,w=Math.max,E=Math.min,b=function(){return p.Date.now()};function k(M,D,V){var U,K,ve,be,J,we,ue=0,qe=!1,ke=!1,Ce=!0;if(typeof M!="function")throw new TypeError(s);function Me(Z){var _e=U,Ie=K;return U=K=void 0,ue=Z,be=M.apply(Ie,_e)}function We(Z){var _e=Z-we;return we===void 0||_e>=D||_e<0||ke&&Z-ue>=ve}function He(){var Z=b();if(We(Z))return Ze(Z);J=setTimeout(He,(function(_e){var Ie=D-(_e-we);return ke?E(Ie,ve-(_e-ue)):Ie})(Z))}function Ze(Z){return J=void 0,Ce&&U?Me(Z):(U=K=void 0,be)}function Ae(){var Z=b(),_e=We(Z);if(U=arguments,K=this,we=Z,_e){if(J===void 0)return(function(Ie){return ue=Ie,J=setTimeout(He,D),qe?Me(Ie):be})(we);if(ke)return J=setTimeout(He,D),Me(we)}return J===void 0&&(J=setTimeout(He,D)),be}return D=v(D)||0,m(V)&&(qe=!!V.leading,ve=(ke="maxWait"in V)?w(v(V.maxWait)||0,D):ve,Ce="trailing"in V?!!V.trailing:Ce),Ae.cancel=function(){J!==void 0&&clearTimeout(J),ue=0,U=we=K=J=void 0},Ae.flush=function(){return J===void 0?be:Ze(b())},Ae}function m(M){var D=typeof M;return!!M&&(D=="object"||D=="function")}function v(M){if(typeof M=="number")return M;if((function(U){return typeof U=="symbol"||(function(K){return!!K&&typeof K=="object"})(U)&&g.call(U)==n})(M))return t;if(m(M)){var D=typeof M.valueOf=="function"?M.valueOf():M;M=m(D)?D+"":D}if(typeof M!="string")return M===0?M:+M;M=M.replace(r,"");var V=l.test(M);return V||c.test(M)?d(M.slice(2),V?2:8):a.test(M)?t:+M}var _=function(M,D,V){var U=!0,K=!0;if(typeof M!="function")throw new TypeError(s);return m(V)&&(U="leading"in V?!!V.leading:U,K="trailing"in V?!!V.trailing:K),k(M,D,{leading:U,maxWait:D,trailing:K})},f="Expected a function",y=NaN,T="[object Symbol]",R=/^\s+|\s+$/g,A=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,P=/^0o[0-7]+$/i,I=parseInt,C=typeof i=="object"&&i&&i.Object===Object&&i,x=typeof self=="object"&&self&&self.Object===Object&&self,S=C||x||Function("return this")(),O=Object.prototype.toString,j=Math.max,L=Math.min,H=function(){return S.Date.now()};function z(M){var D=typeof M;return!!M&&(D=="object"||D=="function")}function B(M){if(typeof M=="number")return M;if((function(U){return typeof U=="symbol"||(function(K){return!!K&&typeof K=="object"})(U)&&O.call(U)==T})(M))return y;if(z(M)){var D=typeof M.valueOf=="function"?M.valueOf():M;M=z(D)?D+"":D}if(typeof M!="string")return M===0?M:+M;M=M.replace(R,"");var V=N.test(M);return V||P.test(M)?I(M.slice(2),V?2:8):A.test(M)?y:+M}var G=function(M,D,V){var U,K,ve,be,J,we,ue=0,qe=!1,ke=!1,Ce=!0;if(typeof M!="function")throw new TypeError(f);function Me(Z){var _e=U,Ie=K;return U=K=void 0,ue=Z,be=M.apply(Ie,_e)}function We(Z){var _e=Z-we;return we===void 0||_e>=D||_e<0||ke&&Z-ue>=ve}function He(){var Z=H();if(We(Z))return Ze(Z);J=setTimeout(He,(function(_e){var Ie=D-(_e-we);return ke?L(Ie,ve-(_e-ue)):Ie})(Z))}function Ze(Z){return J=void 0,Ce&&U?Me(Z):(U=K=void 0,be)}function Ae(){var Z=H(),_e=We(Z);if(U=arguments,K=this,we=Z,_e){if(J===void 0)return(function(Ie){return ue=Ie,J=setTimeout(He,D),qe?Me(Ie):be})(we);if(ke)return J=setTimeout(He,D),Me(we)}return J===void 0&&(J=setTimeout(He,D)),be}return D=B(D)||0,z(V)&&(qe=!!V.leading,ve=(ke="maxWait"in V)?j(B(V.maxWait)||0,D):ve,Ce="trailing"in V?!!V.trailing:Ce),Ae.cancel=function(){J!==void 0&&clearTimeout(J),ue=0,U=we=K=J=void 0},Ae.flush=function(){return J===void 0?be:Ze(H())},Ae},W=function(){};function ee(M){M&&M.forEach(function(D){var V=Array.prototype.slice.call(D.addedNodes),U=Array.prototype.slice.call(D.removedNodes);if((function K(ve){var be=void 0,J=void 0;for(be=0;be<ve.length;be+=1)if((J=ve[be]).dataset&&J.dataset.aos||J.children&&K(J.children))return!0;return!1})(V.concat(U)))return W()})}function Q(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var he={isSupported:function(){return!!Q()},ready:function(M,D){var V=window.document,U=new(Q())(ee);W=D,U.observe(V.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},Te=function(M,D){if(!(M instanceof D))throw new TypeError("Cannot call a class as a function")},me=(function(){function M(D,V){for(var U=0;U<V.length;U++){var K=V[U];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(D,K.key,K)}}return function(D,V,U){return V&&M(D.prototype,V),U&&M(D,U),D}})(),Ee=Object.assign||function(M){for(var D=1;D<arguments.length;D++){var V=arguments[D];for(var U in V)Object.prototype.hasOwnProperty.call(V,U)&&(M[U]=V[U])}return M},ye=/(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,oe=/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,$=/(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 ie(){return navigator.userAgent||navigator.vendor||window.opera||""}var ce=new((function(){function M(){Te(this,M)}return me(M,[{key:"phone",value:function(){var D=ie();return!(!ye.test(D)&&!oe.test(D.substr(0,4)))}},{key:"mobile",value:function(){var D=ie();return!(!$.test(D)&&!X.test(D.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}}]),M})()),ge=function(M,D){var V=void 0;return ce.ie11()?(V=document.createEvent("CustomEvent")).initCustomEvent(M,!0,!0,{detail:D}):V=new CustomEvent(M,{detail:D}),document.dispatchEvent(V)},le=function(M){return M.forEach(function(D,V){return(function(U,K){var ve=U.options,be=U.position,J=U.node,we=(U.data,function(){U.animated&&((function(ue,qe){qe&&qe.forEach(function(ke){return ue.classList.remove(ke)})})(J,ve.animatedClassNames),ge("aos:out",J),U.options.id&&ge("aos:in:"+U.options.id,J),U.animated=!1)});ve.mirror&&K>=be.out&&!ve.once?we():K>=be.in?U.animated||((function(ue,qe){qe&&qe.forEach(function(ke){return ue.classList.add(ke)})})(J,ve.animatedClassNames),ge("aos:in",J),U.options.id&&ge("aos:in:"+U.options.id,J),U.animated=!0):U.animated&&!ve.once&&we()})(D,window.pageYOffset)})},se=function(M){for(var D=0,V=0;M&&!isNaN(M.offsetLeft)&&!isNaN(M.offsetTop);)D+=M.offsetLeft-(M.tagName!="BODY"?M.scrollLeft:0),V+=M.offsetTop-(M.tagName!="BODY"?M.scrollTop:0),M=M.offsetParent;return{top:V,left:D}},te=function(M,D,V){var U=M.getAttribute("data-aos-"+D);if(U!==void 0){if(U==="true")return!0;if(U==="false")return!1}return U||V},Y=function(M,D){return M.forEach(function(V,U){var K=te(V.node,"mirror",D.mirror),ve=te(V.node,"once",D.once),be=te(V.node,"id"),J=D.useClassNames&&V.node.getAttribute("data-aos"),we=[D.animatedClassName].concat(J?J.split(" "):[]).filter(function(ue){return typeof ue=="string"});D.initClassName&&V.node.classList.add(D.initClassName),V.position={in:(function(ue,qe,ke){var Ce=window.innerHeight,Me=te(ue,"anchor"),We=te(ue,"anchor-placement"),He=Number(te(ue,"offset",We?0:qe)),Ze=We||ke,Ae=ue;Me&&document.querySelectorAll(Me)&&(Ae=document.querySelectorAll(Me)[0]);var Z=se(Ae).top-Ce;switch(Ze){case"top-bottom":break;case"center-bottom":Z+=Ae.offsetHeight/2;break;case"bottom-bottom":Z+=Ae.offsetHeight;break;case"top-center":Z+=Ce/2;break;case"center-center":Z+=Ce/2+Ae.offsetHeight/2;break;case"bottom-center":Z+=Ce/2+Ae.offsetHeight;break;case"top-top":Z+=Ce;break;case"bottom-top":Z+=Ce+Ae.offsetHeight;break;case"center-top":Z+=Ce+Ae.offsetHeight/2}return Z+He})(V.node,D.offset,D.anchorPlacement),out:K&&(function(ue,qe){var ke=te(ue,"anchor"),Ce=te(ue,"offset",qe),Me=ue;return ke&&document.querySelectorAll(ke)&&(Me=document.querySelectorAll(ke)[0]),se(Me).top+Me.offsetHeight-Ce})(V.node,D.offset)},V.options={once:ve,mirror:K,animatedClassNames:we,id:be}}),M},Se=function(){var M=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(M,function(D){return{node:D}})},pe=[],Re=!1,ne={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},De=function(){return document.all&&!window.atob},Oe=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(Re=!0),Re&&(pe=Y(pe,ne),le(pe),window.addEventListener("scroll",_(function(){le(pe,ne.once)},ne.throttleDelay)))},$e=function(){if(pe=Se(),Ye(ne.disable)||De())return Be();Oe()},Be=function(){pe.forEach(function(M,D){M.node.removeAttribute("data-aos"),M.node.removeAttribute("data-aos-easing"),M.node.removeAttribute("data-aos-duration"),M.node.removeAttribute("data-aos-delay"),ne.initClassName&&M.node.classList.remove(ne.initClassName),ne.animatedClassName&&M.node.classList.remove(ne.animatedClassName)})},Ye=function(M){return M===!0||M==="mobile"&&ce.mobile()||M==="phone"&&ce.phone()||M==="tablet"&&ce.tablet()||typeof M=="function"&&M()===!0};return{init:function(M){return ne=Ee(ne,M),pe=Se(),ne.disableMutationObserver||he.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,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){/*!
|
|
5
|
+
`),ne.disableMutationObserver=!0),ne.disableMutationObserver||he.ready("[data-aos]",$e),Ye(ne.disable)||De()?Be():(document.querySelector("body").setAttribute("data-aos-easing",ne.easing),document.querySelector("body").setAttribute("data-aos-duration",ne.duration),document.querySelector("body").setAttribute("data-aos-delay",ne.delay),["DOMContentLoaded","load"].indexOf(ne.startEvent)===-1?document.addEventListener(ne.startEvent,function(){Oe(!0)}):window.addEventListener("load",function(){Oe(!0)}),ne.startEvent==="DOMContentLoaded"&&["complete","interactive"].indexOf(document.readyState)>-1&&Oe(!0),window.addEventListener("resize",G(Oe,ne.debounceDelay,!0)),window.addEventListener("orientationchange",G(Oe,ne.debounceDelay,!0)),pe)},refresh:Oe,refreshHard:$e}})})(yt)),yt.exports}var ms=gs();const bs=Zt(ms);var Qt={exports:{}},Ti;function ys(){return Ti||(Ti=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,p=!1,g=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){p=!0,g=b}finally{try{h||E.return==null||E.return()}finally{if(p)throw g}}return o}}function l(c){if(Array.isArray(c))return c}(function(){function c(f){return["elInY+elHeight","elCenterY-".concat(f=0<arguments.length&&f!==void 0?f:30),"elCenterY","elCenterY+".concat(f),"elOutY-elHeight"]}var d,o,h,p,g,w,E={fadeInOut:function(f,y){return y=1<arguments.length&&y!==void 0?y:0,{opacity:[c(0<arguments.length&&f!==void 0?f:30),[y,1,1,1,y]]}},fadeIn:function(f,y){return{opacity:[["elInY+elHeight",0<arguments.length&&f!==void 0?f:"elCenterY"],[1<arguments.length&&y!==void 0?y:0,1]]}},fadeOut:function(f,y){return{opacity:[[0<arguments.length&&f!==void 0?f:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&y!==void 0?y:0]]}},blurInOut:function(f,y){return y=1<arguments.length&&y!==void 0?y:20,{blur:[c(0<arguments.length&&f!==void 0?f:100),[y,0,0,0,y]]}},blurIn:function(f,y){return{blur:[["elInY+elHeight",0<arguments.length&&f!==void 0?f:"elCenterY"],[1<arguments.length&&y!==void 0?y:20,0]]}},blurOut:function(f,y){return{opacity:[[0<arguments.length&&f!==void 0?f:"elCenterY","elOutY-elHeight"],[0,1<arguments.length&&y!==void 0?y:20]]}},scaleInOut:function(f,y){return y=1<arguments.length&&y!==void 0?y:.6,{scale:[c(0<arguments.length&&f!==void 0?f:100),[y,1,1,1,y]]}},scaleIn:function(f,y){return{scale:[["elInY+elHeight",0<arguments.length&&f!==void 0?f:"elCenterY"],[1<arguments.length&&y!==void 0?y:.6,1]]}},scaleOut:function(f,y){return{scale:[[0<arguments.length&&f!==void 0?f:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&y!==void 0?y:.6]]}},slideX:function(f,y){return{translateX:[["elInY",0<arguments.length&&f!==void 0?f:0],[0,1<arguments.length&&y!==void 0?y:500]]}},slideY:function(f,y){return{translateY:[["elInY",0<arguments.length&&f!==void 0?f:0],[0,1<arguments.length&&y!==void 0?y:500]]}},spin:function(f,y){return f=0<arguments.length&&f!==void 0?f:1e3,{rotate:[[0,f],[0,1<arguments.length&&y!==void 0?y:360],{modValue:f}]}},flipX:function(f,y){return f=0<arguments.length&&f!==void 0?f:1e3,{rotateX:[[0,f],[0,1<arguments.length&&y!==void 0?y:360],{modValue:f}]}},flipY:function(f,y){return f=0<arguments.length&&f!==void 0?f:1e3,{rotateY:[[0,f],[0,1<arguments.length&&y!==void 0?y:360],{modValue:f}]}},jiggle:function(f,y){return f=0<arguments.length&&f!==void 0?f:50,y=1<arguments.length&&y!==void 0?y:40,{skewX:[[0,+f,2*f,3*f,4*f],[0,y,0,-y,0],{modValue:4*f}]}},seesaw:function(f,y){return f=0<arguments.length&&f!==void 0?f:50,y=1<arguments.length&&y!==void 0?y:40,{skewY:[[0,+f,2*f,3*f,4*f],[0,y,0,-y,0],{modValue:4*f}]}},zigzag:function(f,y){return f=0<arguments.length&&f!==void 0?f:100,y=1<arguments.length&&y!==void 0?y:100,{translateX:[[0,+f,2*f,3*f,4*f],[0,y,0,-y,0],{modValue:4*f}]}},hueRotate:function(f,y){return f=0<arguments.length&&f!==void 0?f:600,{"hue-rotate":[[0,f],[0,1<arguments.length&&y!==void 0?y:360],{modValue:f}]}}},b=(d=["perspective","scaleX","scaleY","scale","skewX","skewY","skew","rotateX","rotateY","rotate"],o=["blur","hue-rotate","brightness"],h=["translateX","translateY","translateZ"],p=["perspective","border-radius","blur","translateX","translateY","translateZ"],g=["hue-rotate","rotate","rotateX","rotateY","skew","skewX","skewY"],w={easeInQuad:function(f){return f*f},easeOutQuad:function(f){return f*(2-f)},easeInOutQuad:function(f){return f<.5?2*f*f:(4-2*f)*f-1},easeInCubic:function(f){return f*f*f},easeOutCubic:function(f){return--f*f*f+1},easeInOutCubic:function(f){return f<.5?4*f*f*f:(f-1)*(2*f-2)*(2*f-2)+1},easeInQuart:function(f){return f*f*f*f},easeOutQuart:function(f){return 1- --f*f*f*f},easeInOutQuart:function(f){return f<.5?8*f*f*f*f:1-8*--f*f*f*f},easeInQuint:function(f){return f*f*f*f*f},easeOutQuint:function(f){return 1+--f*f*f*f*f},easeInOutQuint:function(f){return f<.5?16*f*f*f*f*f:1+16*--f*f*f*f*f},easeOutBounce:function(f){var y=7.5625,T=2.75;return f<1/T?y*f*f:f<2/T?y*(f-=1.5/T)*f+.75:f<2.5/T?y*(f-=2.25/T)*f+.9375:y*(f-=2.625/T)*f+.984375},easeInBounce:function(f){return 1-w.easeOutBounce(1-f)},easeOutBack:function(f){return 1+2.70158*Math.pow(f-1,3)+1.70158*Math.pow(f-1,2)},easeInBack:function(f){return 2.70158*f*f*f-1.70158*f*f}},new function f(){var y=this;e(this,f),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 R,A={};y.drivers.forEach(function(N){A[N.name]=N.getValue(y.frame)}),y.elements.forEach(function(N){N.update(A,y.frame)}),y.debug&&y.debugData.frameLengths.push(Date.now()-y.debugData.frameStart),y.frame%60==0&&y.debug&&(R=Math.ceil(y.debugData.frameLengths.reduce(function(N,P){return N+P},0)/60),console.log("Average frame calculation time: ".concat(R,"ms")),y.debugData.frameLengths=[]),y.frame++,window.requestAnimationFrame(y.onAnimationFrame)}),i(this,"addDriver",function(T,R){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};y.drivers.push(new v(T,R,A))}),i(this,"removeDriver",function(T){y.drivers=y.drivers.filter(function(R){return R.name!==T})}),i(this,"findAndAddElements",function(){y.elements=[],document.querySelectorAll(".lax").forEach(function(T){var R=[];T.classList.forEach(function(N){N.includes("lax_preset")&&(N=N.replace("lax_preset_",""),R.push(N))});var A=i({},"scrollY",{presets:R});y.elements.push(new _(".lax",y,T,A,0,{}))})}),i(this,"addElements",function(T,R,A){document.querySelectorAll(T).forEach(function(N,P){y.elements.push(new _(T,y,N,R,P,A))})}),i(this,"removeElements",function(T){y.elements=y.elements.filter(function(R){return R.selector!==T})}),i(this,"addElement",function(T,R,A){y.elements.push(new _("",y,T,R,0,A))}),i(this,"removeElement",function(T){y.elements=y.elements.filter(function(R){return R.domElement!==T})})});function k(f,y){if(Array.isArray(f))return f;for(var T=Object.keys(f).map(function(P){return parseInt(P)}).sort(function(P,I){return I<P?1:-1}),R=T[T.length-1],A=0;A<T.length;A++){var N=T[A];if(y<N){R=N;break}}return f[R]}function m(f,L,T){var R=L.width,A=L.height,S=L.x,j=L.y;if(typeof f=="number")return f;var N,P=document.body.scrollHeight,I=document.body.scrollWidth,C=window.innerWidth,x=window.innerHeight,O=s((N=window.pageXOffset!==void 0,O=(document.compatMode||"")==="CSS1Compat",L=N?window.pageXOffset:(O?document.documentElement:document.body).scrollLeft,[N?window.pageYOffset:(O?document.documentElement:document.body).scrollTop,L]),2),L=O[0],S=S+O[1],O=S+R,j=j+L,L=j+A;return Function("return ".concat(f.replace(/screenWidth/g,C).replace(/screenHeight/g,x).replace(/pageHeight/g,P).replace(/pageWidth/g,I).replace(/elWidth/g,R).replace(/elHeight/g,A).replace(/elInY/g,j-x).replace(/elOutY/g,L).replace(/elCenterY/g,j+A/2-x/2).replace(/elInX/g,S-C).replace(/elOutX/g,O).replace(/elCenterX/g,S+R/2-C/2).replace(/index/g,T)))()}function v(f,y){var T=this,R=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(A){var N=T.lastValue;return A%T.frameStep==0&&(N=T.getValueFn(A)),T.inertiaEnabled&&(A=N-T.lastValue,T.m1=.8*T.m1+A*.19999999999999996,T.m2=.8*T.m2+T.m1*.19999999999999996,T.inertia=Math.round(5e3*T.m2)/15e3),T.lastValue=N,[T.lastValue,T.inertia]}),this.name=f,this.getValueFn=y,Object.keys(R).forEach(function(A){T[A]=R[A]}),this.lastValue=this.getValueFn(0)}function _(f,y,T,R){var A=this,N=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,I=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(C,x){var S,O=A.transforms,j={};for(S in O){var L=O[S];C[S]||console.error("No lax driver with name: ",S);var H,z=s(C[S],2),B=z[0],G=z[1];for(H in L){var W,me=s(L[H],3),ee=me[0],Q=me[1],Ee=me[2],oe=Ee===void 0?{}:Ee,he=oe.modValue,ye=oe.frameStep,Te=ye===void 0?1:ye,$=oe.easing,me=oe.inertia,Ee=oe.inertiaMode,ye=oe.cssFn,oe=oe.cssUnit,oe=oe===void 0?"":oe,$=w[$];x%Te==0&&($=(function(X,ie,ce,ge){var le=0;if(X.forEach(function(Y){Y<ce&&le++}),le<=0)return ie[0];if(le>=X.length)return ie[X.length-1];var se,te=(te=X[se=le-1],X=X[le],(ce-te)/(X-te));return ge&&(te=ge(te)),se=ie[se],ie=ie[le],se*(1-(te=te))+ie*te})(ee,Q,he?B%he:B,$),me&&(W=G*me,Ee==="absolute"&&(W=Math.abs(W)),$+=W),W=(oe||p.includes(H)?"px":g.includes(H)?"deg":"")=="px"?0:3,W=$.toFixed(W),j[H]=ye?ye(W,A.domElement):W+oe)}}A.applyStyles(j),A.onUpdate&&A.onUpdate(C,A.domElement)}),i(this,"calculateTransforms",function(){A.transforms={};var C,x=A.laxInstance.windowWidth;for(C in A.transformsData)(function(S){var O=A.transformsData[S],j={},L=O.presets;(L===void 0?[]:L).forEach(function(ee){var B,Q=s(ee.split(":"),3),G=Q[0],W=Q[1],ee=Q[2],Q=window.lax.presets[G];Q?(B=Q(W,ee),Object.keys(B).forEach(function(he){O[he]=B[he]})):console.error("Lax preset cannot be found with name: ",G)}),delete O.presets;for(var H in O)(function(z){var B=s(O[z],3),ee=B[0],W=ee===void 0?[-1e9,1e9]:ee,ee=B[1],ee=ee===void 0?[-1e9,1e9]:ee,B=B[2],B=B===void 0?{}:B,G=A.domElement.getBoundingClientRect(),W=k(W,x).map(function(Q){return m(Q,G,A.groupIndex)}),ee=k(ee,x).map(function(Q){return m(Q,G,A.groupIndex)});j[z]=[W,ee,B]})(H);A.transforms[S]=j})(C)}),i(this,"applyStyles",function(C){var x,S,O,j=(x=C,S={transform:"",filter:""},O={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(x).forEach(function(L){var H=x[L],z=p.includes(L)?"px":g.includes(L)?"deg":"";h.includes(L)?O[L]=H:d.includes(L)?S.transform+="".concat(L,"(").concat(H).concat(z,") "):o.includes(L)?S.filter+="".concat(L,"(").concat(H).concat(z,") "):S[L]="".concat(H).concat(z," ")}),S.transform="translate3d(".concat(O.translateX,"px, ").concat(O.translateY,"px, ").concat(O.translateZ,"px) ").concat(S.transform),S);Object.keys(j).forEach(function(L){A.domElement.style.setProperty(L,j[L])})}),this.selector=f,this.laxInstance=y,this.domElement=T,this.transformsData=R,this.groupIndex=N;var P=(N=I.style)===void 0?{}:N,I=I.onUpdate;Object.keys(P).forEach(function(C){T.style.setProperty(C,P[C])}),I&&(this.onUpdate=I),this.calculateTransforms()}u.exports!==void 0?u.exports=b:window.lax=b})()})(Qt)),Qt.exports}var vs=ys();const lt=Zt(vs);class ws{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"),p=this.getObjVal(t,"data--400-bottom"),g=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"),m=this.getObjVal(t,"data-bottom"),v=this.getObjVal(t,"data-50-bottom"),_=this.getObjVal(t,"data-100-bottom"),f=this.getObjVal(t,"data-150-bottom"),y=this.getObjVal(t,"data-200-bottom"),T=this.getObjVal(t,"data-300-bottom"),R=this.getObjVal(t,"data-400-bottom"),A=this.getObjVal(t,"data-bottom-top"),N=this.getObjVal(t,"data-in"),P=this.getObjVal(t,"data-in-150"),I=this.getObjVal(t,"data-in-300"),C=this.getObjVal(t,"data-cen--150"),x=this.getObjVal(t,"data-cen"),S=this.getObjVal(t,"data-cen-150"),O=this.getObjVal(t,"data-out--300"),j=this.getObjVal(t,"data-out--150"),L=this.getObjVal(t,"data-out"),H=!1;t.hasAttribute("data-xs")&&(H=!0);let z=!1;t.hasAttribute("data-sm")&&(z=!0);let B=!1;t.hasAttribute("data-md")&&(B=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let G={},W={},ee={},Q={},he={},Te={},me={},Ee={},ye={},oe={},$={},X={},ie={},ce={},ge={},le={},se={},te={},Y={},Se={},pe={},Re={},ne={},De={},Oe={},$e={},Be={},Ye={},M={},D={},V={},U={},K={};(i>1280||i>970&&i<=1280&&!B||i>760&&i<=970&&!z||i<=760&&!H)&&(ee=this.getObjVal(t,"data-t"),Q=this.getObjVal(t,"data-t-100"),he=this.getObjVal(t,"data-t-200"),Te=this.getObjVal(t,"data-t-300"),me=this.getObjVal(t,"data-t-400"),Ee=this.getObjVal(t,"data-t-500"),ye=this.getObjVal(t,"data-t-600"),oe=this.getObjVal(t,"data-t-700"),$=this.getObjVal(t,"data-t-800"),X=this.getObjVal(t,"data-t-900"),ie=this.getObjVal(t,"data-t-1000"),ce=this.getObjVal(t,"data-t-1100"),ge=this.getObjVal(t,"data-t-1200"),le=this.getObjVal(t,"data-t-1300"),se=this.getObjVal(t,"data-t-1400"),te=this.getObjVal(t,"data-t-1500"),Y=this.getObjVal(t,"data-t-1600"),Se=this.getObjVal(t,"data-t-1700"),pe=this.getObjVal(t,"data-t-1800"),Re=this.getObjVal(t,"data-t-1900"),ne=this.getObjVal(t,"data-t-2000"),De=this.getObjVal(t,"data-t-2100"),Oe=this.getObjVal(t,"data-t-2200"),$e=this.getObjVal(t,"data-t-2300"),Be=this.getObjVal(t,"data-t-2400"),Ye=this.getObjVal(t,"data-t-2500"),M=this.getObjVal(t,"data-t-2600"),D=this.getObjVal(t,"data-t-2700"),V=this.getObjVal(t,"data-t-2800")),i>970&&i<=1280&&B&&(t.hasAttribute("data-md-t")&&(ee=this.getObjVal(t,"data-md-t")),t.hasAttribute("data-md-t-100")&&(Q=this.getObjVal(t,"data-md-t-100")),t.hasAttribute("data-md-t-200")&&(he=this.getObjVal(t,"data-md-t-200")),t.hasAttribute("data-md-t-300")&&(Te=this.getObjVal(t,"data-md-t-300")),t.hasAttribute("data-md-t-400")&&(me=this.getObjVal(t,"data-md-t-400")),t.hasAttribute("data-md-t-500")&&(Ee=this.getObjVal(t,"data-md-t-500")),t.hasAttribute("data-md-t-600")&&(ye=this.getObjVal(t,"data-md-t-600")),t.hasAttribute("data-md-t-700")&&(oe=this.getObjVal(t,"data-md-t-700")),t.hasAttribute("data-md-t-800")&&($=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")&&(ie=this.getObjVal(t,"data-md-t-1000")),t.hasAttribute("data-md-t-1100")&&(ce=this.getObjVal(t,"data-md-t-1100")),t.hasAttribute("data-md-t-1200")&&(ge=this.getObjVal(t,"data-md-t-1200")),t.hasAttribute("data-md-t-1300")&&(le=this.getObjVal(t,"data-md-t-1300")),t.hasAttribute("data-md-t-1400")&&(se=this.getObjVal(t,"data-md-t-1400")),t.hasAttribute("data-md-t-1500")&&(te=this.getObjVal(t,"data-md-t-1500")),t.hasAttribute("data-md-t-1600")&&(Y=this.getObjVal(t,"data-md-t-1600")),t.hasAttribute("data-md-t-1700")&&(Se=this.getObjVal(t,"data-md-t-1700")),t.hasAttribute("data-md-t-1800")&&(pe=this.getObjVal(t,"data-md-t-1800")),t.hasAttribute("data-md-t-1900")&&(Re=this.getObjVal(t,"data-md-t-1900")),t.hasAttribute("data-md-t-2000")&&(ne=this.getObjVal(t,"data-md-t-2000")),t.hasAttribute("data-md-t-2100")&&(De=this.getObjVal(t,"data-md-t-2100")),t.hasAttribute("data-md-t-2200")&&(Oe=this.getObjVal(t,"data-md-t-2200")),t.hasAttribute("data-md-t-2300")&&($e=this.getObjVal(t,"data-md-t-2300")),t.hasAttribute("data-md-t-2400")&&(Be=this.getObjVal(t,"data-md-t-2400")),t.hasAttribute("data-md-t-2500")&&(Ye=this.getObjVal(t,"data-md-t-2500")),t.hasAttribute("data-md-t-2600")&&(M=this.getObjVal(t,"data-md-t-2600")),t.hasAttribute("data-md-t-2700")&&(D=this.getObjVal(t,"data-md-t-2700")),t.hasAttribute("data-md-t-2800")&&(V=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&&z||i<=760&&!H&&z)&&(t.hasAttribute("data-sm-t")&&(ee=this.getObjVal(t,"data-sm-t")),t.hasAttribute("data-sm-t-100")&&(Q=this.getObjVal(t,"data-sm-t-100")),t.hasAttribute("data-sm-t-200")&&(he=this.getObjVal(t,"data-sm-t-200")),t.hasAttribute("data-sm-t-300")&&(Te=this.getObjVal(t,"data-sm-t-300")),t.hasAttribute("data-sm-t-400")&&(me=this.getObjVal(t,"data-sm-t-400")),t.hasAttribute("data-sm-t-500")&&(Ee=this.getObjVal(t,"data-sm-t-500")),t.hasAttribute("data-sm-t-600")&&(ye=this.getObjVal(t,"data-sm-t-600")),t.hasAttribute("data-sm-t-700")&&(oe=this.getObjVal(t,"data-sm-t-700")),t.hasAttribute("data-sm-t-800")&&($=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")&&(ie=this.getObjVal(t,"data-sm-t-1000")),t.hasAttribute("data-sm-t-1100")&&(ce=this.getObjVal(t,"data-sm-t-1100")),t.hasAttribute("data-sm-t-1200")&&(ge=this.getObjVal(t,"data-sm-t-1200")),t.hasAttribute("data-sm-t-1300")&&(le=this.getObjVal(t,"data-sm-t-1300")),t.hasAttribute("data-sm-t-1400")&&(se=this.getObjVal(t,"data-sm-t-1400")),t.hasAttribute("data-sm-t-1500")&&(te=this.getObjVal(t,"data-sm-t-1500")),t.hasAttribute("data-sm-t-1600")&&(Y=this.getObjVal(t,"data-sm-t-1600")),t.hasAttribute("data-sm-t-1700")&&(Se=this.getObjVal(t,"data-sm-t-1700")),t.hasAttribute("data-sm-t-1800")&&(pe=this.getObjVal(t,"data-sm-t-1800")),t.hasAttribute("data-sm-t-1900")&&(Re=this.getObjVal(t,"data-sm-t-1900")),t.hasAttribute("data-sm-t-2000")&&(ne=this.getObjVal(t,"data-sm-t-2000")),t.hasAttribute("data-sm-t-2100")&&(De=this.getObjVal(t,"data-sm-t-2100")),t.hasAttribute("data-sm-t-2200")&&(Oe=this.getObjVal(t,"data-sm-t-2200")),t.hasAttribute("data-sm-t-2300")&&($e=this.getObjVal(t,"data-sm-t-2300")),t.hasAttribute("data-sm-t-2400")&&(Be=this.getObjVal(t,"data-sm-t-2400")),t.hasAttribute("data-sm-t-2500")&&(Ye=this.getObjVal(t,"data-sm-t-2500")),t.hasAttribute("data-sm-t-2600")&&(M=this.getObjVal(t,"data-sm-t-2600")),t.hasAttribute("data-sm-t-2700")&&(D=this.getObjVal(t,"data-sm-t-2700")),t.hasAttribute("data-sm-t-2800")&&(V=this.getObjVal(t,"data-sm-t-2800"))),i<=414&&H&&(t.hasAttribute("data-xs-t")&&(ee=this.getObjVal(t,"data-xs-t")),t.hasAttribute("data-xs-t-100")&&(Q=this.getObjVal(t,"data-xs-t-100")),t.hasAttribute("data-xs-t-200")&&(he=this.getObjVal(t,"data-xs-t-200")),t.hasAttribute("data-xs-t-300")&&(Te=this.getObjVal(t,"data-xs-t-300")),t.hasAttribute("data-xs-t-400")&&(me=this.getObjVal(t,"data-xs-t-400")),t.hasAttribute("data-xs-t-500")&&(Ee=this.getObjVal(t,"data-xs-t-500")),t.hasAttribute("data-xs-t-600")&&(ye=this.getObjVal(t,"data-xs-t-600")),t.hasAttribute("data-xs-t-700")&&(oe=this.getObjVal(t,"data-xs-t-700")),t.hasAttribute("data-xs-t-800")&&($=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")&&(ie=this.getObjVal(t,"data-xs-t-1000")),t.hasAttribute("data-xs-t-1100")&&(ce=this.getObjVal(t,"data-xs-t-1100")),t.hasAttribute("data-xs-t-1200")&&(ge=this.getObjVal(t,"data-xs-t-1200")),t.hasAttribute("data-xs-t-1300")&&(le=this.getObjVal(t,"data-xs-t-1300")),t.hasAttribute("data-xs-t-1400")&&(se=this.getObjVal(t,"data-xs-t-1400")),t.hasAttribute("data-xs-t-1500")&&(te=this.getObjVal(t,"data-xs-t-1500")),t.hasAttribute("data-xs-t-1600")&&(Y=this.getObjVal(t,"data-xs-t-1600")),t.hasAttribute("data-xs-t-1700")&&(Se=this.getObjVal(t,"data-xs-t-1700")),t.hasAttribute("data-xs-t-1800")&&(pe=this.getObjVal(t,"data-xs-t-1800")),t.hasAttribute("data-xs-t-1900")&&(Re=this.getObjVal(t,"data-xs-t-1900")),t.hasAttribute("data-xs-t-2000")&&(ne=this.getObjVal(t,"data-xs-t-2000")),t.hasAttribute("data-xs-t-2100")&&(De=this.getObjVal(t,"data-xs-t-2100")),t.hasAttribute("data-xs-t-2200")&&(Oe=this.getObjVal(t,"data-xs-t-2200")),t.hasAttribute("data-xs-t-2300")&&($e=this.getObjVal(t,"data-xs-t-2300")),t.hasAttribute("data-xs-t-2400")&&(Be=this.getObjVal(t,"data-xs-t-2400")),t.hasAttribute("data-xs-t-2500")&&(Ye=this.getObjVal(t,"data-xs-t-2500")),t.hasAttribute("data-xs-t-2600")&&(M=this.getObjVal(t,"data-xs-t-2600")),t.hasAttribute("data-xs-t-2700")&&(D=this.getObjVal(t,"data-xs-t-2700")),t.hasAttribute("data-xs-t-2800")&&(V=this.getObjVal(t,"data-xs-t-2800")));let ve=ee,be=Q,J=he,we=Te,ue=me,qe=Ee,ke=ye,Ce=oe,Me=$,We=X,He=ie,Ze=ce,Ae=ge,Z=le,_e=se,Ie=te,Dt=Y,$t=Se,Ht=pe,zt=Re,Vt=ne,Ut=De,Bt=Oe,Yt=$e,Ft=Be,Wt=Ye,Gt=M,Xt=D,Jt=V,ot=window.innerHeight;ot<730?(G=ve,W=be,ee=J,Q=we,he=ue,Te=qe,me=ke,Ee=Ce,ye=Me,oe=We,$=He,X=Ze,ie=Ae,ce=Z,ge=_e,le=Ie,se=Dt,te=$t,Y=Ht,Se=zt,pe=Vt,Re=Ut,ne=Bt,De=Yt,Oe=Ft,$e=Wt,Be=Gt,Ye=Xt,M=Jt,D={},V={}):ot>=730&&ot<790?(W=ve,ee=be,Q=J,he=we,Te=ue,me=qe,Ee=ke,ye=Ce,oe=Me,$=We,X=He,ie=Ze,ce=Ae,ge=Z,le=_e,se=Ie,te=Dt,Y=$t,Se=Ht,pe=zt,Re=Vt,ne=Ut,De=Bt,Oe=Yt,$e=Ft,Be=Wt,Ye=Gt,M=Xt,D=Jt,V={}):ot>=790&&ot<840||(ot>=840&&ot<1125?(ee={},Q=ve,he=be,Te=J,me=we,Ee=ue,ye=qe,oe=ke,$=Ce,X=Me,ie=We,ce=He,ge=Ze,le=Ae,se=Z,te=_e,Y=Ie,Se=Dt,pe=$t,Re=Ht,ne=zt,De=Vt,Oe=Ut,$e=Bt,Be=Yt,Ye=Ft,M=Wt,D=Gt,V=Xt,U=Jt):(ee={},Q={},he=ve,Te=be,me=J,Ee=we,ye=ue,oe=qe,$=ke,X=Ce,ie=Me,ce=We,ge=He,le=Ze,se=Ae,te=Z,Y=_e,Se=Ie,pe=Dt,Re=$t,ne=Ht,De=zt,Oe=Vt,$e=Ut,Be=Bt,Ye=Yt,M=Ft,D=Wt,V=Gt,U=Xt,K=Jt));let q={};Object.keys(A).length!==0&&(q=this.parseObj(A,"elInY",q)),Object.keys(R).length!==0&&(q=this.parseObj(R,"elInY+50",q)),Object.keys(T).length!==0&&(q=this.parseObj(T,"elInY+100",q)),Object.keys(y).length!==0&&(q=this.parseObj(y,"elInY+150",q)),Object.keys(f).length!==0&&(q=this.parseObj(f,"elInY+200",q)),Object.keys(_).length!==0&&(q=this.parseObj(_,"elInY+250",q)),Object.keys(v).length!==0&&(q=this.parseObj(v,"elInY+300",q)),Object.keys(m).length!==0&&(q=this.parseObj(m,"elInY+350",q)),Object.keys(k).length!==0&&(q=this.parseObj(k,"elInY+400",q)),Object.keys(b).length!==0&&(q=this.parseObj(b,"elInY+450",q)),Object.keys(E).length!==0&&(q=this.parseObj(E,"elInY+500",q)),Object.keys(w).length!==0&&(q=this.parseObj(w,"elInY+550",q)),Object.keys(g).length!==0&&(q=this.parseObj(g,"elInY+600",q)),Object.keys(p).length!==0&&(q=this.parseObj(p,"elInY+650",q)),Object.keys(h).length!==0&&(q=this.parseObj(h,"elCenterY-300",q)),Object.keys(o).length!==0&&(q=this.parseObj(o,"elCenterY",q)),Object.keys(d).length!==0&&(q=this.parseObj(d,"elCenterY+100",q)),Object.keys(c).length!==0&&(q=this.parseObj(c,"elCenterY+200",q)),Object.keys(l).length!==0&&(q=this.parseObj(l,"elCenterY+300",q)),Object.keys(a).length!==0&&(q=this.parseObj(a,"elOutY-300",q)),Object.keys(r).length!==0&&(q=this.parseObj(r,"elOutY",q)),Object.keys(N).length!==0&&(q=this.parseObj(N,"elInY",q)),Object.keys(P).length!==0&&(q=this.parseObj(P,"elInY+150",q)),Object.keys(I).length!==0&&(q=this.parseObj(I,"elInY+300 ",q)),Object.keys(C).length!==0&&(q=this.parseObj(C,"elCenterY-150",q)),Object.keys(x).length!==0&&(q=this.parseObj(x,"elCenterY",q)),Object.keys(S).length!==0&&(q=this.parseObj(S,"elCenterY+150",q)),Object.keys(O).length!==0&&(q=this.parseObj(O,"elOutY-300 ",q)),Object.keys(j).length!==0&&(q=this.parseObj(j,"elOutY-150 ",q)),Object.keys(L).length!==0&&(q=this.parseObj(L,"elOutY",q)),Object.keys(G).length!==0&&(q=this.parseObj(G,"elInY-200",q)),Object.keys(W).length!==0&&(q=this.parseObj(W,"elInY-100",q)),Object.keys(ee).length!==0&&(q=this.parseObj(ee,"elInY",q)),Object.keys(Q).length!==0&&(q=this.parseObj(Q,"elInY+100",q)),Object.keys(he).length!==0&&(q=this.parseObj(he,"elInY+200",q)),Object.keys(Te).length!==0&&(q=this.parseObj(Te,"elInY+300 ",q)),Object.keys(me).length!==0&&(q=this.parseObj(me,"elInY+400 ",q)),Object.keys(Ee).length!==0&&(q=this.parseObj(Ee,"elInY+500 ",q)),Object.keys(ye).length!==0&&(q=this.parseObj(ye,"elInY+600 ",q)),Object.keys(oe).length!==0&&(q=this.parseObj(oe,"elInY+700 ",q)),Object.keys($).length!==0&&(q=this.parseObj($,"elInY+800 ",q)),Object.keys(X).length!==0&&(q=this.parseObj(X,"elInY+900 ",q)),Object.keys(ie).length!==0&&(q=this.parseObj(ie,"elInY+1000 ",q)),Object.keys(ce).length!==0&&(q=this.parseObj(ce,"elInY+1100 ",q)),Object.keys(ge).length!==0&&(q=this.parseObj(ge,"elInY+1200 ",q)),Object.keys(le).length!==0&&(q=this.parseObj(le,"elInY+1300 ",q)),Object.keys(se).length!==0&&(q=this.parseObj(se,"elInY+1400 ",q)),Object.keys(te).length!==0&&(q=this.parseObj(te,"elInY+1500 ",q)),Object.keys(Y).length!==0&&(q=this.parseObj(Y,"elInY+1600 ",q)),Object.keys(Se).length!==0&&(q=this.parseObj(Se,"elInY+1700 ",q)),Object.keys(pe).length!==0&&(q=this.parseObj(pe,"elInY+1800 ",q)),Object.keys(Re).length!==0&&(q=this.parseObj(Re,"elInY+1900 ",q)),Object.keys(ne).length!==0&&(q=this.parseObj(ne,"elInY+2000 ",q)),Object.keys(De).length!==0&&(q=this.parseObj(De,"elInY+2100 ",q)),Object.keys(Oe).length!==0&&(q=this.parseObj(Oe,"elInY+2200 ",q)),Object.keys($e).length!==0&&(q=this.parseObj($e,"elInY+2300 ",q)),Object.keys(Be).length!==0&&(q=this.parseObj(Be,"elInY+2400 ",q)),Object.keys(Ye).length!==0&&(q=this.parseObj(Ye,"elInY+2500 ",q)),Object.keys(M).length!==0&&(q=this.parseObj(M,"elInY+2600 ",q)),Object.keys(D).length!==0&&(q=this.parseObj(D,"elInY+2700 ",q)),Object.keys(V).length!==0&&(q=this.parseObj(V,"elInY+2800 ",q)),Object.keys(U).length!==0&&(q=this.parseObj(U,"elInY+2900 ",q)),Object.keys(K).length!==0&&(q=this.parseObj(K,"elInY+3000 ",q)),t.style.transition="",t.setAttribute("data-dummy-selector","1"),lt.addElements("[data-dummy-selector]",{scrollY:q}),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:{}},Ei;function xs(){return Ei||(Ei=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 l(
|
|
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(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function c(I,C){for(var x=0;x<C.length;x++){var S=C[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}function d(I,C,x){return C&&c(I.prototype,C),I}function o(I){return Number(I)===I&&I%1===0}function h(I){return Number(I)===I&&I%1!==0}var p=(function(){function I(C,x){l(this,I),this.element=C,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(I,[{key:"checkVisibility",value:function(x,S){if(!this.active)return this.visible;var O=x.offsetWidth||x.innerWidth||0,j=x.offsetHeight||x.innerHeight||0,L={w:O,h:j},H=this.getBounds(),z=this._checkVisibility(H,L,S);if(z!==this.visible){this.visible=z;var B=this._toggleCallback();B instanceof Promise?B.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(z&&typeof this.toggle.callback.visible=="function")return this.toggle.callback.visible.call(this.element,this);return z}},{key:"getBounds",value:function(){return this.element.getBoundingClientRect()}},{key:"_getElementOffset",value:function(x,S){var O={x:0,y:0};return typeof this.offset.element.x=="function"?O.x=x.width*this.offset.element.x(this,x,S):h(this.offset.element.x)?O.x=x.width*this.offset.element.x:o(this.offset.element.x)&&(O.x=this.offset.element.x),typeof this.offset.element.y=="function"?O.y=x.height*this.offset.element.y(this,x,S):h(this.offset.element.y)?O.y=x.height*this.offset.element.y:o(this.offset.element.y)&&(O.y=this.offset.element.y),O}},{key:"_getViewportOffset",value:function(x,S){var O={x:0,y:0};return typeof this.offset.viewport.x=="function"?O.x=x.w*this.offset.viewport.x(this,x,S):h(this.offset.viewport.x)?O.x=x.w*this.offset.viewport.x:o(this.offset.viewport.x)&&(O.x=this.offset.viewport.x),typeof this.offset.viewport.y=="function"?O.y=x.h*this.offset.viewport.y(this,x,S):h(this.offset.viewport.y)?O.y=x.h*this.offset.viewport.y:o(this.offset.viewport.y)&&(O.y=this.offset.viewport.y),O}},{key:"_checkVisibility",value:function(x,S,O){var j=this._getElementOffset(x,O),L=this._getViewportOffset(S,O),H=!0;return x.left-L.x<-(x.width-j.x)&&(H=!1),x.left+L.x>S.w-j.x&&(H=!1),x.top-L.y<-(x.height-j.y)&&(H=!1),x.top+L.y>S.h-j.y&&(H=!1),H}},{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)}}]),I})();function g(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function w(I,C){for(var x=0;x<C.length;x++){var S=C[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}function E(I,C,x){return C&&w(I.prototype,C),I}var b=(function(){function I(C){g(this,I),this.triggers=C instanceof Array?C:[]}return E(I,[{key:"add",value:function(x){var S=this;if(x instanceof p)return this.triggers.push(x);x.each(function(O){O instanceof p?S.triggers.push(O):console.error("Object added to TriggerCollection is not a Trigger. Object: ",O)})}},{key:"remove",value:function(x){x instanceof p&&(x=[x]),this.triggers=this.triggers.filter(function(S){var O=!1;return x.each(function(j){j==S&&(O=!0)}),!O})}},{key:"query",value:function(x){return this.triggers.filter(function(S){var O=S.element,j=O.parentNode,L=[].slice.call(j.querySelectorAll(x));return L.indexOf(O)>-1})}},{key:"search",value:function(x){var S=this.triggers.filter(function(O){if(x instanceof NodeList||Array.isArray(x)){var j=!1;return x.each(function(L){O.element==L&&(j=!0)}),j}return O.element==x});return S.length==0?null:S.length>1?S:S[0]}},{key:"call",value:function(x){this.triggers.each(x)}}]),I})();function k(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function m(I,C){for(var x=0;x<C.length;x++){var S=C[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}function v(I,C,x){return C&&m(I.prototype,C),I}var _=(function(){function I(C,x){k(this,I),this._parseOptions(C),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(I,[{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)}}]),I})();t.d(s,"Trigger",function(){return R}),t.d(s,"TriggerCollection",function(){return A}),t.d(s,"ScrollAnimationLoop",function(){return N}),t.d(s,"default",function(){return P});function f(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function y(I,C){for(var x=0;x<C.length;x++){var S=C[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}function T(I,C,x){return C&&y(I.prototype,C),I}/*!
|
|
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 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">
|
|
26
|
+
*/var R=p,A=b,N=_,P=(function(){function I(C){f(this,I),this._parseOptions(C),this._initCollection(),this._initLoop()}return T(I,[{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 A(S)}},{key:"_initLoop",value:function(){var x=this;this.loop=new N({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function(O,j){x._scrollCallback(O,j)},start:function(){x._scrollStart()},stop:function(){x._scrollStop()},directionChange:function(O){x._scrollDirectionChange(O)}})}},{key:"_scrollCallback",value:function(x,S){var O=this;this.collection.call(function(j){j.checkVisibility(O.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 R(x,a()(this.defaultTrigger,S))}},{key:"createTriggers",value:function(x,S){var O=this,j=[];return x.each(function(L){j.push(O.createTrigger(L,S))}),j}},{key:"add",value:function(x,S){return x instanceof HTMLElement?(this.collection.add(this.createTrigger(x,S)),this):x instanceof R?(this.collection.add(x),this):x instanceof NodeList?(this.collection.add(this.createTriggers(x,S)),this):Array.isArray(x)&&x.length&&x[0]instanceof R?(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 R?(this.collection.remove(x),this):Array.isArray(x)&&x.length&&x[0]instanceof R?(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 R?(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}}]),I})()})])})})(Kt)),Kt.exports}var ks=xs();const _s=Zt(ks),Ci=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 Le(u,e){if((tt(u)||u===window||u===document)&&(u=[u]),!Mi(u)&&!ut(u)&&(u=[u]),Ii(u)!=0){if(Mi(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(Ne(u,i)&&e.call(u[i],u[i],i,u)===!1)break}}}function Li(u,e=null,i=null){const s=u[Ci]=u[Ci]||[],t={all:s,evt:null,found:null};return e&&i&&Ii(s)>0&&Le(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||[];pt(a)&&(a=document.querySelectorAll(a));function l(c){fe(i)&&i.call(r,c,this),t&&l.destroy()}return l.destroy=function(){Le(a,c=>{const d=Li(c,u,l);d.found&&d.all.splice(d.evt,1),c.removeEventListener&&c.removeEventListener(u,l,n)})},Le(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 re(u,e){Le(e.split(" "),i=>u.classList.add(i))}function je(u,e){Le(e.split(" "),i=>u.classList.remove(i))}function ze(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 fe(i)&&i(),!1;const s=Ss(),t=e.split(" ");Le(t,n=>{re(u,"g"+n)}),Ge(s,{onElement:u,avoidDuplicate:!1,once:!0,withCallback:(n,r)=>{Le(t,a=>{je(r,"g"+a)}),fe(i)&&i()}})}function vt(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 Oi(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 Ai(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function Ss(){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 Ts(){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 Es(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,re(n,"node-ready"),fe(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 Ri(u,e,i){if(Fe(u)){console.error("Inject assets error");return}if(fe(e)&&(i=e,e=!1),pt(e)&&e in window){fe(i)&&i();return}let s;if(u.indexOf(".css")!==-1){if(s=document.querySelectorAll('link[href="'+u+'"]'),s&&s.length>0){fe(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),fe(i)&&i();return}if(s=document.querySelectorAll('script[src="'+u+'"]'),s&&s.length>0){if(fe(i)){if(pt(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(fe(i)){if(pt(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 Cs(){return typeof document>"u"?!1:ii()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints}function fe(u){return typeof u=="function"}function pt(u){return typeof u=="string"}function tt(u){return!!(u&&u.nodeType&&u.nodeType==1)}function qi(u){return Array.isArray(u)}function Mi(u){return u&&u.length&&isFinite(u.length)}function ut(u){return typeof u==="object"&&u!=null&&!fe(u)&&!qi(u)}function Fe(u){return u==null}function Ne(u,e){return u!==null&&hasOwnProperty.call(u,e)}function Ii(u){if(ut(u)){if(u.keys)return u.keys().length;let e=0;for(let i in u)Ne(u,i)&&e++;return e}else return u.length}function wt(u){return!isNaN(parseFloat(u))&&isFinite(u)}function ji(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=[];Le(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 Ls(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=ji();l&&(l.focus(),re(l,"focused"));return}let r=t.getAttribute("data-taborder"),a=ji(r);je(t,"focused"),a&&(a.focus(),re(a,"focused"))}s==39&&u.nextSlide(),s==37&&u.prevSlide(),s==27&&u.close()}})}function xt(u){return Math.sqrt(u.x*u.x+u.y*u.y)}function Os(u,e){return u.x*e.x+u.y*e.y}function As(u,e){var i=xt(u)*xt(e);if(i===0)return 0;var s=Os(u,e)/i;return s>1&&(s=1),Math.acos(s)}function Rs(u,e){return u.x*e.y-e.x*u.y}function qs(u,e){var i=As(u,e);return Rs(u,e)>0&&(i*=-1),i*180/Math.PI}class Ms{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 Ve(u,e){var i=new Ms(u);return i.add(e),i}class Is{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=Ve(this.element,i.rotate||s),this.touchStart=Ve(this.element,i.touchStart||s),this.multipointStart=Ve(this.element,i.multipointStart||s),this.multipointEnd=Ve(this.element,i.multipointEnd||s),this.pinch=Ve(this.element,i.pinch||s),this.swipe=Ve(this.element,i.swipe||s),this.tap=Ve(this.element,i.tap||s),this.doubleTap=Ve(this.element,i.doubleTap||s),this.longTap=Ve(this.element,i.longTap||s),this.singleTap=Ve(this.element,i.singleTap||s),this.pressMove=Ve(this.element,i.pressMove||s),this.twoFingerPressMove=Ve(this.element,i.twoFingerPressMove||s),this.touchMove=Ve(this.element,i.touchMove||s),this.touchEnd=Ve(this.element,i.touchEnd||s),this.touchCancel=Ve(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=xt(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=xt(l)/this.pinchStartLen,this.pinch.dispatch(e,this.element)),e.angle=qs(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=Ts(),i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;let s=ze(u,"gslide-media")?u:u.querySelector(".gslide-media"),t=Qe(s,".ginner-container"),n=u.querySelector(".gslide-description");i>769&&(s=t),re(s,"greset"),vt(s,"translate3d(0, 0, 0)"),Ge(e,{onElement:s,once:!0,withCallback:(r,a)=>{je(s,"greset")}}),s.style.opacity="",n&&(n.style.opacity="")}function js(u){if(u.events.hasOwnProperty("touch"))return!1;let e=Ai(),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,p=!1,g=null,w=null,E=null,b=null,k,m,v=0,_=0,f=!1,y=!1,T={},R={},A=0,N=0,P;const I=document.getElementById("glightbox-slider"),C=document.querySelector(".goverlay"),x=new Is(I,{touchStart:S=>{if(t=!0,(ze(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")&&!ze(S.targetTouches[0].target.parentNode,"gslide-inline")&&(t=!1),t){if(R=S.targetTouches[0],T.pageX=S.targetTouches[0].pageX,T.pageY=S.targetTouches[0].pageY,A=S.targetTouches[0].clientX,N=S.targetTouches[0].clientY,n=u.activeSlide,r=n.querySelector(".gslide-media"),P=n.querySelector(".gslide-inline"),a=null,ze(r,"gslide-image")&&(a=r.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(r=n.querySelector(".ginner-container")),je(C,"greset"),S.pageX>20&&S.pageX<window.innerWidth-20)return;S.preventDefault()}},touchMove:S=>{if(!t||(R=S.targetTouches[0],h||p))return;if(P&&P.offsetHeight>s){const B=T.pageX-R.pageX;if(Math.abs(B)<=13)return!1}l=!0;let O=S.targetTouches[0].clientX,j=S.targetTouches[0].clientY,L=A-O,H=N-j;Math.abs(L)>Math.abs(H)?(f=!1,y=!0):(y=!1,f=!0),k=R.pageX-T.pageX,v=k*100/i,m=R.pageY-T.pageY,_=m*100/s;let z;if(f&&a&&(z=1-Math.abs(m)/s,C.style.opacity=z,u.settings.touchFollowAxis&&(v=0)),y&&(z=1-Math.abs(k)/i,r.style.opacity=z,u.settings.touchFollowAxis&&(_=0)),!a)return vt(r,`translate3d(${v}%, 0, 0)`);vt(r,`translate3d(${v}%, ${_}%, 0)`)},touchEnd:()=>{if(!t)return;if(l=!1,p||h){E=g,b=w;return}const S=Math.abs(parseInt(_)),O=Math.abs(parseInt(v));if(S>29&&a){u.close();return}if(S<29&&O<25)return re(C,"greset"),C.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 O=c*S.zoom;if(p=!0,O<=1){p=!1,O=1,b=null,E=null,g=null,w=null,a.setAttribute("style","");return}O>d&&(O=d),a.style.transform=`scale3d(${O}, ${O}, 1)`,o=O},pressMove:S=>{if(p&&!h){var O=R.pageX-T.pageX,j=R.pageY-T.pageY;E&&(O=O+E),b&&(j=j+b),g=O,w=j;let L=`translate3d(${O}px, ${j}px, 0)`;o&&(L+=` scale3d(${o}, ${o}, 1)`),vt(a,L)}},swipe:S=>{if(!p){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 Ns{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 Ni{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 Ps(u,e,i,s){const t=u.querySelector(".gslide-media");let n=new Image,r="gSlideTitle_"+i,a="gSlideDesc_"+i;n.addEventListener("load",()=>{fe(s)&&s()},!1),n.src=e.href,e.sizes!=""&&e.srcset!=""&&(n.sizes=e.sizes,n.srcset=e.srcset),n.alt="",!Fe(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 Ds(u,e,i,s){const t=u.querySelector(".ginner-container"),n="gvideo"+i,r=u.querySelector(".gslide-media"),a=this.getAllPlayers();re(t,"gvideo-container"),r.insertBefore(nt('<div class="gvideo-wrapper"></div>'),r.firstChild);const l=u.querySelector(".gvideo-wrapper");Ri(this.settings.plyr.css,"Plyr");let c=e.href,d=e?.videoProvider,o=!1;r.style.maxWidth=e.width,Ri(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>`);re(l,`${d}-video gvideo`),l.appendChild(h),l.setAttribute("data-id",n),l.setAttribute("data-index",i);const p=Ne(this.settings.plyr,"config")?this.settings.plyr.config:{},g=new Plyr("#"+n,p);g.on("ready",w=>{a[n]=w.detail.plyr,fe(s)&&s()}),ti(()=>u.querySelector("iframe")&&u.querySelector("iframe").dataset.ready=="true",()=>{this.resize(u)}),g.on("enterfullscreen",Pi),g.on("exitfullscreen",Pi)})}function Pi(u){const e=Qe(u.target,".gslide-media");u.type==="enterfullscreen"&&re(e,"fullscreen"),u.type==="exitfullscreen"&&je(e,"fullscreen")}function $s(u,e,i,s){const t=u.querySelector(".gslide-media"),n=Ne(e,"href")&&e.href?e.href.split("#").pop().trim():!1,r=Ne(e,"content")&&e.content?e.content:!1;let a;if(r&&(pt(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,re(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()}}),fe(s)&&s()}function Hs(u,e,i,s){const t=u.querySelector(".gslide-media"),n=Es({url:e.href,callback:s});t.parentNode.style.maxWidth=e.width,t.parentNode.style.height=e.height,t.appendChild(n)}class zs{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)){Ne(e,"type")||(Ne(e,"content")&&e.content?e.type="inline":Ne(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,Le(s,(a,l)=>{Ne(i,l)&&l!=="width"&&(s[l]=i[l]);const c=e.dataset[l];Fe(c)||(s[l]=this.sanitizeValue(c))}),s.content&&(s.type="inline"),!s.type&&t&&(s.type=this.sourceType(t)),Fe(n)){if(!s.title&&r=="a"){let a=e.title;!Fe(a)&&a!==""&&(s.title=a)}if(!s.title&&r=="img"){let a=e.alt;!Fe(a)&&a!==""&&(s.title=a)}}else{let a=[];Le(s,(l,c)=>{a.push(";\\s?"+c)}),a=a.join("\\s?:|"),n.trim()!==""&&Le(s,(l,c)=>{const d=n,o="s?"+c+"s?:s?(.*?)("+a+"s?:|$)",h=new RegExp(o),p=d.match(h);if(p&&p.length&&p[1]){const g=p[1].trim().replace(/;\s*$/,"");s[c]=this.sanitizeValue(g)}})}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=Ne(e,"width")&&e.width!==""?this.checkSize(e.width):t,e.height=Ne(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 wt(e)?`${e}px`:e}sanitizeValue(e){return e!=="true"&&e!=="false"?e:e==="true"}}class kt{constructor(e,i,s){this.element=e,this.instance=i,this.index=s}setContent(e=null,i=!1){if(ze(e,"loaded"))return!1;const s=this.instance.settings,t=this.slideConfig,n=ii();fe(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,p="gSlideTitle_"+this.index,g="gSlideDesc_"+this.index;if(fe(s.afterSlideLoad)&&(h=()=>{fe(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=p,c.innerHTML=t.title):c.parentNode.removeChild(c),d&&t.description!==""?(d.id=g,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),re(l.parentNode,`desc-${a}`),re(o.parentNode,`description-${a}`)),re(l,`gslide-${r}`),re(e,"loaded"),r==="video"){Ds.apply(this.instance,[e,t,this.index,h]);return}if(r==="external"){Hs.apply(this,[e,t,this.index,h]);return}if(r==="inline"){$s.apply(this.instance,[e,t,this.index,h]),t.draggable&&new Ni({dragEl:e.querySelector(".gslide-inline"),toleranceX:s.dragToleranceX,toleranceY:s.dragToleranceY,slide:e,instance:this.instance});return}if(r==="image"){Ps(e,t,this.index,()=>{const w=e.querySelector("img");t.draggable&&new Ni({dragEl:w,toleranceX:s.dragToleranceX,toleranceY:s.dragToleranceY,slide:e,instance:this.instance}),t.zoomable&&w.naturalWidth>w.offsetWidth&&(re(w,"zoomable"),new Ns(w,e,()=>{this.instance.resize()})),fe(h)&&h()});return}fe(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,re(r,"gdesc-open");let l=Ge("click",{onElement:[r,Qe(a,".gslide-description")],withCallback:(c,d)=>{c.target.nodeName.toLowerCase()!=="a"&&(je(r,"gdesc-open"),re(r,"gdesc-closed"),a.innerHTML=i.smallDescription,this.descriptionEvents(a,i),setTimeout(()=>{je(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 zs(this.instance.settings.slideExtraAttributes);return this.slideConfig=e.parseConfig(this.element,this.instance.settings),this.slideConfig}}const Vs="3.2.0",Di=ii(),$i=Cs();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">
|
|
@@ -45,37 +45,37 @@ 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>`;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);/*!
|
|
48
|
+
</div>`;class Hi{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=wt(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)),Fe(s)&&(s=this.getElementIndex(e),s<0&&(s=0))}wt(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),re(t,"gscrollbar-fixer")}re(t,"glightbox-open"),re(ni,"glightbox-open"),Di&&(re(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(s,!0),this.elements.length===1?(re(this.prevButton,"glightbox-button-hidden"),re(this.nextButton,"glightbox-button-hidden")):(je(this.prevButton,"glightbox-button-hidden"),je(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),fe(this.settings.onOpen)&&this.settings.onOpen(),$i&&this.settings.touchNavigation&&js(this),this.settings.keyboardNavigation&&Ls(this)}openAt(e=0){this.open(null,e)}showSlide(e=0,i=!1){Oi(this.loader),this.index=parseInt(e);let s=this.slidesContainer.querySelector(".current");s&&je(s,"current"),this.slideAnimateOut();let t=this.slidesContainer.querySelectorAll(".gslide")[e];if(ze(t,"loaded"))this.slideAnimateIn(t,i),ei(this.loader);else{Oi(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&&ze(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||Fe(this.elements[e]))return!1;let i=this.slidesContainer.querySelectorAll(".gslide")[e];if(ze(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 kt(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}),fe(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),fe(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:Fe(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:Fe(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=""),je(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}),fe(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}),fe(this.settings.afterSlideChange)&&this.settings.afterSlideChange.apply(this,[n,r])})}setTimeout(()=>{this.resize(e)},100),re(e,"current")}slideAnimateOut(){if(!this.prevActiveSlide)return!1;let e=this.prevActiveSlide;je(e,this.effectsClasses),re(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:Fe(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:Fe(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)}}),fe(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="",je(n,"greset"),n.style.opacity="",r&&(r.style.opacity=""),je(e,"prev")})}getAllPlayers(){return this.videoPlayers}getSlidePlayerInstance(e){const i="gvideo"+e,s=this.getAllPlayers();return Ne(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(Di&&!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&&Le(e,(s,t)=>{const n=new kt(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&&(Le(this.elements,()=>{let s=nt(this.settings.slideHTML);this.slidesContainer.appendChild(s)}),this.showSlide(0,!0)))}getElementIndex(e){let i=!1;return Le(this.elements,(s,t)=>{if(Ne(s,"node")&&s.node==e)return i=t,!0}),i}getElements(){let e=[];this.elements=this.elements?this.elements:[],!Fe(this.settings.elements)&&qi(this.settings.elements)&&this.settings.elements.length&&Le(this.settings.elements,(t,n)=>{const r=new kt(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&&Le(i,(t,n)=>{const r=new kt(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=[];Le(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=Ne(this.settings.svg,"next")?this.settings.svg.next:"",t=Ne(this.settings.svg,"prev")?this.settings.svg.prev:"",n=Ne(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={},re(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&&!ze(document.body,"glightbox-mobile")&&!Qe(c.target,".ginner-container")&&!Qe(c.target,".gbtn")&&!ze(c.target,"gnext")&&!ze(c.target,"gprev")&&this.close()}})),Le(this.elements,(c,d)=>{this.slidesContainer.appendChild(c.instance.create()),c.slideNode=this.slidesContainer.querySelectorAll(".gslide")[d]}),$i&&re(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||ze(e,"zoomed"))return;const i=Ai(),s=e.querySelector(".gvideo-wrapper"),t=e.querySelector(".gslide-image"),n=this.slideDescription;let r=i.width,a=i.height;if(r<=768?re(document.body,"glightbox-mobile"):je(document.body,"glightbox-mobile"),!s&&!t)return;let l=!1;if(n&&(ze(n,"description-bottom")||ze(n,"description-top"))&&!ze(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=Ne(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!c){const g=s.clientWidth,w=s.clientHeight,E=g/w;c=`${g/E}:${w/E}`}let d=c.split(":"),o=this.settings.videosWidth,h=this.settings.videosWidth;wt(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 p=h/(parseInt(d[0])/parseInt(d[1]));if(p=Math.floor(p),l&&(a=a-n.offsetHeight),h>r||p>a||a<p&&r>h){let g=s.offsetWidth,w=s.offsetHeight,E=a/w,b={width:g*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();je(this.nextButton,"disabled"),je(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(re(this.prevButton,"disabled"),re(this.nextButton,"disabled")):this.index===0&&!e?re(this.prevButton,"disabled"):this.index===this.elements.length-1&&!e&&re(this.nextButton,"disabled")}loop(){let e=Ne(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return e=Ne(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&&Le(this.bodyHiddenChildElms,e=>{e.removeAttribute("aria-hidden")}),re(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;je(ni,"glightbox-open"),je(e,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),this.modal.parentNode.removeChild(this.modal),this.trigger("close"),fe(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||!fe(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=[];Le(this.apiEvents,(t,n)=>{const{evt:r,once:a,callback:l}=t;r==e&&(l(i),a&&s.push(n))}),s.length&&Le(s,t=>this.apiEvents.splice(t,1))}clearAllEvents(){this.apiEvents.splice(0,this.apiEvents.length)}version(){return Vs}}class Us{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 l=1;a<this.accelerationDelta&&(l=Math.min(1+50/a,this.accelerationMax),i*=l,s*=l),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,l=a>=this.animationTime,c=l?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,l&&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}}/*!
|
|
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 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",
|
|
52
|
+
*/function zi(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 Vi(u){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(i),!0).forEach(function(s){Ys(u,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(i)):zi(Object(i)).forEach(function(s){Object.defineProperty(u,s,Object.getOwnPropertyDescriptor(i,s))})}return u}function _t(u){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_t=function(e){return typeof e}:_t=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_t(u)}function St(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function Bs(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 Tt(u,e,i){return e&&Bs(u.prototype,e),u}function Ys(u,e,i){return e in u?Object.defineProperty(u,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):u[e]=i,u}function Fs(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&&ai(u,e)}function dt(u){return dt=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},dt(u)}function ai(u,e){return ai=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},ai(u,e)}function Ws(){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 Gs(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Xs(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 Gs(u)}function Js(u){var e=Ws();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 Xs(this,t)}}function Zs(u,e){for(;!Object.prototype.hasOwnProperty.call(u,e)&&(u=dt(u),u!==null););return u}function Et(){return typeof Reflect<"u"&&Reflect.get?Et=Reflect.get:Et=function(e,i,s){var t=Zs(e,i);if(t){var n=Object.getOwnPropertyDescriptor(t,i);return n.get?n.get.call(arguments.length<3?e:s):n.value}},Et.apply(this,arguments)}var Qs={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 Pe(u){return parseInt(u)}function Ks(u){return parseFloat(u)}function oi(u){return typeof u=="string"}function ht(u){var e=_t(u);return e==="function"||e==="object"&&!!u}function Ct(u){return typeof u=="function"}function Ui(u){return typeof u>"u"}function li(u){return u.constructor===Array}function en(u,e,i){var s={};for(var t in e)Ct(e[t])?s[t]=e[t](u,s,i):it("Extension must be a function");for(var n in s)Ct(s[n].mount)&&s[n].mount();return s}function xe(u,e,i){Object.defineProperty(u,e,i)}function tn(u){return Object.keys(u).sort().reduce(function(e,i){return e[i]=u[i],e[i],e},{})}function ci(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]=Vi(Vi({},u.classes[t]),e.classes[t]))})}return e.hasOwnProperty("breakpoints")&&(i.breakpoints=Object.assign({},u.breakpoints,e.breakpoints)),i}var sn=(function(){function u(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};St(this,u),this.events=e,this.hop=e.hasOwnProperty}return Tt(u,[{key:"on",value:function(i,s){if(li(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(li(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})(),nn=(function(){function u(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};St(this,u),this._c={},this._t=[],this._e=new sn,this.disabled=!1,this.selector=e,this.settings=ci(Qs,i),this.index=this.settings.startAt}return Tt(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=en(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 li(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=ci(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=Pe(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(i){this._d=!!i}}]),u})();function rn(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,p=1;if(h==="="){if(u.settings.bound&&Pe(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==="|"&&(p=u.settings.perView||1),h===">"||h==="|"&&o===">"){var g=t(p);g>d&&(this._o=!0),u.index=n(g,p);return}if(h==="<"||h==="|"&&o==="<"){var w=r(p);w<0&&(this._o=!0),u.index=a(w,p);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 xe(s,"move",{get:function(){return this._m},set:function(c){var d=c.substr(1);this._m={direction:c.substr(0,1),steps:d?Pe(d)?Pe(d):d:0}}}),xe(s,"length",{get:function(){var c=u.settings,d=e.Html.slides.length;return this.isBound()?d-1-(Pe(c.perView)-1)+Pe(c.focusAt):d-1}}),xe(s,"offset",{get:function(){return this._o}}),s}function Bi(){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:Bi(),s=null,r=u.apply(t,n),s||(t=n=null)},c=function(){var o=Bi();!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 Ot={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function an(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[Ot[c][0]]="".concat(this.value/2,"px"):l[Ot[c][0]]="",r!==n.length-1?l[Ot[c][1]]="".concat(this.value/2,"px"):l[Ot[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 xe(s,"value",{get:function(){return Pe(u.settings.gap)}}),xe(s,"grow",{get:function(){return s.value*e.Sizes.length}}),xe(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 Yi(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 ui(u){return Array.prototype.slice.call(u)}var on='[data-glide-el="track"]';function ln(u,e,i){var s={mount:function(){this.root=u.selector,this.track=this.root.querySelector(on),this.collectSlides()},collectSlides:function(){this.slides=ui(this.wrapper.children).filter(function(n){return!n.classList.contains(u.settings.classes.slide.clone)})}};return xe(s,"root",{get:function(){return s._r},set:function(n){oi(n)&&(n=document.querySelector(n)),n!==null?s._r=n:it("Root element must be a existing Html node")}}),xe(s,"track",{get:function(){return s._t},set:function(n){s._t=n}}),xe(s,"wrapper",{get:function(){return s.track.children[0]}}),i.on("update",function(){s.collectSlides()}),s}function cn(u,e,i){var s={mount:function(){this.value=u.settings.peek}};return xe(s,"value",{get:function(){return s._v},set:function(n){ht(n)?(n.before=Pe(n.before),n.after=Pe(n.after)):n=Pe(n),s._v=n}}),xe(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 un(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 xe(s,"offset",{get:function(){return s._o},set:function(n){s._o=Ui(n)?0:Pe(n)}}),xe(s,"translate",{get:function(){return e.Sizes.slideWidth*u.index}}),xe(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 dn(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 xe(s,"length",{get:function(){return e.Html.slides.length}}),xe(s,"width",{get:function(){return e.Html.track.offsetWidth}}),xe(s,"wrapperSize",{get:function(){return s.slideWidth*s.length+e.Gaps.grow+e.Clones.grow}}),xe(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 hn(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),Yi(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 pn(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),p=r.slice(0,h).reverse(),g=r.slice(h*-1),w=0;w<Math.max(d,Math.floor(l/r.length));w++){for(var E=0;E<p.length;E++){var b=p[E].cloneNode(!0);b.classList.add(c.slide.clone),n.push(b)}for(var k=0;k<g.length;k++){var m=g[k].cloneNode(!0);m.classList.add(c.slide.clone),n.unshift(m)}}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"),p=0;p<o.length;p++)a.appendChild(o[p]);for(var g=0;g<d.length;g++)a.insertBefore(d[g],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 xe(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]:{};St(this,u),this.listeners=e}return Tt(u,[{key:"on",value:function(i,s,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;oi(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;oi(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 fn(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 gn=["ltr","rtl"],mn={">":"<","<":">","=":"="};function bn(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(mn[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 xe(s,"value",{get:function(){return s._v},set:function(n){gn.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 yn(u,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function vn(u,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function wn(u,e){return{modify:function(s){return s+e.Clones.grow/2}}}function xn(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 kn(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 _n(u,e,i){var s=[vn,wn,xn,kn].concat(u._t,[yn]);return{mutate:function(n){for(var r=0;r<s.length;r++){var a=s[r];Ct(a)&&Ct(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 Sn(u,e,i){var s={set:function(n){var r=_n(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 Tn(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 xe(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 Fi=!1;try{var Wi=Object.defineProperty({},"passive",{get:function(){Fi=!0}});window.addEventListener("testPassive",null,Wi),window.removeEventListener("testPassive",null,Wi)}catch{}var di=Fi,At=["touchstart","mousedown"],Gi=["touchmove","mousemove"],Xi=["touchend","touchcancel","mouseup","mouseleave"],Ji=["mousedown","mousemove","mouseup","mouseleave"];function En(u,e,i){var s=new st,t=0,n=0,r=0,a=!1,l=di?{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=Pe(h.pageX),r=Pe(h.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),i.emit("swipe.start")}},move:function(o){if(!u.disabled){var h=u.settings,p=h.touchAngle,g=h.touchRatio,w=h.classes,E=this.touches(o),b=Pe(E.pageX)-n,k=Pe(E.pageY)-r,m=Math.abs(b<<2),v=Math.abs(k<<2),_=Math.sqrt(m+v),f=Math.sqrt(v);if(t=Math.asin(f/_),t*180/Math.PI<p)o.stopPropagation(),e.Move.make(b*Ks(g)),e.Html.root.classList.add(w.dragging),i.emit("swipe.move");else return!1}},end:function(o){if(!u.disabled){var h=u.settings,p=h.perSwipe,g=h.touchAngle,w=h.classes,E=this.touches(o),b=this.threshold(o),k=E.pageX-n,m=t*180/Math.PI;this.enable(),k>b&&m<g?e.Run.make(e.Direction.resolve("".concat(p,"<"))):k<-b&&m<g?e.Run.make(e.Direction.resolve("".concat(p,">"))):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,p=h.swipeThreshold,g=h.dragThreshold;p&&s.on(At[0],e.Html.wrapper,function(w){o.start(w)},l),g&&s.on(At[1],e.Html.wrapper,function(w){o.start(w)},l)},unbindSwipeStart:function(){s.off(At[0],e.Html.wrapper,l),s.off(At[1],e.Html.wrapper,l)},bindSwipeMove:function(){var o=this;s.on(Gi,e.Html.wrapper,Lt(function(h){o.move(h)},u.settings.throttle),l)},unbindSwipeMove:function(){s.off(Gi,e.Html.wrapper,l)},bindSwipeEnd:function(){var o=this;s.on(Xi,e.Html.wrapper,function(h){o.end(h)})},unbindSwipeEnd:function(){s.off(Xi,e.Html.wrapper)},touches:function(o){return Ji.indexOf(o.type)>-1?o:o.touches[0]||o.changedTouches[0]},threshold:function(o){var h=u.settings;return Ji.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 Cn(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 Ln(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 xe(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 On='[data-glide-el="controls[nav]"]',hi='[data-glide-el^="controls"]',An="".concat(hi,' [data-glide-dir*="<"]'),Rn="".concat(hi,' [data-glide-dir*=">"]');function qn(u,e,i){var s=new st,t=di?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(On),this._c=e.Html.root.querySelectorAll(hi),this._arrowControls={previous:e.Html.root.querySelectorAll(An),next:e.Html.root.querySelectorAll(Rn)},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),Yi(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){ui(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){ui(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){!di&&a.type==="touchstart"&&a.preventDefault();var l=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(l))}};return xe(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 Mn(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 In(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&&Ui(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 xe(t,"time",{get:function(){var r=e.Html.slides[u.index].getAttribute("data-glide-autoplay");return Pe(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 Zi(u){return ht(u)?tn(u):(it("Breakpoints option must be an object"),{})}function jn(u,e,i){var s=new st,t=u.settings,n=Zi(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=ci(t,a.match(n))},u.settings.throttle)),i.on("update",function(){n=Zi(n),r=Object.assign({},t)}),i.on("destroy",function(){s.off("resize",window)}),a}var Nn={Html:ln,Translate:Sn,Transition:Tn,Direction:bn,Peek:cn,Sizes:dn,Gaps:an,Move:un,Clones:pn,Resize:fn,Build:hn,Run:rn,Swipe:En,Images:Cn,Anchors:Ln,Controls:qn,Keyboard:Mn,Autoplay:In,Breakpoints:jn},Pn=(function(u){Fs(i,u);var e=Js(i);function i(){return St(this,i),e.apply(this,arguments)}return Tt(i,[{key:"mount",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Et(dt(i.prototype),"mount",this).call(this,Object.assign({},Nn,t))}}]),i})(nn);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 Qi(u){rt=u}const ft={exec:()=>null};function de(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(Ue.caret,"$1"),i=i.replace(t,r),s},getRegex:()=>new RegExp(i,e)};return s}const Ue={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")},Dn=/^(?:[ \t]*(?:\n|$))+/,$n=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hn=/^ {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+|$)/,zn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fi=/(?:[*+-]|\d{1,9}[.)])/,Ki=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,es=de(Ki).replace(/bull/g,fi).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(),Vn=de(Ki).replace(/bull/g,fi).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(),gi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Un=/^[^\n]+/,mi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Bn=de(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",mi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yn=de(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fi).getRegex(),Rt="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",bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fn=de("^ {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",bi).replace("tag",Rt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ts=de(gi).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",Rt).getRegex(),yi={blockquote:de(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ts).getRegex(),code:$n,def:Bn,fences:Hn,heading:zn,hr:gt,html:Fn,lheading:es,list:Yn,newline:Dn,paragraph:ts,table:ft,text:Un},is=de("^ *([^\\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",Rt).getRegex(),Wn={...yi,lheading:Vn,table:is,paragraph:de(gi).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",is).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",Rt).getRegex()},Gn={...yi,html:de(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bi).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:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:de(gi).replace("hr",gt).replace("heading",` *#{1,6} *[^
|
|
53
|
+
]`).replace("lheading",es).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ss=/^( {2,}|\\)\n(?!\s*$)/,Zn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qt=/[\p{P}\p{S}]/u,vi=/[\s\p{P}\p{S}]/u,ns=/[^\s\p{P}\p{S}]/u,Qn=de(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vi).getRegex(),rs=/(?!~)[\p{P}\p{S}]/u,Kn=/(?!~)[\s\p{P}\p{S}]/u,er=/(?:[^\s\p{P}\p{S}]|~)/u,tr=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,as=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ir=de(as,"u").replace(/punct/g,qt).getRegex(),sr=de(as,"u").replace(/punct/g,rs).getRegex(),os="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nr=de(os,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,vi).replace(/punct/g,qt).getRegex(),rr=de(os,"gu").replace(/notPunctSpace/g,er).replace(/punctSpace/g,Kn).replace(/punct/g,rs).getRegex(),ar=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,vi).replace(/punct/g,qt).getRegex(),or=de(/\\(punct)/,"gu").replace(/punct/g,qt).getRegex(),lr=de(/^<(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(),cr=de(bi).replace("(?:-->|$)","-->").getRegex(),ur=de("^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",cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Mt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dr=de(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ls=de(/^!?\[(label)\]\[(ref)\]/).replace("label",Mt).replace("ref",mi).getRegex(),cs=de(/^!?\[(ref)\](?:\[\])?/).replace("ref",mi).getRegex(),hr=de("reflink|nolink(?!\\()","g").replace("reflink",ls).replace("nolink",cs).getRegex(),wi={_backpedal:ft,anyPunctuation:or,autolink:lr,blockSkip:tr,br:ss,code:Jn,del:ft,emStrongLDelim:ir,emStrongRDelimAst:nr,emStrongRDelimUnd:ar,escape:Xn,link:dr,nolink:cs,punctuation:Qn,reflink:ls,reflinkSearch:hr,tag:ur,text:Zn,url:ft},pr={...wi,link:de(/^!?\[(label)\]\((.*?)\)/).replace("label",Mt).getRegex(),reflink:de(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Mt).getRegex()},xi={...wi,emStrongRDelimAst:rr,emStrongLDelim:sr,url:de(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},fr={...xi,br:de(ss).replace("{2,}","*").getRegex(),text:de(xi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},It={normal:yi,gfm:Wn,pedantic:Gn},mt={normal:wi,gfm:xi,breaks:fr,pedantic:pr},gr={"&":"&","<":"<",">":">",'"':""","'":"'"},us=u=>gr[u];function Ke(u,e){if(e){if(Ue.escapeTest.test(u))return u.replace(Ue.escapeReplace,us)}else if(Ue.escapeTestNoEncode.test(u))return u.replace(Ue.escapeReplaceNoEncode,us);return u}function ds(u){try{u=encodeURI(u).replace(Ue.percentDecode,"%")}catch{return null}return u}function hs(u,e){const i=u.replace(Ue.findPipe,(n,r,a)=>{let l=!1,c=r;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=i.split(Ue.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(Ue.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 mr(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 ps(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 br(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=
|
|
55
|
+
`)}class jt{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=br(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
57
|
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=bt(i[0],`
|
|
58
58
|
`).split(`
|
|
59
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
|
|
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 p=r.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){const g=p,w=g.raw+`
|
|
64
64
|
`+s.join(`
|
|
65
|
-
`),E=this.blockquote(w);r[r.length-1]=E,t=t.substring(0,t.length-
|
|
65
|
+
`),E=this.blockquote(w);r[r.length-1]=E,t=t.substring(0,t.length-g.raw.length)+E.raw,n=n.substring(0,n.length-g.text.length)+E.text;break}else if(p?.type==="list"){const g=p,w=g.raw+`
|
|
66
66
|
`+s.join(`
|
|
67
|
-
`),E=this.list(w);r[r.length-1]=E,t=t.substring(0,t.length-
|
|
67
|
+
`),E=this.list(w);r[r.length-1]=E,t=t.substring(0,t.length-p.raw.length)+E.raw,n=n.substring(0,n.length-g.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,k=>" ".repeat(3*k.length)),
|
|
70
|
-
`,1)[0],
|
|
71
|
-
`,e=e.substring(
|
|
72
|
-
`,1)[0];let T;if(
|
|
73
|
-
`+T.slice(w);else{if(
|
|
74
|
-
`+
|
|
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=
|
|
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=bt(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{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)),p=e.split(`
|
|
70
|
+
`,1)[0],g=!h.trim(),w=0;if(this.options.pedantic?(w=2,o=h.trimStart()):g?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),g&&this.rules.other.blankLine.test(p)&&(d+=p+`
|
|
71
|
+
`,e=e.substring(p.length+1),c=!0),!c){const k=this.rules.other.nextBulletRegex(w),m=this.rules.other.hrRegex(w),v=this.rules.other.fencesBeginRegex(w),_=this.rules.other.headingBeginRegex(w),f=this.rules.other.htmlBeginRegex(w);for(;e;){const y=e.split(`
|
|
72
|
+
`,1)[0];let T;if(p=y,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),T=p):T=p.replace(this.rules.other.tabCharGlobal," "),v.test(p)||_.test(p)||f.test(p)||k.test(p)||m.test(p))break;if(T.search(this.rules.other.nonSpaceChar)>=w||!p.trim())o+=`
|
|
73
|
+
`+T.slice(w);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(h)||_.test(h)||m.test(h))break;o+=`
|
|
74
|
+
`+p}!g&&!p.trim()&&(g=!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=hs(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(hs(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=mr(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)),ps(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 ps(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,p=e.slice(0,r+t.index+h+l);if(Math.min(r,l)%2){const w=p.slice(1,-1);return{type:"em",raw:p,text:w,tokens:this.lexer.inlineTokens(w)}}const g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}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 jt,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:Ue,block:It.normal,inline:mt.normal};this.options.pedantic?(i.block=It.pedantic,i.inline=mt.pedantic):this.options.gfm&&(i.block=It.gfm,this.options.breaks?i.inline=mt.breaks:i.inline=mt.gfm),this.tokenizer.rules=i}static get rules(){return{block:It,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(Ue.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(Ue.tabCharGlobal," ").replace(Ue.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+=`
|
|
@@ -84,7 +84,7 @@ ${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
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 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
|
|
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 Nt{options;parser;constructor(e){this.options=e||rt}space(e){return""}code({text:e,lang:i,escaped:s}){const t=(i||"").match(Ue.notSpaceStart)?.[0],n=e.replace(Ue.endingNewline,"")+`
|
|
88
88
|
`;return t?'<pre><code class="language-'+Ke(t)+'">'+(s?n:Ke(n,!0))+`</code></pre>
|
|
89
89
|
`:"<pre><code>"+(s?n:Ke(n,!0))+`</code></pre>
|
|
90
90
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -102,9 +102,9 @@ ${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>${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=
|
|
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
|
|
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
|
|
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=ds(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=ds(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 ki{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 Nt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ki}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 yr{defaults=pi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Je;Renderer=Nt;TextRenderer=ki;Lexer=Xe;Tokenizer=jt;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 Nt(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 jt(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 yr;function ae(u,e){return at.parse(u,e)}ae.options=ae.setOptions=function(u){return at.setOptions(u),ae.defaults=at.defaults,Qi(ae.defaults),ae},ae.getDefaults=pi,ae.defaults=rt,ae.use=function(...u){return at.use(...u),ae.defaults=at.defaults,Qi(ae.defaults),ae},ae.walkTokens=function(u,e){return at.walkTokens(u,e)},ae.parseInline=at.parseInline,ae.Parser=Je,ae.parser=Je.parse,ae.Renderer=Nt,ae.TextRenderer=ki,ae.Lexer=Xe,ae.lexer=Xe.lex,ae.Tokenizer=jt,ae.Hooks=Pt,ae.parse=ae,ae.options,ae.setOptions,ae.use,ae.walkTokens,ae.parseInline,Je.parse,Xe.lex;class vr{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
109
|
${e}`,a,l,c;if(s.image&&i==="openai")return r+=`
|
|
110
110
|
Extract some information.
|
|
@@ -236,14 +236,14 @@ Check the request and return the details.
|
|
|
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 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="",
|
|
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="",p,g=!1,w=[],E=[];return d.entries&&d.entries.forEach(b=>{p=b.url.split(".").pop().toLowerCase(),p==="mp4"?(o+=`
|
|
240
240
|
<p class="responsive-video">
|
|
241
241
|
<video controls>
|
|
242
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+=``):
|
|
246
|
+
`,h+=``):p==="wav"||p==="mp3"?(o+=`
|
|
247
247
|
<p class="responsive-audio">
|
|
248
248
|
<audio controls>
|
|
249
249
|
<source src="${b.url}" type="audio/mpeg">
|
|
@@ -258,7 +258,7 @@ Check the information and return the details.
|
|
|
258
258
|
<a class="link-download" href="${b.url}" download>${this.out("Download")}</a>
|
|
259
259
|
</div>
|
|
260
260
|
</div>
|
|
261
|
-
`,h+=``,
|
|
261
|
+
`,h+=``,g=!0),w.push(b.url),E.push(b.file_url)}),g&&(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">
|
|
@@ -283,7 +283,7 @@ 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 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=`
|
|
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 p=h[e.image_url],g=h[e.image_url+"_mask"];if(!g)return{mediaGenerated:!1,status:"error",message:this.out("Image mask not found.")};t={prompt:c,image:p,mask:g},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 p=h[e.image_url];if(!p)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:p,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 p=h[e.image_url];if(!p)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};l==="kwaivgi/kling-v1.6-pro"&&(t={start_image:p,prompt:c,duration:d}),l==="kwaivgi/kling-v1.6-standard"&&(t={start_image:p,prompt:c,duration:d}),l==="minimax/video-01-live"&&(t={first_frame_image:p,prompt:c}),l==="luma/ray"&&(t={start_image_url:p,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 p=this.waitingReplicate(n,c,i,s);return this.builder.isMediaGenerating=!1,p}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 p=this.renderResult(h,i,s);return{mediaGenerated:!0,status:"success",markdown:p.markdown,output:p.output,output2:p.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 m of o){if(m.value instanceof FileList&&m.type==="multifile"){const v=m.value;if(v.length>0)for(const _ of v)c.append("file[]",_),d=!0}if(m.value instanceof FileList&&m.type==="file"){const v=m.value;if(v.length>0){const _=v[0];c.append("file[]",_),d=!0}}if(typeof m.value=="string"&&m.value.indexOf("base64")!==-1){let v=m.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 m=0;m<this.builder.selectedFiles.length;m++){const v=this.builder.selectedFiles[m];c.append("file[]",v),d=!0}let h,p=e.size||"auto",g=e.quality||"auto",w=e.num_images||1;if(d){c.append("size",p),c.append("n",w),c.append("quality",g),t={prompt:l,size:p,quality:g,n:w},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n);let m=this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;h=await fetch(m,{method:"POST",body:c})}else{let m=e.background||"auto",v=e.output_format||"png";t={prompt:l,background:m,output_format:v,size:p,quality:g,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 f={"Content-Type":"application/json",...this.builder.settings.headers};h=await fetch(_,{signal:this.builder.mediaSignal,method:"POST",headers:f,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 m of k){const v=await new Promise((_,f)=>{const y=new FileReader;y.onload=T=>{const R=T.target.result.split(",")[1];_(R)},y.onerror=f,y.readAsDataURL(m)});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 g=await(await fetch(o,{signal:this.builder.mediaSignal,method:"POST",headers:h,body:JSON.stringify(n)})).json();this.builder.settings.consoleLog&&console.log(g),this.builder.isMediaGenerating=!1;const w=g.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 g=this.validateModel(e.model,t,"text_to_image_generation");if(!g)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,m=e.num_images||1;if(m>4&&(m=4),k){let{w:B,h:G}=this.getDimension(k);E=B,b=G}let v=e.color1_red,_=e.color1_green,f=e.color1_blue,y=e.color2_red,T=e.color2_green,R=e.color2_blue,A=e.color3_red,N=e.color3_green,P=e.color3_blue,I=e.color4_red,C=e.color4_green,x=e.color4_blue,S=e.color5_red,O=e.color5_green,j=e.color5_blue,L=[];v&&_&&f&&!(v==="0"&&_==="0"&&f==="0")&&L.push({r:v,g:_,b:f}),y&&T&&R&&!(y==="0"&&T==="0"&&R==="0")&&L.push({r:y,g:T,b:R}),A&&N&&P&&!(A==="0"&&N==="0"&&P==="0")&&L.push({r:A,g:N,b:P}),I&&C&&x&&!(I==="0"&&C==="0"&&x==="0")&&L.push({r:I,g:C,b:x}),S&&O&&j&&!(S==="0"&&O==="0"&&j==="0")&&L.push({r:S,g:O,b:j});let z=await(async()=>{let B=[],G=this.builder.getFormValues();for(const W of G)if(W.value instanceof FileList&&W.type==="multifile"){const ee=W.value;if(ee.length>0){let Q=0;for(const he of ee){Q++;const Te=new FormData;Te.append("file",he),Te.append("customData",this.builder.settings.customData);let me=this.builder.settings.uploadMediaUrl_Fal;const ye=await(await fetch(me,{method:"POST",body:Te})).json();if(ye.ok){const oe=ye.url;B.push(oe),this.builder.filesUploaded["file_"+Q]=oe}}}}return B})();n={prompt:w,image_size:{width:E,height:b},num_images:m},g.indexOf("gemini")!==-1&&(n={prompt:w,input_image_urls:z}),g==="fal-ai/ideogram/v2a"&&(k=this.getClosestAspectRatio(E,b),n={prompt:w,aspect_ratio:k,num_images:m}),g.indexOf("recraft")!==-1&&(n={prompt:w,image_size:{width:E,height:b},num_images:m,colors:L}),r.model=g,r.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let g=this.validateModel(e.model,t,"edit_area_in_image");if(!g)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],m=b[e.image_url+"_mask"];if(n={image_url:k,mask_url:m,prompt:w},r.model=g,!m){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 g=this.validateModel(e.model,t,"text_to_2d_illustration_generation");if(!g)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 m=e.style||"any",v=e.style_id||this.builder.settings._2dIllustrationStyleId,_=e.color1_red,f=e.color1_green,y=e.color1_blue,T=e.color2_red,R=e.color2_green,A=e.color2_blue,N=e.color3_red,P=e.color3_green,I=e.color3_blue,C=e.color4_red,x=e.color4_green,S=e.color4_blue,O=e.color5_red,j=e.color5_green,L=e.color5_blue,H=[];_&&f&&y&&!(_==="0"&&f==="0"&&y==="0")&&H.push({r:_,g:f,b:y}),T&&R&&A&&!(T==="0"&&R==="0"&&A==="0")&&H.push({r:T,g:R,b:A}),N&&P&&I&&!(N==="0"&&P==="0"&&I==="0")&&H.push({r:N,g:P,b:I}),C&&x&&S&&!(C==="0"&&x==="0"&&S==="0")&&H.push({r:C,g:x,b:S}),O&&j&&L&&!(O==="0"&&j==="0"&&L==="0")&&H.push({r:O,g:j,b:L}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:m,style_id:v,colors:H},r.model=g,r.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let g=this.validateModel(e.model,t,"text_to_digital_illustration_generation");if(!g)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 m=e.style||"digital_illustration",v=e.color1_red,_=e.color1_green,f=e.color1_blue,y=e.color2_red,T=e.color2_green,R=e.color2_blue,A=e.color3_red,N=e.color3_green,P=e.color3_blue,I=e.color4_red,C=e.color4_green,x=e.color4_blue,S=e.color5_red,O=e.color5_green,j=e.color5_blue,L=[];v&&_&&f&&!(v==="0"&&_==="0"&&f==="0")&&L.push({r:v,g:_,b:f}),y&&T&&R&&!(y==="0"&&T==="0"&&R==="0")&&L.push({r:y,g:T,b:R}),A&&N&&P&&!(A==="0"&&N==="0"&&P==="0")&&L.push({r:A,g:N,b:P}),I&&C&&x&&!(I==="0"&&C==="0"&&x==="0")&&L.push({r:I,g:C,b:x}),S&&O&&j&&!(S==="0"&&O==="0"&&j==="0")&&L.push({r:S,g:O,b:j}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:m,colors:L},r.model=g,r.customData=this.builder.settings.customData}else if(e.text_to_book_cover_generation){let g=this.validateModel(e.model,t,"text_to_book_cover_generation");if(!g)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 m="digital_illustration/cover",v=e.color1_red,_=e.color1_green,f=e.color1_blue,y=e.color2_red,T=e.color2_green,R=e.color2_blue,A=e.color3_red,N=e.color3_green,P=e.color3_blue,I=e.color4_red,C=e.color4_green,x=e.color4_blue,S=e.color5_red,O=e.color5_green,j=e.color5_blue,L=[];v&&_&&f&&!(v==="0"&&_==="0"&&f==="0")&&L.push({r:v,g:_,b:f}),y&&T&&R&&!(y==="0"&&T==="0"&&R==="0")&&L.push({r:y,g:T,b:R}),A&&N&&P&&!(A==="0"&&N==="0"&&P==="0")&&L.push({r:A,g:N,b:P}),I&&C&&x&&!(I==="0"&&C==="0"&&x==="0")&&L.push({r:I,g:C,b:x}),S&&O&&j&&!(S==="0"&&O==="0"&&j==="0")&&L.push({r:S,g:O,b:j}),n={prompt:w,image_size:{width:E,height:b},num_images:k,style:m,colors:L},r.model=g,r.customData=this.builder.settings.customData}else if(e.upscale_image){let g=this.validateModel(e.model,t,"upscale_image");if(!g)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=g,r.customData=this.builder.settings.customData}else if(e.describe_image){let g=this.validateModel(e.model,t,"describe_image");if(!g)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=g,r.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let g=this.validateModel(e.model,t,"image_to_video_generation");if(!g)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"},g.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=g,r.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let g=this.validateModel(e.model,t,"text_to_video_generation");if(!g)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"},g.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=g,r.customData=this.builder.settings.customData}else if(e.text_to_speech){let g=this.validateModel(e.model,t,"text_to_speech");if(!g)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=g,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 p=this.waitingFal(r,c,i,s);return this.builder.isMediaGenerating=!1,p}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 p=this.renderResult(h,s,t);return{mediaGenerated:!0,status:"success",markdown:p.markdown,output:p.output,output2:p.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 p=h.url;t.files.push(p),this.builder.filesUploaded["file_"+a]=p}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 m=v=>{if(Array.isArray(v)){const _=v[0],f=k.find(y=>y.name===_);if(f&&v.every(y=>y===_))return f.files;for(let y=0;y<v.length;y++)v[y]=m(v[y])}else if(typeof v=="object"&&v!==null)for(let _ in v)v[_]=m(v[_]);return v};return m(b)})(d,h),s||(o.startsWith("fal")?s="fal":s="replicate");const g=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 m=w[k];d[b]=m}if(Array.isArray(d[b])){for(let m=0;m<d[b].length;m++)if(d[b][m]===k){let v=w[k];d[b][m]=v}}})}),Object.keys(d).forEach(b=>{let k=d[b];if(g(k))for(const m in k)Object.prototype.hasOwnProperty.call(k,m)&&Object.keys(w).forEach(v=>{if(k[m]===v){let _=w[v];k[m]=_,v===_&&!_.startsWith("http")&&(k[m]="")}});if(Array.isArray(k)){for(let m=0;m<k.length;m++)if(g(k[m]))for(const v in k[m])Object.prototype.hasOwnProperty.call(k[m],v)&&Object.keys(w).forEach(_=>{if(k[m][v]===_){let f=w[_];k[m][v]=f,_===f&&!f.startsWith("http")&&(k[m][v]="")}});d[b]=[...k.filter(m=>m!=="")]}});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 g={image_url:h[l.image_url]||l.image_url,customData:this.builder.settings.customData};this.builder.payloads.push(g),this.builder.settings.consoleLog&&console.log(g);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(g)})).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,m=`
|
|
287
287
|
<div class="image-container">
|
|
288
288
|
<div>
|
|
289
289
|
<img src="${k}" />
|
|
@@ -292,7 +292,7 @@ Check the information and return the details.
|
|
|
292
292
|
<a class="link-download" href="${k}" download>${this.out("Download")}</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
</div>`;let v=``;return a?(r.innerHTML="",r.remove()):(r.innerHTML=
|
|
295
|
+
</div>`;let v=``;return a?(r.innerHTML="",r.remove()):(r.innerHTML=m,this.builder.outputHtml+=`<div class="result-container">${m}</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 wr{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 xr{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"/>
|
|
@@ -325,9 +325,9 @@ 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 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="">
|
|
328
|
+
</svg>`,r.appendChild(h);const p=document.createElement("input");p.type="hidden",p.name=this.settings.name,p.className="inp-imagemask",p.value="",t.appendChild(p);const g=document.createElement("canvas");g.className="imagemask";const w=g.getContext("2d",{willReadFrequently:!0}),E=document.createElement("canvas"),b=E.getContext("2d",{willReadFrequently:!0}),k=this.element.querySelector(".inp-imagemask"),m=L=>{const H=document.createElement("canvas"),z=H.getContext("2d",{willReadFrequently:!0});H.width=L.width,H.height=L.height,z.clearRect(0,0,L.width,L.height),z.fillStyle="black",z.fillRect(0,0,L.width,L.height),z.drawImage(L,0,0);const B=H.toDataURL("image/png");let G=document.querySelector(".imagemask-output");G||(G=document.createElement("img"),G.className="imagemask-output",document.body.appendChild(G)),G.src=B,this.empty||(k.value=B)};let v=[],_=[];const f=()=>{v.push(E.toDataURL()),v.length>10&&v.shift(),_=[]},y=L=>{const H=new Image;H.src=L,H.onload=()=>{w.clearRect(0,0,g.width,g.height),w.drawImage(H,0,0,g.width,g.height),b.clearRect(0,0,E.width,E.height),b.drawImage(H,0,0,E.width,E.height),m(E)}};g.addEventListener("mousedown",()=>{f()}),c.addEventListener("click",L=>{L.preventDefault(),v.length>0&&(_.push(g.toDataURL()),y(v.pop()))}),d.addEventListener("click",L=>{L.preventDefault(),_.length>0&&(v.push(g.toDataURL()),y(_.pop()))});const T=document.createElement("img");n.appendChild(T),n.appendChild(g),this.loaded=()=>{n.style.display="flex";const L=document.querySelector(".imagemask-controls");L.style.display="flex",e.style.display="flex",N(),v=[],_=[],w.clearRect(0,0,g.width,g.height),b.clearRect(0,0,E.width,E.height),this.empty=!0,k.value="";try{m(E)}catch{}},T.onload=()=>{this.loaded()};let R=null,A=null;const N=()=>{g.width>0&&g.height>0&&(R=w.getImageData(0,0,g.width,g.height),A=b.getImageData(0,0,E.width,E.height));const L=T.offsetWidth,H=T.offsetHeight,z=window.devicePixelRatio||1;g.width=L*z,g.height=H*z,w.scale(z,z),g.style.width=`${L}px`,g.style.height=`${H}px`;const B=T.naturalWidth,G=T.naturalHeight;if(E.width=B*z,E.height=G*z,b.scale(z,z),E.style.width=`${B}px`,E.style.height=`${G}px`,R){const W=document.createElement("canvas");W.width=R.width,W.height=R.height,W.getContext("2d").putImageData(R,0,0);const Q=document.createElement("canvas");Q.width=A.width,Q.height=A.height,Q.getContext("2d").putImageData(A,0,0),w.drawImage(W,0,0,R.width,R.height,0,0,g.width,g.height),b.drawImage(Q,0,0,A.width,A.height,0,0,E.width,E.height)}};let P=!1,I=parseInt(l.value,10);l.addEventListener("input",L=>{I=parseInt(L.target.value,10)});const C=L=>{const H=g.getBoundingClientRect();if(L.touches){const z=L.touches[0];return{x:z.clientX-H.left,y:z.clientY-H.top}}return{x:L.clientX-H.left,y:L.clientY-H.top}},x=L=>{P=!0,O(L)},S=()=>{P=!1,w.beginPath(),this.empty=!1,m(E)},O=L=>{if(!P)return;const{x:H,y:z}=C(L),B=E.width/g.width,G=E.height/g.height,W=H*B,ee=z*G;w.fillStyle="rgb(255, 255, 255)",w.beginPath(),w.arc(H,z,I/2,0,Math.PI*2),w.fill(),b.fillStyle="rgb(255, 255, 255)",b.beginPath(),b.arc(W,ee,I/2*B,0,Math.PI*2),b.fill()};g.addEventListener("mousedown",x),g.addEventListener("mouseup",S),g.addEventListener("mousemove",O),g.addEventListener("touchstart",L=>{x(L),L.preventDefault()},{passive:!1}),g.addEventListener("touchend",L=>{S(),L.preventDefault()}),g.addEventListener("touchmove",L=>{O(L),L.preventDefault()},{passive:!1}),o.addEventListener("click",L=>{L.preventDefault(),f(),w.clearRect(0,0,g.width,g.height),b.clearRect(0,0,E.width,E.height),this.empty=!0,k.value="",m(E)}),window.addEventListener("resize",N);const j=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=""),N()};h.addEventListener("click",L=>{L.preventDefault(),j(!0)}),s.addEventListener("click",L=>{L.preventDefault(),j(!1)}),document.addEventListener("keydown",L=>{L.key==="Escape"&&j(!1)})}}class kr{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 vr({lang:this.settings.lang},this),this.upload=new wr({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:p,replicate:g,web:w,openai:E,google:b}=this.settings.templatesConfig;return!w&&h.includes("web")||!b&&h.includes("google")||!E&&h.includes("openai")?!1:!p&&!g?!(h.includes("fal")||h.includes("replicate")):!p&&h.includes("fal")?h.includes("replicate"):!g&&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(g=>o==="all"||g.categories.includes(o));const p=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(g=>g.categories.every(w=>p.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(g=>g.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 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",
|
|
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",p=>{if(p.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",p=>{p.preventDefault(),this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateUse",s)}),o=!0}n.innerHTML=`
|
|
331
331
|
${l}
|
|
332
332
|
<div class="card-text">
|
|
333
333
|
<div class="title">${s.name}</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
|
|
347
|
+
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const p=e.cloneNode(!0),g=p.querySelector(".result-tool");g&&g.remove(),p.querySelectorAll(".link-view, .link-download").forEach(b=>{b.remove()}),p.style.position="fixed",p.style.left="-9999px",document.body.appendChild(p);const E=p.innerText.trim();document.body.removeChild(p),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 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">
|
|
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 p=document.createElement("p");p.className="form-desc",p.innerText=i.description||this.out("Your Description Here"),o.appendChild(p)}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 p=document.createElement("div");p.className="form-field",o.type==="hidden"&&(p.className="hidden"),o.displayInOutput||r.appendChild(p),o.type==="color"&&p.classList.add("field-color");const g=o.type;let w=o.name;if(r.querySelector(`[name="${w}"]`)&&(a++,w=w+"_"+a),g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`short_text_label_${b}`,m.type="text",m.name=w,m.value=o.value||"",m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("textarea");m.id=`long_text_label_${b}`,m.name=w,m.value=o.value||"",m.className="inp-base",m.style.height=o.height+"px",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`number_label_${b}`,m.type="number",m.name=w,m.value=o.value||"",m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="slider"){p.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>':""),p.appendChild(k),o.fieldNote){const R=document.createElement("div");R.className="field-note",R.innerHTML=o.fieldNote,p.appendChild(R)}const m=document.createElement("div");m.className="slider-container",p.appendChild(m);const v=document.createElement("div");v.className="slider-values",m.appendChild(v);const _=document.createElement("span");v.appendChild(_),_.innerText=o.minValue;const f=document.createElement("span");v.appendChild(f),f.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),m.appendChild(y);const T=document.createElement("div");T.className="current-value",m.appendChild(T),m.querySelector(".current-value").textContent=o.value||0,y.addEventListener("input",()=>{m.querySelector(".current-value").textContent=y.value})}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("div");if(m.setAttribute("aria-labelledby",`radio_group_label_${b}`),m.setAttribute("role","group"),m.className="div-options",p.appendChild(m),o.choices&&o.choices.forEach((v,_)=>{let f=v;o.choicesText&&(f=o.choicesText[_]||v);const y=document.createElement("label");y.setAttribute("for",`${b}_${_}`),y.className="option-label",m.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 R=document.createElement("span");R.className="peer-span-rounded",y.appendChild(R);const A='<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>';R.innerHTML=A,_===0&&o.isRequired&&T.setAttribute("required","required");const N=document.createElement("span");N.innerText=f,y.appendChild(N),T.addEventListener("change",this.changeListener)}),o.showOtherItem){const v=document.createElement("label");v.setAttribute("for",b+"_other"),v.className="option-label",m.appendChild(v);const _=document.createElement("input");_.type="radio",_.className="peer",_.id=b+"_other",_.name=w,_.value="other",v.appendChild(_);const f=document.createElement("span");f.className="peer-span-rounded",v.appendChild(f);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>';f.innerHTML=y;const T=document.createElement("span");T.innerText=o.otherText,v.appendChild(T);const R=document.createElement("div");p.appendChild(R);const A=document.createElement("input");A.type="text",A.name=w+"_other",A.className="inp-base",R.appendChild(A),_.addEventListener("change",this.changeListener),A.addEventListener("input",this.inputListener)}}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("div");if(m.setAttribute("aria-labelledby",`checkbox_group_label_${b}`),m.setAttribute("role","group"),m.className="div-options",p.appendChild(m),o.choices&&o.choices.forEach((v,_)=>{let f=v;o.choicesText&&(f=o.choicesText[_]||v);const y=document.createElement("label");y.setAttribute("for",`${b}_${_}`),y.className="option-label",m.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 R=document.createElement("span");R.className="peer-span-square",y.appendChild(R);const A=`<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>`;R.innerHTML=A;const N=document.createElement("span");N.innerText=f,y.appendChild(N),T.addEventListener("change",this.changeListener)}),o.showOtherItem){const v=document.createElement("label");v.setAttribute("for",b+"_other"),v.className="option-label",m.appendChild(v);const _=document.createElement("input");_.type="checkbox",_.className="peer",_.id=b+"_other",_.name=w,_.value="other",v.appendChild(_);const f=document.createElement("span");f.className="peer-span-square",v.appendChild(f);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>`;f.innerHTML=y;const T=document.createElement("span");T.innerText=o.otherText,v.appendChild(T);const R=document.createElement("div");p.appendChild(R);const A=document.createElement("input");A.type="text",A.name=w+"_other",A.className="inp-base",R.appendChild(A),_.addEventListener("change",this.changeListener),A.addEventListener("input",this.inputListener)}}if(g==="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}`,p.appendChild(k),o.fieldNote){const y=document.createElement("div");y.className="field-note",y.innerHTML=o.fieldNote,p.appendChild(y)}const m=document.createElement("div");m.className="switch",m.tabIndex=0,m.role="switch",m.setAttribute("aria-labelledby",`switch_${b}`),m.setAttribute("aria-checked","false"),m.setAttribute("data-checked","false"),p.appendChild(m);const v=document.createElement("div");v.className="switch-thumb",m.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."))),m.appendChild(_),o.value==="true"?(m.setAttribute("aria-checked","true"),m.setAttribute("data-checked","true"),_.value="true",o.isRequired&&_.setCustomValidity("")):(m.setAttribute("aria-checked","false"),m.setAttribute("data-checked","false"),_.value="false",o.isRequired&&_.setCustomValidity(this.out("Please toggle this switch to proceed."))),k.addEventListener("click",()=>{m.focus()});const f=()=>{const y=m.getAttribute("aria-checked")==="true";m.setAttribute("aria-checked",!y),m.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)};m.addEventListener("keydown",y=>{(y.key===" "||y.key==="Enter")&&(y.preventDefault(),f())}),m.addEventListener("click",()=>{f()})}if(g==="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>':""),p.appendChild(k),o.fieldNote){const N=document.createElement("div");N.className="field-note",N.innerHTML=o.fieldNote,p.appendChild(N)}const m=document.createElement("div");m.className="relative",p.appendChild(m);const v=document.createElement("div");v.className="relative inline-block",m.appendChild(v);const _=document.createElement("select");_.id=`dropdown_${b}`,_.name=w,o.isRequired&&_.setAttribute("required","required"),v.appendChild(_);const f=document.createElement("option");if(f.setAttribute("selected","selected"),f.setAttribute("disabled","disabled"),f.value="",f.innerText=o.placeholder,_.appendChild(f),o.choices&&o.choices.forEach((N,P)=>{let I=N;o.choicesText&&(I=o.choicesText[P]||N);const C=document.createElement("option");C.value=N,C.innerText=I,_.appendChild(C),P===o.selected&&(f.remove(),C.setAttribute("selected","selected"))}),o.showOtherItem){const N=document.createElement("option");N.value="other",N.innerText=o.otherText,_.appendChild(N)}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 T=document.createElement("input");T.type="text",T.id=`input_other_${b}`,T.name=w+"_other",T.className="input-other hidden inp-base",
|
|
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",p.appendChild(T);const R=p.querySelector(`#dropdown_${b}`),A=p.querySelector(`#input_other_${b}`);R.addEventListener("change",()=>{R.value==="other"?(A.classList.remove("hidden"),A.focus()):A.classList.add("hidden");const N=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(N)}),T.addEventListener("input",this.inputListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`date_${b}`,m.type="date",m.name=w,m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("change",this.changeListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`time_${b}`,m.type="time",m.name=w,m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("change",this.changeListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`datetime_${b}`,m.type="datetime-local",m.name=w,m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("change",this.changeListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`color_${b}`,m.type="color",m.name=w,m.value=o.value||"",m.className="input-color",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="file"||g==="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>':""),p.appendChild(k),o.fieldNote){const $=document.createElement("div");$.className="field-note",$.innerHTML=o.fieldNote,p.appendChild($)}const m=document.createElement("div");m.className="file-input-wrapper",g==="file"&&m.setAttribute("aria-label",this.out(this.settings.fileUploadText)),g==="multifile"&&m.setAttribute("aria-label",this.out(this.settings.multiFileUploadText)),p.appendChild(m);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."),p.appendChild(v),v.addEventListener("input",()=>{const $=p.querySelector(".btn-clearfile");$&&$.click(),this.inputListener(),v.value!==""?o.isRequired&&_.removeAttribute("required"):o.isRequired&&_.setAttribute("required","required"),Ee(v.value),this.clearSelectedFiles()}),o.useURL?v.style.display="":v.style.display="none";const _=document.createElement("input");_.id=`file_${b}`,_.type="file",g==="multifile"&&(_.multiple=!0),_.name=w,o.isRequired&&_.setAttribute("required","required"),_.className="peer",m.appendChild(_);const f=document.createElement("div");f.className="file-drop-area",m.appendChild(f);const y=document.createElement("div");y.className="file-controls",y.id=`drag_message_${b}`,m.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",g==="file"&&(T.innerHTML=this.out(this.settings.fileUploadText)),g==="multifile"&&(T.innerHTML=this.out(this.settings.multiFileUploadText)),y.appendChild(T));let R;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(R=document.createElement("button"),R.className="btn-selectfile",R.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
|
-
`,y.appendChild(
|
|
370
|
+
`,y.appendChild(R));let A;(o.source&&o.source==="camera"||o.source&&o.source==="local_and_camera")&&(A=document.createElement("button"),A.className="btn-takephoto",A.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
|
-
`,y.appendChild(
|
|
375
|
+
`,y.appendChild(A));const N=document.createElement("div");N.className="file-preview-container",m.appendChild(N);const P=document.createElement("div");P.className="file-drop-info-highlight",P.id=`file_name_${b}`,m.appendChild(P),R&&R.addEventListener("click",$=>{$.preventDefault(),_.click()}),m.classList.add("disabledrop"),(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(m.classList.remove("disabledrop"),m.addEventListener("dragover",$=>{$.preventDefault(),Array.from($.dataTransfer.items).some(ie=>ie.kind==="file")&&m.classList.add("drag-over")}),m.addEventListener("dragleave",()=>{m.classList.remove("drag-over")}),g==="file"?m.addEventListener("drop",$=>{if($.preventDefault(),$.dataTransfer.files&&$.dataTransfer.files.length>0){m.classList.remove("drag-over");const X=$.dataTransfer.files[0];X&&(_.files=$.dataTransfer.files,ye(X),this.clearSelectedFiles())}}):g==="multifile"&&m.addEventListener("drop",$=>{if($.preventDefault(),$.dataTransfer.files&&$.dataTransfer.files.length>0){m.classList.remove("drag-over"),N.innerHTML="";const X=$.dataTransfer.files;X.length>0&&(_.files=X,Array.from(X).forEach(ie=>{oe(ie)}),this.clearSelectedFiles())}})),g==="file"?_.addEventListener("change",()=>{const $=_.files[0];$&&(ye($),this.clearSelectedFiles())}):g==="multifile"&&_.addEventListener("change",()=>{N.innerHTML="";const $=_.files;Array.from($).forEach(X=>{X&&(oe(X),this.clearSelectedFiles())})});const I={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 C=[];(o.allowedFileTypes||["images","videos","audio","documents","others"]).forEach($=>{switch($){case"images":C=C.concat(I.images);break;case"videos":C=C.concat(I.videos);break;case"audio":C=C.concat(I.audio);break;case"documents":C=C.concat(I.documents);break;case"others":C=C.concat(I.others);break}});const S=C.map($=>$.type).join(",");_.setAttribute("accept",S);let O;if(o.useImageMask){p.classList.add("image-mask");const $=document.createElement("div");p.appendChild($),O=new xr($,{lang:this.settings.lang,name:w+"_mask"}),this.objImageMask=O}o.largePreview&&p.classList.add("large-preview");const j=()=>{const $=m.querySelector(".img-preview");$&&($.remove(),o.useImageMask&&O.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(m,L);const H=p.querySelector(".livevideo"),z=p.querySelector(".photo-captured"),B=p.querySelector(".btn-selectfile2"),G=p.querySelector(".btn-takephoto2"),W=p.querySelector(".btn-capturephoto"),ee=p.querySelector(".btn-clearphoto"),Q=p.querySelector(".btn-stopcamera");this.photoBlob={};let he;B&&B.addEventListener("click",$=>{$.preventDefault(),R.click()});const Te=async()=>{const $=p.querySelector(".btn-clearfile");$&&$.click();try{he=await navigator.mediaDevices.getUserMedia({video:!0}),H.srcObject=he}catch{alert("Unable to access the camera."),H.style.display="none",W.style.display="none",Q.style.display="none",y.style.display="none",P.style.display="none"}setTimeout(()=>{G.style.display="none",z.style.display="none",H.style.display="",W.style.display="",ee.style.display="none",B&&(B.style.display="none"),G.style.display="none",Q.style.display="",y.style.display="none",P.style.display="none"},100)};A&&A.addEventListener("click",async $=>{$.preventDefault(),Te()}),G.addEventListener("click",async $=>{$.preventDefault(),Te()}),Q.addEventListener("click",()=>{he&&he.getTracks().forEach($=>$.stop()),H.style.display="none",W.style.display="none",Q.style.display="none",G.style.display="none",y.style.display="",P.style.display=""}),W.addEventListener("click",$=>{if($.preventDefault(),z.style.display="",z.width=H.videoWidth,z.height=H.videoHeight,z.getContext("2d").drawImage(H,0,0,z.width,z.height),he.getTracks().forEach(X=>X.stop()),H.style.display="none",W.style.display="none",ee.style.display="",B&&(B.style.display=""),G.style.display="",Q.style.display="none",z.toBlob(X=>{this.photoBlob[w]=X,_.removeAttribute("required")},"image/jpeg"),G.style.display="",o.useImageMask){const X=z.toDataURL("image/jpeg");O.setImage(X)}this.clearSelectedFiles()});const me=()=>{this.photoBlob[w]=null,z.style.display="none",z.getContext("2d").clearRect(0,0,z.width,z.height),v.value!==""?o.isRequired&&_.removeAttribute("required"):o.isRequired&&_.setAttribute("required","required"),ee.style.display="none",B&&(B.style.display="none"),G.style.display="none",y.style.display="",P.style.display=""};ee.addEventListener("click",()=>{me()});const Ee=($,X)=>{const ie=`.${$.split(".").pop().toLowerCase()}`;if(!C.some(Y=>Y.extensions.split(", ").includes(ie)))return;let ge=I.images.some(Y=>Y.extensions.split(", ").includes(ie));if(o.useImageMask){if(!ge)return;O.loadUrl($)}me(),P.innerHTML="";const le=document.createElement("div");P.appendChild(le);const se=document.createElement("button");if(se.className="btn-clearfile",se.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
|
+
`,P.appendChild(se),se.addEventListener("click",Y=>{let pe=se.closest(".form-field").querySelector(".img-preview");pe&&pe.remove(),v.value="",_.value="",P.innerHTML="",T.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&O.clearImage();const Re=document.querySelector(".formview-container .submit-container");Re&&setTimeout(()=>{this.stickyElement(Re)},1e3),Y.preventDefault(),Y.stopImmediatePropagation()}),ge){let Y=m.querySelector(".formview-container .img-preview");Y||(Y=document.createElement("img"),Y.className="img-preview",m.appendChild(Y)),Y.src=$}else j();if(!X){const Y=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(Y)}const te=document.querySelector(".formview-container .submit-container");te&&setTimeout(()=>{this.stickyElement(te)},1e3)};o.value&&Ee(o.value,!0);const ye=$=>{if($){if(!C.some(se=>se.type===$.type)){alert(this.out("Invalid file type."));return}if(o.useImageMask){if(!["image/jpeg","image/png","image/webp"].includes($.type)){alert(this.out("Invalid file type."));return}O.loadImage($)}me(),v.value="",P.innerHTML="";const ie=document.createElement("div");ie.innerText=$.name,P.appendChild(ie);const ce=document.createElement("button");if(ce.className="btn-clearfile",ce.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
|
+
`,P.appendChild(ce),ce.addEventListener("click",se=>{let Y=ce.closest(".form-field").querySelector(".img-preview");Y&&Y.remove(),_.value="",P.innerHTML="",T.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&O.clearImage();const Se=document.querySelector(".formview-container .submit-container");Se&&setTimeout(()=>{this.stickyElement(Se)},1e3),se.preventDefault(),se.stopImmediatePropagation()}),$.type.startsWith("image/")){const se=new FileReader;se.onload=function(te){let Y=m.querySelector(".formview-container .img-preview");Y||(Y=document.createElement("img"),Y.className="img-preview",m.appendChild(Y)),Y.src=te.target.result},se.readAsDataURL($)}else j();const ge=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(ge);const le=document.querySelector(".formview-container .submit-container");le&&setTimeout(()=>{this.stickyElement(le)},1e3)}},oe=$=>{if($){if(C=C.concat(I.images),!C.some(Y=>Y.type===$.type)){alert(this.out("Invalid file type."));return}const ie=document.createElement("div");ie.className="image-item",N.appendChild(ie);const ce=document.createElement("div");ce.className="file-drop-info-highlight",ie.appendChild(ce);const ge=document.createElement("div");ge.innerText=$.name,ce.appendChild(ge);const le=document.createElement("button");if(le.className="btn-clearfile",le.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
|
-
`,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+=`
|
|
419
|
+
`,ce.appendChild(le),le.addEventListener("click",Y=>{const Se=le.closest(".image-item");Se&&Se.remove(),(ne=>{const De=new DataTransfer,Oe=_.files;Array.from(Oe).forEach($e=>{$e!==ne&&De.items.add($e)}),_.files=De.files})($);const Re=document.querySelector(".formview-container .submit-container");Re&&setTimeout(()=>{this.stickyElement(Re)},1e3),Y.preventDefault(),Y.stopImmediatePropagation()}),$.type.startsWith("image/")){const Y=new FileReader;Y.onload=function(Se){let pe=document.createElement("img");pe.className="img-preview",ie.appendChild(pe),pe.src=Se.target.result},Y.readAsDataURL($)}const se=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(se);const te=document.querySelector(".formview-container .submit-container");te&&setTimeout(()=>{this.stickyElement(te)},1e3)}}}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`email_label_${b}`,m.type="email",m.name=w,m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`phone_label_${b}`,m.type="tel",m.name=w,m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="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>':""),p.appendChild(k),o.fieldNote){const v=document.createElement("div");v.className="field-note",v.innerHTML=o.fieldNote,p.appendChild(v)}const m=document.createElement("input");m.id=`url_label_${b}`,m.type="url",m.name=w,m.value=o.value||"",m.className="inp-base",m.placeholder=o.placeholder,o.isRequired&&m.setAttribute("required","required"),p.appendChild(m),m.addEventListener("input",this.inputListener)}if(g==="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,p.appendChild(k);const m=document.createElement("input");m.id=`hidden_label_${b}`,m.type="hidden",m.name=w,m.value=o.value,p.appendChild(m)}});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",m=>{m.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 p=document.createElement("button");p.className="btn-submitform";const g=i.submitText||this.settings.submitText;p.innerText=g,o.appendChild(p),(i.fullWidthButton||!1)&&p.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",p="reference_code";const g=document.createElement("div");g.className="form-field ",g.classList.add(p),r.appendChild(g);let w=this.getId();const E=document.createElement("label");E.setAttribute("for",`short_text_label_${w}`),E.className="field-label",E.innerHTML=o,g.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",g.appendChild(b),this.settings.captchaContainer){const k=this.settings.captchaContainerClassName,m=document.createElement("div");m.className="captcha-container",k&&m.classList.add(k),r.appendChild(m)}if(i.useSubmitButton){const k=document.createElement("div");k.className="submit-container",r.appendChild(k);let m=!0;if("hideReset"in i&&(m=i.hideReset),!m){const T=document.createElement("button");T.className="btn-resetform";const R=i.resetText||this.settings.resetText;T.innerText=R,k.appendChild(T),T.addEventListener("click",N=>{N.preventDefault();const P=T.closest("form");P&&(P.reset(),P.querySelectorAll(".btn-clearfile").forEach(x=>{x.click()}),P.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 p=document.createElement("div");p.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(p.style.height=o.spacerHeight+"px"),d.appendChild(p);return}if(o.type==="separator"){const p=document.createElement("hr");p.style.borderTopColor=o.color,d.appendChild(p);return}if(o.type==="html"){if(o.html){const p=document.createElement("div");p.innerHTML=o.html,d.appendChild(p)}return}if(o.type==="heading"){const p=document.createElement(o.heading||"h2");p.innerHTML=o.headingText||this.out("Your Heading Here!"),d.appendChild(p);return}if(o.type==="paragraph"){const p=document.createElement("p");p.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),d.appendChild(p);return}if(o.type==="media"){if(o.tag==="video"){const p=document.createElement("video");p.style.width="100%",p.style.height="auto",p.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",p.appendChild(h),d.appendChild(p)}else if(o.tag==="audio"){const p=document.createElement("audio");p.controls=!0;let g=document.createElement("source");g.src=o.url,g.type="audio/mp3",p.appendChild(g),d.appendChild(p)}else if(o.tag==="img"){const p=document.createElement("img");p.src=o.url,p.setAttribute("alt",this.out("Output Image")),d.appendChild(p)}return}if(o.type==="image"){const p=document.createElement("img");p.src=o.url,p.setAttribute("alt",this.out("Output Image")),d.appendChild(p);return}if(o.type==="video"){const p=document.createElement("video");p.style.width="100%",p.style.height="auto",p.controls=!0;let g=document.createElement("source");g.src=o.url,g.type="video/mp4",p.appendChild(g),d.appendChild(p);return}if(o.type==="audio"){const p=document.createElement("audio");p.controls=!0;let g=document.createElement("source");g.src=o.url,g.type="audio/mp3",p.appendChild(g),d.appendChild(p);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(),p=d.substring(d.lastIndexOf("/")+1),g=document.createElement("a");g.href=URL.createObjectURL(h),g.download=p,g.click(),URL.revokeObjectURL(g.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}
|
|
@@ -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=[],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(
|
|
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(m=>k.includes(m))});const p=this.settings.scrapeLimit,g=h.slice(0,p);t.innerHTML="",c=document.createElement("p"),c.innerHTML=this.out("Getting more information..."),t.appendChild(c);let w=[];for(let b=0;b<g.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>
|
|
@@ -503,7 +503,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],l=[];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=(v,_)=>{if(v===void 0)return"";if(!isNaN(v))return v;let
|
|
506
|
+
`,this.isNormal=!0),this.isGenerating=!0;let d=(v,_)=>{if(v===void 0)return"";if(!isNaN(v))return v;let f=v;return _&&_.trim().startsWith("{")&&(f=JSON.stringify(v).slice(1,-1)),f};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 R=y.value[0];if(!R)continue;const A=await new Promise((N,P)=>{const I=new FileReader;I.onload=C=>{const x=C.target.result.split(",")[1];N(x)},I.onerror=P,I.readAsDataURL(R)});_=_.replaceAll(`{{${y.name}}}`,A),_=_.replaceAll(`{{${y.name.toUpperCase()}}}`,A)}}v.prompt=_}o.forEach(v=>{let _=v.prompt;h.forEach(f=>{if(f.value===void 0&&(f.value=""),typeof f.value=="object"&&Array.isArray(f.value)){const y=f.value.join(", ");_=_.replaceAll(`{{${f.name}}}`,y),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,y)}else f.value instanceof FileList||typeof f.value=="string"&&f.value.indexOf("base64")!==-1?(_=_.replaceAll(`{{${f.name}}}`,f.name),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,f.name)):(_=_.replaceAll(`{{${f.name}}}`,d(f.value,v.prompt)),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,d(f.value,v.prompt)))}),v.prompt=_}),o.forEach(v=>{let _=v.context;h.forEach(f=>{if(f.value||(f.value=""),typeof f.value=="object"&&Array.isArray(f.value)){const y=f.value.join(", ");_=_.replaceAll(`{{${f.name}}}`,y),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,y)}else f.value instanceof FileList||typeof f.value=="string"&&f.value.indexOf("base64")!==-1?(_=_.replaceAll(`{{${f.name}}}`,f.name),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,f.name)):(_=_.replaceAll(`{{${f.name}}}`,d(f.value,v.prompt)),_=_.replaceAll(`{{${f.name.toUpperCase()}}}`,d(f.value,v.prompt)))}),v.context=_})}const p=async(v,_,f,y,T,R,A,N)=>{const P=document.createElement("div");P.classList.add("result-container"),i.appendChild(P),P.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=[],l=[];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 I=!1,C;if(v.trim().startsWith("{"))try{C=JSON.parse(v),C&&typeof C=="object"&&(I=!0)}catch{return P.innerHTML=`<p>${this.out("Incorrect JSON format.")}</p>`,!1}(A&&(A.image||A.video||A.audio)||I)&&(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=[],l=[];if(r.url&&r.needsc
|
|
|
523
523
|
</svg>
|
|
524
524
|
</span>
|
|
525
525
|
|
|
526
|
-
`,a.setAttribute("disabled","")));let x="",S="",
|
|
526
|
+
`,a.setAttribute("disabled","")));let x="",S="",O;if(A&&A.search&&(O=await this.getRelevantInfo(v,_,P),O.data!==""&&(_+=`
|
|
527
527
|
Use the following information to answer the request:
|
|
528
528
|
|
|
529
|
-
${
|
|
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
|
|
532
|
-
`);w="";let _=0,
|
|
533
|
-
`}}this.tokenInput+=_,this.tokenOutput+=
|
|
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(),
|
|
535
|
-
`);
|
|
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})();
|
|
529
|
+
${O.data}
|
|
530
|
+
`)),A&&(A.image||A.video||A.audio)||I){const j=await this.media.generate(v,_,f,y,A,P,N);return this.needCleanup=!0,this.settings.consoleLog&&console.log(j),j.mediaGenerated?{media:j.output,media2:j.output2,markdown:j.markdown}:(P.innerHTML=`<p>${j.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(v,_,T,R,async j=>{if(!(j&&typeof j=="object")){if(x+=j,!N){const L=ae.parse(x);P.innerHTML=L,S+=L}await new Promise(L=>setTimeout(L,50))}}),await new Promise(j=>{const L=setInterval(()=>{P.innerHTML===ae.parse(x)&&(clearInterval(L),j())},10)}),N&&(P.innerHTML="",P.remove()),this.outputHtml+=`<div class="result-container">${S}</div>`;else if(this.settings.assistantUrl){let j=await this.assistant(v,_,T,R);if(!j)return!1;if(x=j,N)P.innerHTML="",P.remove();else{const L=ae.parse(j);P.innerHTML=L,this.outputHtml+=`<div class="result-container">${L}</div>`}}}else if(this.settings.sendCommandStreamUrl){let j="",L="",H="";const z=async B=>{let G=0;for(;G<B.length;){if(H=j.slice(0,H.length+1),G++,!N){const W=ae.parse(H);P.innerHTML=W,L=W}await new Promise(W=>setTimeout(W,50))}};await this.sendStream(v,_,T,y,R,async B=>{x+=B,j+=B,await z(B)}),await new Promise(B=>{const G=setInterval(()=>{H.length===j.length&&(clearInterval(G),B())},10)}),N&&(P.innerHTML="",P.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`}else{let j=await this.send(v,_,T,y,R);if(!j)return!1;if(x=j,N)P.innerHTML="",P.remove();else{const L=ae.parse(j);P.innerHTML=L,this.outputHtml+=`<div class="result-container">${L}</div>`}}if(!N){let j="";if(O&&O.urls.forEach(H=>{let z=H;z.length>75&&(z=z.slice(0,75)+"..."),j+=`<div><a class="source_url" href="${H}">${z}</url></div>`}),O&&O.failed.forEach(H=>{let z=H;z.length>75&&(z=z.slice(0,75)+"..."),j+=`<div><a class="source_url" style="opacity:0.5" href="${H}">${z}</url></div>`}),j!==""){const H=document.createElement("div");H.classList.add("result-container"),i.appendChild(H),H.innerHTML=j}}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:f,context:y,provider:T,model:R,system:A,functs:N,tools:P,hideOutput:I}=v[_];T=T||"",y=y||"",A=A||"You are an assistant",N=N||[];let C=f;this.previousResults.forEach((S,O)=>{const j=`{{output_step_${O+1}}}`;C=C.replace(new RegExp(j,"g"),d(S,f)),C=C.replace(new RegExp(j.toUpperCase(),"g"),d(S,f))}),f=C,f=f.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(f),C=y,this.previousResults.forEach((S,O)=>{const j=`{{output_step_${O+1}}}`;C=C.replace(new RegExp(j,"g"),d(S,f)),C=C.replace(new RegExp(j.toUpperCase(),"g"),d(S,f))}),y=C,y=y.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let x=await p(f,y,T,R,A,N,P,I);if(!x)break;if(this.mediaGenerated.push(...x.media),x.media&&x.media.length===1){let S=x.media[0],O=x.media2&&x.media2.length===1&&x.media2[0];this.previousResults.push(O||S),I&&(this.filesUploaded[`output_step_${_}`]=S)}else this.previousResults.push(x.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(_,f)=>{if(!this.isGenerating)return;let{prompt:y,context:T,provider:R,model:A,system:N,functs:P,tools:I,hideOutput:C}=_[f];T=T||"",N=N||"You are an assistant",P=P||[];let x=y;this.previousResults&&this.previousResults.forEach((O,j)=>{const L=`{{output_step_${j+1}}}`;x=x.replace(new RegExp(L,"g"),O),x=x.replace(new RegExp(L.toUpperCase(),"g"),O)}),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((O,j)=>{const L=`{{output_step_${j+1}}}`;x=x.replace(new RegExp(L,"g"),O),x=x.replace(new RegExp(L.toUpperCase(),"g"),O)}),T=x,T=T.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(T);let S=await p(y,T,R,A,N,P,I,C);if(S&&(this.mediaGenerated.push(...S.media),!!this.previousResults))if(S.media&&S.media.length===1){let O=S.media[0],j=S.media2&&S.media2.length===1&&S.media2[0];this.previousResults[f]=j||O,C&&(this.filesUploaded[`output_step_${f}`]=O)}else this.previousResults[f]=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 f=document.createElement("div");if(f.innerHTML=v,f.querySelector("video"))return"Video";if(f.querySelector("img"))return"Image";if(f.querySelector("audio"))return"Audio";const y=f.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 f=_.target.href;try{const y=await fetch(f,{mode:"cors"});if(!y.ok)throw new Error("Failed to fetch the image.");const T=await y.blob(),R=f.substring(f.lastIndexOf("/")+1),A=document.createElement("a");A.href=URL.createObjectURL(T),A.download=R,A.click(),URL.revokeObjectURL(A.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(p=>p.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 p=l+"_red";d=s[p],d!==void 0&&(o={questions:a,name:p,value:d},t.push(o));let g=l+"_green";d=s[g],d!==void 0&&(o={questions:a,name:g,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 p;return h.answer.choices.forEach(g=>{p=g.message.content}),p}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 p=h.body.getReader(),g=new TextDecoder;let w="",E=!1;for(;!E;){const{done:b,value:k}=await p.read();if(E=b,E)break;const m=g.decode(k,{stream:!0});w+=m;const v=w.split(`
|
|
532
|
+
`);w="";let _=0,f=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 R=JSON.parse(T);if(R.usage&&(_=R.usage.prompt_tokens,f=R.usage.completion_tokens),R.choices&&R.choices[0].delta&&R.choices[0].delta.content){const A=R.choices[0].delta.content;r&&r(A)}}catch{w+=y+`
|
|
533
|
+
`}}this.tokenInput+=_,this.tokenOutput+=f}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(),p=new TextDecoder;let g="",w=!1;for(;!w;){const{done:E,value:b}=await h.read();if(w=E,w)break;const k=p.decode(b,{stream:!0});g+=k;const m=g.split(`
|
|
535
|
+
`);g="";for(const v of m)if(v.trim()!=="")if(v.startsWith("data:")){const _=v.slice(5).trim();_==="[DONE]"&&this.settings.consoleLog&&console.log("Stream completed.");try{const f=JSON.parse(_);if(f.choices&&f.choices[0].delta&&f.choices[0].delta.content){const y=f.choices[0].delta.content;n&&n(y)}}catch{g+=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 _r{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 F=new _r;class Sr{constructor(e={}){const i={};this.settings=Object.assign(this,i,e)}init(){const e=h=>{const p=h.parentNode,g=h.nextElementSibling;if(F.hasClass(g,"is-menu-links")){let E=g.querySelectorAll("li");E.forEach(b=>{if(b!==p){const k=b.querySelector("ul");F.removeClass(k,"active")}}),E=document.querySelectorAll(".is-menu > ul > li ul"),E.forEach(b=>{const k=b.querySelector("ul");F.removeClass(k,"active")})}F.hasClass(g,"active")&&!F.hasClass(g,"is-menu-links")&&g.querySelectorAll("li").forEach(b=>{if(b!==p){const k=b.querySelector("ul");F.removeClass(k,"active")}});const w=p.querySelector("ul");w&&F.addClass(w,"active")},i=h=>{if(h.nextElementSibling){const p=h.nextElementSibling;if(p)if(F.hasClass(p,"active"))F.removeClass(p,"active"),h.focus();else{const w=h.parentNode.parentNode;F.removeClass(w,"active"),w.previousElementSibling.focus()}else{const w=h.parentNode.parentNode;F.removeClass(w,"active"),w.previousElementSibling.focus()}}else{const g=h.parentNode.parentNode;F.removeClass(g,"active"),g.previousElementSibling.focus()}},s=h=>{const p=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(p.nextElementSibling)if(p.nextElementSibling.classList.contains("active"))p.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(p.parentNode.nextElementSibling)p.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=p.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(p.parentNode.nextElementSibling)p.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=p.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(h.keyCode===38)if(p.nextElementSibling)if(p.nextElementSibling.classList.contains("active"))p.nextElementSibling.classList.remove("active");else{const g=p.parentNode.previousElementSibling;g&&g.querySelector("a").focus()}else if(p.parentNode.previousElementSibling)p.parentNode.previousElementSibling.querySelector("a").focus();else{const w=p.parentNode.parentNode;w.classList.contains("active")&&w.classList.remove("active"),w.previousElementSibling.focus()}else if(h.which===9&&!h.shiftKey)if(p.nextElementSibling)if(p.nextElementSibling.classList.contains("active"))p.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(p.parentNode.nextElementSibling)p.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=p.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(p.parentNode.nextElementSibling)p.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const w=p.parentNode.parentNode;w.classList.contains("active")&&(w.classList.remove("active"),w.previousElementSibling.focus(),h.preventDefault())}else if(h.which===9&&h.shiftKey){if(p.nextElementSibling)p.nextElementSibling.classList.contains("active")&&p.nextElementSibling.classList.remove("active");else if(!p.parentNode.previousElementSibling){const w=p.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 p=h.querySelector("span");p&&p.addEventListener("click",g=>{if(window.innerWidth>=1024)return;const b=g.target.closest("li").querySelector("ul");b&&(F.hasClass(b,"active")?(F.removeClass(b,"active"),b.style.display=""):F.addClass(b,"active")),g.preventDefault(),g.stopImmediatePropagation()}),h.addEventListener("click",g=>{const w=h.querySelector("ul"),E=window.innerWidth;let b=g.target.tagName.toLowerCase();if(E>1024){if((b==="a"||b==="i")&&!g.target.getAttribute("href")){g.preventDefault(),g.stopImmediatePropagation();return}}else{let k=!0;if((b==="a"||b==="i")&&(g.target.getAttribute("href")||(g.preventDefault(),k=!1)),k){const m=document.querySelector(".is-menu");if(m.style.right==="0px"){F.removeClass(r,"active"),m.style.right="-1000px";const v=document.querySelector(".is-menu-overlay");F.removeClass(v,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}}}w&&(F.hasClass(w,"active")?(F.removeClass(w,"active"),w.style.display=""):(F.addClass(w,"active"),setTimeout(()=>{},0)))}),h.addEventListener("mouseleave",g=>{window.innerWidth<=1024||(this.timer=setTimeout(()=>{const E=h.querySelector("ul");E&&F.removeClass(E,"active")},200),g.preventDefault(),g.stopImmediatePropagation())}),h.addEventListener("mouseenter",g=>{const w=window.innerWidth;if(w<=1024||this.staticClose)return;const E=document.querySelector(".is-menu-search-input");if(F.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");F.removeClass(_,"active")}),!0;if(F.hasClass(b,"is-menu-links")){let m=b.querySelectorAll("li");m.forEach(v=>{if(v!==h){const _=v.querySelector("ul");F.removeClass(_,"active")}}),m=document.querySelectorAll(".is-menu > ul > li ul"),m.forEach(v=>{const _=v.querySelector("ul");F.removeClass(_,"active")})}F.hasClass(b,"active")&&!F.hasClass(b,"is-menu-links")&&b.querySelectorAll("li").forEach(v=>{if(v!==h){const _=v.querySelector("ul");F.removeClass(_,"active")}});const k=h.querySelector("ul");if(k&&F.addClass(k,"active"),k.style.right="",k.classList.contains("active")){const m=k.getBoundingClientRect();m.left+m.width>w&&(k.style.right=0)}g.preventDefault(),g.stopImmediatePropagation()})});const r=document.querySelector("#is-menu-toggle");r.addEventListener("click",h=>{const p=document.querySelector(".is-menu");if(p.style.right==="0px"){F.removeClass(r,"active"),p.style.right="-1000px";const g=document.querySelector(".is-menu-overlay");F.removeClass(g,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}else{F.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"),p.style.right="0px";const w=document.querySelector(".is-menu-overlay");F.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");F.removeClass(h,"active"),document.querySelectorAll(".is-menu li ul").forEach(E=>{F.removeClass(E,"active")});const g=document.querySelector(".is-menu");if(g.style.transition="none",window.innerWidth>1024){g.style.right="0px",document.querySelectorAll(".is-menu li ul").forEach(k=>{k.style.display=""});const b=document.querySelector(".is-menu-overlay");F.removeClass(b,"active"),document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""}else g.style.right="-1000px";setTimeout(()=>{g.style.transition=""},30)}),window.addEventListener("scroll",()=>{var h=100,p=this.getCurrentScroll();p>=h?F.addClass(document.querySelector(".is-topbar"),"shrink"):F.removeClass(document.querySelector(".is-topbar"),"shrink"),window.innerWidth>=1024&&document.querySelector(".is-topbar.static")&&(p>30?this.staticClose||(document.querySelectorAll(".is-menu li ul").forEach(E=>{F.removeClass(E,"active")}),this.staticClose=!0):this.staticClose=!1)});const l=h=>{const p=document.querySelector(".is-menu-search-input");F.addClass(p,"active"),p.querySelector("input").focus(),document.querySelectorAll(".is-menu li ul").forEach(E=>{F.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 p=h.target;if(!F.hasClass(p,"is-menu-search")&&p.getAttribute("id")!=="is_btnSearch"&&p.getAttribute("id")!=="is_txtSearch"){const g=document.querySelector(".is-menu-search-input");F.removeClass(g,"active")}});const d=document.querySelector("#is_txtSearch");d.addEventListener("keydown",h=>{if(h.which==13&&this.settings.onSearch(d.value),h.which==27){const p=document.querySelector(".is-menu-search-input");F.removeClass(p,"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 Tr{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=Pn,window.FormViewer=kr,window.NavBar=Sr,window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{bs.init({duration:1200})},300),new Us}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,p=0;o.forEach(function(g){g.classList.contains("is-section-navbar")||(p===d-1&&(h=g),p++)}),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 ws({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(g=>{g!==c&&g.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 _s({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 Hi(e),window.GLightbox=Hi.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 Tr})();
|