@innovastudio/contentbox-runtime 1.0.3 → 1.0.5
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 +4660 -4261
- package/dist/contentbox-runtime.min.js +106 -106
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var ContentBoxRuntime=(function(){"use strict";var Kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ot(v){return v&&v.__esModule&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v}var ht={exports:{}},Mi=ht.exports,ei;function ji(){return ei||(ei=1,(function(v,e){(function(i,s){v.exports=s()})(Mi,function(){var i=typeof window<"u"?window:typeof Kt<"u"?Kt:typeof self<"u"?self:{},s="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,o=typeof i=="object"&&i&&i.Object===Object&&i,h=typeof self=="object"&&self&&self.Object===Object&&self,g=o||h||Function("return this")(),y=Object.prototype.toString,E=Math.max,M=Math.min,w=function(){return g.Date.now()};function C(L,j,z){var B,Z,ie,ee,K,he,re=0,Se=!1,pe=!1,we=!0;if(typeof L!="function")throw new TypeError(s);function Ee(ue){var Me=B,He=Z;return B=Z=void 0,re=ue,ee=L.apply(He,Me)}function De(ue){var Me=ue-he;return he===void 0||Me>=j||Me<0||pe&&ue-re>=ie}function Ne(){var ue=w();if(De(ue))return Pe(ue);K=setTimeout(Ne,(function(Me){var He=j-(Me-he);return pe?M(He,ie-(Me-re)):He})(ue))}function Pe(ue){return K=void 0,we&&B?Ee(ue):(B=Z=void 0,ee)}function Ce(){var ue=w(),Me=De(ue);if(B=arguments,Z=this,he=ue,Me){if(K===void 0)return(function(He){return re=He,K=setTimeout(Ne,j),Se?Ee(He):ee})(he);if(pe)return K=setTimeout(Ne,j),Ee(he)}return K===void 0&&(K=setTimeout(Ne,j)),ee}return j=_(j)||0,b(z)&&(Se=!!z.leading,ie=(pe="maxWait"in z)?E(_(z.maxWait)||0,j):ie,we="trailing"in z?!!z.trailing:we),Ce.cancel=function(){K!==void 0&&clearTimeout(K),re=0,B=he=Z=K=void 0},Ce.flush=function(){return K===void 0?ee:Pe(w())},Ce}function b(L){var j=typeof L;return!!L&&(j=="object"||j=="function")}function _(L){if(typeof L=="number")return L;if((function(B){return typeof B=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(B)&&y.call(B)==n})(L))return t;if(b(L)){var j=typeof L.valueOf=="function"?L.valueOf():L;L=b(j)?j+"":j}if(typeof L!="string")return L===0?L:+L;L=L.replace(r,"");var z=u.test(L);return z||c.test(L)?d(L.slice(2),z?2:8):a.test(L)?t:+L}var O=function(L,j,z){var B=!0,Z=!0;if(typeof L!="function")throw new TypeError(s);return b(z)&&(B="leading"in z?!!z.leading:B,Z="trailing"in z?!!z.trailing:Z),C(L,j,{leading:B,maxWait:j,trailing:Z})},m="Expected a function",k=NaN,R="[object Symbol]",V=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,Y=/^0b[01]+$/i,G=/^0o[0-7]+$/i,F=parseInt,I=typeof i=="object"&&i&&i.Object===Object&&i,T=typeof self=="object"&&self&&self.Object===Object&&self,A=I||T||Function("return this")(),$=Object.prototype.toString,W=Math.max,D=Math.min,J=function(){return A.Date.now()};function Q(L){var j=typeof L;return!!L&&(j=="object"||j=="function")}function ne(L){if(typeof L=="number")return L;if((function(B){return typeof B=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(B)&&$.call(B)==R})(L))return k;if(Q(L)){var j=typeof L.valueOf=="function"?L.valueOf():L;L=Q(j)?j+"":j}if(typeof L!="string")return L===0?L:+L;L=L.replace(V,"");var z=Y.test(L);return z||G.test(L)?F(L.slice(2),z?2:8):N.test(L)?k:+L}var se=function(L,j,z){var B,Z,ie,ee,K,he,re=0,Se=!1,pe=!1,we=!0;if(typeof L!="function")throw new TypeError(m);function Ee(ue){var Me=B,He=Z;return B=Z=void 0,re=ue,ee=L.apply(He,Me)}function De(ue){var Me=ue-he;return he===void 0||Me>=j||Me<0||pe&&ue-re>=ie}function Ne(){var ue=J();if(De(ue))return Pe(ue);K=setTimeout(Ne,(function(Me){var He=j-(Me-he);return pe?D(He,ie-(Me-re)):He})(ue))}function Pe(ue){return K=void 0,we&&B?Ee(ue):(B=Z=void 0,ee)}function Ce(){var ue=J(),Me=De(ue);if(B=arguments,Z=this,he=ue,Me){if(K===void 0)return(function(He){return re=He,K=setTimeout(Ne,j),Se?Ee(He):ee})(he);if(pe)return K=setTimeout(Ne,j),Ee(he)}return K===void 0&&(K=setTimeout(Ne,j)),ee}return j=ne(j)||0,Q(z)&&(Se=!!z.leading,ie=(pe="maxWait"in z)?W(ne(z.maxWait)||0,j):ie,we="trailing"in z?!!z.trailing:we),Ce.cancel=function(){K!==void 0&&clearTimeout(K),re=0,B=he=Z=K=void 0},Ce.flush=function(){return K===void 0?ee:Pe(J())},Ce},le=function(){};function de(L){L&&L.forEach(function(j){var z=Array.prototype.slice.call(j.addedNodes),B=Array.prototype.slice.call(j.removedNodes);if((function Z(ie){var ee=void 0,K=void 0;for(ee=0;ee<ie.length;ee+=1)if((K=ie[ee]).dataset&&K.dataset.aos||K.children&&Z(K.children))return!0;return!1})(z.concat(B)))return le()})}function oe(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var xe={isSupported:function(){return!!oe()},ready:function(L,j){var z=window.document,B=new(oe())(de);le=j,B.observe(z.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},je=function(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")},Le=(function(){function L(j,z){for(var B=0;B<z.length;B++){var Z=z[B];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(j,Z.key,Z)}}return function(j,z,B){return z&&L(j.prototype,z),B&&L(j,B),j}})(),Re=Object.assign||function(L){for(var j=1;j<arguments.length;j++){var z=arguments[j];for(var B in z)Object.prototype.hasOwnProperty.call(z,B)&&(L[B]=z[B])}return L},_e=/(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,ve=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,X=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,te=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function ge(){return navigator.userAgent||navigator.vendor||window.opera||""}var be=new((function(){function L(){je(this,L)}return Le(L,[{key:"phone",value:function(){var j=ge();return!(!_e.test(j)&&!ve.test(j.substr(0,4)))}},{key:"mobile",value:function(){var j=ge();return!(!X.test(j)&&!te.test(j.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),L})()),Te=function(L,j){var z=void 0;return be.ie11()?(z=document.createEvent("CustomEvent")).initCustomEvent(L,!0,!0,{detail:j}):z=new CustomEvent(L,{detail:j}),document.dispatchEvent(z)},ye=function(L){return L.forEach(function(j,z){return(function(B,Z){var ie=B.options,ee=B.position,K=B.node,he=(B.data,function(){B.animated&&((function(re,Se){Se&&Se.forEach(function(pe){return re.classList.remove(pe)})})(K,ie.animatedClassNames),Te("aos:out",K),B.options.id&&Te("aos:in:"+B.options.id,K),B.animated=!1)});ie.mirror&&Z>=ee.out&&!ie.once?he():Z>=ee.in?B.animated||((function(re,Se){Se&&Se.forEach(function(pe){return re.classList.add(pe)})})(K,ie.animatedClassNames),Te("aos:in",K),B.options.id&&Te("aos:in:"+B.options.id,K),B.animated=!0):B.animated&&!ie.once&&he()})(j,window.pageYOffset)})},me=function(L){for(var j=0,z=0;L&&!isNaN(L.offsetLeft)&&!isNaN(L.offsetTop);)j+=L.offsetLeft-(L.tagName!="BODY"?L.scrollLeft:0),z+=L.offsetTop-(L.tagName!="BODY"?L.scrollTop:0),L=L.offsetParent;return{top:z,left:j}},fe=function(L,j,z){var B=L.getAttribute("data-aos-"+j);if(B!==void 0){if(B==="true")return!0;if(B==="false")return!1}return B||z},ae=function(L,j){return L.forEach(function(z,B){var Z=fe(z.node,"mirror",j.mirror),ie=fe(z.node,"once",j.once),ee=fe(z.node,"id"),K=j.useClassNames&&z.node.getAttribute("data-aos"),he=[j.animatedClassName].concat(K?K.split(" "):[]).filter(function(re){return typeof re=="string"});j.initClassName&&z.node.classList.add(j.initClassName),z.position={in:(function(re,Se,pe){var we=window.innerHeight,Ee=fe(re,"anchor"),De=fe(re,"anchor-placement"),Ne=Number(fe(re,"offset",De?0:Se)),Pe=De||pe,Ce=re;Ee&&document.querySelectorAll(Ee)&&(Ce=document.querySelectorAll(Ee)[0]);var ue=me(Ce).top-we;switch(Pe){case"top-bottom":break;case"center-bottom":ue+=Ce.offsetHeight/2;break;case"bottom-bottom":ue+=Ce.offsetHeight;break;case"top-center":ue+=we/2;break;case"center-center":ue+=we/2+Ce.offsetHeight/2;break;case"bottom-center":ue+=we/2+Ce.offsetHeight;break;case"top-top":ue+=we;break;case"bottom-top":ue+=we+Ce.offsetHeight;break;case"center-top":ue+=we+Ce.offsetHeight/2}return ue+Ne})(z.node,j.offset,j.anchorPlacement),out:Z&&(function(re,Se){var pe=fe(re,"anchor"),we=fe(re,"offset",Se),Ee=re;return pe&&document.querySelectorAll(pe)&&(Ee=document.querySelectorAll(pe)[0]),me(Ee).top+Ee.offsetHeight-we})(z.node,j.offset)},z.options={once:ie,mirror:Z,animatedClassNames:he,id:ee}}),L},qe=function(){var L=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(L,function(j){return{node:j}})},l=[],p=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},f=function(){return document.all&&!window.atob},S=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(p=!0),p&&(l=ae(l,x),ye(l),window.addEventListener("scroll",O(function(){ye(l,x.once)},x.throttleDelay)))},q=function(){if(l=qe(),H(x.disable)||f())return P();S()},P=function(){l.forEach(function(L,j){L.node.removeAttribute("data-aos"),L.node.removeAttribute("data-aos-easing"),L.node.removeAttribute("data-aos-duration"),L.node.removeAttribute("data-aos-delay"),x.initClassName&&L.node.classList.remove(x.initClassName),x.animatedClassName&&L.node.classList.remove(x.animatedClassName)})},H=function(L){return L===!0||L==="mobile"&&be.mobile()||L==="phone"&&be.phone()||L==="tablet"&&be.tablet()||typeof L=="function"&&L()===!0};return{init:function(L){return x=Re(x,L),l=qe(),x.disableMutationObserver||xe.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,g=!1,y=void 0;try{for(var E,M=c[Symbol.iterator]();!(h=(E=M.next()).done)&&(o.push(E.value),!d||o.length!==d);h=!0);}catch(w){g=!0,y=w}finally{try{h||M.return==null||M.return()}finally{if(g)throw y}}return o}}function u(c){if(Array.isArray(c))return c}(function(){function c(m){return["elInY+elHeight","elCenterY-".concat(m=0<arguments.length&&m!==void 0?m:30),"elCenterY","elCenterY+".concat(m),"elOutY-elHeight"]}var d,o,h,g,y,E,M={fadeInOut:function(m,k){return k=1<arguments.length&&k!==void 0?k:0,{opacity:[c(0<arguments.length&&m!==void 0?m:30),[k,1,1,1,k]]}},fadeIn:function(m,k){return{opacity:[["elInY+elHeight",0<arguments.length&&m!==void 0?m:"elCenterY"],[1<arguments.length&&k!==void 0?k:0,1]]}},fadeOut:function(m,k){return{opacity:[[0<arguments.length&&m!==void 0?m:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&k!==void 0?k:0]]}},blurInOut:function(m,k){return k=1<arguments.length&&k!==void 0?k:20,{blur:[c(0<arguments.length&&m!==void 0?m:100),[k,0,0,0,k]]}},blurIn:function(m,k){return{blur:[["elInY+elHeight",0<arguments.length&&m!==void 0?m:"elCenterY"],[1<arguments.length&&k!==void 0?k:20,0]]}},blurOut:function(m,k){return{opacity:[[0<arguments.length&&m!==void 0?m:"elCenterY","elOutY-elHeight"],[0,1<arguments.length&&k!==void 0?k:20]]}},scaleInOut:function(m,k){return k=1<arguments.length&&k!==void 0?k:.6,{scale:[c(0<arguments.length&&m!==void 0?m:100),[k,1,1,1,k]]}},scaleIn:function(m,k){return{scale:[["elInY+elHeight",0<arguments.length&&m!==void 0?m:"elCenterY"],[1<arguments.length&&k!==void 0?k:.6,1]]}},scaleOut:function(m,k){return{scale:[[0<arguments.length&&m!==void 0?m:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&k!==void 0?k:.6]]}},slideX:function(m,k){return{translateX:[["elInY",0<arguments.length&&m!==void 0?m:0],[0,1<arguments.length&&k!==void 0?k:500]]}},slideY:function(m,k){return{translateY:[["elInY",0<arguments.length&&m!==void 0?m:0],[0,1<arguments.length&&k!==void 0?k:500]]}},spin:function(m,k){return m=0<arguments.length&&m!==void 0?m:1e3,{rotate:[[0,m],[0,1<arguments.length&&k!==void 0?k:360],{modValue:m}]}},flipX:function(m,k){return m=0<arguments.length&&m!==void 0?m:1e3,{rotateX:[[0,m],[0,1<arguments.length&&k!==void 0?k:360],{modValue:m}]}},flipY:function(m,k){return m=0<arguments.length&&m!==void 0?m:1e3,{rotateY:[[0,m],[0,1<arguments.length&&k!==void 0?k:360],{modValue:m}]}},jiggle:function(m,k){return m=0<arguments.length&&m!==void 0?m:50,k=1<arguments.length&&k!==void 0?k:40,{skewX:[[0,+m,2*m,3*m,4*m],[0,k,0,-k,0],{modValue:4*m}]}},seesaw:function(m,k){return m=0<arguments.length&&m!==void 0?m:50,k=1<arguments.length&&k!==void 0?k:40,{skewY:[[0,+m,2*m,3*m,4*m],[0,k,0,-k,0],{modValue:4*m}]}},zigzag:function(m,k){return m=0<arguments.length&&m!==void 0?m:100,k=1<arguments.length&&k!==void 0?k:100,{translateX:[[0,+m,2*m,3*m,4*m],[0,k,0,-k,0],{modValue:4*m}]}},hueRotate:function(m,k){return m=0<arguments.length&&m!==void 0?m:600,{"hue-rotate":[[0,m],[0,1<arguments.length&&k!==void 0?k:360],{modValue:m}]}}},w=(d=["perspective","scaleX","scaleY","scale","skewX","skewY","skew","rotateX","rotateY","rotate"],o=["blur","hue-rotate","brightness"],h=["translateX","translateY","translateZ"],g=["perspective","border-radius","blur","translateX","translateY","translateZ"],y=["hue-rotate","rotate","rotateX","rotateY","skew","skewX","skewY"],E={easeInQuad:function(m){return m*m},easeOutQuad:function(m){return m*(2-m)},easeInOutQuad:function(m){return m<.5?2*m*m:(4-2*m)*m-1},easeInCubic:function(m){return m*m*m},easeOutCubic:function(m){return--m*m*m+1},easeInOutCubic:function(m){return m<.5?4*m*m*m:(m-1)*(2*m-2)*(2*m-2)+1},easeInQuart:function(m){return m*m*m*m},easeOutQuart:function(m){return 1- --m*m*m*m},easeInOutQuart:function(m){return m<.5?8*m*m*m*m:1-8*--m*m*m*m},easeInQuint:function(m){return m*m*m*m*m},easeOutQuint:function(m){return 1+--m*m*m*m*m},easeInOutQuint:function(m){return m<.5?16*m*m*m*m*m:1+16*--m*m*m*m*m},easeOutBounce:function(m){var k=7.5625,R=2.75;return m<1/R?k*m*m:m<2/R?k*(m-=1.5/R)*m+.75:m<2.5/R?k*(m-=2.25/R)*m+.9375:k*(m-=2.625/R)*m+.984375},easeInBounce:function(m){return 1-E.easeOutBounce(1-m)},easeOutBack:function(m){return 1+2.70158*Math.pow(m-1,3)+1.70158*Math.pow(m-1,2)},easeInBack:function(m){return 2.70158*m*m*m-1.70158*m*m}},new function m(){var k=this;e(this,m),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",M),i(this,"debugData",{frameLengths:[]}),i(this,"init",function(){k.findAndAddElements(),window.requestAnimationFrame(k.onAnimationFrame),k.windowWidth=document.body.clientWidth,k.windowHeight=document.body.clientHeight,window.onresize=k.onWindowResize}),i(this,"onWindowResize",function(){document.body.clientWidth===k.windowWidth&&document.body.clientHeight===k.windowHeight||(k.windowWidth=document.body.clientWidth,k.windowHeight=document.body.clientHeight,k.elements.forEach(function(R){return R.calculateTransforms()}))}),i(this,"onAnimationFrame",function(R){k.debug&&(k.debugData.frameStart=Date.now());var V,N={};k.drivers.forEach(function(Y){N[Y.name]=Y.getValue(k.frame)}),k.elements.forEach(function(Y){Y.update(N,k.frame)}),k.debug&&k.debugData.frameLengths.push(Date.now()-k.debugData.frameStart),k.frame%60==0&&k.debug&&(V=Math.ceil(k.debugData.frameLengths.reduce(function(Y,G){return Y+G},0)/60),console.log("Average frame calculation time: ".concat(V,"ms")),k.debugData.frameLengths=[]),k.frame++,window.requestAnimationFrame(k.onAnimationFrame)}),i(this,"addDriver",function(R,V){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};k.drivers.push(new _(R,V,N))}),i(this,"removeDriver",function(R){k.drivers=k.drivers.filter(function(V){return V.name!==R})}),i(this,"findAndAddElements",function(){k.elements=[],document.querySelectorAll(".lax").forEach(function(R){var V=[];R.classList.forEach(function(Y){Y.includes("lax_preset")&&(Y=Y.replace("lax_preset_",""),V.push(Y))});var N=i({},"scrollY",{presets:V});k.elements.push(new O(".lax",k,R,N,0,{}))})}),i(this,"addElements",function(R,V,N){document.querySelectorAll(R).forEach(function(Y,G){k.elements.push(new O(R,k,Y,V,G,N))})}),i(this,"removeElements",function(R){k.elements=k.elements.filter(function(V){return V.selector!==R})}),i(this,"addElement",function(R,V,N){k.elements.push(new O("",k,R,V,0,N))}),i(this,"removeElement",function(R){k.elements=k.elements.filter(function(V){return V.domElement!==R})})});function C(m,k){if(Array.isArray(m))return m;for(var R=Object.keys(m).map(function(G){return parseInt(G)}).sort(function(G,F){return F<G?1:-1}),V=R[R.length-1],N=0;N<R.length;N++){var Y=R[N];if(k<Y){V=Y;break}}return m[V]}function b(m,D,R){var V=D.width,N=D.height,A=D.x,W=D.y;if(typeof m=="number")return m;var Y,G=document.body.scrollHeight,F=document.body.scrollWidth,I=window.innerWidth,T=window.innerHeight,$=s((Y=window.pageXOffset!==void 0,$=(document.compatMode||"")==="CSS1Compat",D=Y?window.pageXOffset:($?document.documentElement:document.body).scrollLeft,[Y?window.pageYOffset:($?document.documentElement:document.body).scrollTop,D]),2),D=$[0],A=A+$[1],$=A+V,W=W+D,D=W+N;return Function("return ".concat(m.replace(/screenWidth/g,I).replace(/screenHeight/g,T).replace(/pageHeight/g,G).replace(/pageWidth/g,F).replace(/elWidth/g,V).replace(/elHeight/g,N).replace(/elInY/g,W-T).replace(/elOutY/g,D).replace(/elCenterY/g,W+N/2-T/2).replace(/elInX/g,A-I).replace(/elOutX/g,$).replace(/elCenterX/g,A+V/2-I/2).replace(/index/g,R)))()}function _(m,k){var R=this,V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};e(this,_),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(N){var Y=R.lastValue;return N%R.frameStep==0&&(Y=R.getValueFn(N)),R.inertiaEnabled&&(N=Y-R.lastValue,R.m1=.8*R.m1+N*.19999999999999996,R.m2=.8*R.m2+R.m1*.19999999999999996,R.inertia=Math.round(5e3*R.m2)/15e3),R.lastValue=Y,[R.lastValue,R.inertia]}),this.name=m,this.getValueFn=k,Object.keys(V).forEach(function(N){R[N]=V[N]}),this.lastValue=this.getValueFn(0)}function O(m,k,R,V){var N=this,Y=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,F=5<arguments.length&&arguments[5]!==void 0?arguments[5]:{};e(this,O),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(I,T){var A,$=N.transforms,W={};for(A in $){var D=$[A];I[A]||console.error("No lax driver with name: ",A);var J,Q=s(I[A],2),ne=Q[0],se=Q[1];for(J in D){var le,Le=s(D[J],3),de=Le[0],oe=Le[1],Re=Le[2],ve=Re===void 0?{}:Re,xe=ve.modValue,_e=ve.frameStep,je=_e===void 0?1:_e,X=ve.easing,Le=ve.inertia,Re=ve.inertiaMode,_e=ve.cssFn,ve=ve.cssUnit,ve=ve===void 0?"":ve,X=E[X];T%je==0&&(X=(function(te,ge,be,Te){var ye=0;if(te.forEach(function(ae){ae<be&&ye++}),ye<=0)return ge[0];if(ye>=te.length)return ge[te.length-1];var me,fe=(fe=te[me=ye-1],te=te[ye],(be-fe)/(te-fe));return Te&&(fe=Te(fe)),me=ge[me],ge=ge[ye],me*(1-(fe=fe))+ge*fe})(de,oe,xe?ne%xe:ne,X),Le&&(le=se*Le,Re==="absolute"&&(le=Math.abs(le)),X+=le),le=(ve||g.includes(J)?"px":y.includes(J)?"deg":"")=="px"?0:3,le=X.toFixed(le),W[J]=_e?_e(le,N.domElement):le+ve)}}N.applyStyles(W),N.onUpdate&&N.onUpdate(I,N.domElement)}),i(this,"calculateTransforms",function(){N.transforms={};var I,T=N.laxInstance.windowWidth;for(I in N.transformsData)(function(A){var $=N.transformsData[A],W={},D=$.presets;(D===void 0?[]:D).forEach(function(de){var ne,oe=s(de.split(":"),3),se=oe[0],le=oe[1],de=oe[2],oe=window.lax.presets[se];oe?(ne=oe(le,de),Object.keys(ne).forEach(function(xe){$[xe]=ne[xe]})):console.error("Lax preset cannot be found with name: ",se)}),delete $.presets;for(var J in $)(function(Q){var ne=s($[Q],3),de=ne[0],le=de===void 0?[-1e9,1e9]:de,de=ne[1],de=de===void 0?[-1e9,1e9]:de,ne=ne[2],ne=ne===void 0?{}:ne,se=N.domElement.getBoundingClientRect(),le=C(le,T).map(function(oe){return b(oe,se,N.groupIndex)}),de=C(de,T).map(function(oe){return b(oe,se,N.groupIndex)});W[Q]=[le,de,ne]})(J);N.transforms[A]=W})(I)}),i(this,"applyStyles",function(I){var T,A,$,W=(T=I,A={transform:"",filter:""},$={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(T).forEach(function(D){var J=T[D],Q=g.includes(D)?"px":y.includes(D)?"deg":"";h.includes(D)?$[D]=J:d.includes(D)?A.transform+="".concat(D,"(").concat(J).concat(Q,") "):o.includes(D)?A.filter+="".concat(D,"(").concat(J).concat(Q,") "):A[D]="".concat(J).concat(Q," ")}),A.transform="translate3d(".concat($.translateX,"px, ").concat($.translateY,"px, ").concat($.translateZ,"px) ").concat(A.transform),A);Object.keys(W).forEach(function(D){N.domElement.style.setProperty(D,W[D])})}),this.selector=m,this.laxInstance=k,this.domElement=R,this.transformsData=V,this.groupIndex=Y;var G=(Y=F.style)===void 0?{}:Y,F=F.onUpdate;Object.keys(G).forEach(function(I){R.style.setProperty(I,G[I])}),F&&(this.onUpdate=F),this.calculateTransforms()}v.exports!==void 0?v.exports=w:window.lax=w})()})(Mt)),Mt.exports}var Di=Pi();const et=ot(Di);class Hi{constructor(e={}){const i={};this.settings=Object.assign(this,i,e),this.elements=[]}init(){et.init(),et.addDriver("scrollY",function(){return window.scrollY}),this.refresh(),this.lax=et,Object.assign(this,et)}refresh(){let e=!1;document.body.hasAttribute("data-skrollrr-off")&&(e=!0),this.elements.forEach(t=>{et.removeElement(t),t.style&&(t.style.transition&&(t.style.transition=""),t.style.transform&&(t.style.transform=""))}),this.elements=[];let i=window.innerWidth;document.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]").forEach(t=>{let n=!1;if(i<=760&&t.closest(".m-skrollrr-off")&&(n=!0),e||n){t.style.transform="",t.style.transition="",t.style.opacity="";return}t.style.transform="";let r=this.getObjVal(t,"data-top-bottom"),a=this.getObjVal(t,"data-top"),u=this.getObjVal(t,"data-50-top"),c=this.getObjVal(t,"data-100-top"),d=this.getObjVal(t,"data-center-bottom"),o=this.getObjVal(t,"data-center"),h=this.getObjVal(t,"data-center-top"),g=this.getObjVal(t,"data--400-bottom"),y=this.getObjVal(t,"data--300-bottom"),E=this.getObjVal(t,"data--200-bottom"),M=this.getObjVal(t,"data--150-bottom"),w=this.getObjVal(t,"data--100-bottom"),C=this.getObjVal(t,"data--50-bottom"),b=this.getObjVal(t,"data-bottom"),_=this.getObjVal(t,"data-50-bottom"),O=this.getObjVal(t,"data-100-bottom"),m=this.getObjVal(t,"data-150-bottom"),k=this.getObjVal(t,"data-200-bottom"),R=this.getObjVal(t,"data-300-bottom"),V=this.getObjVal(t,"data-400-bottom"),N=this.getObjVal(t,"data-bottom-top"),Y=this.getObjVal(t,"data-in"),G=this.getObjVal(t,"data-in-150"),F=this.getObjVal(t,"data-in-300"),I=this.getObjVal(t,"data-cen--150"),T=this.getObjVal(t,"data-cen"),A=this.getObjVal(t,"data-cen-150"),$=this.getObjVal(t,"data-out--300"),W=this.getObjVal(t,"data-out--150"),D=this.getObjVal(t,"data-out"),J=!1;t.hasAttribute("data-xs")&&(J=!0);let Q=!1;t.hasAttribute("data-sm")&&(Q=!0);let ne=!1;t.hasAttribute("data-md")&&(ne=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let se={},le={},de={},oe={},xe={},je={},Le={},Re={},_e={},ve={},X={},te={},ge={},be={},Te={},ye={},me={},fe={},ae={},qe={},l={},p={},x={},f={},S={},q={},P={},H={},L={},j={},z={},B={},Z={};(i>1280||i>970&&i<=1280&&!ne||i>760&&i<=970&&!Q||i<=760&&!J)&&(de=this.getObjVal(t,"data-t"),oe=this.getObjVal(t,"data-t-100"),xe=this.getObjVal(t,"data-t-200"),je=this.getObjVal(t,"data-t-300"),Le=this.getObjVal(t,"data-t-400"),Re=this.getObjVal(t,"data-t-500"),_e=this.getObjVal(t,"data-t-600"),ve=this.getObjVal(t,"data-t-700"),X=this.getObjVal(t,"data-t-800"),te=this.getObjVal(t,"data-t-900"),ge=this.getObjVal(t,"data-t-1000"),be=this.getObjVal(t,"data-t-1100"),Te=this.getObjVal(t,"data-t-1200"),ye=this.getObjVal(t,"data-t-1300"),me=this.getObjVal(t,"data-t-1400"),fe=this.getObjVal(t,"data-t-1500"),ae=this.getObjVal(t,"data-t-1600"),qe=this.getObjVal(t,"data-t-1700"),l=this.getObjVal(t,"data-t-1800"),p=this.getObjVal(t,"data-t-1900"),x=this.getObjVal(t,"data-t-2000"),f=this.getObjVal(t,"data-t-2100"),S=this.getObjVal(t,"data-t-2200"),q=this.getObjVal(t,"data-t-2300"),P=this.getObjVal(t,"data-t-2400"),H=this.getObjVal(t,"data-t-2500"),L=this.getObjVal(t,"data-t-2600"),j=this.getObjVal(t,"data-t-2700"),z=this.getObjVal(t,"data-t-2800")),i>970&&i<=1280&&ne&&(t.hasAttribute("data-md-t")&&(de=this.getObjVal(t,"data-md-t")),t.hasAttribute("data-md-t-100")&&(oe=this.getObjVal(t,"data-md-t-100")),t.hasAttribute("data-md-t-200")&&(xe=this.getObjVal(t,"data-md-t-200")),t.hasAttribute("data-md-t-300")&&(je=this.getObjVal(t,"data-md-t-300")),t.hasAttribute("data-md-t-400")&&(Le=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")&&(_e=this.getObjVal(t,"data-md-t-600")),t.hasAttribute("data-md-t-700")&&(ve=this.getObjVal(t,"data-md-t-700")),t.hasAttribute("data-md-t-800")&&(X=this.getObjVal(t,"data-md-t-800")),t.hasAttribute("data-md-t-900")&&(te=this.getObjVal(t,"data-md-t-900")),t.hasAttribute("data-md-t-1000")&&(ge=this.getObjVal(t,"data-md-t-1000")),t.hasAttribute("data-md-t-1100")&&(be=this.getObjVal(t,"data-md-t-1100")),t.hasAttribute("data-md-t-1200")&&(Te=this.getObjVal(t,"data-md-t-1200")),t.hasAttribute("data-md-t-1300")&&(ye=this.getObjVal(t,"data-md-t-1300")),t.hasAttribute("data-md-t-1400")&&(me=this.getObjVal(t,"data-md-t-1400")),t.hasAttribute("data-md-t-1500")&&(fe=this.getObjVal(t,"data-md-t-1500")),t.hasAttribute("data-md-t-1600")&&(ae=this.getObjVal(t,"data-md-t-1600")),t.hasAttribute("data-md-t-1700")&&(qe=this.getObjVal(t,"data-md-t-1700")),t.hasAttribute("data-md-t-1800")&&(l=this.getObjVal(t,"data-md-t-1800")),t.hasAttribute("data-md-t-1900")&&(p=this.getObjVal(t,"data-md-t-1900")),t.hasAttribute("data-md-t-2000")&&(x=this.getObjVal(t,"data-md-t-2000")),t.hasAttribute("data-md-t-2100")&&(f=this.getObjVal(t,"data-md-t-2100")),t.hasAttribute("data-md-t-2200")&&(S=this.getObjVal(t,"data-md-t-2200")),t.hasAttribute("data-md-t-2300")&&(q=this.getObjVal(t,"data-md-t-2300")),t.hasAttribute("data-md-t-2400")&&(P=this.getObjVal(t,"data-md-t-2400")),t.hasAttribute("data-md-t-2500")&&(H=this.getObjVal(t,"data-md-t-2500")),t.hasAttribute("data-md-t-2600")&&(L=this.getObjVal(t,"data-md-t-2600")),t.hasAttribute("data-md-t-2700")&&(j=this.getObjVal(t,"data-md-t-2700")),t.hasAttribute("data-md-t-2800")&&(z=this.getObjVal(t,"data-md-t-2800"))),i<=970&&t.hasAttribute("m-data-out")&&(D=this.getObjVal(t,"m-data-out")),(i>760&&i<=970&&Q||i<=760&&!J&&Q)&&(t.hasAttribute("data-sm-t")&&(de=this.getObjVal(t,"data-sm-t")),t.hasAttribute("data-sm-t-100")&&(oe=this.getObjVal(t,"data-sm-t-100")),t.hasAttribute("data-sm-t-200")&&(xe=this.getObjVal(t,"data-sm-t-200")),t.hasAttribute("data-sm-t-300")&&(je=this.getObjVal(t,"data-sm-t-300")),t.hasAttribute("data-sm-t-400")&&(Le=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")&&(_e=this.getObjVal(t,"data-sm-t-600")),t.hasAttribute("data-sm-t-700")&&(ve=this.getObjVal(t,"data-sm-t-700")),t.hasAttribute("data-sm-t-800")&&(X=this.getObjVal(t,"data-sm-t-800")),t.hasAttribute("data-sm-t-900")&&(te=this.getObjVal(t,"data-sm-t-900")),t.hasAttribute("data-sm-t-1000")&&(ge=this.getObjVal(t,"data-sm-t-1000")),t.hasAttribute("data-sm-t-1100")&&(be=this.getObjVal(t,"data-sm-t-1100")),t.hasAttribute("data-sm-t-1200")&&(Te=this.getObjVal(t,"data-sm-t-1200")),t.hasAttribute("data-sm-t-1300")&&(ye=this.getObjVal(t,"data-sm-t-1300")),t.hasAttribute("data-sm-t-1400")&&(me=this.getObjVal(t,"data-sm-t-1400")),t.hasAttribute("data-sm-t-1500")&&(fe=this.getObjVal(t,"data-sm-t-1500")),t.hasAttribute("data-sm-t-1600")&&(ae=this.getObjVal(t,"data-sm-t-1600")),t.hasAttribute("data-sm-t-1700")&&(qe=this.getObjVal(t,"data-sm-t-1700")),t.hasAttribute("data-sm-t-1800")&&(l=this.getObjVal(t,"data-sm-t-1800")),t.hasAttribute("data-sm-t-1900")&&(p=this.getObjVal(t,"data-sm-t-1900")),t.hasAttribute("data-sm-t-2000")&&(x=this.getObjVal(t,"data-sm-t-2000")),t.hasAttribute("data-sm-t-2100")&&(f=this.getObjVal(t,"data-sm-t-2100")),t.hasAttribute("data-sm-t-2200")&&(S=this.getObjVal(t,"data-sm-t-2200")),t.hasAttribute("data-sm-t-2300")&&(q=this.getObjVal(t,"data-sm-t-2300")),t.hasAttribute("data-sm-t-2400")&&(P=this.getObjVal(t,"data-sm-t-2400")),t.hasAttribute("data-sm-t-2500")&&(H=this.getObjVal(t,"data-sm-t-2500")),t.hasAttribute("data-sm-t-2600")&&(L=this.getObjVal(t,"data-sm-t-2600")),t.hasAttribute("data-sm-t-2700")&&(j=this.getObjVal(t,"data-sm-t-2700")),t.hasAttribute("data-sm-t-2800")&&(z=this.getObjVal(t,"data-sm-t-2800"))),i<=414&&J&&(t.hasAttribute("data-xs-t")&&(de=this.getObjVal(t,"data-xs-t")),t.hasAttribute("data-xs-t-100")&&(oe=this.getObjVal(t,"data-xs-t-100")),t.hasAttribute("data-xs-t-200")&&(xe=this.getObjVal(t,"data-xs-t-200")),t.hasAttribute("data-xs-t-300")&&(je=this.getObjVal(t,"data-xs-t-300")),t.hasAttribute("data-xs-t-400")&&(Le=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")&&(_e=this.getObjVal(t,"data-xs-t-600")),t.hasAttribute("data-xs-t-700")&&(ve=this.getObjVal(t,"data-xs-t-700")),t.hasAttribute("data-xs-t-800")&&(X=this.getObjVal(t,"data-xs-t-800")),t.hasAttribute("data-xs-t-900")&&(te=this.getObjVal(t,"data-xs-t-900")),t.hasAttribute("data-xs-t-1000")&&(ge=this.getObjVal(t,"data-xs-t-1000")),t.hasAttribute("data-xs-t-1100")&&(be=this.getObjVal(t,"data-xs-t-1100")),t.hasAttribute("data-xs-t-1200")&&(Te=this.getObjVal(t,"data-xs-t-1200")),t.hasAttribute("data-xs-t-1300")&&(ye=this.getObjVal(t,"data-xs-t-1300")),t.hasAttribute("data-xs-t-1400")&&(me=this.getObjVal(t,"data-xs-t-1400")),t.hasAttribute("data-xs-t-1500")&&(fe=this.getObjVal(t,"data-xs-t-1500")),t.hasAttribute("data-xs-t-1600")&&(ae=this.getObjVal(t,"data-xs-t-1600")),t.hasAttribute("data-xs-t-1700")&&(qe=this.getObjVal(t,"data-xs-t-1700")),t.hasAttribute("data-xs-t-1800")&&(l=this.getObjVal(t,"data-xs-t-1800")),t.hasAttribute("data-xs-t-1900")&&(p=this.getObjVal(t,"data-xs-t-1900")),t.hasAttribute("data-xs-t-2000")&&(x=this.getObjVal(t,"data-xs-t-2000")),t.hasAttribute("data-xs-t-2100")&&(f=this.getObjVal(t,"data-xs-t-2100")),t.hasAttribute("data-xs-t-2200")&&(S=this.getObjVal(t,"data-xs-t-2200")),t.hasAttribute("data-xs-t-2300")&&(q=this.getObjVal(t,"data-xs-t-2300")),t.hasAttribute("data-xs-t-2400")&&(P=this.getObjVal(t,"data-xs-t-2400")),t.hasAttribute("data-xs-t-2500")&&(H=this.getObjVal(t,"data-xs-t-2500")),t.hasAttribute("data-xs-t-2600")&&(L=this.getObjVal(t,"data-xs-t-2600")),t.hasAttribute("data-xs-t-2700")&&(j=this.getObjVal(t,"data-xs-t-2700")),t.hasAttribute("data-xs-t-2800")&&(z=this.getObjVal(t,"data-xs-t-2800")));let ie=de,ee=oe,K=xe,he=je,re=Le,Se=Re,pe=_e,we=ve,Ee=X,De=te,Ne=ge,Pe=be,Ce=Te,ue=ye,Me=me,He=fe,Ge=ae,nt=qe,Oe=l,$e=p,Be=x,Xe=f,st=S,rt=q,at=P,Lt=H,At=L,Rt=j,qt=z,Ke=window.innerHeight;Ke<730?(se=ie,le=ee,de=K,oe=he,xe=re,je=Se,Le=pe,Re=we,_e=Ee,ve=De,X=Ne,te=Pe,ge=Ce,be=ue,Te=Me,ye=He,me=Ge,fe=nt,ae=Oe,qe=$e,l=Be,p=Xe,x=st,f=rt,S=at,q=Lt,P=At,H=Rt,L=qt,j={},z={}):Ke>=730&&Ke<790?(le=ie,de=ee,oe=K,xe=he,je=re,Le=Se,Re=pe,_e=we,ve=Ee,X=De,te=Ne,ge=Pe,be=Ce,Te=ue,ye=Me,me=He,fe=Ge,ae=nt,qe=Oe,l=$e,p=Be,x=Xe,f=st,S=rt,q=at,P=Lt,H=At,L=Rt,j=qt,z={}):Ke>=790&&Ke<840||(Ke>=840&&Ke<1125?(de={},oe=ie,xe=ee,je=K,Le=he,Re=re,_e=Se,ve=pe,X=we,te=Ee,ge=De,be=Ne,Te=Pe,ye=Ce,me=ue,fe=Me,ae=He,qe=Ge,l=nt,p=Oe,x=$e,f=Be,S=Xe,q=st,P=rt,H=at,L=Lt,j=At,z=Rt,B=qt):(de={},oe={},xe=ie,je=ee,Le=K,Re=he,_e=re,ve=Se,X=pe,te=we,ge=Ee,be=De,Te=Ne,ye=Pe,me=Ce,fe=ue,ae=Me,qe=He,l=Ge,p=nt,x=Oe,f=$e,S=Be,q=Xe,P=st,H=rt,L=at,j=Lt,z=At,B=Rt,Z=qt));let U={};Object.keys(N).length!==0&&(U=this.parseObj(N,"elInY",U)),Object.keys(V).length!==0&&(U=this.parseObj(V,"elInY+50",U)),Object.keys(R).length!==0&&(U=this.parseObj(R,"elInY+100",U)),Object.keys(k).length!==0&&(U=this.parseObj(k,"elInY+150",U)),Object.keys(m).length!==0&&(U=this.parseObj(m,"elInY+200",U)),Object.keys(O).length!==0&&(U=this.parseObj(O,"elInY+250",U)),Object.keys(_).length!==0&&(U=this.parseObj(_,"elInY+300",U)),Object.keys(b).length!==0&&(U=this.parseObj(b,"elInY+350",U)),Object.keys(C).length!==0&&(U=this.parseObj(C,"elInY+400",U)),Object.keys(w).length!==0&&(U=this.parseObj(w,"elInY+450",U)),Object.keys(M).length!==0&&(U=this.parseObj(M,"elInY+500",U)),Object.keys(E).length!==0&&(U=this.parseObj(E,"elInY+550",U)),Object.keys(y).length!==0&&(U=this.parseObj(y,"elInY+600",U)),Object.keys(g).length!==0&&(U=this.parseObj(g,"elInY+650",U)),Object.keys(h).length!==0&&(U=this.parseObj(h,"elCenterY-300",U)),Object.keys(o).length!==0&&(U=this.parseObj(o,"elCenterY",U)),Object.keys(d).length!==0&&(U=this.parseObj(d,"elCenterY+100",U)),Object.keys(c).length!==0&&(U=this.parseObj(c,"elCenterY+200",U)),Object.keys(u).length!==0&&(U=this.parseObj(u,"elCenterY+300",U)),Object.keys(a).length!==0&&(U=this.parseObj(a,"elOutY-300",U)),Object.keys(r).length!==0&&(U=this.parseObj(r,"elOutY",U)),Object.keys(Y).length!==0&&(U=this.parseObj(Y,"elInY",U)),Object.keys(G).length!==0&&(U=this.parseObj(G,"elInY+150",U)),Object.keys(F).length!==0&&(U=this.parseObj(F,"elInY+300 ",U)),Object.keys(I).length!==0&&(U=this.parseObj(I,"elCenterY-150",U)),Object.keys(T).length!==0&&(U=this.parseObj(T,"elCenterY",U)),Object.keys(A).length!==0&&(U=this.parseObj(A,"elCenterY+150",U)),Object.keys($).length!==0&&(U=this.parseObj($,"elOutY-300 ",U)),Object.keys(W).length!==0&&(U=this.parseObj(W,"elOutY-150 ",U)),Object.keys(D).length!==0&&(U=this.parseObj(D,"elOutY",U)),Object.keys(se).length!==0&&(U=this.parseObj(se,"elInY-200",U)),Object.keys(le).length!==0&&(U=this.parseObj(le,"elInY-100",U)),Object.keys(de).length!==0&&(U=this.parseObj(de,"elInY",U)),Object.keys(oe).length!==0&&(U=this.parseObj(oe,"elInY+100",U)),Object.keys(xe).length!==0&&(U=this.parseObj(xe,"elInY+200",U)),Object.keys(je).length!==0&&(U=this.parseObj(je,"elInY+300 ",U)),Object.keys(Le).length!==0&&(U=this.parseObj(Le,"elInY+400 ",U)),Object.keys(Re).length!==0&&(U=this.parseObj(Re,"elInY+500 ",U)),Object.keys(_e).length!==0&&(U=this.parseObj(_e,"elInY+600 ",U)),Object.keys(ve).length!==0&&(U=this.parseObj(ve,"elInY+700 ",U)),Object.keys(X).length!==0&&(U=this.parseObj(X,"elInY+800 ",U)),Object.keys(te).length!==0&&(U=this.parseObj(te,"elInY+900 ",U)),Object.keys(ge).length!==0&&(U=this.parseObj(ge,"elInY+1000 ",U)),Object.keys(be).length!==0&&(U=this.parseObj(be,"elInY+1100 ",U)),Object.keys(Te).length!==0&&(U=this.parseObj(Te,"elInY+1200 ",U)),Object.keys(ye).length!==0&&(U=this.parseObj(ye,"elInY+1300 ",U)),Object.keys(me).length!==0&&(U=this.parseObj(me,"elInY+1400 ",U)),Object.keys(fe).length!==0&&(U=this.parseObj(fe,"elInY+1500 ",U)),Object.keys(ae).length!==0&&(U=this.parseObj(ae,"elInY+1600 ",U)),Object.keys(qe).length!==0&&(U=this.parseObj(qe,"elInY+1700 ",U)),Object.keys(l).length!==0&&(U=this.parseObj(l,"elInY+1800 ",U)),Object.keys(p).length!==0&&(U=this.parseObj(p,"elInY+1900 ",U)),Object.keys(x).length!==0&&(U=this.parseObj(x,"elInY+2000 ",U)),Object.keys(f).length!==0&&(U=this.parseObj(f,"elInY+2100 ",U)),Object.keys(S).length!==0&&(U=this.parseObj(S,"elInY+2200 ",U)),Object.keys(q).length!==0&&(U=this.parseObj(q,"elInY+2300 ",U)),Object.keys(P).length!==0&&(U=this.parseObj(P,"elInY+2400 ",U)),Object.keys(H).length!==0&&(U=this.parseObj(H,"elInY+2500 ",U)),Object.keys(L).length!==0&&(U=this.parseObj(L,"elInY+2600 ",U)),Object.keys(j).length!==0&&(U=this.parseObj(j,"elInY+2700 ",U)),Object.keys(z).length!==0&&(U=this.parseObj(z,"elInY+2800 ",U)),Object.keys(B).length!==0&&(U=this.parseObj(B,"elInY+2900 ",U)),Object.keys(Z).length!==0&&(U=this.parseObj(Z,"elInY+3000 ",U)),t.style.transition="",t.setAttribute("data-dummy-selector","1"),et.addElements("[data-dummy-selector]",{scrollY:U}),this.elements.push(document.querySelector("[data-dummy-selector]")),t.removeAttribute("data-dummy-selector"),setTimeout(()=>{t.style.opacity=1,t.getAttribute("data-smooth-scrolling")==="off"||this.settings.transition&&(t.style.transition=this.settings.transition)},100)})}parseTransformProperty(e){for(var i=/(\w+)\((.+?)\)/g,s={},t;t=i.exec(e);)s[t[1]]=s[t[1]]?s[t[1]].concat([t[2]]):[t[2]];return s}getObjVal(e,i){let s={},t=e.getAttribute(i);return t&&t.split(";").forEach(r=>{if(r.indexOf("transform")!==-1&&(s=this.parseTransformProperty(r)),r.indexOf("opacity")!==-1){let a=r.replace("opacity:","").replace(";","");s.opacity=[parseFloat(a)]}}),s}parseObj(e,i,s){if(e.translateY){let t;e.translateY[0].indexOf("%")!==-1?t=parseFloat(e.translateY[0])/100*window.innerHeight:t=parseFloat(e.translateY[0]),s.translateY||(s.translateY=[[],[]]),s.translateY[0].push(i),s.translateY[1].push(t)}if(e.translateX){let t;e.translateX[0].indexOf("%")!==-1?t=parseFloat(e.translateX[0])/100*window.innerWidth:t=parseFloat(e.translateX[0]),s.translateX||(s.translateX=[[],[]]),s.translateX[0].push(i),s.translateX[1].push(t)}if(e.scale){let t=parseFloat(e.scale[0]);s.scale||(s.scale=[[],[]]),s.scale[0].push(i),s.scale[1].push(t)}if(e.rotate){let t=parseFloat(e.rotate[0]);s.rotate||(s.rotate=[[],[]]),s.rotate[0].push(i),s.rotate[1].push(t)}if(e.opacity){let t=parseFloat(e.opacity[0]);s.opacity||(s.opacity=[[],[]]),s.opacity[0].push(i),s.opacity[1].push(t)}return s}}var jt={exports:{}},ii;function $i(){return ii||(ii=1,(function(v,e){(function(s,t){v.exports=t()})(window,function(){return(function(i){var s={};function t(n){if(s[n])return s[n].exports;var r=s[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=s,t.d=function(n,r,a){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:a})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var u in n)t.d(a,u,(function(c){return n[c]}).bind(null,u));return a},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=2)})([(function(i,s){/*!
|
|
5
|
+
`),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
|
|
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 V=g,N=w,Y=O,G=(function(){function F(I){m(this,F),this._parseOptions(I),this._initCollection(),this._initLoop()}return R(F,[{key:"_parseOptions",value:function(T){T=a()(new n,T),this.defaultTrigger=T.trigger,this.scrollOptions=T.scroll}},{key:"_initCollection",value:function(){var T=document.querySelectorAll("[data-scroll]"),A=[];T.length>0&&(A=this.createTriggers(T)),this.collection=new N(A)}},{key:"_initLoop",value:function(){var T=this;this.loop=new Y({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function($,W){T._scrollCallback($,W)},start:function(){T._scrollStart()},stop:function(){T._scrollStop()},directionChange:function($){T._scrollDirectionChange($)}})}},{key:"_scrollCallback",value:function(T,A){var $=this;this.collection.call(function(W){W.checkVisibility($.scrollOptions.element,A)}),this.scrollOptions.callback(T,A)}},{key:"_scrollStart",value:function(){this.scrollOptions.start()}},{key:"_scrollStop",value:function(){this.scrollOptions.stop()}},{key:"_scrollDirectionChange",value:function(T){this.scrollOptions.directionChange(T)}},{key:"createTrigger",value:function(T,A){return new V(T,a()(this.defaultTrigger,A))}},{key:"createTriggers",value:function(T,A){var $=this,W=[];return T.each(function(D){W.push($.createTrigger(D,A))}),W}},{key:"add",value:function(T,A){return T instanceof HTMLElement?(this.collection.add(this.createTrigger(T,A)),this):T instanceof V?(this.collection.add(T),this):T instanceof NodeList?(this.collection.add(this.createTriggers(T,A)),this):Array.isArray(T)&&T.length&&T[0]instanceof V?(this.collection.add(T),this):Array.isArray(T)&&T.length&&T[0]instanceof HTMLElement?(this.collection.add(this.createTriggers(T,A)),this):(this.collection.add(this.createTriggers(document.querySelectorAll(T),A)),this)}},{key:"remove",value:function(T){return T instanceof V?(this.collection.remove(T),this):Array.isArray(T)&&T.length&&T[0]instanceof V?(this.collection.remove(T),this):T instanceof HTMLElement?(this.collection.remove(this.search(T)),this):Array.isArray(T)&&T.length&&T[0]instanceof HTMLElement?(this.collection.remove(this.search(T)),this):T instanceof NodeList?(this.collection.remove(this.search(T)),this):Array.isArray(T)&&T.length&&T[0]instanceof V?(this.collection.remove(T),this):(this.collection.remove(this.query(T.toString())),this)}},{key:"query",value:function(T){return this.collection.query(T)}},{key:"search",value:function(T){return this.collection.search(T)}},{key:"listen",value:function(){this.loop||this._initLoop()}},{key:"kill",value:function(){this.loop.kill(),this.loop=null}}]),F})()})])})})(jt)),jt.exports}var zi=$i();const Vi=ot(zi);var pt={exports:{}},Bi=pt.exports,ni;function Ui(){return ni||(ni=1,(function(v,e){(function(i,s){v.exports=s()})(Bi,(function(){function i(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}function s(l,p){for(var x=0;x<p.length;x++){var f=p[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,n(f.key),f)}}function t(l,p,x){return p&&s(l.prototype,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function n(l){var p=(function(x,f){if(typeof x!="object"||!x)return x;var S=x[Symbol.toPrimitive];if(S!==void 0){var q=S.call(x,f);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)})(l,"string");return typeof p=="symbol"?p:p+""}function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(l)}var a=Date.now();function u(){var l={},p=!0,x=0,f=arguments.length;Object.prototype.toString.call(arguments[0])==="[object Boolean]"&&(p=arguments[0],x++);for(var S=function(P){for(var H in P)Object.prototype.hasOwnProperty.call(P,H)&&(p&&Object.prototype.toString.call(P[H])==="[object Object]"?l[H]=u(!0,l[H],P[H]):l[H]=P[H])};x<f;x++){var q=arguments[x];S(q)}return l}function c(l,p){if((G(l)||l===window||l===document)&&(l=[l]),I(l)||T(l)||(l=[l]),W(l)!=0){if(I(l)&&!T(l))for(var x=l.length,f=0;f<x&&p.call(l[f],l[f],f,l)!==!1;f++);else if(T(l)){for(var S in l)if($(l,S)&&p.call(l[S],l[S],S,l)===!1)break}}}function d(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=l[a]=l[a]||[],S={all:f,evt:null,found:null};return p&&x&&W(f)>0&&c(f,(function(q,P){if(q.eventName==p&&q.fn.toString()==x.toString())return S.found=!0,S.evt=P,!1})),S}function o(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=p.onElement,f=p.withCallback,S=p.avoidDuplicate,q=S===void 0||S,P=p.once,H=P!==void 0&&P,L=p.useCapture,j=L!==void 0&&L,z=arguments.length>2?arguments[2]:void 0,B=x||[];function Z(ie){N(f)&&f.call(z,ie,this),H&&Z.destroy()}return Y(B)&&(B=document.querySelectorAll(B)),Z.destroy=function(){c(B,(function(ie){var ee=d(ie,l,Z);ee.found&&ee.all.splice(ee.evt,1),ie.removeEventListener&&ie.removeEventListener(l,Z,j)}))},c(B,(function(ie){var ee=d(ie,l,Z);(ie.addEventListener&&q&&!ee.found||!q)&&(ie.addEventListener(l,Z,j),ee.all.push({eventName:l,fn:Z}))})),Z}function h(l,p){c(p.split(" "),(function(x){return l.classList.add(x)}))}function g(l,p){c(p.split(" "),(function(x){return l.classList.remove(x)}))}function y(l,p){return l.classList.contains(p)}function E(l,p){for(;l!==document.body;){if(!(l=l.parentElement))return!1;if(typeof l.matches=="function"?l.matches(p):l.msMatchesSelector(p))return l}}function M(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||p==="")return!1;if(p==="none")return N(x)&&x(),!1;var f=m(),S=p.split(" ");c(S,(function(q){h(l,"g"+q)})),o(f,{onElement:l,avoidDuplicate:!1,once:!0,withCallback:function(q,P){c(S,(function(H){g(P,"g"+H)})),N(x)&&x()}})}function w(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(p==="")return l.style.webkitTransform="",l.style.MozTransform="",l.style.msTransform="",l.style.OTransform="",l.style.transform="",!1;l.style.webkitTransform=p,l.style.MozTransform=p,l.style.msTransform=p,l.style.OTransform=p,l.style.transform=p}function C(l){l.style.display="block"}function b(l){l.style.display="none"}function _(l){var p=document.createDocumentFragment(),x=document.createElement("div");for(x.innerHTML=l;x.firstChild;)p.appendChild(x.firstChild);return p}function O(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function m(){var l,p=document.createElement("fakeelement"),x={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(l in x)if(p.style[l]!==void 0)return x[l]}function k(l,p,x,f){if(l())p();else{var S;x||(x=100);var q=setInterval((function(){l()&&(clearInterval(q),S&&clearTimeout(S),p())}),x)}}function R(l,p,x){if(A(l))console.error("Inject assets error");else if(N(p)&&(x=p,p=!1),Y(p)&&p in window)N(x)&&x();else{var f;if(l.indexOf(".css")!==-1){if((f=document.querySelectorAll('link[href="'+l+'"]'))&&f.length>0)return void(N(x)&&x());var S=document.getElementsByTagName("head")[0],q=S.querySelectorAll('link[rel="stylesheet"]'),P=document.createElement("link");return P.rel="stylesheet",P.type="text/css",P.href=l,P.media="all",q?S.insertBefore(P,q[0]):S.appendChild(P),void(N(x)&&x())}if((f=document.querySelectorAll('script[src="'+l+'"]'))&&f.length>0){if(N(x)){if(Y(p))return k((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}}else{var H=document.createElement("script");H.type="text/javascript",H.src=l,H.onload=function(){if(N(x)){if(Y(p))return k((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}},document.body.appendChild(H)}}}function V(){return"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function N(l){return typeof l=="function"}function Y(l){return typeof l=="string"}function G(l){return!(!l||!l.nodeType||l.nodeType!=1)}function F(l){return Array.isArray(l)}function I(l){return l&&l.length&&isFinite(l.length)}function T(l){return r(l)==="object"&&l!=null&&!N(l)&&!F(l)}function A(l){return l==null}function $(l,p){return l!==null&&hasOwnProperty.call(l,p)}function W(l){if(T(l)){if(l.keys)return l.keys().length;var p=0;for(var x in l)$(l,x)&&p++;return p}return l.length}function D(l){return!isNaN(parseFloat(l))&&isFinite(l)}function J(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,p=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!p.length)return!1;if(p.length==1)return p[0];typeof l=="string"&&(l=parseInt(l));var x=[];c(p,(function(H){x.push(H.getAttribute("data-taborder"))}));var f=Math.max.apply(Math,x.map((function(H){return parseInt(H)}))),S=l<0?1:l+1;S>f&&(S="1");var q=x.filter((function(H){return H>=parseInt(S)})),P=q.sort()[0];return document.querySelector('.gbtn[data-taborder="'.concat(P,'"]'))}function Q(l){if(l.events.hasOwnProperty("keyboard"))return!1;l.events.keyboard=o("keydown",{onElement:window,withCallback:function(p,x){var f=(p=p||window.event).keyCode;if(f==9){var S=document.querySelector(".gbtn.focused");if(!S){var q=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if(q=="input"||q=="textarea"||q=="button")return}p.preventDefault();var P=document.querySelectorAll(".gbtn[data-taborder]");if(!P||P.length<=0)return;if(!S){var H=J();return void(H&&(H.focus(),h(H,"focused")))}var L=J(S.getAttribute("data-taborder"));g(S,"focused"),L&&(L.focus(),h(L,"focused"))}f==39&&l.nextSlide(),f==37&&l.prevSlide(),f==27&&l.close()}})}var ne=t((function l(p,x){var f=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(i(this,l),this.img=p,this.slide=x,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",(function(q){return f.dragStart(q)}),!1),this.img.addEventListener("mouseup",(function(q){return f.dragEnd(q)}),!1),this.img.addEventListener("mousemove",(function(q){return f.drag(q)}),!1),this.img.addEventListener("click",(function(q){return f.slide.classList.contains("dragging-nav")?(f.zoomOut(),!1):f.zoomedIn?void(f.zoomedIn&&!f.dragging&&f.zoomOut()):f.zoomIn()}),!1),this.img.setZoomEvents=!0}),[{key:"zoomIn",value:function(){var l=this.widowWidth();if(!(this.zoomedIn||l<=768)){var p=this.img;if(p.setAttribute("data-style",p.getAttribute("style")),p.style.maxWidth=p.naturalWidth+"px",p.style.maxHeight=p.naturalHeight+"px",p.naturalWidth>l){var x=l/2-p.naturalWidth/2;this.setTranslate(this.img.parentNode,x,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}}},{key:"zoomOut",value:function(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&typeof this.onclose=="function"&&this.onclose()}},{key:"dragStart",value:function(l){l.preventDefault(),this.zoomedIn?(l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset),l.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))):this.active=!1}},{key:"dragEnd",value:function(l){var p=this;l.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout((function(){p.dragging=!1,p.img.isDragging=!1,p.img.classList.remove("dragging")}),100)}},{key:"drag",value:function(l){this.active&&(l.preventDefault(),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:"onMove",value:function(l){if(this.zoomedIn){var p=l.clientX-this.img.naturalWidth/2,x=l.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,p,x)}}},{key:"setTranslate",value:function(l,p,x){l.style.transform="translate3d("+p+"px, "+x+"px, 0)"}},{key:"widowWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),se=t((function l(){var p=this,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l);var f=x.dragEl,S=x.toleranceX,q=S===void 0?40:S,P=x.toleranceY,H=P===void 0?65:P,L=x.slide,j=L===void 0?null:L,z=x.instance,B=z===void 0?null:z;this.el=f,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=q,this.toleranceY=H,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=j,this.instance=B,this.el.addEventListener("mousedown",(function(Z){return p.dragStart(Z)}),!1),this.el.addEventListener("mouseup",(function(Z){return p.dragEnd(Z)}),!1),this.el.addEventListener("mousemove",(function(Z){return p.drag(Z)}),!1)}),[{key:"dragStart",value:function(l){if(this.slide.classList.contains("zoomed"))this.active=!1;else{l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset);var p=l.target.nodeName.toLowerCase();l.target.classList.contains("nodrag")||E(l.target,".nodrag")||["input","select","textarea","button","a"].indexOf(p)!==-1?this.active=!1:(l.preventDefault(),(l.target===this.el||p!=="img"&&E(l.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=E(l.target,".ginner-container")))}}},{key:"dragEnd",value:function(l){var p=this;l&&l.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,this.doSlideChange=="right"&&this.instance.prevSlide(),this.doSlideChange=="left"&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout((function(){p.instance.preventOutsideClick=!1,p.toleranceReached=!1,p.lastDirection=null,p.dragging=!1,p.el.isDragging=!1,p.el.classList.remove("dragging"),p.slide.classList.remove("dragging-nav"),p.dragContainer.style.transform="",p.dragContainer.style.transition=""}),100)}},{key:"drag",value:function(l){if(this.active){l.preventDefault(),this.slide.classList.add("dragging-nav"),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var p=Math.abs(this.currentX),x=Math.abs(this.currentY);if(p>0&&p>=Math.abs(this.currentY)&&(!this.lastDirection||this.lastDirection=="x")){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);var f=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&f&&(this.doSlideChange=f),this.instance.settings.dragAutoSnap&&f)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),f=="right"&&this.instance.prevSlide(),void(f=="left"&&this.instance.nextSlide())}if(this.toleranceY>0&&x>0&&x>=p&&(!this.lastDirection||this.lastDirection=="y")){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);var S=this.shouldClose();return!this.instance.settings.dragAutoSnap&&S&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&S&&this.instance.close())}}}},{key:"shouldChange",value:function(){var l=!1;if(Math.abs(this.currentX)>=this.toleranceX){var p=this.currentX>0?"right":"left";(p=="left"&&this.slide!==this.slide.parentNode.lastChild||p=="right"&&this.slide!==this.slide.parentNode.firstChild)&&(l=p)}return l}},{key:"shouldClose",value:function(){var l=!1;return Math.abs(this.currentY)>=this.toleranceY&&(l=!0),l}},{key:"setTranslate",value:function(l,p,x){var f=arguments.length>3&&arguments[3]!==void 0&&arguments[3];l.style.transition=f?"all .2s ease":"",l.style.transform="translate3d(".concat(p,"px, ").concat(x,"px, 0)")}}]);function le(l,p,x,f){var S=l.querySelector(".gslide-media"),q=new Image,P="gSlideTitle_"+x,H="gSlideDesc_"+x;q.addEventListener("load",(function(){N(f)&&f()}),!1),q.src=p.href,p.sizes!=""&&p.srcset!=""&&(q.sizes=p.sizes,q.srcset=p.srcset),q.alt="",A(p.alt)||p.alt===""||(q.alt=p.alt),p.title!==""&&q.setAttribute("aria-labelledby",P),p.description!==""&&q.setAttribute("aria-describedby",H),p.hasOwnProperty("_hasCustomWidth")&&p._hasCustomWidth&&(q.style.width=p.width),p.hasOwnProperty("_hasCustomHeight")&&p._hasCustomHeight&&(q.style.height=p.height),S.insertBefore(q,S.firstChild)}function de(l,p,x,f){var S=this,q=l.querySelector(".ginner-container"),P="gvideo"+x,H=l.querySelector(".gslide-media"),L=this.getAllPlayers();h(q,"gvideo-container"),H.insertBefore(_('<div class="gvideo-wrapper"></div>'),H.firstChild);var j=l.querySelector(".gvideo-wrapper");R(this.settings.plyr.css,"Plyr");var z=p.href,B=p?.videoProvider,Z=!1;H.style.maxWidth=p.width,R(this.settings.plyr.js,"Plyr",(function(){if(!B&&z.match(/vimeo\.com\/([0-9]*)/)&&(B="vimeo"),!B&&(z.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||z.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||z.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||z.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))&&(B="youtube"),B==="local"||!B){B="local";var ie='<video id="'+P+'" ';ie+='style="background:#000; max-width: '.concat(p.width,';" '),ie+='preload="metadata" ',ie+='x-webkit-airplay="allow" ',ie+="playsinline ",ie+="controls ",ie+='class="gvideo-local">',ie+='<source src="'.concat(z,'">'),Z=_(ie+="</video>")}var ee=Z||_('<div id="'.concat(P,'" data-plyr-provider="').concat(B,'" data-plyr-embed-id="').concat(z,'"></div>'));h(j,"".concat(B,"-video gvideo")),j.appendChild(ee),j.setAttribute("data-id",P),j.setAttribute("data-index",x);var K=$(S.settings.plyr,"config")?S.settings.plyr.config:{},he=new Plyr("#"+P,K);he.on("ready",(function(re){L[P]=re.detail.plyr,N(f)&&f()})),k((function(){return l.querySelector("iframe")&&l.querySelector("iframe").dataset.ready=="true"}),(function(){S.resize(l)})),he.on("enterfullscreen",oe),he.on("exitfullscreen",oe)}))}function oe(l){var p=E(l.target,".gslide-media");l.type==="enterfullscreen"&&h(p,"fullscreen"),l.type==="exitfullscreen"&&g(p,"fullscreen")}function xe(l,p,x,f){var S,q=this,P=l.querySelector(".gslide-media"),H=!(!$(p,"href")||!p.href)&&p.href.split("#").pop().trim(),L=!(!$(p,"content")||!p.content)&&p.content;if(L&&(Y(L)&&(S=_('<div class="ginlined-content">'.concat(L,"</div>"))),G(L))){L.style.display=="none"&&(L.style.display="block");var j=document.createElement("div");j.className="ginlined-content",j.appendChild(L),S=j}if(H){var z=document.getElementById(H);if(!z)return!1;var B=z.cloneNode(!0);B.style.height=p.height,B.style.maxWidth=p.width,h(B,"ginlined-content"),S=B}if(!S)return console.error("Unable to append inline slide content",p),!1;P.style.height=p.height,P.style.width=p.width,P.appendChild(S),this.events["inlineclose"+H]=o("click",{onElement:P.querySelectorAll(".gtrigger-close"),withCallback:function(Z){Z.preventDefault(),q.close()}}),N(f)&&f()}function je(l,p,x,f){var S=l.querySelector(".gslide-media"),q=(function(P){var H=P.url,L=P.allow,j=P.callback,z=P.appendTo,B=document.createElement("iframe");return B.className="vimeo-video gvideo",B.src=H,B.style.width="100%",B.style.height="100%",L&&B.setAttribute("allow",L),B.onload=function(){B.onload=null,h(B,"node-ready"),N(j)&&j()},z&&z.appendChild(B),B})({url:p.href,callback:f});S.parentNode.style.maxWidth=p.width,S.parentNode.style.height=p.height,S.appendChild(q)}var Le=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},T(p)&&(this.defaults=u(this.defaults,p))}),[{key:"sourceType",value:function(l){var p=l;return(l=l.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)!==null?"image":l.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||l.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)||l.match(/vimeo\.com\/([0-9]*)/)||l.match(/\.(mp4|ogg|webm|mov)/)!==null?"video":l.match(/\.(mp3|wav|wma|aac|ogg)/)!==null?"audio":l.indexOf("#")>-1&&p.split("#").pop().trim()!==""?"inline":l.indexOf("goajax=true")>-1?"ajax":"external"}},{key:"parseConfig",value:function(l,p){var x=this,f=u({descPosition:p.descPosition},this.defaults);if(T(l)&&!G(l)){$(l,"type")||($(l,"content")&&l.content?l.type="inline":$(l,"href")&&(l.type=this.sourceType(l.href)));var S=u(f,l);return this.setSize(S,p),S}var q="",P=l.getAttribute("data-glightbox"),H=l.nodeName.toLowerCase();if(H==="a"&&(q=l.href),H==="img"&&(q=l.src,f.alt=l.alt),f.href=q,c(f,(function(ie,ee){$(p,ee)&&ee!=="width"&&(f[ee]=p[ee]);var K=l.dataset[ee];A(K)||(f[ee]=x.sanitizeValue(K))})),f.content&&(f.type="inline"),!f.type&&q&&(f.type=this.sourceType(q)),A(P)){if(!f.title&&H=="a"){var L=l.title;A(L)||L===""||(f.title=L)}if(!f.title&&H=="img"){var j=l.alt;A(j)||j===""||(f.title=j)}}else{var z=[];c(f,(function(ie,ee){z.push(";\\s?"+ee)})),z=z.join("\\s?:|"),P.trim()!==""&&c(f,(function(ie,ee){var K=P,he=new RegExp("s?"+ee+"s?:s?(.*?)("+z+"s?:|$)"),re=K.match(he);if(re&&re.length&&re[1]){var Se=re[1].trim().replace(/;\s*$/,"");f[ee]=x.sanitizeValue(Se)}}))}if(f.description&&f.description.substring(0,1)==="."){var B;try{B=document.querySelector(f.description).innerHTML}catch(ie){if(!(ie instanceof DOMException))throw ie}B&&(f.description=B)}if(!f.description){var Z=l.querySelector(".glightbox-desc");Z&&(f.description=Z.innerHTML)}return this.setSize(f,p,l),this.slideConfig=f,f}},{key:"setSize",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=l.type=="video"?this.checkSize(p.videosWidth):this.checkSize(p.width),S=this.checkSize(p.height);return l.width=$(l,"width")&&l.width!==""?this.checkSize(l.width):f,l.height=$(l,"height")&&l.height!==""?this.checkSize(l.height):S,x&&l.type=="image"&&(l._hasCustomWidth=!!x.dataset.width,l._hasCustomHeight=!!x.dataset.height),l}},{key:"checkSize",value:function(l){return D(l)?"".concat(l,"px"):l}},{key:"sanitizeValue",value:function(l){return l!=="true"&&l!=="false"?l:l==="true"}}]),Re=t((function l(p,x,f){i(this,l),this.element=p,this.instance=x,this.index=f}),[{key:"setContent",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(y(p,"loaded"))return!1;var f=this.instance.settings,S=this.slideConfig,q=V();N(f.beforeSlideLoad)&&f.beforeSlideLoad({index:this.index,slide:p,player:!1});var P=S.type,H=S.descPosition,L=p.querySelector(".gslide-media"),j=p.querySelector(".gslide-title"),z=p.querySelector(".gslide-desc"),B=p.querySelector(".gdesc-inner"),Z=x,ie="gSlideTitle_"+this.index,ee="gSlideDesc_"+this.index;if(N(f.afterSlideLoad)&&(Z=function(){N(x)&&x(),f.afterSlideLoad({index:l.index,slide:p,player:l.instance.getSlidePlayerInstance(l.index)})}),S.title==""&&S.description==""?B&&B.parentNode.parentNode.removeChild(B.parentNode):(j&&S.title!==""?(j.id=ie,j.innerHTML=S.title):j.parentNode.removeChild(j),z&&S.description!==""?(z.id=ee,q&&f.moreLength>0?(S.smallDescription=this.slideShortDesc(S.description,f.moreLength,f.moreText),z.innerHTML=S.smallDescription,this.descriptionEvents(z,S)):z.innerHTML=S.description):z.parentNode.removeChild(z),h(L.parentNode,"desc-".concat(H)),h(B.parentNode,"description-".concat(H))),h(L,"gslide-".concat(P)),h(p,"loaded"),P!=="video"){if(P!=="external")return P==="inline"?(xe.apply(this.instance,[p,S,this.index,Z]),void(S.draggable&&new se({dragEl:p.querySelector(".gslide-inline"),toleranceX:f.dragToleranceX,toleranceY:f.dragToleranceY,slide:p,instance:this.instance}))):void(P!=="image"?N(Z)&&Z():le(p,S,this.index,(function(){var K=p.querySelector("img");S.draggable&&new se({dragEl:K,toleranceX:f.dragToleranceX,toleranceY:f.dragToleranceY,slide:p,instance:l.instance}),S.zoomable&&K.naturalWidth>K.offsetWidth&&(h(K,"zoomable"),new ne(K,p,(function(){l.instance.resize()}))),N(Z)&&Z()})));je.apply(this,[p,S,this.index,Z])}else de.apply(this.instance,[p,S,this.index,Z])}},{key:"slideShortDesc",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,x=arguments.length>2&&arguments[2]!==void 0&&arguments[2],f=document.createElement("div");f.innerHTML=l;var S=f.innerText,q=x;if((l=S.trim()).length<=p)return l;var P=l.substr(0,p-1);return q?(f=null,P+'... <a href="#" class="desc-more">'+x+"</a>"):P}},{key:"descriptionEvents",value:function(l,p){var x=this,f=l.querySelector(".desc-more");if(!f)return!1;o("click",{onElement:f,withCallback:function(S,q){S.preventDefault();var P=document.body,H=E(q,".gslide-desc");if(!H)return!1;H.innerHTML=p.description,h(P,"gdesc-open");var L=o("click",{onElement:[P,E(H,".gslide-description")],withCallback:function(j,z){j.target.nodeName.toLowerCase()!=="a"&&(g(P,"gdesc-open"),h(P,"gdesc-closed"),H.innerHTML=p.smallDescription,x.descriptionEvents(H,p),setTimeout((function(){g(P,"gdesc-closed")}),400),L.destroy())}})}})}},{key:"create",value:function(){return _(this.instance.settings.slideHTML)}},{key:"getConfig",value:function(){G(this.element)||this.element.hasOwnProperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var l=new Le(this.instance.settings.slideExtraAttributes);return this.slideConfig=l.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function _e(l){return Math.sqrt(l.x*l.x+l.y*l.y)}function ve(l,p){var x=(function(f,S){var q=_e(f)*_e(S);if(q===0)return 0;var P=(function(H,L){return H.x*L.x+H.y*L.y})(f,S)/q;return P>1&&(P=1),Math.acos(P)})(l,p);return(function(f,S){return f.x*S.y-S.x*f.y})(l,p)>0&&(x*=-1),180*x/Math.PI}var X=t((function l(p){i(this,l),this.handlers=[],this.el=p}),[{key:"add",value:function(l){this.handlers.push(l)}},{key:"del",value:function(l){l||(this.handlers=[]);for(var p=this.handlers.length;p>=0;p--)this.handlers[p]===l&&this.handlers.splice(p,1)}},{key:"dispatch",value:function(){for(var l=0,p=this.handlers.length;l<p;l++){var x=this.handlers[l];typeof x=="function"&&x.apply(this.el,arguments)}}}]);function te(l,p){var x=new X(l);return x.add(p),x}var ge=t((function l(p,x){i(this,l),this.element=typeof p=="string"?document.querySelector(p):p,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var f=function(){};this.rotate=te(this.element,x.rotate||f),this.touchStart=te(this.element,x.touchStart||f),this.multipointStart=te(this.element,x.multipointStart||f),this.multipointEnd=te(this.element,x.multipointEnd||f),this.pinch=te(this.element,x.pinch||f),this.swipe=te(this.element,x.swipe||f),this.tap=te(this.element,x.tap||f),this.doubleTap=te(this.element,x.doubleTap||f),this.longTap=te(this.element,x.longTap||f),this.singleTap=te(this.element,x.singleTap||f),this.pressMove=te(this.element,x.pressMove||f),this.twoFingerPressMove=te(this.element,x.twoFingerPressMove||f),this.touchMove=te(this.element,x.touchMove||f),this.touchEnd=te(this.element,x.touchEnd||f),this.touchCancel=te(this.element,x.touchCancel||f),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}),[{key:"start",value:function(l){if(l.touches)if(l.target&&l.target.nodeName&&["a","button","input"].indexOf(l.target.nodeName.toLowerCase())>=0)console.log("ignore drag for this touched element",l.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=l.touches[0].pageX,this.y1=l.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(l,this.element),this.preTapPosition.x!==null&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var p=this.preV;if(l.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var x={x:l.touches[1].pageX-this.x1,y:l.touches[1].pageY-this.y1};p.x=x.x,p.y=x.y,this.pinchStartLen=_e(p),this.multipointStart.dispatch(l,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout((function(){this.longTap.dispatch(l,this.element),this._preventTap=!0}).bind(this),750)}}},{key:"move",value:function(l){if(l.touches){var p=this.preV,x=l.touches.length,f=l.touches[0].pageX,S=l.touches[0].pageY;if(this.isDoubleTap=!1,x>1){var q=l.touches[1].pageX,P=l.touches[1].pageY,H={x:l.touches[1].pageX-f,y:l.touches[1].pageY-S};p.x!==null&&(this.pinchStartLen>0&&(l.zoom=_e(H)/this.pinchStartLen,this.pinch.dispatch(l,this.element)),l.angle=ve(H,p),this.rotate.dispatch(l,this.element)),p.x=H.x,p.y=H.y,this.x2!==null&&this.sx2!==null?(l.deltaX=(f-this.x2+q-this.sx2)/2,l.deltaY=(S-this.y2+P-this.sy2)/2):(l.deltaX=0,l.deltaY=0),this.twoFingerPressMove.dispatch(l,this.element),this.sx2=q,this.sy2=P}else{if(this.x2!==null){l.deltaX=f-this.x2,l.deltaY=S-this.y2;var L=Math.abs(this.x1-this.x2),j=Math.abs(this.y1-this.y2);(L>10||j>10)&&(this._preventTap=!0)}else l.deltaX=0,l.deltaY=0;this.pressMove.dispatch(l,this.element)}this.touchMove.dispatch(l,this.element),this._cancelLongTap(),this.x2=f,this.y2=S,x>1&&l.preventDefault()}}},{key:"end",value:function(l){if(l.changedTouches){this._cancelLongTap();var p=this;l.touches.length<2&&(this.multipointEnd.dispatch(l,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(l.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){p.swipe.dispatch(l,p.element)}),0)):(this.tapTimeout=setTimeout((function(){p._preventTap||p.tap.dispatch(l,p.element),p.isDoubleTap&&(p.doubleTap.dispatch(l,p.element),p.isDoubleTap=!1)}),0),p.isDoubleTap||(p.singleTapTimeout=setTimeout((function(){p.singleTap.dispatch(l,p.element)}),250))),this.touchEnd.dispatch(l,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelAll",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:"cancel",value:function(l){this.cancelAll(),this.touchCancel.dispatch(l,this.element)}},{key:"_cancelLongTap",value:function(){clearTimeout(this.longTapTimeout)}},{key:"_cancelSingleTap",value:function(){clearTimeout(this.singleTapTimeout)}},{key:"_swipeDirection",value:function(l,p,x,f){return Math.abs(l-p)>=Math.abs(x-f)?l-p>0?"Left":"Right":x-f>0?"Up":"Down"}},{key:"on",value:function(l,p){this[l]&&this[l].add(p)}},{key:"off",value:function(l,p){this[l]&&this[l].del(p)}},{key:"destroy",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}]);function be(l){var p=(function(){var P,H=document.createElement("fakeelement"),L={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(P in L)if(H.style[P]!==void 0)return L[P]})(),x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=y(l,"gslide-media")?l:l.querySelector(".gslide-media"),S=E(f,".ginner-container"),q=l.querySelector(".gslide-description");x>769&&(f=S),h(f,"greset"),w(f,"translate3d(0, 0, 0)"),o(p,{onElement:f,once:!0,withCallback:function(P,H){g(f,"greset")}}),f.style.opacity="",q&&(q.style.opacity="")}function Te(l){if(l.events.hasOwnProperty("touch"))return!1;var p,x,f,S=O(),q=S.width,P=S.height,H=!1,L=null,j=null,z=null,B=!1,Z=1,ie=1,ee=!1,K=!1,he=null,re=null,Se=null,pe=null,we=0,Ee=0,De=!1,Ne=!1,Pe={},Ce={},ue=0,Me=0,He=document.getElementById("glightbox-slider"),Ge=document.querySelector(".goverlay"),nt=new ge(He,{touchStart:function(Oe){if(H=!0,(y(Oe.targetTouches[0].target,"ginner-container")||E(Oe.targetTouches[0].target,".gslide-desc")||Oe.targetTouches[0].target.nodeName.toLowerCase()=="a")&&(H=!1),E(Oe.targetTouches[0].target,".gslide-inline")&&!y(Oe.targetTouches[0].target.parentNode,"gslide-inline")&&(H=!1),H){if(Ce=Oe.targetTouches[0],Pe.pageX=Oe.targetTouches[0].pageX,Pe.pageY=Oe.targetTouches[0].pageY,ue=Oe.targetTouches[0].clientX,Me=Oe.targetTouches[0].clientY,L=l.activeSlide,j=L.querySelector(".gslide-media"),f=L.querySelector(".gslide-inline"),z=null,y(j,"gslide-image")&&(z=j.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(j=L.querySelector(".ginner-container")),g(Ge,"greset"),Oe.pageX>20&&Oe.pageX<window.innerWidth-20)return;Oe.preventDefault()}},touchMove:function(Oe){if(H&&(Ce=Oe.targetTouches[0],!ee&&!K)){if(f&&f.offsetHeight>P){var $e=Pe.pageX-Ce.pageX;if(Math.abs($e)<=13)return!1}B=!0;var Be,Xe=Oe.targetTouches[0].clientX,st=Oe.targetTouches[0].clientY,rt=ue-Xe,at=Me-st;if(Math.abs(rt)>Math.abs(at)?(De=!1,Ne=!0):(Ne=!1,De=!0),p=Ce.pageX-Pe.pageX,we=100*p/q,x=Ce.pageY-Pe.pageY,Ee=100*x/P,De&&z&&(Be=1-Math.abs(x)/P,Ge.style.opacity=Be,l.settings.touchFollowAxis&&(we=0)),Ne&&(Be=1-Math.abs(p)/q,j.style.opacity=Be,l.settings.touchFollowAxis&&(Ee=0)),!z)return w(j,"translate3d(".concat(we,"%, 0, 0)"));w(j,"translate3d(".concat(we,"%, ").concat(Ee,"%, 0)"))}},touchEnd:function(){if(H){if(B=!1,K||ee)return Se=he,void(pe=re);var Oe=Math.abs(parseInt(Ee)),$e=Math.abs(parseInt(we));if(!(Oe>29&&z))return Oe<29&&$e<25?(h(Ge,"greset"),Ge.style.opacity=1,be(j)):void 0;l.close()}},multipointEnd:function(){setTimeout((function(){ee=!1}),50)},multipointStart:function(){ee=!0,Z=ie||1},pinch:function(Oe){if(!z||B)return!1;ee=!0,z.scaleX=z.scaleY=Z*Oe.zoom;var $e=Z*Oe.zoom;if(K=!0,$e<=1)return K=!1,$e=1,pe=null,Se=null,he=null,re=null,void z.setAttribute("style","");$e>4.5&&($e=4.5),z.style.transform="scale3d(".concat($e,", ").concat($e,", 1)"),ie=$e},pressMove:function(Oe){if(K&&!ee){var $e=Ce.pageX-Pe.pageX,Be=Ce.pageY-Pe.pageY;Se&&($e+=Se),pe&&(Be+=pe),he=$e,re=Be;var Xe="translate3d(".concat($e,"px, ").concat(Be,"px, 0)");ie&&(Xe+=" scale3d(".concat(ie,", ").concat(ie,", 1)")),w(z,Xe)}},swipe:function(Oe){if(!K)if(ee)ee=!1;else{if(Oe.direction=="Left"){if(l.index==l.elements.length-1)return be(j);l.nextSlide()}if(Oe.direction=="Right"){if(l.index==0)return be(j);l.prevSlide()}}}});l.events.touch=nt}var ye=V(),me=V()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,fe=document.getElementsByTagName("html")[0],ae={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>'},slideHTML:`<div class="gslide">
|
|
26
|
+
*/var 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">
|
|
@@ -36,7 +36,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
|
-
</div>`,lightboxHTML
|
|
39
|
+
</div>`,ri.lightboxHTML=`<div id="glightbox-body" class="glightbox-container" tabindex="-1" role="dialog" aria-hidden="false">
|
|
40
40
|
<div class="gloader visible"></div>
|
|
41
41
|
<div class="goverlay"></div>
|
|
42
42
|
<div class="gcontainer">
|
|
@@ -45,55 +45,55 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
|
|
46
46
|
<button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
|
|
47
47
|
</div>
|
|
48
|
-
</div>`},qe=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.customOptions=p,this.settings=u(ae,p),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}),[{key:"init",value:function(){var l=this,p=this.getSelector();p&&(this.baseEvents=o("click",{onElement:p,withCallback:function(x,f){x.preventDefault(),l.open(f)}})),this.elements=this.getElements()}},{key:"open",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var x=D(p)?p:this.settings.startAt;if(G(l)){var f=l.getAttribute("data-gallery");f&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,f)),A(x)&&(x=this.getElementIndex(l))<0&&(x=0)}D(x)||(x=0),this.build(),M(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);var S=document.body,q=window.innerWidth-document.documentElement.clientWidth;if(q>0){var P=document.createElement("style");P.type="text/css",P.className="gcss-styles",P.innerText=".gscrollbar-fixer {margin-right: ".concat(q,"px}"),document.head.appendChild(P),h(S,"gscrollbar-fixer")}h(S,"glightbox-open"),h(fe,"glightbox-open"),ye&&(h(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(x,!0),this.elements.length===1?(h(this.prevButton,"glightbox-button-hidden"),h(this.nextButton,"glightbox-button-hidden")):(g(this.prevButton,"glightbox-button-hidden"),g(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),N(this.settings.onOpen)&&this.settings.onOpen(),me&&this.settings.touchNavigation&&Te(this),this.settings.keyboardNavigation&&Q(this)}},{key:"openAt",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.open(null,l)}},{key:"showSlide",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];C(this.loader),this.index=parseInt(p);var f=this.slidesContainer.querySelector(".current");f&&g(f,"current"),this.slideAnimateOut();var S=this.slidesContainer.querySelectorAll(".gslide")[p];if(y(S,"loaded"))this.slideAnimateIn(S,x),b(this.loader);else{C(this.loader);var q=this.elements[p],P={index:this.index,slide:S,slideNode:S,slideConfig:q.slideConfig,slideIndex:this.index,trigger:q.node,player:null};this.trigger("slide_before_load",P),q.instance.setContent(S,(function(){b(l.loader),l.resize(),l.slideAnimateIn(S,x),l.trigger("slide_after_load",P)}))}this.slideDescription=S.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&y(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(p+1),this.preloadSlide(p-1)),this.updateNavigationClasses(),this.activeSlide=S}},{key:"preloadSlide",value:function(l){var p=this;if(l<0||l>this.elements.length-1||A(this.elements[l]))return!1;var x=this.slidesContainer.querySelectorAll(".gslide")[l];if(y(x,"loaded"))return!1;var f=this.elements[l],S=f.type,q={index:l,slide:x,slideNode:x,slideConfig:f.slideConfig,slideIndex:l,trigger:f.node,player:null};this.trigger("slide_before_load",q),S==="video"||S==="external"?setTimeout((function(){f.instance.setContent(x,(function(){p.trigger("slide_after_load",q)}))}),200):f.instance.setContent(x,(function(){p.trigger("slide_after_load",q)}))}},{key:"prevSlide",value:function(){this.goToSlide(this.index-1)}},{key:"nextSlide",value:function(){this.goToSlide(this.index+1)}},{key:"goToSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(l<0||l>this.elements.length-1))return!1;l<0?l=this.elements.length-1:l>=this.elements.length&&(l=0),this.showSlide(l)}},{key:"insertSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;p<0&&(p=this.elements.length);var x=new Re(l,this,p),f=x.getConfig(),S=u({},f),q=x.create(),P=this.elements.length-1;S.index=p,S.node=!1,S.instance=x,S.slideConfig=f,this.elements.splice(p,0,S);var H=null,L=null;if(this.slidesContainer){if(p>P)this.slidesContainer.appendChild(q);else{var j=this.slidesContainer.querySelectorAll(".gslide")[p];this.slidesContainer.insertBefore(q,j)}(this.settings.preload&&this.index==0&&p==0||this.index-1==p||this.index+1==p)&&this.preloadSlide(p),this.index===0&&p===0&&(this.index=1),this.updateNavigationClasses(),H=this.slidesContainer.querySelectorAll(".gslide")[p],L=this.getSlidePlayerInstance(p),S.slideNode=H}this.trigger("slide_inserted",{index:p,slide:H,slideNode:H,slideConfig:f,slideIndex:p,trigger:null,player:L}),N(this.settings.slideInserted)&&this.settings.slideInserted({index:p,slide:H,player:L})}},{key:"removeSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;if(l<0||l>this.elements.length-1)return!1;var p=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[l];p&&(this.getActiveSlideIndex()==l&&(l==this.elements.length-1?this.prevSlide():this.nextSlide()),p.parentNode.removeChild(p)),this.elements.splice(l,1),this.trigger("slide_removed",l),N(this.settings.slideRemoved)&&this.settings.slideRemoved(l)}},{key:"slideAnimateIn",value:function(l,p){var x=this,f=l.querySelector(".gslide-media"),S=l.querySelector(".gslide-description"),q={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:A(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:A(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},P={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(f.offsetWidth>0&&S&&(b(S),S.style.display=""),g(l,this.effectsClasses),p)M(l,this.settings.cssEfects[this.settings.openEffect].in,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:q,current:P}),N(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[q,P])}));else{var H=this.settings.slideEffect,L=H!=="none"?this.settings.cssEfects[H].in:H;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(L=this.settings.cssEfects.slideBack.in),M(l,L,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:q,current:P}),N(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[q,P])}))}setTimeout((function(){x.resize(l)}),100),h(l,"current")}},{key:"slideAnimateOut",value:function(){if(!this.prevActiveSlide)return!1;var l=this.prevActiveSlide;g(l,this.effectsClasses),h(l,"prev");var p=this.settings.slideEffect,x=p!=="none"?this.settings.cssEfects[p].out:p;this.slidePlayerPause(l),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:A(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:A(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)}}),N(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(x=this.settings.cssEfects.slideBack.out),M(l,x,(function(){var f=l.querySelector(".ginner-container"),S=l.querySelector(".gslide-media"),q=l.querySelector(".gslide-description");f.style.transform="",S.style.transform="",g(S,"greset"),S.style.opacity="",q&&(q.style.opacity=""),g(l,"prev")}))}},{key:"getAllPlayers",value:function(){return this.videoPlayers}},{key:"getSlidePlayerInstance",value:function(l){var p="gvideo"+l,x=this.getAllPlayers();return!(!$(x,p)||!x[p])&&x[p]}},{key:"stopSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"slidePlayerPause",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"playSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");var x=this.getSlidePlayerInstance(l);x&&!x.playing&&x.play()}},{key:"slidePlayerPlay",value:function(l){var p;if(!ye||(p=this.settings.plyr.config)!==null&&p!==void 0&&p.muted){if(G(l)){var x=l.querySelector(".gvideo-wrapper");x&&(l=x.getAttribute("data-index"))}var f=this.getSlidePlayerInstance(l);f&&!f.playing&&(f.play(),this.settings.autofocusVideos&&f.elements.container.focus())}}},{key:"setElements",value:function(l){var p=this;this.settings.elements=!1;var x=[];l&&l.length&&c(l,(function(f,S){var q=new Re(f,p,S),P=q.getConfig(),H=u({},P);H.slideConfig=P,H.instance=q,H.index=S,x.push(H)})),this.elements=x,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(c(this.elements,(function(){var f=_(p.settings.slideHTML);p.slidesContainer.appendChild(f)})),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(l){var p=!1;return c(this.elements,(function(x,f){if($(x,"node")&&x.node==l)return p=f,!0})),p}},{key:"getElements",value:function(){var l=this,p=[];this.elements=this.elements?this.elements:[],!A(this.settings.elements)&&F(this.settings.elements)&&this.settings.elements.length&&c(this.settings.elements,(function(f,S){var q=new Re(f,l,S),P=q.getConfig(),H=u({},P);H.node=!1,H.index=S,H.instance=q,H.slideConfig=P,p.push(H)}));var x=!1;return this.getSelector()&&(x=document.querySelectorAll(this.getSelector())),x&&c(x,(function(f,S){var q=new Re(f,l,S),P=q.getConfig(),H=u({},P);H.node=f,H.index=S,H.instance=q,H.slideConfig=P,H.gallery=f.getAttribute("data-gallery"),p.push(H)})),p}},{key:"getGalleryElements",value:function(l,p){return l.filter((function(x){return x.gallery==p}))}},{key:"getSelector",value:function(){return!this.settings.elements&&(this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getActiveSlide",value:function(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}},{key:"getActiveSlideIndex",value:function(){return this.index}},{key:"getAnimationClasses",value:function(){var l=[];for(var p in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(p)){var x=this.settings.cssEfects[p];l.push("g".concat(x.in)),l.push("g".concat(x.out))}return l.join(" ")}},{key:"build",value:function(){var l=this;if(this.built)return!1;var p=document.body.childNodes,x=[];c(p,(function(j){j.parentNode==document.body&&j.nodeName.charAt(0)!=="#"&&j.hasAttribute&&!j.hasAttribute("aria-hidden")&&(x.push(j),j.setAttribute("aria-hidden","true"))}));var f=$(this.settings.svg,"next")?this.settings.svg.next:"",S=$(this.settings.svg,"prev")?this.settings.svg.prev:"",q=$(this.settings.svg,"close")?this.settings.svg.close:"",P=this.settings.lightboxHTML;P=_(P=(P=(P=P.replace(/{nextSVG}/g,f)).replace(/{prevSVG}/g,S)).replace(/{closeSVG}/g,q)),document.body.appendChild(P);var H=document.getElementById("glightbox-body");this.modal=H;var L=H.querySelector(".gclose");this.prevButton=H.querySelector(".gprev"),this.nextButton=H.querySelector(".gnext"),this.overlay=H.querySelector(".goverlay"),this.loader=H.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=x,this.events={},h(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&L&&(this.events.close=o("click",{onElement:L,withCallback:function(j,z){j.preventDefault(),l.close()}})),L&&!this.settings.closeButton&&L.parentNode.removeChild(L),this.nextButton&&(this.events.next=o("click",{onElement:this.nextButton,withCallback:function(j,z){j.preventDefault(),l.nextSlide()}})),this.prevButton&&(this.events.prev=o("click",{onElement:this.prevButton,withCallback:function(j,z){j.preventDefault(),l.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=o("click",{onElement:H,withCallback:function(j,z){l.preventOutsideClick||y(document.body,"glightbox-mobile")||E(j.target,".ginner-container")||E(j.target,".gbtn")||y(j.target,"gnext")||y(j.target,"gprev")||l.close()}})),c(this.elements,(function(j,z){l.slidesContainer.appendChild(j.instance.create()),j.slideNode=l.slidesContainer.querySelectorAll(".gslide")[z]})),me&&h(document.body,"glightbox-touch"),this.events.resize=o("resize",{onElement:window,withCallback:function(){l.resize()}}),this.built=!0}},{key:"resize",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if((l=l||this.activeSlide)&&!y(l,"zoomed")){var p=O(),x=l.querySelector(".gvideo-wrapper"),f=l.querySelector(".gslide-image"),S=this.slideDescription,q=p.width,P=p.height;if(q<=768?h(document.body,"glightbox-mobile"):g(document.body,"glightbox-mobile"),x||f){var H=!1;if(S&&(y(S,"description-bottom")||y(S,"description-top"))&&!y(S,"gabsolute")&&(H=!0),f){if(q<=768)f.querySelector("img");else if(H){var L,j,z=S.offsetHeight,B=f.querySelector("img"),Z=(L=this.elements[this.index])===null||L===void 0?void 0:L.node,ie="100vh";Z&&(ie=(j=Z.getAttribute("data-height"))!==null&&j!==void 0?j:ie),B.setAttribute("style","max-height: calc(".concat(ie," - ").concat(z,"px)")),S.setAttribute("style","max-width: ".concat(B.offsetWidth,"px;"))}}if(x){var ee=$(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!ee){var K=x.clientWidth,he=x.clientHeight,re=K/he;ee="".concat(K/re,":").concat(he/re)}var Se=ee.split(":"),pe=this.settings.videosWidth,we=this.settings.videosWidth,Ee=(we=D(pe)||pe.indexOf("px")!==-1?parseInt(pe):pe.indexOf("vw")!==-1?q*parseInt(pe)/100:pe.indexOf("vh")!==-1?P*parseInt(pe)/100:pe.indexOf("%")!==-1?q*parseInt(pe)/100:parseInt(x.clientWidth))/(parseInt(Se[0])/parseInt(Se[1]));if(Ee=Math.floor(Ee),H&&(P-=S.offsetHeight),we>q||Ee>P||P<Ee&&q>we){var De=x.offsetWidth,Ne=x.offsetHeight,Pe=P/Ne,Ce={width:De*Pe,height:Ne*Pe};x.parentNode.setAttribute("style","max-width: ".concat(Ce.width,"px")),H&&S.setAttribute("style","max-width: ".concat(Ce.width,"px;"))}else x.parentNode.style.maxWidth="".concat(pe),H&&S.setAttribute("style","max-width: ".concat(pe,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updateNavigationClasses",value:function(){var l=this.loop();g(this.nextButton,"disabled"),g(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(h(this.prevButton,"disabled"),h(this.nextButton,"disabled")):this.index!==0||l?this.index!==this.elements.length-1||l||h(this.nextButton,"disabled"):h(this.prevButton,"disabled")}},{key:"loop",value:function(){var l=$(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return l=$(this.settings,"loop")?this.settings.loop:l,l}},{key:"close",value:function(){var l=this;if(!this.lightboxOpen){if(this.events){for(var p in this.events)this.events.hasOwnProperty(p)&&this.events[p].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&c(this.bodyHiddenChildElms,(function(x){x.removeAttribute("aria-hidden")})),h(this.modal,"glightbox-closing"),M(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),M(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,(function(){if(l.activeSlide=null,l.prevActiveSlideIndex=null,l.prevActiveSlide=null,l.built=!1,l.events){for(var x in l.events)l.events.hasOwnProperty(x)&&l.events[x].destroy();l.events=null}var f=document.body;g(fe,"glightbox-open"),g(f,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),l.modal.parentNode.removeChild(l.modal),l.trigger("close"),N(l.settings.onClose)&&l.settings.onClose();var S=document.querySelector(".gcss-styles");S&&S.parentNode.removeChild(S),l.lightboxOpen=!1,l.closing=null}))}},{key:"destroy",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:"on",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||!N(p))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:l,once:x,callback:p})}},{key:"once",value:function(l,p){this.on(l,p,!0)}},{key:"trigger",value:function(l){var p=this,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,f=[];c(this.apiEvents,(function(S,q){var P=S.evt,H=S.once,L=S.callback;P==l&&(L(x),H&&f.push(q))})),f.length&&c(f,(function(S){return p.apiEvents.splice(S,1)}))}},{key:"clearAllEvents",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:"version",value:function(){return"3.3.1"}}]);return function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=new qe(l);return p.init(),p}}))})(pt)),pt.exports}var Fi=Ui();const si=ot(Fi);var It={exports:{}},ri;function Yi(){return ri||(ri=1,(function(v,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,u,c,d,o=[],h,g=/^Mac/.test(navigator.platform);function y(){s.keyboardSupport&&Q("keydown",m)}function E(){if(!(r||!document.body)){r=!0;var f=document.body,S=document.documentElement,q=window.innerHeight,P=f.scrollHeight;if(a=document.compatMode.indexOf("CSS")>=0?S:f,u=f,y(),top!=self)t=!0;else if(fe&&P>q&&(f.offsetHeight<=q||S.offsetHeight<=q)){var H=document.createElement("div");H.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+a.scrollHeight+"px",document.body.appendChild(H);var L;d=function(){L||(L=setTimeout(function(){H.style.height="0",H.style.height=a.scrollHeight+"px",L=null},500))},setTimeout(d,10),Q("resize",d);var j={attributes:!0,childList:!0,characterData:!1};if(c=new Re(d),c.observe(f,j),a.offsetHeight<=q){var z=document.createElement("div");z.style.clear="both",f.appendChild(z)}}s.fixedBackground||(f.style.backgroundAttachment="scroll",S.style.backgroundAttachment="scroll")}}function M(){c&&c.disconnect(),ne(p,O),ne("mousedown",k),ne("keydown",m),ne("resize",d),ne("load",E)}var w=[],C=!1,b=Date.now();function _(f,S,q){if(le(S,q),s.accelerationMax!=1){var P=Date.now(),H=P-b;if(H<s.accelerationDelta){var L=(1+50/H)/2;L>1&&(L=Math.min(L,s.accelerationMax),S*=L,q*=L)}b=Date.now()}if(w.push({x:S,y:q,lastX:S<0?.99:-.99,lastY:q<0?.99:-.99,start:Date.now()}),!C){var j=_e(),z=f===j||f===document.body;f.$scrollBehavior==null&&J(f)&&(f.$scrollBehavior=f.style.scrollBehavior,f.style.scrollBehavior="auto");var B=function(Z){for(var ie=Date.now(),ee=0,K=0,he=0;he<w.length;he++){var re=w[he],Se=ie-re.start,pe=Se>=s.animationTime,we=pe?1:Se/s.animationTime;s.pulseAlgorithm&&(we=X(we));var Ee=re.x*we-re.lastX>>0,De=re.y*we-re.lastY>>0;ee+=Ee,K+=De,re.lastX+=Ee,re.lastY+=De,pe&&(w.splice(he,1),he--)}z?window.scrollBy(ee,K):(ee&&(f.scrollLeft+=ee),K&&(f.scrollTop+=K)),!S&&!q&&(w=[]),w.length?Le(B,f,1e3/s.frameRate+1):(C=!1,f.$scrollBehavior!=null&&(f.style.scrollBehavior=f.$scrollBehavior,f.$scrollBehavior=null))};Le(B,f,0),C=!0}}function O(f){r||E();var S=R(f);if(f.defaultPrevented||f.ctrlKey||se(u,"embed")||se(S,"embed")&&/\.pdf/i.test(S.src)||se(u,"object"))return!0;var q=-f.wheelDeltaX||f.deltaX||0,P=-f.wheelDeltaY||f.deltaY||0;g&&(f.wheelDeltaX&&oe(f.wheelDeltaX,120)&&(q=-120*(f.wheelDeltaX/Math.abs(f.wheelDeltaX))),f.wheelDeltaY&&oe(f.wheelDeltaY,120)&&(P=-120*(f.wheelDeltaY/Math.abs(f.wheelDeltaY)))),!q&&!P&&(P=-f.wheelDelta||0),f.deltaMode===1&&(q*=40,P*=40);var H=A(S);if(!H)return t&&be?(Object.defineProperty(f,"target",{value:window.frameElement}),parent.wheel(f)):!0;if(de(P))return!0;Math.abs(q)>1.2&&(q*=s.stepSize/120),Math.abs(P)>1.2&&(P*=s.stepSize/120),_(H,q,P),f.preventDefault(),F()}function m(f){var S=R(f),q=f.ctrlKey||f.altKey||f.metaKey||f.shiftKey&&f.code!=="Space";document.body.contains(u)||(u=document.activeElement);var P=/^(textarea|select|embed|object)$/i,H=/^(button|submit|radio|checkbox|file|color|image)$/i;if(f.defaultPrevented||P.test(S.nodeName)||se(S,"input")&&!H.test(S.type)||se(u,"video")||je(f)||S.isContentEditable||q||(se(S,"button")||se(S,"input")&&H.test(S.type))&&f.code==="Space"||se(S,"input")&&S.type=="radio"&&(f.code==="ArrowUp"||f.code==="ArrowDown"||f.code==="ArrowLeft"||f.code==="ArrowRight"))return!0;var L,j=0,z=0,B=A(u);if(!B)return t&&be?parent.keydown(f):!0;var Z=B.clientHeight;switch(B==document.body&&(Z=window.innerHeight),f.code){case"ArrowUp":z=-s.arrowScroll;break;case"ArrowDown":z=s.arrowScroll;break;case"Space":L=f.shiftKey?1:-1,z=-L*Z*.9;break;case"PageUp":z=-Z*.9;break;case"PageDown":z=Z*.9;break;case"Home":B==document.body&&document.scrollingElement&&(B=document.scrollingElement),z=-B.scrollTop;break;case"End":var ie=B.scrollHeight-B.scrollTop,ee=ie-Z;z=ee>0?ee+10:0;break;case"ArrowLeft":j=-s.arrowScroll;break;case"ArrowRight":j=s.arrowScroll;break;default:return!0}_(B,j,z),f.preventDefault(),F()}function k(f){u=R(f)}function R(f){return f.composedPath?f.composedPath()[0]:f.target}var V=(function(){var f=0;return function(S){return S.uniqueID||(S.uniqueID=f++)}})(),N={},Y,G={};function F(){clearTimeout(Y),Y=setInterval(function(){N=G={}},1e3)}function I(f,S,q){for(var P=N,H=f.length;H--;)P[V(f[H])]=S;return S}function T(f,S){return N[V(f)]}function A(f){for(var S=[],q=document.body,P=a.scrollHeight;f;){var H=T(f);if(H)return I(S,H);if(S.push(f),P===f.scrollHeight){var L=W(a)&&W(q),j=L||D(a);if(t&&$(a)||!t&&j)return I(S,_e())}else if($(f)&&D(f))return I(S,f);f=f.parentElement||f.getRootNode&&f.getRootNode().host}}function $(f){return f.clientHeight+10<f.scrollHeight}function W(f){var S=getComputedStyle(f,"").getPropertyValue("overflow-y");return S!=="hidden"}function D(f){var S=getComputedStyle(f,"").getPropertyValue("overflow-y");return S==="scroll"||S==="auto"}function J(f){var S=V(f);if(G[S]==null){var q=getComputedStyle(f,"")["scroll-behavior"];G[S]=q=="smooth"}return G[S]}function Q(f,S,q){window.addEventListener(f,S,q||!1)}function ne(f,S,q){window.removeEventListener(f,S,!1)}function se(f,S){return f&&(f.nodeName||"").toLowerCase()===S.toLowerCase()}function le(f,S){f=f>0?1:-1,S=S>0?1:-1,(n.x!==f||n.y!==S)&&(n.x=f,n.y=S,w=[],b=0)}try{localStorage.SS_deltaBuffer&&(o=localStorage.SS_deltaBuffer.split(","))}catch{}function de(f){if(f){o.length||(o=[f,f,f]),f=Math.abs(f),o.push(f),o.shift(),clearTimeout(h),h=setTimeout(function(){try{localStorage.SS_deltaBuffer=o.join(",")}catch{}},1e3);var S=f>120&&xe(f),q=!xe(120)&&!xe(100)&&!S;return f<50?!0:q}}function oe(f,S){return Math.floor(f/S)==f/S}function xe(f){return oe(o[0],f)&&oe(o[1],f)&&oe(o[2],f)}function je(f){var S=R(f),q=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(q=S.classList&&S.classList.contains("html5-video-controls"),q)break;while(S=S.parentNode);return q}var Le=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(f,S,q){window.setTimeout(f,q||1e3/60)}})(),Re=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,_e=(function(){var f=document.scrollingElement;return function(){if(!f){var S=document.createElement("div");S.style.cssText="height:10000px;width:1px;",document.body.appendChild(S);var q=document.body.scrollTop;document.documentElement.scrollTop,window.scrollBy(0,3),document.body.scrollTop!=q?f=document.body:f=document.documentElement,window.scrollBy(0,-3),document.body.removeChild(S)}return f}})();function ve(f){var S,q,P;return f=f*s.pulseScale,f<1?S=f-(1-Math.exp(-f)):(q=Math.exp(-1),f-=1,P=1-Math.exp(-f),S=q+P*(1-q)),S*s.pulseNormalize}function X(f){return f>=1?1:f<=0?0:(s.pulseNormalize==1&&(s.pulseNormalize/=ve(1)),ve(f))}var te=window.navigator.userAgent,ge=/Edge/.test(te),be=/chrome/i.test(te)&&!ge,Te=/safari/i.test(te)&&!ge,ye=/mobile/i.test(te),me=/Windows NT 6.1/i.test(te)&&/rv:11/i.test(te),fe=Te&&(/Version\/8/i.test(te)||/Version\/9/i.test(te)),ae=(be||Te||me)&&!ye,qe=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){qe=!0}}))}catch{}var l=qe?{passive:!1}:!1,p="onwheel"in document.createElement("div")?"wheel":"mousewheel";ae&&(Q(p,O,l),Q("mousedown",k),Q("load",E));function x(f){for(var S in f)i.hasOwnProperty(S)&&(s[S]=f[S])}x.destroy=M,window.SmoothScrollOptions&&x(window.SmoothScrollOptions),v.exports=x})()})(It)),It.exports}var Wi=Yi();const Gi=ot(Wi);/*!
|
|
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 ai(v,e){var i=Object.keys(v);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(v);e&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(v,t).enumerable})),i.push.apply(i,s)}return i}function oi(v){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?ai(Object(i),!0).forEach(function(s){Ji(v,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(i)):ai(Object(i)).forEach(function(s){Object.defineProperty(v,s,Object.getOwnPropertyDescriptor(i,s))})}return v}function ft(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ft=function(e){return typeof e}:ft=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(v)}function gt(v,e){if(!(v instanceof e))throw new TypeError("Cannot call a class as a function")}function Xi(v,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(v,s.key,s)}}function mt(v,e,i){return e&&Xi(v.prototype,e),v}function Ji(v,e,i){return e in v?Object.defineProperty(v,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):v[e]=i,v}function Zi(v,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(e&&e.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),e&&Nt(v,e)}function tt(v){return tt=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},tt(v)}function Nt(v,e){return Nt=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},Nt(v,e)}function Qi(){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 Ki(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function en(v,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 Ki(v)}function tn(v){var e=Qi();return function(){var s=tt(v),t;if(e){var n=tt(this).constructor;t=Reflect.construct(s,arguments,n)}else t=s.apply(this,arguments);return en(this,t)}}function nn(v,e){for(;!Object.prototype.hasOwnProperty.call(v,e)&&(v=tt(v),v!==null););return v}function bt(){return typeof Reflect<"u"&&Reflect.get?bt=Reflect.get:bt=function(e,i,s){var t=nn(e,i);if(t){var n=Object.getOwnPropertyDescriptor(t,i);return n.get?n.get.call(arguments.length<3?e:s):n.value}},bt.apply(this,arguments)}var 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 We(v){console.error("[Glide warn]: ".concat(v))}function ze(v){return parseInt(v)}function rn(v){return parseFloat(v)}function Pt(v){return typeof v=="string"}function it(v){var e=ft(v);return e==="function"||e==="object"&&!!v}function vt(v){return typeof v=="function"}function li(v){return typeof v>"u"}function Dt(v){return v.constructor===Array}function an(v,e,i){var s={};for(var t in e)vt(e[t])?s[t]=e[t](v,s,i):We("Extension must be a function");for(var n in s)vt(s[n].mount)&&s[n].mount();return s}function Ie(v,e,i){Object.defineProperty(v,e,i)}function on(v){return Object.keys(v).sort().reduce(function(e,i){return e[i]=v[i],e[i],e},{})}function Ht(v,e){var i=Object.assign({},v,e);if(e.hasOwnProperty("classes")){i.classes=Object.assign({},v.classes,e.classes);var s=["direction","type","slide","arrow","nav"];s.forEach(function(t){e.classes.hasOwnProperty(t)&&(i.classes[t]=oi(oi({},v.classes[t]),e.classes[t]))})}return e.hasOwnProperty("breakpoints")&&(i.breakpoints=Object.assign({},v.breakpoints,e.breakpoints)),i}var ln=(function(){function v(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,v),this.events=e,this.hop=e.hasOwnProperty}return mt(v,[{key:"on",value:function(i,s){if(Dt(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(Dt(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||{})})}}]),v})(),cn=(function(){function v(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gt(this,v),this._c={},this._t=[],this._e=new ln,this.disabled=!1,this.selector=e,this.settings=Ht(sn,i),this.index=this.settings.startAt}return mt(v,[{key:"mount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),it(i)?this._c=an(this,i,this._e):We("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Dt(i)?this._t=i:We("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=Ht(this.settings,i),i.hasOwnProperty("startAt")&&(this.index=i.startAt),this._e.emit("update"),this}},{key:"go",value:function(i){return this._c.Run.make(i),this}},{key:"move",value:function(i){return this._c.Transition.disable(),this._c.Move.make(i),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i&&(this.settings.autoplay=i),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(i,s){return this._e.on(i,s),this}},{key:"isType",value:function(i){return this.settings.type===i}},{key:"settings",get:function(){return this._o},set:function(i){it(i)?this._o=i:We("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(i){this._i=ze(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(i){this._d=!!i}}]),v})();function un(v,e,i){var s={mount:function(){this._o=!1},make:function(c){var d=this;v.disabled||(!v.settings.waitForTransition||v.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),v.enable()}))},calculate:function(){var c=this.move,d=this.length,o=c.steps,h=c.direction,g=1;if(h==="="){if(v.settings.bound&&ze(o)>d){v.index=d;return}v.index=o;return}if(h===">"&&o===">"){v.index=d;return}if(h==="<"&&o==="<"){v.index=0;return}if(h==="|"&&(g=v.settings.perView||1),h===">"||h==="|"&&o===">"){var y=t(g);y>d&&(this._o=!0),v.index=n(y,g);return}if(h==="<"||h==="|"&&o==="<"){var E=r(g);E<0&&(this._o=!0),v.index=a(E,g);return}We("Invalid direction pattern [".concat(h).concat(o,"] has been used"))},isStart:function(){return v.index<=0},isEnd:function(){return v.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 v.isType("slider")&&v.settings.focusAt!=="center"&&v.settings.bound}};function t(u){var c=v.index;return v.isType("carousel")?c+u:c+(u-c%u)}function n(u,c){var d=s.length;return u<=d?u:v.isType("carousel")?u-(d+1):v.settings.rewind?s.isBound()&&!s.isEnd()?d:0:s.isBound()?d:Math.floor(d/c)*c}function r(u){var c=v.index;if(v.isType("carousel"))return c-u;var d=Math.ceil(c/u);return(d-1)*u}function a(u,c){var d=s.length;return u>=0?u:v.isType("carousel")?u+(d+1):v.settings.rewind?s.isBound()&&s.isStart()?d:Math.floor(d/c)*c:0}return Ie(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}}}),Ie(s,"length",{get:function(){var c=v.settings,d=e.Html.slides.length;return this.isBound()?d-1-(ze(c.perView)-1)+ze(c.focusAt):d-1}}),Ie(s,"offset",{get:function(){return this._o}}),s}function ci(){return new Date().getTime()}function yt(v,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,t,n,r,a=0,u=function(){a=i.leading===!1?0:ci(),s=null,r=v.apply(t,n),s||(t=n=null)},c=function(){var o=ci();!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=v.apply(t,n),s||(t=n=null)):!s&&i.trailing!==!1&&(s=setTimeout(u,h)),r};return c.cancel=function(){clearTimeout(s),a=0,s=t=n=null},c}var wt={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function dn(v,e,i){var s={apply:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style,c=e.Direction.value;r!==0?u[wt[c][0]]="".concat(this.value/2,"px"):u[wt[c][0]]="",r!==n.length-1?u[wt[c][1]]="".concat(this.value/2,"px"):u[wt[c][1]]=""}},remove:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style;u.marginLeft="",u.marginRight=""}}};return Ie(s,"value",{get:function(){return ze(v.settings.gap)}}),Ie(s,"grow",{get:function(){return s.value*e.Sizes.length}}),Ie(s,"reductor",{get:function(){var n=v.settings.perView;return s.value*(n-1)/n}}),i.on(["build.after","update"],yt(function(){s.apply(e.Html.wrapper.children)},30)),i.on("destroy",function(){s.remove(e.Html.wrapper.children)}),s}function ui(v){if(v&&v.parentNode){for(var e=v.parentNode.firstChild,i=[];e;e=e.nextSibling)e.nodeType===1&&e!==v&&i.push(e);return i}return[]}function $t(v){return Array.prototype.slice.call(v)}var hn='[data-glide-el="track"]';function pn(v,e,i){var s={mount:function(){this.root=v.selector,this.track=this.root.querySelector(hn),this.collectSlides()},collectSlides:function(){this.slides=$t(this.wrapper.children).filter(function(n){return!n.classList.contains(v.settings.classes.slide.clone)})}};return Ie(s,"root",{get:function(){return s._r},set:function(n){Pt(n)&&(n=document.querySelector(n)),n!==null?s._r=n:We("Root element must be a existing Html node")}}),Ie(s,"track",{get:function(){return s._t},set:function(n){s._t=n}}),Ie(s,"wrapper",{get:function(){return s.track.children[0]}}),i.on("update",function(){s.collectSlides()}),s}function fn(v,e,i){var s={mount:function(){this.value=v.settings.peek}};return Ie(s,"value",{get:function(){return s._v},set:function(n){it(n)?(n.before=ze(n.before),n.after=ze(n.after)):n=ze(n),s._v=n}}),Ie(s,"reductor",{get:function(){var n=s.value,r=v.settings.perView;return it(n)?n.before/r+n.after/r:n*2/r}}),i.on(["resize","update"],function(){s.mount()}),s}function gn(v,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 Ie(s,"offset",{get:function(){return s._o},set:function(n){s._o=li(n)?0:ze(n)}}),Ie(s,"translate",{get:function(){return e.Sizes.slideWidth*v.index}}),Ie(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 mn(v,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 Ie(s,"length",{get:function(){return e.Html.slides.length}}),Ie(s,"width",{get:function(){return e.Html.track.offsetWidth}}),Ie(s,"wrapperSize",{get:function(){return s.slideWidth*s.length+e.Gaps.grow+e.Clones.grow}}),Ie(s,"slideWidth",{get:function(){return s.width/v.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 bn(v,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(v.settings.classes.type[v.settings.type])},activeClass:function(){var n=v.settings.classes,r=e.Html.slides[v.index];r&&(r.classList.add(n.slide.active),ui(r).forEach(function(a){a.classList.remove(n.slide.active)}))},removeClasses:function(){var n=v.settings.classes,r=n.type,a=n.slide;e.Html.root.classList.remove(r[v.settings.type]),e.Html.slides.forEach(function(u){u.classList.remove(a.active)})}};return i.on(["destroy","update"],function(){s.removeClasses()}),i.on(["resize","update"],function(){s.mount()}),i.on("move.after",function(){s.activeClass()}),s}function vn(v,e,i){var s={mount:function(){this.items=[],v.isType("carousel")&&(this.items=this.collect())},collect:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=e.Html.slides,a=v.settings,u=a.perView,c=a.classes,d=a.cloningRatio;if(r.length>0)for(var o=+!!v.settings.peek,h=u+o+Math.round(u/2),g=r.slice(0,h).reverse(),y=r.slice(h*-1),E=0;E<Math.max(d,Math.floor(u/r.length));E++){for(var M=0;M<g.length;M++){var w=g[M].cloneNode(!0);w.classList.add(c.slide.clone),n.push(w)}for(var C=0;C<y.length;C++){var b=y[C].cloneNode(!0);b.classList.add(c.slide.clone),n.unshift(b)}}return n},append:function(){for(var n=this.items,r=e.Html,a=r.wrapper,u=r.slides,c=Math.floor(n.length/2),d=n.slice(0,c).reverse(),o=n.slice(c*-1).reverse(),h="".concat(e.Sizes.slideWidth,"px"),g=0;g<o.length;g++)a.appendChild(o[g]);for(var y=0;y<d.length;y++)a.insertBefore(d[y],u[0]);for(var E=0;E<n.length;E++)n[E].style.width=h},remove:function(){for(var n=this.items,r=0;r<n.length;r++)e.Html.wrapper.removeChild(n[r])}};return Ie(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(){v.isType("carousel")&&s.append()}),i.on("destroy",function(){s.remove()}),s}var Je=(function(){function v(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,v),this.listeners=e}return mt(v,[{key:"on",value:function(i,s,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Pt(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;Pt(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}}]),v})();function yn(v,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("resize",window,yt(function(){i.emit("resize")},v.settings.throttle))},unbind:function(){s.off("resize",window)}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}var wn=["ltr","rtl"],xn={">":"<","<":">","=":"="};function kn(v,e,i){var s={mount:function(){this.value=v.settings.direction},resolve:function(n){var r=n.slice(0,1);return this.is("rtl")?n.split(r).join(xn[r]):n},is:function(n){return this.value===n},addClass:function(){e.Html.root.classList.add(v.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(v.settings.classes.direction[this.value])}};return Ie(s,"value",{get:function(){return s._v},set:function(n){wn.indexOf(n)>-1?s._v=n:We("Direction value must be `ltr` or `rtl`")}}),i.on(["destroy","update"],function(){s.removeClass()}),i.on("update",function(){s.mount()}),i.on(["build.before","update"],function(){s.addClass()}),s}function _n(v,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function Sn(v,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function En(v,e){return{modify:function(s){return s+e.Clones.grow/2}}}function Tn(v,e){return{modify:function(s){if(v.settings.focusAt>=0){var t=e.Peek.value;return it(t)?s-t.before:s-t}return s}}}function Cn(v,e){return{modify:function(s){var t=e.Gaps.value,n=e.Sizes.width,r=v.settings.focusAt,a=e.Sizes.slideWidth;return r==="center"?s-(n/2-a/2):s-a*r-t*r}}}function On(v,e,i){var s=[Sn,En,Tn,Cn].concat(v._t,[_n]);return{mutate:function(n){for(var r=0;r<s.length;r++){var a=s[r];vt(a)&&vt(a().modify)?n=a(v,e,i).modify(n):We("Transformer should be a function that returns an object with `modify()` method")}return n}}}function Ln(v,e,i){var s={set:function(n){var r=On(v,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=v.index,a=v.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n+(r-a):(r+a)%n},getTravelDistance:function(){var n=e.Sizes.slideWidth*v.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n*-1:n}};return i.on("move",function(t){if(!v.isType("carousel")||!e.Run.isOffset())return s.set(t.movement);e.Transition.after(function(){i.emit("translate.jump"),s.set(e.Sizes.slideWidth*v.index)});var n=e.Sizes.slideWidth*e.Translate.getStartIndex();return s.set(n-e.Translate.getTravelDistance())}),i.on("destroy",function(){s.remove()}),s}function An(v,e,i){var s=!1,t={compose:function(r){var a=v.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 Ie(t,"duration",{get:function(){var r=v.settings;return v.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 di=!1;try{var hi=Object.defineProperty({},"passive",{get:function(){di=!0}});window.addEventListener("testPassive",null,hi),window.removeEventListener("testPassive",null,hi)}catch{}var zt=di,xt=["touchstart","mousedown"],pi=["touchmove","mousemove"],fi=["touchend","touchcancel","mouseup","mouseleave"],gi=["mousedown","mousemove","mouseup","mouseleave"];function Rn(v,e,i){var s=new Je,t=0,n=0,r=0,a=!1,u=zt?{passive:!0}:!1,c={mount:function(){this.bindSwipeStart()},start:function(o){if(!a&&!v.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(!v.disabled){var h=v.settings,g=h.touchAngle,y=h.touchRatio,E=h.classes,M=this.touches(o),w=ze(M.pageX)-n,C=ze(M.pageY)-r,b=Math.abs(w<<2),_=Math.abs(C<<2),O=Math.sqrt(b+_),m=Math.sqrt(_);if(t=Math.asin(m/O),t*180/Math.PI<g)o.stopPropagation(),e.Move.make(w*rn(y)),e.Html.root.classList.add(E.dragging),i.emit("swipe.move");else return!1}},end:function(o){if(!v.disabled){var h=v.settings,g=h.perSwipe,y=h.touchAngle,E=h.classes,M=this.touches(o),w=this.threshold(o),C=M.pageX-n,b=t*180/Math.PI;this.enable(),C>w&&b<y?e.Run.make(e.Direction.resolve("".concat(g,"<"))):C<-w&&b<y?e.Run.make(e.Direction.resolve("".concat(g,">"))):e.Move.make(),e.Html.root.classList.remove(E.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),i.emit("swipe.end")}},bindSwipeStart:function(){var o=this,h=v.settings,g=h.swipeThreshold,y=h.dragThreshold;g&&s.on(xt[0],e.Html.wrapper,function(E){o.start(E)},u),y&&s.on(xt[1],e.Html.wrapper,function(E){o.start(E)},u)},unbindSwipeStart:function(){s.off(xt[0],e.Html.wrapper,u),s.off(xt[1],e.Html.wrapper,u)},bindSwipeMove:function(){var o=this;s.on(pi,e.Html.wrapper,yt(function(h){o.move(h)},v.settings.throttle),u)},unbindSwipeMove:function(){s.off(pi,e.Html.wrapper,u)},bindSwipeEnd:function(){var o=this;s.on(fi,e.Html.wrapper,function(h){o.end(h)})},unbindSwipeEnd:function(){s.off(fi,e.Html.wrapper)},touches:function(o){return gi.indexOf(o.type)>-1?o:o.touches[0]||o.changedTouches[0]},threshold:function(o){var h=v.settings;return gi.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(v.settings.classes.swipeable)}),i.on("destroy",function(){c.unbindSwipeStart(),c.unbindSwipeMove(),c.unbindSwipeEnd(),s.destroy()}),c}function qn(v,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){s.off("dragstart",e.Html.wrapper)},dragstart:function(r){r.preventDefault()}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}function Mn(v,e,i){var s=new Je,t=!1,n=!1,r={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){s.on("click",e.Html.wrapper,this.click)},unbind:function(){s.off("click",e.Html.wrapper)},click:function(u){n&&(u.stopPropagation(),u.preventDefault())},detach:function(){if(n=!0,!t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!1;t=!0}return this},attach:function(){if(n=!1,t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!0;t=!1}return this}};return Ie(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 jn='[data-glide-el="controls[nav]"]',Vt='[data-glide-el^="controls"]',In="".concat(Vt,' [data-glide-dir*="<"]'),Nn="".concat(Vt,' [data-glide-dir*=">"]');function Pn(v,e,i){var s=new Je,t=zt?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(jn),this._c=e.Html.root.querySelectorAll(Vt),this._arrowControls={previous:e.Html.root.querySelectorAll(In),next:e.Html.root.querySelectorAll(Nn)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var u=v.settings,c=a[v.index];c&&(c.classList.add(u.classes.nav.active),ui(c).forEach(function(d){d.classList.remove(u.classes.nav.active)}))},removeClass:function(a){var u=a[v.index];u?.classList.remove(v.settings.classes.nav.active)},setArrowState:function(){if(!v.settings.rewind){var a=n._arrowControls.next,u=n._arrowControls.previous;this.resetArrowState(a,u),v.index===0&&this.disableArrow(u),v.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=v.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){$t(o).forEach(function(h){h.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=v.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){$t(o).forEach(function(h){h.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var u=0;u<a.length;u++)s.on("click",a[u],this.click),s.on("touchstart",a[u],this.click,t)},unbind:function(a){for(var u=0;u<a.length;u++)s.off(["click","touchstart"],a[u])},click:function(a){!zt&&a.type==="touchstart"&&a.preventDefault();var u=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(u))}};return Ie(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(v,e,i){var s=new Je,t={mount:function(){v.settings.keyboard&&this.bind()},bind:function(){s.on("keyup",document,this.press)},unbind:function(){s.off("keyup",document)},press:function(r){var a=v.settings.perSwipe,u={ArrowRight:">",ArrowLeft:"<"};["ArrowRight","ArrowLeft"].includes(r.code)&&e.Run.make(e.Direction.resolve("".concat(a).concat(u[r.code])))}};return i.on(["destroy","update"],function(){t.unbind()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function Hn(v,e,i){var s=new Je,t={mount:function(){this.enable(),this.start(),v.settings.hoverpause&&this.bind()},enable:function(){this._e=!0},disable:function(){this._e=!1},start:function(){var r=this;this._e&&(this.enable(),v.settings.autoplay&&li(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 Ie(t,"time",{get:function(){var r=e.Html.slides[v.index].getAttribute("data-glide-autoplay");return ze(r||v.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 mi(v){return it(v)?on(v):(We("Breakpoints option must be an object"),{})}function $n(v,e,i){var s=new Je,t=v.settings,n=mi(t.breakpoints),r=Object.assign({},t),a={match:function(c){if(typeof window.matchMedia<"u"){for(var d in c)if(c.hasOwnProperty(d)&&window.matchMedia("(max-width: ".concat(d,"px)")).matches)return c[d]}return r}};return Object.assign(t,a.match(n)),s.on("resize",window,yt(function(){v.settings=Ht(t,a.match(n))},v.settings.throttle)),i.on("update",function(){n=mi(n),r=Object.assign({},t)}),i.on("destroy",function(){s.off("resize",window)}),a}var zn={Html:pn,Translate:Ln,Transition:An,Direction:kn,Peek:fn,Sizes:mn,Gaps:dn,Move:gn,Clones:vn,Resize:yn,Build:bn,Run:un,Swipe:Rn,Images:qn,Anchors:Mn,Controls:Pn,Keyboard:Dn,Autoplay:Hn,Breakpoints:$n},Vn=(function(v){Zi(i,v);var e=tn(i);function i(){return gt(this,i),e.apply(this,arguments)}return mt(i,[{key:"mount",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return bt(tt(i.prototype),"mount",this).call(this,Object.assign({},zn,t))}}]),i})(cn);function Bt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ze=Bt();function bi(v){Ze=v}const lt={exec:()=>null};function Ae(v,e=""){let i=typeof v=="string"?v:v.source;const s={replace:(t,n)=>{let r=typeof n=="string"?n:n.source;return r=r.replace(Ve.caret,"$1"),i=i.replace(t,r),s},getRegex:()=>new RegExp(i,e)};return s}const Ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:v=>new RegExp(`^( {0,3}${v})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:v=>new RegExp(`^ {0,${Math.min(3,v-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:v=>new RegExp(`^ {0,${Math.min(3,v-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:v=>new RegExp(`^ {0,${Math.min(3,v-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:v=>new RegExp(`^ {0,${Math.min(3,v-1)}}#`),htmlBeginRegex:v=>new RegExp(`^ {0,${Math.min(3,v-1)}}<(?:[a-z].*>|!--)`,"i")},Bn=/^(?:[ \t]*(?:\n|$))+/,Un=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ct=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ut=/(?:[*+-]|\d{1,9}[.)])/,vi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yi=Ae(vi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wn=Ae(vi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ft=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gn=/^[^\n]+/,Yt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Xn=Ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jn=Ae(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ut).getRegex(),kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zn=Ae("^ {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",Wt).replace("tag",kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wi=Ae(Ft).replace("hr",ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Gt={blockquote:Ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wi).getRegex(),code:Un,def:Xn,fences:Fn,heading:Yn,hr:ct,html:Zn,lheading:yi,list:Jn,newline:Bn,paragraph:wi,table:lt,text:Gn},xi=Ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Qn={...Gt,lheading:Wn,table:xi,paragraph:Ae(Ft).replace("hr",ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex()},Kn={...Gt,html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wt).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:lt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ae(Ft).replace("hr",ct).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=
|
|
57
|
-
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=
|
|
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
|
+
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=bt(i[0],`
|
|
58
58
|
`).split(`
|
|
59
|
-
`),t="",n="";const r=[];for(;s.length>0;){let a=!1;const
|
|
59
|
+
`),t="",n="";const r=[];for(;s.length>0;){let a=!1;const l=[];let c;for(c=0;c<s.length;c++)if(this.rules.other.blockquoteStart.test(s[c]))l.push(s[c]),a=!0;else if(!a)l.push(s[c]);else break;s=s.slice(c);const d=l.join(`
|
|
60
60
|
`),o=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
61
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}
|
|
62
62
|
${d}`:d,n=n?`${n}
|
|
63
|
-
${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,r,!0),this.lexer.state.top=h,s.length===0)break;const
|
|
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
|
-
`),
|
|
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
|
-
`),
|
|
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,
|
|
70
|
-
`,1)[0],
|
|
71
|
-
`,e=e.substring(
|
|
72
|
-
`,1)[0];let
|
|
73
|
-
`+
|
|
74
|
-
`+
|
|
75
|
-
`,e=e.substring(
|
|
76
|
-
`):[],r={type:"table",raw:i[0],header:[],align:[],rows:[]};if(s.length===t.length){for(const a of t)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<s.length;a++)r.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:r.align[a]});for(const a of n)r.rows.push(
|
|
77
|
-
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){const i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){const i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){const i=this.rules.inline.link.exec(e);if(i){const s=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const r=
|
|
78
|
-
`),this.blockTokens(e,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,i=[],s=!1){for(this.options.pedantic&&(e=e.replace(
|
|
69
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),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+=`
|
|
82
82
|
`+t.raw,r.text+=`
|
|
83
|
-
`+t.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),i.push(t);continue}let n=e;if(this.options.extensions?.startBlock){let r=1/0;const a=e.slice(1);let
|
|
83
|
+
`+t.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),i.push(t);continue}let n=e;if(this.options.extensions?.startBlock){let r=1/0;const a=e.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(r=Math.min(r,l))}),r<1/0&&r>=0&&(n=e.substring(0,r+1))}if(this.state.top&&(t=this.tokenizer.paragraph(n))){const r=i.at(-1);s&&r?.type==="paragraph"?(r.raw+=`
|
|
84
84
|
`+t.raw,r.text+=`
|
|
85
85
|
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t),s=n.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);const r=i.at(-1);r?.type==="text"?(r.raw+=`
|
|
86
86
|
`+t.raw,r.text+=`
|
|
87
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){let s=e,t=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let n=!1,r="";for(;e;){n||(r=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,i))?(e=e.substring(a.raw.length),i.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const c=i.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),i.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),i.push(a);continue}let
|
|
88
|
-
`;return t?'<pre><code class="language-'+
|
|
89
|
-
`:"<pre><code>"+(s?n:
|
|
87
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):i.push(t);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){let s=e,t=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let n=!1,r="";for(;e;){n||(r=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,i))?(e=e.substring(a.raw.length),i.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const c=i.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),i.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),i.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),i.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0;const d=e.slice(1);let o;this.options.extensions.startInline.forEach(h=>{o=h.call({lexer:this},d),typeof o=="number"&&o>=0&&(c=Math.min(c,o))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),n=!0;const c=i.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):i.push(a);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return i}}class 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
|
+
`;return t?'<pre><code class="language-'+Ke(t)+'">'+(s?n:Ke(n,!0))+`</code></pre>
|
|
89
|
+
`:"<pre><code>"+(s?n:Ke(n,!0))+`</code></pre>
|
|
90
90
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
91
91
|
${this.parser.parse(e)}</blockquote>
|
|
92
92
|
`}html({text:e}){return e}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
|
93
93
|
`}hr(e){return`<hr>
|
|
94
|
-
`}list(e){const i=e.ordered,s=e.start;let t="";for(let a=0;a<e.items.length;a++){const
|
|
94
|
+
`}list(e){const i=e.ordered,s=e.start;let t="";for(let a=0;a<e.items.length;a++){const l=e.items[a];t+=this.listitem(l)}const n=i?"ol":"ul",r=i&&s!==1?' start="'+s+'"':"";return"<"+n+r+`>
|
|
95
95
|
`+t+"</"+n+`>
|
|
96
|
-
`}listitem(e){let i="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+
|
|
96
|
+
`}listitem(e){let i="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+Ke(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):i+=s+" "}return i+=this.parser.parse(e.tokens,!!e.loose),`<li>${i}</li>
|
|
97
97
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
98
98
|
`}table(e){let i="",s="";for(let n=0;n<e.header.length;n++)s+=this.tablecell(e.header[n]);i+=this.tablerow({text:s});let t="";for(let n=0;n<e.rows.length;n++){const r=e.rows[n];s="";for(let a=0;a<r.length;a++)s+=this.tablecell(r[a]);t+=this.tablerow({text:s})}return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
|
99
99
|
<thead>
|
|
@@ -102,13 +102,13 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
102
102
|
`}tablerow({text:e}){return`<tr>
|
|
103
103
|
${e}</tr>
|
|
104
104
|
`}tablecell(e){const i=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+i+`</${s}>
|
|
105
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
106
|
-
`+this.renderer.text(a);i?s+=this.renderer.paragraph({type:"paragraph",raw:
|
|
107
|
-
Please report this to https://github.com/markedjs/marked.`,e){const t="<p>An error occurred:</p><pre>"+
|
|
105
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ke(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:s}){const t=this.parser.parseInline(s),n=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
|
-
${e}`,a,
|
|
109
|
+
${e}`,a,l,c;if(s.image&&i==="openai")return r+=`
|
|
110
110
|
Extract some information.
|
|
111
|
-
`,a=[{name:"check_request",description:"Check request and extract information.",parameters:{type:"object",properties:{prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},size:{type:"string",description:"Choose specified size: auto, 1024x1024, 1536x1024, 1024x1536"},quality:{type:"string",description:"Choose: auto, low, medium, high"},background:{type:"string",description:"Choose: auto, transparent, opaque"},output_format:{type:"string",description:"Choose: png, jpeg, webp"}},required:[]}}],
|
|
111
|
+
`,a=[{name:"check_request",description:"Check request and extract information.",parameters:{type:"object",properties:{prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},size:{type:"string",description:"Choose specified size: auto, 1024x1024, 1536x1024, 1024x1536"},quality:{type:"string",description:"Choose: auto, low, medium, high"},background:{type:"string",description:"Choose: auto, transparent, opaque"},output_format:{type:"string",description:"Choose: png, jpeg, webp"}},required:[]}}],l=await this.builder.send(r,n,t,"",a),l?(c=JSON.parse(l),c):!1;if(s.image){if(r+=`
|
|
112
112
|
|
|
113
113
|
Check the type of the request:
|
|
114
114
|
- Text/Prompt to Image Generation
|
|
@@ -124,148 +124,148 @@ Check the type of the request:
|
|
|
124
124
|
- Edit Area in Image
|
|
125
125
|
- Generate Variation of an Image
|
|
126
126
|
- Describe an image or ask questions about the image
|
|
127
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_image_generation:{type:"boolean",description:"Check if the request asks to create or generate an image based on the prompt."},text_to_2d_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a 2D illustration based on the prompt."},text_to_digital_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a digital illustration based on the prompt."},text_to_book_cover_generation:{type:"boolean",description:"Check if the request asks to create or generate a book cover based on the prompt."},upscale_image:{type:"boolean",description:"Check if the request asks to upscale or enlarge an image."},minimize_image:{type:"boolean",description:"Check if the request asks to minimize (compress) the size of an image."},edit_area_in_image:{type:"boolean",description:"Check if the request asks to edit an image."},describe_image:{type:"boolean",description:"Check if the request is asking to describe an image or asking questions about the image."}},required:[]}}],
|
|
127
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_image_generation:{type:"boolean",description:"Check if the request asks to create or generate an image based on the prompt."},text_to_2d_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a 2D illustration based on the prompt."},text_to_digital_illustration_generation:{type:"boolean",description:"Check if the request asks to create or generate a digital illustration based on the prompt."},text_to_book_cover_generation:{type:"boolean",description:"Check if the request asks to create or generate a book cover based on the prompt."},upscale_image:{type:"boolean",description:"Check if the request asks to upscale or enlarge an image."},minimize_image:{type:"boolean",description:"Check if the request asks to minimize (compress) the size of an image."},edit_area_in_image:{type:"boolean",description:"Check if the request asks to edit an image."},describe_image:{type:"boolean",description:"Check if the request is asking to describe an image or asking questions about the image."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}else if(s.video){if(r+=`
|
|
128
128
|
|
|
129
129
|
Check the type of the request:
|
|
130
130
|
- Image to Video Generation (generate a video based on image)
|
|
131
131
|
- Prompt/text to Video Generation (generate a video based on prompt)
|
|
132
132
|
- Upscale video
|
|
133
133
|
- Add sound to video
|
|
134
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{image_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on image, not prompt."},text_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on prompt, not image."}},required:[]}}],
|
|
134
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{image_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on image, not prompt."},text_to_video_generation:{type:"boolean",description:"Check if the request asked to create or generate a video based on prompt, not image."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}else if(s.audio){if(r+=`
|
|
135
135
|
|
|
136
136
|
Check the type of the request:
|
|
137
137
|
- Prompt/text to Audio Generation (generate sound or audio based on prompt)
|
|
138
138
|
- Text to Speech (generate speech from text)
|
|
139
|
-
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_speech:{type:"boolean",description:"heck if the request is asking to generate speech from text."}},required:[]}}],
|
|
139
|
+
`,a=[{name:"check_request",description:"Check request.",parameters:{type:"object",properties:{text_to_speech:{type:"boolean",description:"heck if the request is asking to generate speech from text."}},required:[]}}],l=await this.builder.send(r,n,t,"",a),!l)return!1;c=JSON.parse(l)}return this.builder.settings.consoleLog&&console.log(c),this.extractInfo(c,i,e)}async extractInfo(e,i,s){const t=this.builder.settings.defaultModels;if(e.text_to_image_generation){const n="You are an assistant",a=`
|
|
140
140
|
Thie is the list of models:
|
|
141
141
|
- ${t.text_to_image_generation[i].join(`
|
|
142
142
|
- `)}
|
|
143
|
-
`,
|
|
143
|
+
`,l=`This is user's request:
|
|
144
144
|
|
|
145
145
|
${s}
|
|
146
146
|
|
|
147
147
|
Check the request and return the details.
|
|
148
|
-
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},width:{type:"number",description:"Return image width to generate, only if specified."},height:{type:"number",description:"Return image height to generate, only if specified."},aspect_ratio:{type:"string",description:"Return the aspect ration, only if specified. Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
148
|
+
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},num_images:{type:"number",description:"The number of images to generate, only if specified."},width:{type:"number",description:"Return image width to generate, only if specified."},height:{type:"number",description:"Return image height to generate, only if specified."},aspect_ratio:{type:"string",description:"Return the aspect ration, only if specified. Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.image_to_video_generation){const n="You are an assistant",a=`
|
|
149
149
|
Thie is the list of models:
|
|
150
150
|
- ${t.image_to_video_generation[i].join(`
|
|
151
151
|
- `)}
|
|
152
|
-
`,
|
|
152
|
+
`,l=`This is user's request:
|
|
153
153
|
|
|
154
154
|
${s}
|
|
155
155
|
|
|
156
156
|
Check the request and return the details.
|
|
157
|
-
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},duration:{type:"number",description:"Return duration of the video to generate."}},required:[]}}],d=await this.builder.send(
|
|
157
|
+
`;let c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},duration:{type:"number",description:"Return duration of the video to generate."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_video_generation){const n="You are an assistant",a=`
|
|
158
158
|
Thie is the list of models:
|
|
159
159
|
- ${t.text_to_video_generation[i].join(`
|
|
160
160
|
- `)}
|
|
161
|
-
`;let
|
|
161
|
+
`;let l=`This is user's request:
|
|
162
162
|
|
|
163
163
|
${s}
|
|
164
164
|
|
|
165
165
|
Check the request and return the details.
|
|
166
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},duration:{type:"number",description:"Return duration of the video to generate. If not explicitely specified, return 5"}},required:[]}}],d=await this.builder.send(
|
|
166
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},duration:{type:"number",description:"Return duration of the video to generate. If not explicitely specified, return 5"}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.minimize_image){let n="You are an assistant",r="",a=`This is user's request:
|
|
167
167
|
|
|
168
168
|
${s}
|
|
169
169
|
|
|
170
170
|
Check the request and return the details.
|
|
171
|
-
`,
|
|
171
|
+
`,l=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:["image_url"]}}],c=await this.builder.send(a,r,n,"",l);if(!c)return!1;let d=JSON.parse(c);return{...e,...d}}else if(e.upscale_image){const n="You are an assistant",a=`
|
|
172
172
|
Thie is the list of models:
|
|
173
173
|
- ${t.upscale_image[i].join(`
|
|
174
174
|
- `)}
|
|
175
|
-
`;let
|
|
175
|
+
`;let l=`This is user's request:
|
|
176
176
|
|
|
177
177
|
${s}
|
|
178
178
|
|
|
179
179
|
Check the request and return the details.
|
|
180
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:[]}}],d=await this.builder.send(
|
|
180
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.describe_image){const n="You are an assistant",a=`
|
|
181
181
|
Thie is the list of models:
|
|
182
182
|
- ${t.describe_image[i].join(`
|
|
183
183
|
- `)}
|
|
184
|
-
`;let
|
|
184
|
+
`;let l=`This is user's request:
|
|
185
185
|
|
|
186
186
|
${s}
|
|
187
187
|
|
|
188
188
|
Check the request and return the details.
|
|
189
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."}},required:["image_url","prompt"]}}],d=await this.builder.send(
|
|
189
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."}},required:["image_url","prompt"]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.edit_area_in_image){const n="You are an assistant",r=t.edit_area_in_image[i];let a="";r&&(a=`
|
|
190
190
|
Thie is the list of models:
|
|
191
191
|
- ${r.join(`
|
|
192
192
|
- `)}
|
|
193
|
-
`);let
|
|
193
|
+
`);let l=`This is user's request:
|
|
194
194
|
|
|
195
195
|
${s}
|
|
196
196
|
|
|
197
197
|
Check the request and return the details.
|
|
198
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},num_images:{type:"number",description:"The number of images to generate."}},required:[]}}],d=await this.builder.send(
|
|
198
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},image_url:{type:"string",description:"Return user's image reference URL (if JPG or PNG image URL is specified)."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the video."},num_images:{type:"number",description:"The number of images to generate."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_2d_illustration_generation){const n="You are an assistant",a=`
|
|
199
199
|
Thie is the list of models:
|
|
200
200
|
- ${t.text_to_2d_illustration_generation[i].join(`
|
|
201
201
|
- `)}
|
|
202
|
-
`;let
|
|
202
|
+
`;let l=`This is user's request:
|
|
203
203
|
|
|
204
204
|
${s}
|
|
205
205
|
|
|
206
206
|
Check the request and return the details.
|
|
207
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
207
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_digital_illustration_generation){const n="You are an assistant",a=`
|
|
208
208
|
Thie is the list of models:
|
|
209
209
|
- ${t.text_to_digital_illustration_generation[i].join(`
|
|
210
210
|
- `)}
|
|
211
|
-
`;let
|
|
211
|
+
`;let l=`This is user's request:
|
|
212
212
|
|
|
213
213
|
${s}
|
|
214
214
|
|
|
215
215
|
Check the request and return the details.
|
|
216
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
216
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration"'},style_id:{type:"string",description:"Return specified style_id for generating the image."},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_book_cover_generation){const n="You are an assistant",a=`
|
|
217
217
|
Thie is the list of models:
|
|
218
218
|
- ${t.text_to_book_cover_generation[i].join(`
|
|
219
219
|
- `)}
|
|
220
|
-
`;let
|
|
220
|
+
`;let l=`This is user's request:
|
|
221
221
|
|
|
222
222
|
${s}
|
|
223
223
|
|
|
224
224
|
Check the request and return the details.
|
|
225
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration/cover"'},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(
|
|
225
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},prompt:{type:"string",description:"Return user's instruction/prompt for generating the image."},style:{type:"string",description:'Return "digital_illustration/cover"'},num_images:{type:"number",description:"The number of images to generate."},width:{type:"number",description:"Return image width to generate."},height:{type:"number",description:"Return image height to generate."},aspect_ratio:{type:"string",description:"Example: 3:4, 16:9, etc"},color1_red:{type:"string",description:"Return red part from color1 rgb."},color1_green:{type:"string",description:"Return green part from color1 rgb."},color1_blue:{type:"string",description:"Return blue part from color1 rgb."},color2_red:{type:"string",description:"Return red part from color2 rgb."},color2_green:{type:"string",description:"Return green part from color2 rgb."},color2_blue:{type:"string",description:"Return blue part from color2 rgb."},color3_red:{type:"string",description:"Return red part from color3 rgb."},color3_green:{type:"string",description:"Return green part from color3 rgb."},color3_blue:{type:"string",description:"Return blue part from color3 rgb."},color4_red:{type:"string",description:"Return red part from color4 rgb."},color4_green:{type:"string",description:"Return green part from color4 rgb."},color4_blue:{type:"string",description:"Return blue part from color4 rgb."},color5_red:{type:"string",description:"Return red part from color5 rgb."},color5_green:{type:"string",description:"Return green part from color5 rgb."},color5_blue:{type:"string",description:"Return blue part from color5 rgb."}},required:[]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}else if(e.text_to_speech){const n="You are an assistant",a=`
|
|
226
226
|
Thie is the list of models:
|
|
227
227
|
- ${t.text_to_speech[i].join(`
|
|
228
228
|
- `)}
|
|
229
|
-
`;let
|
|
229
|
+
`;let l=`This is user's request:
|
|
230
230
|
|
|
231
231
|
${s}
|
|
232
232
|
|
|
233
233
|
Check the request and return the details.
|
|
234
|
-
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},text:{type:"string",description:"Return text or prompt to convert to speech."},voice:{type:"string",description:"Return the voice reference to use."},speed:{type:"string",description:"Return the speed."}},required:["text"]}}],d=await this.builder.send(
|
|
234
|
+
`,c=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the chosen model name from the model list."},text:{type:"string",description:"Return text or prompt to convert to speech."},voice:{type:"string",description:"Return the voice reference to use."},speed:{type:"string",description:"Return the speed."}},required:["text"]}}],d=await this.builder.send(l,a,n,"",c);if(!d)return!1;let o=JSON.parse(d);return{...e,...o}}return!1}async checkModel(e){let i="You are an assistant",s="",t=`This is the information:
|
|
235
235
|
|
|
236
236
|
${e}
|
|
237
237
|
|
|
238
238
|
Check the information and return the details.
|
|
239
|
-
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let
|
|
239
|
+
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let l={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Fal,{signal:this.builder.mediaSignal,method:"POST",headers:l,body:JSON.stringify(e)});let c=await n.text();try{r=JSON.parse(c)}catch{return{mediaGenerated:!1,status:"error",message:c}}if(this.builder.output.push(r),r.error)return this.builder.settings.consoleLog&&console.log(r.error),{mediaGenerated:!1,status:"error",message:r.error};{const d=r.data;let o="",h="",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
|
-
<source src="${
|
|
242
|
+
<source src="${b.url}" type="video/mp4">
|
|
243
243
|
Your browser does not support the video tag.
|
|
244
244
|
</video>
|
|
245
245
|
</p>
|
|
246
|
-
`,h+=``):p==="wav"||p==="mp3"?(o+=`
|
|
247
247
|
<p class="responsive-audio">
|
|
248
248
|
<audio controls>
|
|
249
|
-
<source src="${
|
|
249
|
+
<source src="${b.url}" type="audio/mpeg">
|
|
250
250
|
Your browser does not support the audio tag.
|
|
251
251
|
</audio>
|
|
252
252
|
</p>
|
|
253
|
-
`,h+=``):(o+=`
|
|
254
254
|
<div>
|
|
255
|
-
<img src="${
|
|
255
|
+
<img src="${b.url}" />
|
|
256
256
|
<div>
|
|
257
|
-
<a class="link-view" href="${
|
|
258
|
-
<a class="link-download" href="${
|
|
257
|
+
<a class="link-view" href="${b.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
258
|
+
<a class="link-download" href="${b.url}" download>${this.out("Download")}</a>
|
|
259
259
|
</div>
|
|
260
260
|
</div>
|
|
261
|
-
`,h+=``,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">
|
|
265
265
|
Your browser does not support the video tag.
|
|
266
266
|
</video>
|
|
267
267
|
</p>
|
|
268
|
-
`,n+=``,r.push(d.url),a.push(d.file_url)):
|
|
268
|
+
`,n+=``,r.push(d.url),a.push(d.file_url)):l==="wav"||l==="mp3"?(t+=`
|
|
269
269
|
<p class="responsive-audio">
|
|
270
270
|
<audio controls>
|
|
271
271
|
<source src="${d.url}" type="audio/mpeg">
|
|
@@ -283,22 +283,22 @@ Check the information and return the details.
|
|
|
283
283
|
`,n+=``,r.push(d.url),a.push(d.file_url),c=!0)}),c&&(t=`<div class="image-container">${t}</div>`)}else typeof e=="string"&&(t=`
|
|
284
284
|
<p>
|
|
285
285
|
${e}
|
|
286
|
-
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let u=this.validateModel(e.model,r,"text_to_image_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.aspect_ratio||"16:9",o=e.num_images||1;o>4&&(o=4),t={prompt:c,aspect_ratio:d,num_outputs:o},n.model=u,n.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let u=this.validateModel(e.model,o,"edit_area_in_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o,!0);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let g=h[e.image_url],y=h[e.image_url+"_mask"];if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Image mask not found.")};t={prompt:c,image:g,mask:y},n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let u=this.validateModel(e.model,r,"text_to_digital_illustration_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.width||1280,o=e.height||768;e.num_images,t={prompt:c,size:`${d}x${o}`,style:"digital_illustration"},n.model=u,n.customData=this.builder.settings.customData}else if(e.upscale_image){let u=this.validateModel(e.model,d,"upscale_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let d="replicate";const o=await this.builder.upload.getInputURLs(d);if(o.error)return{mediaGenerated:!1,status:"error",message:o.error};let h=o[e.image_url];if(!h)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:h},n.model=u,n.customData=this.builder.settings.customData}else if(e.describe_image){let u=this.validateModel(e.model,o,"describe_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let g=h[e.image_url];if(!g)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:g,prompt:`${c}. No talk. Answer only.`},n.model=u,n.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let u=this.validateModel(e.model,o,"image_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt||"stunning video",d=e.duration||5;d>10&&(d=5);let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let g=h[e.image_url];if(!g)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};u==="kwaivgi/kling-v1.6-pro"&&(t={start_image:g,prompt:c,duration:d}),u==="kwaivgi/kling-v1.6-standard"&&(t={start_image:g,prompt:c,duration:d}),u==="minimax/video-01-live"&&(t={first_frame_image:g,prompt:c}),u==="luma/ray"&&(t={start_image_url:g,prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let u=this.validateModel(e.model,r,"text_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.duration||5;d>10&&(d=5),u==="kwaivgi/kling-v1.6-standard"&&(t={prompt:c,duration:d}),u==="minimax/video-01"&&(t={prompt:c}),u==="luma/ray"&&(t={prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_speech){let u=this.validateModel(e.model,r,"text_to_speech");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};t={text:e.text,voice:e.voice||"af_nicole",speed:parseFloat(e.speed)||1},n.model=u,n.customData=this.builder.settings.customData}if(n.model.indexOf(":")!==-1){const c=n.model.split(":")[1];n.version=c;let d=this.builder.settings.replicateEndpoint1;n.endpoint=d,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 1")}else{let u=this.builder.settings.replicateEndpoint2;u=u.replace("{MODEL}",n.model),n.endpoint=u,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 2")}this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);let a=!1;if(this.builder.settings.generateMediaUrl_Replicate&&(a=!0),a){let u=this.builder.settings.generateMediaUrl_Replicate;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(n)})).json();if(h.ok){if(c=h.data.id,!c)return{mediaGenerated:!1,status:"error",message:h.data&&h.data.detail}}else return{mediaGenerated:!1,status:"error",message:h.error};const g=this.waitingReplicate(n,c,i,s);return this.builder.isMediaGenerating=!1,g}else{let u=this.builder.settings.generateMediaUrl;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl.")};let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(n)})).json();if(this.builder.isMediaGenerating=!1,o.error)return this.builder.settings.consoleLog&&console.log(o.error),{mediaGenerated:!1,status:"error",message:o.error};{const h=o.data;let g=this.renderResult(h,i,s);return{mediaGenerated:!0,status:"success",markdown:g.markdown,output:g.output,output2:g.output2}}}}async generateOpenAI(e,i,s){let t,n={},a=this.validateModel(e.model,"openai","image_generation"),u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};const c=new FormData;c.append("customData",JSON.stringify(this.builder.settings.customData)),c.append("model",a),c.append("prompt",u);let d=!1,o=this.builder.getFormValues();for(const b of o){if(b.value instanceof FileList&&b.type==="multifile"){const _=b.value;if(_.length>0)for(const O of _)c.append("file[]",O),d=!0}if(b.value instanceof FileList&&b.type==="file"){const _=b.value;if(_.length>0){const O=_[0];c.append("file[]",O),d=!0}}if(typeof b.value=="string"&&b.value.indexOf("base64")!==-1){let _=b.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/,"");c.append("mask",_)}}if(this.builder.selectedFiles&&this.builder.selectedFiles.length>0)for(let b=0;b<this.builder.selectedFiles.length;b++){const _=this.builder.selectedFiles[b];c.append("file[]",_),d=!0}let h,g=e.size||"auto",y=e.quality||"auto",E=e.num_images||1;if(d){c.append("size",g),c.append("n",E),c.append("quality",y),t={prompt:u,size:g,quality:y,n:E},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n);let b=this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;h=await fetch(b,{method:"POST",body:c})}else{let b=e.background||"auto",_=e.output_format||"png";t={prompt:u,background:b,output_format:_,size:g,quality:y,n:E},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_OpenAI_CreateImage;let m={"Content-Type":"application/json",...this.builder.settings.headers};h=await fetch(O,{signal:this.builder.mediaSignal,method:"POST",headers:m,body:JSON.stringify(n)})}const M=await h.json();this.builder.settings.consoleLog&&console.log(M),this.builder.isMediaGenerating=!1;const w=M.data;this.builder.output.push(M);let C=this.renderResult(w,i,s);return{mediaGenerated:!0,status:"success",markdown:C.markdown,output:C.output,output2:C.output2}}async generateGoogle(e,i,s){let t,n={},a=this.validateModel(e.model,"google","edit_area_in_image");if(!a)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let c=[];c.push({text:u});let d=this.builder.getFormValues();if(!(d&&Object.keys(d).length===0)){for(const w of d)if(w.value instanceof FileList&&w.type==="multifile"){const C=w.value;if(C.length>0)for(const b of C){const _=await new Promise((O,m)=>{const k=new FileReader;k.onload=R=>{const V=R.target.result.split(",")[1];O(V)},k.onerror=m,k.readAsDataURL(b)});c.push({inlineData:{mimeType:"image/png",data:_}})}}}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 y=await(await fetch(o,{signal:this.builder.mediaSignal,method:"POST",headers:h,body:JSON.stringify(n)})).json();this.builder.settings.consoleLog&&console.log(y),this.builder.isMediaGenerating=!1;const E=y.data;let M=this.renderResult(E,i,s);return{mediaGenerated:!0,status:"success",markdown:M.markdown,output:M.output,output2:M.output2}}async generateFal(e,i,s){let t="fal",n,r={};if(e.text_to_image_generation){let y=this.validateModel(e.model,t,"text_to_image_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let M=e.width||1280,w=e.height||768,C=e.aspect_ratio,b=e.num_images||1;if(b>4&&(b=4),C){let{w:ne,h:se}=this.getDimension(C);M=ne,w=se}let _=e.color1_red,O=e.color1_green,m=e.color1_blue,k=e.color2_red,R=e.color2_green,V=e.color2_blue,N=e.color3_red,Y=e.color3_green,G=e.color3_blue,F=e.color4_red,I=e.color4_green,T=e.color4_blue,A=e.color5_red,$=e.color5_green,W=e.color5_blue,D=[];_&&O&&m&&!(_==="0"&&O==="0"&&m==="0")&&D.push({r:_,g:O,b:m}),k&&R&&V&&!(k==="0"&&R==="0"&&V==="0")&&D.push({r:k,g:R,b:V}),N&&Y&&G&&!(N==="0"&&Y==="0"&&G==="0")&&D.push({r:N,g:Y,b:G}),F&&I&&T&&!(F==="0"&&I==="0"&&T==="0")&&D.push({r:F,g:I,b:T}),A&&$&&W&&!(A==="0"&&$==="0"&&W==="0")&&D.push({r:A,g:$,b:W});let Q=await(async()=>{let ne=[],se=this.builder.getFormValues();for(const le of se)if(le.value instanceof FileList&&le.type==="multifile"){const de=le.value;if(de.length>0){let oe=0;for(const xe of de){oe++;const je=new FormData;je.append("file",xe),je.append("customData",this.builder.settings.customData);let Le=this.builder.settings.uploadMediaUrl_Fal;const _e=await(await fetch(Le,{method:"POST",body:je})).json();if(_e.ok){const ve=_e.url;ne.push(ve),this.builder.filesUploaded["file_"+oe]=ve}}}}return ne})();n={prompt:E,image_size:{width:M,height:w},num_images:b},y.indexOf("gemini")!==-1&&(n={prompt:E,input_image_urls:Q}),y==="fal-ai/ideogram/v2a"&&(C=this.getClosestAspectRatio(M,w),n={prompt:E,aspect_ratio:C,num_images:b}),y.indexOf("recraft")!==-1&&(n={prompt:E,image_size:{width:M,height:w},num_images:b,colors:D}),r.model=y,r.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let y=this.validateModel(e.model,t,"edit_area_in_image");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)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 w=await this.builder.upload.getInputURLs(t);if(w.error)return{mediaGenerated:!1,status:"error",message:w.error};let C=w[e.image_url],b=w[e.image_url+"_mask"];if(n={image_url:C,mask_url:b,prompt:E},r.model=y,!b){n={image_url:C,prompt:E};let _=this.validateModel(e.model,t,"edit_image");r.model=_}r.customData=this.builder.settings.customData}else if(e.text_to_2d_illustration_generation){let y=this.validateModel(e.model,t,"text_to_2d_illustration_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let M=e.width||1280,w=e.height||768,C=e.num_images||1;C>4&&(C=4);let b=e.style||"any",_=e.style_id||this.builder.settings._2dIllustrationStyleId,O=e.color1_red,m=e.color1_green,k=e.color1_blue,R=e.color2_red,V=e.color2_green,N=e.color2_blue,Y=e.color3_red,G=e.color3_green,F=e.color3_blue,I=e.color4_red,T=e.color4_green,A=e.color4_blue,$=e.color5_red,W=e.color5_green,D=e.color5_blue,J=[];O&&m&&k&&!(O==="0"&&m==="0"&&k==="0")&&J.push({r:O,g:m,b:k}),R&&V&&N&&!(R==="0"&&V==="0"&&N==="0")&&J.push({r:R,g:V,b:N}),Y&&G&&F&&!(Y==="0"&&G==="0"&&F==="0")&&J.push({r:Y,g:G,b:F}),I&&T&&A&&!(I==="0"&&T==="0"&&A==="0")&&J.push({r:I,g:T,b:A}),$&&W&&D&&!($==="0"&&W==="0"&&D==="0")&&J.push({r:$,g:W,b:D}),n={prompt:E,image_size:{width:M,height:w},num_images:C,style:b,style_id:_,colors:J},r.model=y,r.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let y=this.validateModel(e.model,t,"text_to_digital_illustration_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let M=e.width||1280,w=e.height||768,C=e.num_images||1;C>4&&(C=4);let b=e.style||"digital_illustration",_=e.color1_red,O=e.color1_green,m=e.color1_blue,k=e.color2_red,R=e.color2_green,V=e.color2_blue,N=e.color3_red,Y=e.color3_green,G=e.color3_blue,F=e.color4_red,I=e.color4_green,T=e.color4_blue,A=e.color5_red,$=e.color5_green,W=e.color5_blue,D=[];_&&O&&m&&!(_==="0"&&O==="0"&&m==="0")&&D.push({r:_,g:O,b:m}),k&&R&&V&&!(k==="0"&&R==="0"&&V==="0")&&D.push({r:k,g:R,b:V}),N&&Y&&G&&!(N==="0"&&Y==="0"&&G==="0")&&D.push({r:N,g:Y,b:G}),F&&I&&T&&!(F==="0"&&I==="0"&&T==="0")&&D.push({r:F,g:I,b:T}),A&&$&&W&&!(A==="0"&&$==="0"&&W==="0")&&D.push({r:A,g:$,b:W}),n={prompt:E,image_size:{width:M,height:w},num_images:C,style:b,colors:D},r.model=y,r.customData=this.builder.settings.customData}else if(e.text_to_book_cover_generation){let y=this.validateModel(e.model,t,"text_to_book_cover_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let M=e.width||1024,w=e.height||1365,C=e.num_images||1;C>4&&(C=1);let b="digital_illustration/cover",_=e.color1_red,O=e.color1_green,m=e.color1_blue,k=e.color2_red,R=e.color2_green,V=e.color2_blue,N=e.color3_red,Y=e.color3_green,G=e.color3_blue,F=e.color4_red,I=e.color4_green,T=e.color4_blue,A=e.color5_red,$=e.color5_green,W=e.color5_blue,D=[];_&&O&&m&&!(_==="0"&&O==="0"&&m==="0")&&D.push({r:_,g:O,b:m}),k&&R&&V&&!(k==="0"&&R==="0"&&V==="0")&&D.push({r:k,g:R,b:V}),N&&Y&&G&&!(N==="0"&&Y==="0"&&G==="0")&&D.push({r:N,g:Y,b:G}),F&&I&&T&&!(F==="0"&&I==="0"&&T==="0")&&D.push({r:F,g:I,b:T}),A&&$&&W&&!(A==="0"&&$==="0"&&W==="0")&&D.push({r:A,g:$,b:W}),n={prompt:E,image_size:{width:M,height:w},num_images:C,style:b,colors:D},r.model=y,r.customData=this.builder.settings.customData}else if(e.upscale_image){let y=this.validateModel(e.model,t,"upscale_image");if(!y)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 M=await this.builder.upload.getInputURLs(t);if(M.error)return{mediaGenerated:!1,status:"error",message:M.error};let w=M[e.image_url];if(!w)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:w,upscale_factor:2},r.model=y,r.customData=this.builder.settings.customData}else if(e.describe_image){let y=this.validateModel(e.model,t,"describe_image");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)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 w=await this.builder.upload.getInputURLs(t);if(w.error)return{mediaGenerated:!1,status:"error",message:w.error};let C=w[e.image_url];if(!C)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:C,prompt:`${E}. No talk. Answer only.`},r.model=y,r.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let y=this.validateModel(e.model,t,"image_to_video_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;E=e.prompt||"stunning video";let M=e.duration||5;M>10&&(M=5);const w=await this.builder.upload.getInputURLs(t);if(w.error)return{mediaGenerated:!1,status:"error",message:w.error};let C=w[e.image_url];if(!C)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};n={prompt:E,image_url:C,duration:M,aspect_ratio:"16:9"},y.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=y,r.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let y=this.validateModel(e.model,t,"text_to_video_generation");if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let E=e.prompt;if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let M=e.duration||5;M>10&&(M=5),n={prompt:E,duration:M,aspect_ratio:"16:9"},y.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=y,r.customData=this.builder.settings.customData}else if(e.text_to_speech){let y=this.validateModel(e.model,t,"text_to_speech");if(!y)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=y,r.customData=this.builder.settings.customData}let a=`https://queue.fal.run/${r.model}`;r.endpoint=a,r.payload=n,this.builder.payloads.push(r),this.builder.settings.consoleLog&&console.log(r);let u=this.builder.settings.generateMediaUrl_Fal;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Fal.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(r)})).json();if(h.ok)c=h.request_id;else return{mediaGenerated:!1,status:"error",message:h.error};const g=this.waitingFal(r,c,i,s);return this.builder.isMediaGenerating=!1,g}validateModel(e,i,s){const n=this.builder.settings.defaultModels[s][i];return this.builder.settings.modelFallback?n.length===1?(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0]):e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):n.length>=1?(this.builder.settings.consoleLog&&console.log("Use default: "+n[0]),n[0]):!1:e?e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):!1:(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0])}async generate_GoogleMediaByJSON(e,i,s,t){this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let n;if(e.trim().startsWith("{"))try{n=JSON.parse(e)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}let r=i.trim();if(!r)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let a={};a.model=r,a.customData=this.builder.settings.customData,a.payload=n,this.builder.payloads.push(a),this.builder.settings.consoleLog&&console.log(a);const u=this.builder.settings.generateMediaUrl_Google;let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(a)})).json();this.builder.settings.consoleLog&&console.log(o);const h=o.data;let g=this.renderResult(h,s,t);return{mediaGenerated:!0,status:"success",markdown:g.markdown,output:g.output,output2:g.output2}}async uploadMultiple(){let e=[],i=this.builder.getFormValues();for(const s of i)if(s.value instanceof FileList&&s.type==="multifile"){const t={};if(t.name=s.name,t.files=[],this.builder.selectedFiles&&this.builder.selectedFiles.length>0){const r=[];for(let a=0;a<this.builder.selectedFiles.length;a++){const u=this.builder.selectedFiles[a],c=new FormData;c.append("file",u),c.append("customData",this.builder.settings.customData);let d=this.builder.settings.uploadMediaUrl_Fal;const h=await(await fetch(d,{method:"POST",body:c})).json();if(h.ok){const g=h.url;t.files.push(g),this.builder.filesUploaded["file_"+a]=g}r.push(t)}return r}const n=s.value;if(n.length>0){let r=0;for(const a of n){r++;const u=new FormData;u.append("file",a),u.append("customData",this.builder.settings.customData);let c=this.builder.settings.uploadMediaUrl_Fal;const o=await(await fetch(c,{method:"POST",body:u})).json();if(o.ok){const h=o.url;t.files.push(h),this.builder.filesUploaded["file_"+r]=h}}}e.push(t)}return e}async generate(e,i,s,t,n,r,a){if(s=s||this.builder.settings.defaultMediaGenerationProvider,s==="google"&&e.trim().startsWith("{"))return this.generate_GoogleMediaByJSON(e,i,r,a);this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let u,c=!1,d;if(e.trim().startsWith("{"))try{d=JSON.parse(e),d&&typeof d=="object"&&(c=!0)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}if(c){let o=i.trim();if(!o)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let h=await this.uploadMultiple();((w,C)=>{const b=_=>{if(Array.isArray(_)){const O=_[0],m=C.find(k=>k.name===O);if(m&&_.every(k=>k===O))return m.files;for(let k=0;k<_.length;k++)_[k]=b(_[k])}else if(typeof _=="object"&&_!==null)for(let O in _)_[O]=b(_[O]);return _};return b(w)})(d,h),s||(o.startsWith("fal")?s="fal":s="replicate");const y=w=>typeof w=="object"&&w!==null&&!Array.isArray(w),E=await this.builder.upload.getInputURLs(s);if(E.error)return{mediaGenerated:!1,status:"error",message:E.error};Object.keys(d).forEach(w=>{Object.keys(E).forEach(C=>{if(d[w]===C){let b=E[C];d[w]=b}if(Array.isArray(d[w])){for(let b=0;b<d[w].length;b++)if(d[w][b]===C){let _=E[C];d[w][b]=_}}})}),Object.keys(d).forEach(w=>{let C=d[w];if(y(C))for(const b in C)Object.prototype.hasOwnProperty.call(C,b)&&Object.keys(E).forEach(_=>{if(C[b]===_){let O=E[_];C[b]=O,_===O&&!O.startsWith("http")&&(C[b]="")}});if(Array.isArray(C)){for(let b=0;b<C.length;b++)if(y(C[b]))for(const _ in C[b])Object.prototype.hasOwnProperty.call(C[b],_)&&Object.keys(E).forEach(O=>{if(C[b][_]===O){let m=E[O];C[b][_]=m,O===m&&!m.startsWith("http")&&(C[b][_]="")}});d[w]=[...C.filter(b=>b!=="")]}});let M={};if(M.model=o,M.customData=this.builder.settings.customData,s==="replicate"&&o.indexOf(":")!==-1){const w=o.split(":");M.version=w[1]}if(s==="replicate")if(o.indexOf(":")!==-1){let w=this.builder.settings.replicateEndpoint1;M.endpoint=w,M.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 1")}else{let w=this.builder.settings.replicateEndpoint2;w=w.replace("{MODEL}",M.model),M.endpoint=w,M.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 2")}else if(s==="fal"){let w=`https://queue.fal.run/${M.model}`;M.endpoint=w,M.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD")}return this.builder.payloads.push(M),this.builder.settings.consoleLog&&console.log(M),this.generateMediaByJSON(M,s,r,a)}try{if(u=await this.checkIntent(e,s,n),this.builder.settings.consoleLog&&console.log(u),!u)return{mediaGenerated:!1,status:"aborted",message:this.out("Request aborted.")};if(u.minimize_image){if(!u.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const h=await this.builder.upload.getInputURLs();if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let y={image_url:h[u.image_url]||u.image_url,customData:this.builder.settings.customData};this.builder.payloads.push(y),this.builder.settings.consoleLog&&console.log(y);let E={"Content-Type":"application/json",...this.builder.settings.headers};const w=await(await fetch(this.builder.settings.minimizeImageUrl,{signal:this.builder.mediaSignal,method:"POST",headers:E,body:JSON.stringify(y)})).json();if(this.builder.output.push(w),w.error)return this.builder.settings.consoleLog&&console.log(w.error),this.builder.isMediaGenerating=!1,{mediaGenerated:!1,status:"error",message:w.error};{const C=w.url,b=`
|
|
286
|
+
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let l=this.validateModel(e.model,r,"text_to_image_generation");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.aspect_ratio||"16:9",o=e.num_images||1;o>4&&(o=4),t={prompt:c,aspect_ratio:d,num_outputs:o},n.model=l,n.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let l=this.validateModel(e.model,o,"edit_area_in_image");if(!l)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o,!0);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let 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
|
-
<img src="${
|
|
289
|
+
<img src="${k}" />
|
|
290
290
|
<div>
|
|
291
|
-
<a class="link-view" href="${
|
|
292
|
-
<a class="link-download" href="${
|
|
291
|
+
<a class="link-view" href="${k}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
292
|
+
<a class="link-download" href="${k}" download>${this.out("Download")}</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
</div>`;let
|
|
295
|
+
</div>`;let v=``;return a?(r.innerHTML="",r.remove()):(r.innerHTML=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"/>
|
|
299
299
|
<path d="M18 6l-12 12" /><path d="M6 6l12 12" />
|
|
300
300
|
</svg>`,e.appendChild(s);const t=document.createElement("div");t.className="imagemask-body",e.appendChild(t);const n=document.createElement("div");n.className="imagemask-container",t.appendChild(n);const r=document.createElement("div");r.className="imagemask-controls",t.appendChild(r);const a=document.createElement("label");r.appendChild(a),a.innerHTML=`${this.out("Brush Size")}:
|
|
301
|
-
<input type="range" class="brush-size" min="5" max="100" value="30">`;const
|
|
301
|
+
<input type="range" class="brush-size" min="5" max="100" value="30">`;const l=a.querySelector(".brush-size"),c=document.createElement("button");c.className="btn-undobrush",c.title=this.out("Undo"),c.innerHTML=`
|
|
302
302
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
303
303
|
class="icon-undo">
|
|
304
304
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
@@ -325,10 +325,10 @@ Check the information and return the details.
|
|
|
325
325
|
<path d="M8 20l-4 0l0 -4" /><path d="M4 20l6 -6" />
|
|
326
326
|
<path d="M16 20l4 0l0 -4" /><path d="M14 14l6 6" />
|
|
327
327
|
<path d="M8 4l-4 0l0 4" /><path d="M4 4l6 6" />
|
|
328
|
-
</svg>`,r.appendChild(h);const g=document.createElement("input");g.type="hidden",g.name=this.settings.name,g.className="inp-imagemask",g.value="",t.appendChild(g);const y=document.createElement("canvas");y.className="imagemask";const E=y.getContext("2d",{willReadFrequently:!0}),M=document.createElement("canvas"),w=M.getContext("2d",{willReadFrequently:!0}),C=this.element.querySelector(".inp-imagemask"),b=D=>{const J=document.createElement("canvas"),Q=J.getContext("2d",{willReadFrequently:!0});J.width=D.width,J.height=D.height,Q.clearRect(0,0,D.width,D.height),Q.fillStyle="black",Q.fillRect(0,0,D.width,D.height),Q.drawImage(D,0,0);const ne=J.toDataURL("image/png");let se=document.querySelector(".imagemask-output");se||(se=document.createElement("img"),se.className="imagemask-output",document.body.appendChild(se)),se.src=ne,this.empty||(C.value=ne)};let _=[],O=[];const m=()=>{_.push(M.toDataURL()),_.length>10&&_.shift(),O=[]},k=D=>{const J=new Image;J.src=D,J.onload=()=>{E.clearRect(0,0,y.width,y.height),E.drawImage(J,0,0,y.width,y.height),w.clearRect(0,0,M.width,M.height),w.drawImage(J,0,0,M.width,M.height),b(M)}};y.addEventListener("mousedown",()=>{m()}),c.addEventListener("click",D=>{D.preventDefault(),_.length>0&&(O.push(y.toDataURL()),k(_.pop()))}),d.addEventListener("click",D=>{D.preventDefault(),O.length>0&&(_.push(y.toDataURL()),k(O.pop()))});const R=document.createElement("img");n.appendChild(R),n.appendChild(y),this.loaded=()=>{n.style.display="flex";const D=document.querySelector(".imagemask-controls");D.style.display="flex",e.style.display="flex",Y(),_=[],O=[],E.clearRect(0,0,y.width,y.height),w.clearRect(0,0,M.width,M.height),this.empty=!0,C.value="";try{b(M)}catch{}},R.onload=()=>{this.loaded()};let V=null,N=null;const Y=()=>{y.width>0&&y.height>0&&(V=E.getImageData(0,0,y.width,y.height),N=w.getImageData(0,0,M.width,M.height));const D=R.offsetWidth,J=R.offsetHeight,Q=window.devicePixelRatio||1;y.width=D*Q,y.height=J*Q,E.scale(Q,Q),y.style.width=`${D}px`,y.style.height=`${J}px`;const ne=R.naturalWidth,se=R.naturalHeight;if(M.width=ne*Q,M.height=se*Q,w.scale(Q,Q),M.style.width=`${ne}px`,M.style.height=`${se}px`,V){const le=document.createElement("canvas");le.width=V.width,le.height=V.height,le.getContext("2d").putImageData(V,0,0);const oe=document.createElement("canvas");oe.width=N.width,oe.height=N.height,oe.getContext("2d").putImageData(N,0,0),E.drawImage(le,0,0,V.width,V.height,0,0,y.width,y.height),w.drawImage(oe,0,0,N.width,N.height,0,0,M.width,M.height)}};let G=!1,F=parseInt(u.value,10);u.addEventListener("input",D=>{F=parseInt(D.target.value,10)});const I=D=>{const J=y.getBoundingClientRect();if(D.touches){const Q=D.touches[0];return{x:Q.clientX-J.left,y:Q.clientY-J.top}}return{x:D.clientX-J.left,y:D.clientY-J.top}},T=D=>{G=!0,$(D)},A=()=>{G=!1,E.beginPath(),this.empty=!1,b(M)},$=D=>{if(!G)return;const{x:J,y:Q}=I(D),ne=M.width/y.width,se=M.height/y.height,le=J*ne,de=Q*se;E.fillStyle="rgb(255, 255, 255)",E.beginPath(),E.arc(J,Q,F/2,0,Math.PI*2),E.fill(),w.fillStyle="rgb(255, 255, 255)",w.beginPath(),w.arc(le,de,F/2*ne,0,Math.PI*2),w.fill()};y.addEventListener("mousedown",T),y.addEventListener("mouseup",A),y.addEventListener("mousemove",$),y.addEventListener("touchstart",D=>{T(D),D.preventDefault()},{passive:!1}),y.addEventListener("touchend",D=>{A(),D.preventDefault()}),y.addEventListener("touchmove",D=>{$(D),D.preventDefault()},{passive:!1}),o.addEventListener("click",D=>{D.preventDefault(),m(),E.clearRect(0,0,y.width,y.height),w.clearRect(0,0,M.width,M.height),this.empty=!0,C.value="",b(M)}),window.addEventListener("resize",Y);const W=D=>{D?(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=""),Y()};h.addEventListener("click",D=>{D.preventDefault(),W(!0)}),s.addEventListener("click",D=>{D.preventDefault(),W(!1)}),document.addEventListener("keydown",D=>{D.key==="Escape"&&W(!1)})}}class Cs{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 Ss({lang:this.settings.lang},this),this.upload=new Es({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:g,replicate:y,web:E,openai:M,google:w}=this.settings.templatesConfig;return!E&&h.includes("web")||!w&&h.includes("google")||!M&&h.includes("openai")?!1:!g&&!y?!(h.includes("fal")||h.includes("replicate")):!g&&h.includes("fal")?h.includes("replicate"):!y&&h.includes("replicate")?h.includes("fal"):!0});const r=this.settings.templateFilters,a={all:{desc:this.out("All")},image:{desc:this.out("Image")},video:{desc:this.out("Video")},audio:{desc:this.out("Audio")},web:{desc:this.out("Web")},text:{desc:this.out("Text")}},u=document.createElement("div");u.className="app-filters",e.appendChild(u);const c=document.createElement("ul");c.className="app-list",e.appendChild(c);const d=o=>{let h=t.filter(y=>o==="all"||y.categories.includes(o));const g=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(y=>y.categories.every(E=>g.includes(E))),this.renderList(h,c)};r.forEach(o=>{const h=document.createElement("button");h.textContent=a[o].desc,h.setAttribute("data-value",o),o==="all"&&h.classList.add("active"),h.addEventListener("click",()=>{u.querySelectorAll("button").forEach(y=>y.classList.remove("active")),h.classList.add("active"),d(o)}),u.appendChild(h)}),d("all")}}async selectFile(e){const i=this.element.querySelector(".file-input-wrapper");if(!i)return;const s=i.querySelector('input[type="file"]');if(!s||!this.acceptsImagesOnly(s))return;let t;e.startsWith("http")?t=this.settings.viewFileUrl+"?url="+e:t=e;const r=await(await fetch(t)).blob(),a=new File([r],e.split("/").pop(),{type:r.type});this.element.querySelector(".div-selected-preview")||(this.selectedFiles=[]),s&&s.hasAttribute("multiple")?this.selectedFiles.some(d=>d.name===a.name)||this.selectedFiles.push(a):this.selectedFiles=[a],this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),i.closest(".image-mask")&&this.objImageMask&&this.objImageMask.loadImage(a)}setSelectedFiles(e){this.selectedFiles=e;const i=this.element.querySelector('input[type="file"]');i&&i.removeAttribute("required")}renderSelectedFiles(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;let i=this.element.querySelector(".div-selected-preview");i?i.innerHTML="":(i=document.createElement("div"),i.classList.add("div-selected-preview"),e.appendChild(i)),this.clearFileInput(),this.selectedFiles&&this.selectedFiles.forEach((s,t)=>{const n=document.createElement("div"),r=document.createElement("img");r.src=URL.createObjectURL(s);const a=document.createElement("button");a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
328
|
+
</svg>`,r.appendChild(h);const 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
|
|
331
|
-
${
|
|
330
|
+
</svg>`,a.addEventListener("click",()=>{this.selectedFiles.splice(t,1),this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),e.closest(".image-mask")&&this.objImageMask&&this.objImageMask.clearImage()}),n.appendChild(r),n.appendChild(a),i.appendChild(n)})}clearSelectedFiles(){this.selectedFiles=[],this.setSelectedFiles(this.selectedFiles);let e=this.element.querySelector(".div-selected-preview");e&&(e.innerHTML="")}clearFileInput(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;const i=e.querySelector('input[type="file"]');if(!i)return;try{if(i.value="",i.files&&i.files.length>0){const l=new DataTransfer;i.files=l.files}}catch{}const s=e.querySelector(".file-drop-info-highlight");s&&(s.innerHTML="");const t=e.querySelector(".img-preview");t&&t.remove();const n=e.querySelector(".file-preview-container");n&&(n.innerHTML="");const r=e.querySelector(".btn-clearphoto");r&&r.click();const a=this.element.querySelector('input[type="file"]');a&&a.removeAttribute("required")}acceptsImagesOnly(e){const i=(e.getAttribute("accept")||"").split(",").map(s=>s.trim());return i.length===0?!1:i.every(s=>s.startsWith("image/")||s==="image/*")}renderList(e,i){i.innerHTML="",e.forEach(s=>{if(s.name){const t=document.createElement("li");i.appendChild(t);const n=document.createElement("a");n.setAttribute("href","#");let r=this.settings.assetsFolder,a=s.form.thumbnail,l="";if(r&&a){let h=r+a;l=`<img class="thumbnail" src="${h}" alt="${s.name}" />`,s.form.thumbnailFit&&(l=`<img class="thumbnail" style="object-fit:${s.form.thumbnailFit}" src="${h}" alt="${s.name}" />`)}const c=document.createElement("div");c.className="div-template-buttons";let d=!1,o=!1;if(this.settings.templateButtons&&this.settings.templateButtons.viewButton&&this.settings.templateButtons.viewButton.text){const h=document.createElement("button");h.className="btn-template-view",h.innerText=this.out(this.settings.templateButtons.viewButton.text),c.appendChild(h),h.addEventListener("click",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
|
+
${l}
|
|
332
332
|
<div class="card-text">
|
|
333
333
|
<div class="title">${s.name}</div>
|
|
334
334
|
<div class="description">${s.form.description}</div>
|
|
@@ -344,7 +344,7 @@ Check the information and return the details.
|
|
|
344
344
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
|
|
345
345
|
</svg>
|
|
346
346
|
<span>${this.out("Clear")}</span>
|
|
347
|
-
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const
|
|
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 u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}else if(window.innerHeight+window.scrollY>s)e.style.position="",e.style.top="";else{const u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}e.parentNode.offsetWidth!==0&&(e.style.width=`${e.parentNode.offsetWidth}px`)};this._scrollListener=n;let r;this._resizeListener=()=>{r&&clearTimeout(r),r=setTimeout(()=>{let a=null;const u=()=>{const c=e.offsetTop;c===a?(t(),n()):(a=c,requestAnimationFrame(u))};u()},200)},t(),n(),i?i.addEventListener("scroll",n):window.addEventListener("scroll",n),window.addEventListener("resize",this._resizeListener)}view(e){if(!e)return;let i;try{i=JSON.parse(e)}catch{console.log("Invalid JSON Form.");return}this.json=i,this.inputListener=()=>{clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)},300)},this.changeListener=()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)};let s;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}s=document.querySelector(this.settings.previewSelector)}else s=this.element;if(s){if(s.classList.remove("hidden"),s.classList.add("formview-container"),s.classList.add("fb-ui"),s.innerHTML="",!(i.hideHeader||!1)){const o=document.createElement("div");o.className="form-header",s.appendChild(o);const h=document.createElement("h1");h.className="form-title",h.innerText=i.title||this.out("Your Form Title Here"),o.appendChild(h);const g=document.createElement("p");g.className="form-desc",g.innerText=i.description||this.out("Your Description Here"),o.appendChild(g)}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 w=document.createElement("div");w.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(w.style.height=o.spacerHeight+"px"),o.displayInOutput||r.appendChild(w);return}if(o.type==="separator"){const w=document.createElement("hr");w.style.borderTopColor=o.color,o.displayInOutput||r.appendChild(w);return}if(o.type==="html"){if(o.html){const w=document.createElement("div");w.innerHTML=o.html,o.displayInOutput||r.appendChild(w)}return}if(o.type==="heading"){const w=document.createElement(o.heading||"h2");w.innerHTML=o.headingText||this.out("Your Heading Here!"),o.displayInOutput||r.appendChild(w);return}if(o.type==="paragraph"){const w=document.createElement("p");w.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),o.displayInOutput||r.appendChild(w);return}if(o.type==="media"){if(o.tag==="video"){const w=document.createElement("video");w.style.width="100%",w.style.height="auto",w.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",w.appendChild(h),o.displayInOutput||r.appendChild(w)}else if(o.tag==="audio"){const w=document.createElement("audio");w.controls=!0;let C=document.createElement("source");C.src=o.url,C.type="audio/mp3",w.appendChild(C),o.displayInOutput||r.appendChild(w)}else if(o.tag==="img"){const w=document.createElement("img");w.src=o.url,w.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(w)}return}if(o.type==="image"){const w=document.createElement("img");w.src=o.url,w.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(w);return}if(o.type==="video"){const w=document.createElement("video");w.style.width="100%",w.style.height="auto",w.controls=!0;let C=document.createElement("source");C.src=o.url,C.type="video/mp4",w.appendChild(C),o.displayInOutput||r.appendChild(w);return}if(o.type==="audio"){const w=document.createElement("audio");w.controls=!0;let C=document.createElement("source");C.src=o.url,C.type="audio/mp3",w.appendChild(C),o.displayInOutput||r.appendChild(w);return}const g=document.createElement("div");g.className="form-field",o.type==="hidden"&&(g.className="hidden"),o.displayInOutput||r.appendChild(g),o.type==="color"&&g.classList.add("field-color");const y=o.type;let E=o.name;if(r.querySelector(`[name="${E}"]`)&&(a++,E=E+"_"+a),y==="short-text"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`short_text_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("input");b.id=`short_text_label_${w}`,b.type="text",b.name=E,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="long-text"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`long_text_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("textarea");b.id=`long_text_label_${w}`,b.name=E,b.value=o.value||"",b.className="inp-base",b.style.height=o.height+"px",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="number"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`number_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("input");b.id=`number_label_${w}`,b.type="number",b.name=E,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="slider"){g.classList.add("input-slider");let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`number_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const V=document.createElement("div");V.className="field-note",V.innerHTML=o.fieldNote,g.appendChild(V)}const b=document.createElement("div");b.className="slider-container",g.appendChild(b);const _=document.createElement("div");_.className="slider-values",b.appendChild(_);const O=document.createElement("span");_.appendChild(O),O.innerText=o.minValue;const m=document.createElement("span");_.appendChild(m),m.innerText=o.maxValue;const k=document.createElement("input");k.id=`number_label_${w}`,k.type="range",k.name=E,k.setAttribute("min",o.minValue),k.setAttribute("max",o.maxValue),k.setAttribute("step",o.step),k.setAttribute("value",o.value||0),b.appendChild(k);const R=document.createElement("div");R.className="current-value",b.appendChild(R),b.querySelector(".current-value").textContent=o.value||0,k.addEventListener("input",()=>{b.querySelector(".current-value").textContent=k.value})}if(y==="select"){let w=this.getId();const C=document.createElement("div");if(C.id=`radio_group_label_${w}`,C.className="field-label-normal",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`radio_group_label_${w}`),b.setAttribute("role","group"),b.className="div-options",g.appendChild(b),o.choices&&o.choices.forEach((_,O)=>{let m=_;o.choicesText&&(m=o.choicesText[O]||_);const k=document.createElement("label");k.setAttribute("for",`${w}_${O}`),k.className="option-label",b.appendChild(k);const R=document.createElement("input");R.type="radio",R.className="peer",R.id=`${w}_${O}`,R.name=E,R.value=_,k.appendChild(R),O===o.selected&&(R.checked=!0);const V=document.createElement("span");V.className="peer-span-rounded",k.appendChild(V);const N='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';V.innerHTML=N,O===0&&o.isRequired&&R.setAttribute("required","required");const Y=document.createElement("span");Y.innerText=m,k.appendChild(Y),R.addEventListener("change",this.changeListener)}),o.showOtherItem){const _=document.createElement("label");_.setAttribute("for",w+"_other"),_.className="option-label",b.appendChild(_);const O=document.createElement("input");O.type="radio",O.className="peer",O.id=w+"_other",O.name=E,O.value="other",_.appendChild(O);const m=document.createElement("span");m.className="peer-span-rounded",_.appendChild(m);const k='<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=k;const R=document.createElement("span");R.innerText=o.otherText,_.appendChild(R);const V=document.createElement("div");g.appendChild(V);const N=document.createElement("input");N.type="text",N.name=E+"_other",N.className="inp-base",V.appendChild(N),O.addEventListener("change",this.changeListener),N.addEventListener("input",this.inputListener)}}if(y==="multi-select"){let w=this.getId();const C=document.createElement("div");if(C.id=`checkbox_group_label_${w}`,C.className="field-label-normal",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`checkbox_group_label_${w}`),b.setAttribute("role","group"),b.className="div-options",g.appendChild(b),o.choices&&o.choices.forEach((_,O)=>{let m=_;o.choicesText&&(m=o.choicesText[O]||_);const k=document.createElement("label");k.setAttribute("for",`${w}_${O}`),k.className="option-label",b.appendChild(k);const R=document.createElement("input");R.type="checkbox",R.className="peer",R.id=`${w}_${O}`,R.name=E+"[]",R.value=_,k.appendChild(R);const V=document.createElement("span");V.className="peer-span-square",k.appendChild(V);const N=`<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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,be.appendChild(ye),ye.addEventListener("click",ae=>{const qe=ye.closest(".image-item");qe&&qe.remove(),(x=>{const f=new DataTransfer,S=O.files;Array.from(S).forEach(q=>{q!==x&&f.items.add(q)}),O.files=f.files})(X);const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),ae.preventDefault(),ae.stopImmediatePropagation()}),X.type.startsWith("image/")){const ae=new FileReader;ae.onload=function(qe){let l=document.createElement("img");l.className="img-preview",ge.appendChild(l),l.src=qe.target.result},ae.readAsDataURL(X)}const me=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(me);const fe=document.querySelector(".formview-container .submit-container");fe&&setTimeout(()=>{this.stickyElement(fe)},1e3)}}}if(y==="email"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`email_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("input");b.id=`email_label_${w}`,b.type="email",b.name=E,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="phone"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`phone_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("input");b.id=`phone_label_${w}`,b.type="tel",b.name=E,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="url"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`url_label_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const _=document.createElement("div");_.className="field-note",_.innerHTML=o.fieldNote,g.appendChild(_)}const b=document.createElement("input");b.id=`url_label_${w}`,b.type="url",b.name=E,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="hidden"){let w=this.getId();const C=document.createElement("label");C.setAttribute("for",`hidden_label_${w}`),C.className="field-label hidden",C.innerText=o.title,g.appendChild(C);const b=document.createElement("input");b.id=`hidden_label_${w}`,b.type="hidden",b.name=E,b.value=o.value,g.appendChild(b)}});const u=r.closest("[data-site-token]");if(u){const o=u.getAttribute("data-site-token"),h=document.createElement("input");h.type="hidden",h.name="form_token",h.value=o,r.appendChild(h)}if(this.settings.isBuilder){const o=document.createElement("div");o.className="submit-container",r.appendChild(o);let h=!0;if("hideReset"in i&&(h=i.hideReset),!h){const M=document.createElement("button");M.className="btn-resetform";const w=i.resetText||this.settings.resetText;M.innerText=w,o.appendChild(M),M.addEventListener("click",b=>{b.preventDefault();const _=M.closest("form");_&&(_.reset(),_.querySelectorAll(".btn-clearfile").forEach(k=>{k.click()}),_.querySelectorAll(".slider-container").forEach(k=>{const R=k.querySelector("input");k.querySelector(".current-value").textContent=R.value}))}),(i.fullWidthButton||!1)&&M.classList.add("w-full")}const g=document.createElement("button");g.className="btn-submitform";const y=i.submitText||this.settings.submitText;g.innerText=y,o.appendChild(g),(i.fullWidthButton||!1)&&g.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&o.classList.add("always-visible"),this.stickyElement(o),r.addEventListener("submit",async M=>{M.preventDefault(),this.steps&&this.steps.length>0&&this.process()})}else{let o="Reference Code:",h="reference_code",g="reference_code";const y=document.createElement("div");y.className="form-field ",y.classList.add(g),r.appendChild(y);let E=this.getId();const M=document.createElement("label");M.setAttribute("for",`short_text_label_${E}`),M.className="field-label",M.innerHTML=o,y.appendChild(M);const w=document.createElement("input");if(w.id=`short_text_label_${E}`,w.type="text",w.name=h,w.autocomplete="off",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.className="inp-base",y.appendChild(w),this.settings.captchaContainer){const C=this.settings.captchaContainerClassName,b=document.createElement("div");b.className="captcha-container",C&&b.classList.add(C),r.appendChild(b)}if(i.useSubmitButton){const C=document.createElement("div");C.className="submit-container",r.appendChild(C);let b=!0;if("hideReset"in i&&(b=i.hideReset),!b){const R=document.createElement("button");R.className="btn-resetform";const V=i.resetText||this.settings.resetText;R.innerText=V,C.appendChild(R),R.addEventListener("click",Y=>{Y.preventDefault();const G=R.closest("form");G&&(G.reset(),G.querySelectorAll(".btn-clearfile").forEach(T=>{T.click()}),G.querySelectorAll(".slider-container").forEach(T=>{const A=T.querySelector("input");T.querySelector(".current-value").textContent=A.value}))}),(i.fullWidthButton||!1)&&R.classList.add("w-full")}const _=document.createElement("button");_.className="btn-submitform";const O=i.submitText;_.innerText=O,C.appendChild(_),(i.fullWidthButton||!1)&&_.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&C.classList.add("always-visible"),this.stickyElement(C),_.addEventListener("click",async R=>{this.trigger("submit",R)});const k=r.closest("form");k?k.addEventListener("submit",async R=>{this.steps&&this.steps.length>0&&(R.preventDefault(),R.stopImmediatePropagation(),this.process())}):_.addEventListener("click",async R=>{this.steps&&this.steps.length>0&&(R.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 g=document.createElement("div");g.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(g.style.height=o.spacerHeight+"px"),d.appendChild(g);return}if(o.type==="separator"){const g=document.createElement("hr");g.style.borderTopColor=o.color,d.appendChild(g);return}if(o.type==="html"){if(o.html){const g=document.createElement("div");g.innerHTML=o.html,d.appendChild(g)}return}if(o.type==="heading"){const g=document.createElement(o.heading||"h2");g.innerHTML=o.headingText||this.out("Your Heading Here!"),d.appendChild(g);return}if(o.type==="paragraph"){const g=document.createElement("p");g.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),d.appendChild(g);return}if(o.type==="media"){if(o.tag==="video"){const g=document.createElement("video");g.style.width="100%",g.style.height="auto",g.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",g.appendChild(h),d.appendChild(g)}else if(o.tag==="audio"){const g=document.createElement("audio");g.controls=!0;let y=document.createElement("source");y.src=o.url,y.type="audio/mp3",g.appendChild(y),d.appendChild(g)}else if(o.tag==="img"){const g=document.createElement("img");g.src=o.url,g.setAttribute("alt",this.out("Output Image")),d.appendChild(g)}return}if(o.type==="image"){const g=document.createElement("img");g.src=o.url,g.setAttribute("alt",this.out("Output Image")),d.appendChild(g);return}if(o.type==="video"){const g=document.createElement("video");g.style.width="100%",g.style.height="auto",g.controls=!0;let y=document.createElement("source");y.src=o.url,y.type="video/mp4",g.appendChild(y),d.appendChild(g);return}if(o.type==="audio"){const g=document.createElement("audio");g.controls=!0;let y=document.createElement("source");y.src=o.url,y.type="audio/mp3",g.appendChild(y),d.appendChild(g);return}}})}if(this.settings.resultSelector&&document.querySelector(this.settings.resultSelector).classList.add("result-wrapper"),this.settings.saveResults&&this.settings.resultSelector&&localStorage.getItem("_results"))try{this.previousResults=JSON.parse(localStorage.getItem("_results"));let n=localStorage.getItem("_results_html");const r=document.querySelector(this.settings.resultSelector);r.innerHTML=n,this.addResultTool(),r.querySelectorAll(".link-download").forEach(u=>{u.addEventListener("click",async c=>{c.preventDefault();const d=c.target.href;try{const o=await fetch(d,{mode:"cors"});if(!o.ok)throw new Error("Failed to fetch the image.");const h=await o.blob(),g=d.substring(d.lastIndexOf("/")+1),y=document.createElement("a");y.href=URL.createObjectURL(h),y.download=g,y.click(),URL.revokeObjectURL(y.href)}catch(o){console.error("Error downloading the image:",o)}})})}catch{}const t=document.querySelector(".formview-container .submit-container");t&&setTimeout(()=>{this.stickyElement(t)},1e3)}abort(){this.controller&&this.controller.abort()}async search(e){let i={"Content-Type":"application/json",...this.settings.headers};try{const s=await fetch(this.settings.searchUrl,{method:"POST",headers:i,body:JSON.stringify({query:e,customData:this.settings.customData})});if(!s.ok)throw new Error("Failed to fetch data");const t=await s.json(),n=t.organic_results?"organic_results":"organic";return(t[n]||[]).map(r=>({title:r.title,link:r.link,snippet:r.snippet||r.description}))}catch(s){return console.error("Error in search:",s.message||s),[]}}async scrapeUrls(e){if(e.length===0)return{data:"",urls:[],failed:[]};this.settings.consoleLog&&console.log(e);let i={"Content-Type":"application/json",...this.settings.headers};const s=await fetch(this.settings.scrapeUrl,{method:"POST",headers:i,body:JSON.stringify({urls:e,customData:this.settings.customData})});if(!s.ok)throw new Error(`Error: ${s.statusText}`);let t="";const n=await s.json();if(this.settings.consoleLog&&console.log(n),n.error)return this.settings.consoleLog&&console.log(n.error),{data:"",urls:[],failed:[]};let r=[],a=[];if(this.settings.scrapeProvider==="firecrawl"&&n.forEach(u=>{if(u.success){const c=u.metadata.title,d=u.markdown,o=u.metadata.url;r.push(o),t+=`
|
|
419
|
+
`,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}
|
|
@@ -429,7 +429,7 @@ Check the information and return the details.
|
|
|
429
429
|
----------------
|
|
430
430
|
|
|
431
431
|
|
|
432
|
-
`}else{let c=
|
|
432
|
+
`}else{let c=l.url;if(c){const d=l.url;a.push(d)}else c=l.url.link,a.push(c)}}),this.settings.scrapeProvider==="scrapingbee")for(let l=0;l<n.length;l++){let c=e[l];r.push(c);let d=n[l];t+=`
|
|
433
433
|
|
|
434
434
|
|
|
435
435
|
## ${c}
|
|
@@ -451,7 +451,7 @@ Check if the request requires checking certain URLs. If so, returns the URLs.
|
|
|
451
451
|
Also check if the request requires search to find answers by searching on the web to get the current relevant information.
|
|
452
452
|
`,n=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{needscrape:{type:"boolean",description:"Check the if request requires search on the web or not."},url:{type:"string",description:"If request need to check certail URL, return the URL."},url2:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url3:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url4:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url5:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url6:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url7:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url8:{type:"string",description:"If the request needs to check a certail URL, return the URL."},needsearch:{type:"boolean",description:"Check the if request requires search on the web or not."}},required:["needsearch","needscrape"]}}],r=await this.send(t,s,i,n);return r?JSON.parse(r):!1}async getRelevantInfo(e,i,s){if(!this.settings.searchUrl&&!this.settings.scrapeUrl)return{data:"",urls:[],failed:[]};const t=document.createElement("div");t.classList.add("status"),s.appendChild(t);let n="",r=await this.checkPrompt(`${i}
|
|
453
453
|
|
|
454
|
-
${e}`);this.settings.consoleLog&&console.log(r);let a=[],
|
|
454
|
+
${e}`);this.settings.consoleLog&&console.log(r);let a=[],l=[];if(r.url&&r.needscrape&&this.settings.scrapeUrl){let c=document.createElement("p");c.innerHTML=this.out("Fetching data from the web..."),t.appendChild(c);let d=[];r.url&&d.push(r.url),r.url2&&d.push(r.url2),r.url3&&d.push(r.url3),r.url4&&d.push(r.url4),r.url5&&d.push(r.url5),r.url6&&d.push(r.url6),r.url7&&d.push(r.url7),r.url8&&d.push(r.url8);let o=await this.scrapeUrls(d);n+=o.data,a=o.urls,l=o.failed}else if(this.settings.searchUrl&&this.settings.scrapeUrl){let c=document.createElement("p");c.innerHTML=this.out("Searching the web.."),t.appendChild(c);let d=await this.search(e);const o=this.settings.scrapeExclude;let h=d.filter(b=>{let k=new URL(b.link).hostname;return!o.some(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>
|
|
@@ -471,7 +471,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
471
471
|
</svg>
|
|
472
472
|
</span>
|
|
473
473
|
|
|
474
|
-
`,setTimeout(()=>{s.innerHTML=e,n.innerHTML=r},400)}async process(e){if(this.trigger("generate"),this.payloads=[],this.output=[],this.mediaGenerated=[],this.needCleanup=!1,this.outputHtml="",!this.settings.resultSelector){this.settings.consoleLog&&console.log("resultSelector not set.");return}const i=document.querySelector(this.settings.resultSelector);if(!i){console.log("resultElement not found.");return}let s=!1,t=!1;this.steps.forEach(
|
|
474
|
+
`,setTimeout(()=>{s.innerHTML=e,n.innerHTML=r},400)}async process(e){if(this.trigger("generate"),this.payloads=[],this.output=[],this.mediaGenerated=[],this.needCleanup=!1,this.outputHtml="",!this.settings.resultSelector){this.settings.consoleLog&&console.log("resultSelector not set.");return}const i=document.querySelector(this.settings.resultSelector);if(!i){console.log("resultElement not found.");return}let s=!1,t=!1;this.steps.forEach(v=>{v.prompt.trim().startsWith("{")&&(s=!0),v.tools&&(v.tools.image||v.tools.video||v.tools.audio)&&(s=!0),v.tools&&v.tools.search&&(t=!0)});let n;if(s&&this.settings.disableMediaGeneration){n=`
|
|
475
475
|
<div class="form-info">
|
|
476
476
|
<h3>${this.out(this.settings.disableMediaGenerationTitle)}</h3>
|
|
477
477
|
<p>
|
|
@@ -488,7 +488,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
488
488
|
<p>
|
|
489
489
|
<b>Web searching and scraping are currently disabled, so your request cannot be processed.</b>
|
|
490
490
|
</p>
|
|
491
|
-
</div>`,this.showDemoInfo(n);return}let r;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}r=document.querySelector(this.settings.previewSelector)}else r=this.element;let a=r.querySelector(".btn-submitform"),
|
|
491
|
+
</div>`,this.showDemoInfo(n);return}let r;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}r=document.querySelector(this.settings.previewSelector)}else r=this.element;let a=r.querySelector(".btn-submitform"),l=a.innerHTML;this.tokenInput=0,this.tokenOutput=0;let c=!1;if(e!=null&&(c=!0),this.singleStep=c,c||(this.filesUploaded={}),this.isNormal&&!c){if(this.isMediaGenerating){alert(this.out("The media generation process cannot be aborted."));return}this.abort(),a.innerHTML=l,a.removeAttribute("disabled"),this.isGenerating=!1;return}if(this.isNormal&&c||this.isSingle&&!c||this.isSingle&&c)return;this.isNormal=!1,this.isSingle=!1,c?(a.innerHTML=`
|
|
492
492
|
<span class="loading-icon">
|
|
493
493
|
<svg class="animate-spin" style="margin: 0;margin-right: 0.6rem;width: 1rem;height: 1rem;" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
494
494
|
<circle style="opacity: 0.25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
@@ -503,7 +503,7 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
503
503
|
</svg>
|
|
504
504
|
</span>
|
|
505
505
|
${this.out("Abort")}
|
|
506
|
-
`,this.isNormal=!0),this.isGenerating=!0;let d=(_
|
|
506
|
+
`,this.isNormal=!0),this.isGenerating=!0;let d=(v,_)=>{if(v===void 0)return"";if(!isNaN(v))return v;let 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=[],u=[];if(r.url&&r.needsc
|
|
|
515
515
|
<animate attributeName="cy" begin="0.4s" dur="0.6s" values="15;5;15" repeatCount="indefinite"></animate>
|
|
516
516
|
</circle>
|
|
517
517
|
</svg>
|
|
518
|
-
`;let
|
|
518
|
+
`;let 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=[],u=[];if(r.url&&r.needsc
|
|
|
523
523
|
</svg>
|
|
524
524
|
</span>
|
|
525
525
|
|
|
526
|
-
`,a.setAttribute("disabled","")));let
|
|
526
|
+
`,a.setAttribute("disabled","")));let x="",S="",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
|
-
`)),N&&(N.image||N.video||N.audio)||F){const W=await this.media.generate(_,O,m,k,N,G,Y);return this.needCleanup=!0,this.settings.consoleLog&&console.log(W),W.mediaGenerated?{media:W.output,media2:W.output2,markdown:W.markdown}:(G.innerHTML=`<p>${W.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(_,O,R,V,async W=>{if(!(W&&typeof W=="object")){if(T+=W,!Y){const D=ke.parse(T);G.innerHTML=D,A+=D}await new Promise(D=>setTimeout(D,50))}}),await new Promise(W=>{const D=setInterval(()=>{G.innerHTML===ke.parse(T)&&(clearInterval(D),W())},10)}),Y&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${A}</div>`;else if(this.settings.assistantUrl){let W=await this.assistant(_,O,R,V);if(!W)return!1;if(T=W,Y)G.innerHTML="",G.remove();else{const D=ke.parse(W);G.innerHTML=D,this.outputHtml+=`<div class="result-container">${D}</div>`}}}else if(this.settings.sendCommandStreamUrl){let W="",D="",J="";const Q=async ne=>{let se=0;for(;se<ne.length;){if(J=W.slice(0,J.length+1),se++,!Y){const le=ke.parse(J);G.innerHTML=le,D=le}await new Promise(le=>setTimeout(le,50))}};await this.sendStream(_,O,R,k,V,async ne=>{T+=ne,W+=ne,await Q(ne)}),await new Promise(ne=>{const se=setInterval(()=>{J.length===W.length&&(clearInterval(se),ne())},10)}),Y&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${D}</div>`}else{let W=await this.send(_,O,R,k,V);if(!W)return!1;if(T=W,Y)G.innerHTML="",G.remove();else{const D=ke.parse(W);G.innerHTML=D,this.outputHtml+=`<div class="result-container">${D}</div>`}}if(!Y){let W="";if($&&$.urls.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" href="${J}">${Q}</url></div>`}),$&&$.failed.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" style="opacity:0.5" href="${J}">${Q}</url></div>`}),W!==""){const J=document.createElement("div");J.classList.add("result-container"),i.appendChild(J),J.innerHTML=W}}return this.payloads.push({prompt:_,context:O}),this.output.push(T),{media:[],markdown:T}};c||await(async _=>{this.previousResults=[],this.outputHtml="";for(let O=0;O<_.length;O++){if(!this.isGenerating)return;let{prompt:m,context:k,provider:R,model:V,system:N,functs:Y,tools:G,hideOutput:F}=_[O];R=R||"",k=k||"",N=N||"You are an assistant",Y=Y||[];let I=m;this.previousResults.forEach((A,$)=>{const W=`{{output_step_${$+1}}}`;I=I.replace(new RegExp(W,"g"),d(A,m)),I=I.replace(new RegExp(W.toUpperCase(),"g"),d(A,m))}),m=I,m=m.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(m),I=k,this.previousResults.forEach((A,$)=>{const W=`{{output_step_${$+1}}}`;I=I.replace(new RegExp(W,"g"),d(A,m)),I=I.replace(new RegExp(W.toUpperCase(),"g"),d(A,m))}),k=I,k=k.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let T=await g(m,k,R,V,N,Y,G,F);if(!T)break;if(this.mediaGenerated.push(...T.media),T.media&&T.media.length===1){let A=T.media[0],$=T.media2&&T.media2.length===1&&T.media2[0];this.previousResults.push($||A),F&&(this.filesUploaded[`output_step_${O}`]=A)}else this.previousResults.push(T.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(O,m)=>{if(!this.isGenerating)return;let{prompt:k,context:R,provider:V,model:N,system:Y,functs:G,tools:F,hideOutput:I}=O[m];R=R||"",Y=Y||"You are an assistant",G=G||[];let T=k;this.previousResults&&this.previousResults.forEach(($,W)=>{const D=`{{output_step_${W+1}}}`;T=T.replace(new RegExp(D,"g"),$),T=T.replace(new RegExp(D.toUpperCase(),"g"),$)}),k=T,k=k.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(k),T=R,this.previousResults&&this.previousResults.forEach(($,W)=>{const D=`{{output_step_${W+1}}}`;T=T.replace(new RegExp(D,"g"),$),T=T.replace(new RegExp(D.toUpperCase(),"g"),$)}),R=T,R=R.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(R);let A=await g(k,R,V,N,Y,G,F,I);if(A&&(this.mediaGenerated.push(...A.media),!!this.previousResults))if(A.media&&A.media.length===1){let $=A.media[0],W=A.media2&&A.media2.length===1&&A.media2[0];this.previousResults[m]=W||$,I&&(this.filesUploaded[`output_step_${m}`]=$)}else this.previousResults[m]=A.markdown})(o,e)),a.innerHTML=u,a.removeAttribute("disabled"),this.isGenerating=!1;const E=this.calculateCost();this.settings.onUsage&&this.settings.onUsage(E),this.trigger("usage",E),this.isNormal=!1,this.isSingle=!1;const M=(_,O=100)=>{const m=document.createElement("div");if(m.innerHTML=_,m.querySelector("video"))return"Video";if(m.querySelector("img"))return"Image";if(m.querySelector("audio"))return"Audio";const k=m.textContent.trim();return k.length>O?k.substring(0,O)+"...":k},w=Object.keys(this.filesUploaded).length===0&&this.filesUploaded.constructor===Object;if(this.needCleanup&&!w){this.settings.consoleLog&&(console.log("Cleanup"),console.log(this.filesUploaded));let _={"Content-Type":"application/json",...this.settings.headers};await fetch(this.settings.cleanup,{method:"POST",headers:_,body:JSON.stringify(this.filesUploaded)})}let C=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(_=>C.indexOf(_)!==-1),this.trigger("resultReady",{previewText:M(C),markdown:this.previousResults,html:C,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",C)),this.addResultTool(),i.querySelectorAll(".link-download").forEach(_=>{_.addEventListener("click",async O=>{O.preventDefault();const m=O.target.href;try{const k=await fetch(m,{mode:"cors"});if(!k.ok)throw new Error("Failed to fetch the image.");const R=await k.blob(),V=m.substring(m.lastIndexOf("/")+1),N=document.createElement("a");N.href=URL.createObjectURL(R),N.download=V,N.click(),URL.revokeObjectURL(N.href)}catch(k){console.error("Error downloading the image:",k)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:u,value:c,checked:d,files:o}=r;if(u==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(u==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(u==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(u==="file")s[a]=o;else if(u==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(g=>g.value)}else if(u==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,u=r.name,c=r.type;if(u==="")return;let d=s[u],o={questions:a,name:u,value:d,type:c};t.push(o);let h=u+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(u=u+"_mask",d=s[u],o={questions:a,name:u,value:d},t.push(o));let g=u+"_red";d=s[g],d!==void 0&&(o={questions:a,name:g,value:d},t.push(o));let y=u+"_green";d=s[y],d!==void 0&&(o={questions:a,name:y,value:d},t.push(o));let E=u+"_blue";d=s[E],d!==void 0&&(o={questions:a,name:E,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,u=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:u,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
-
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let
|
|
532
|
-
`);
|
|
533
|
-
`}}this.tokenInput+=
|
|
534
|
-
`+h.error),!1):(h.usage&&(this.tokenInput+=h.usage.prompt_tokens,this.tokenOutput+=h.usage.completion_tokens),h.answer.content[0].text.value)}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async assistantStream(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,
|
|
535
|
-
`);
|
|
536
|
-
`}}else{const O=JSON.parse(_);this.tokenInput+=O.prompt_tokens,this.tokenOutput+=O.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 Os{addClass(e,i){e&&(this.hasClass(e,i)||(e.classList.length===0?e.className=i:e.className=e.className+" "+i,e.className=e.className.replace(/ +/g," ")))}removeClass(e,i){if(e&&e.classList.length>0){let s,t,n,r,a=i.split(" ");for(s=0,n=a.length;s<n;++s){if(!a[s])continue;let u=a[s],c="",d=e.className.split(" ");for(t=0,r=d.length;t<r;++t)d[t]&&d[t]!==u&&(c+=d[t]+" ");e.className=c.trim()}e.className===""&&e.removeAttribute("class")}}hasClass(e,i){if(!e)return!1;try{let s=e.getAttribute("class");return new RegExp("\\b"+i+"\\b").test(s)}catch{}}}const ce=new Os;class Ls{constructor(e={}){const i={};this.settings=Object.assign(this,i,e)}init(){const e=h=>{const g=h.parentNode,y=h.nextElementSibling;if(ce.hasClass(y,"is-menu-links")){let M=y.querySelectorAll("li");M.forEach(w=>{if(w!==g){const C=w.querySelector("ul");ce.removeClass(C,"active")}}),M=document.querySelectorAll(".is-menu > ul > li ul"),M.forEach(w=>{const C=w.querySelector("ul");ce.removeClass(C,"active")})}ce.hasClass(y,"active")&&!ce.hasClass(y,"is-menu-links")&&y.querySelectorAll("li").forEach(w=>{if(w!==g){const C=w.querySelector("ul");ce.removeClass(C,"active")}});const E=g.querySelector("ul");E&&ce.addClass(E,"active")},i=h=>{if(h.nextElementSibling){const g=h.nextElementSibling;if(g)if(ce.hasClass(g,"active"))ce.removeClass(g,"active"),h.focus();else{const E=h.parentNode.parentNode;ce.removeClass(E,"active"),E.previousElementSibling.focus()}else{const E=h.parentNode.parentNode;ce.removeClass(E,"active"),E.previousElementSibling.focus()}}else{const y=h.parentNode.parentNode;ce.removeClass(y,"active"),y.previousElementSibling.focus()}},s=h=>{const g=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(g.nextElementSibling)if(g.nextElementSibling.classList.contains("active"))g.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(g.parentNode.nextElementSibling)g.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const E=g.parentNode.parentNode;E.classList.contains("active")&&(E.classList.remove("active"),E.previousElementSibling.focus(),h.preventDefault())}else if(g.parentNode.nextElementSibling)g.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const E=g.parentNode.parentNode;E.classList.contains("active")&&(E.classList.remove("active"),E.previousElementSibling.focus(),h.preventDefault())}else if(h.keyCode===38)if(g.nextElementSibling)if(g.nextElementSibling.classList.contains("active"))g.nextElementSibling.classList.remove("active");else{const y=g.parentNode.previousElementSibling;y&&y.querySelector("a").focus()}else if(g.parentNode.previousElementSibling)g.parentNode.previousElementSibling.querySelector("a").focus();else{const E=g.parentNode.parentNode;E.classList.contains("active")&&E.classList.remove("active"),E.previousElementSibling.focus()}else if(h.which===9&&!h.shiftKey)if(g.nextElementSibling)if(g.nextElementSibling.classList.contains("active"))g.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(g.parentNode.nextElementSibling)g.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const E=g.parentNode.parentNode;E.classList.contains("active")&&(E.classList.remove("active"),E.previousElementSibling.focus(),h.preventDefault())}else if(g.parentNode.nextElementSibling)g.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const E=g.parentNode.parentNode;E.classList.contains("active")&&(E.classList.remove("active"),E.previousElementSibling.focus(),h.preventDefault())}else if(h.which===9&&h.shiftKey){if(g.nextElementSibling)g.nextElementSibling.classList.contains("active")&&g.nextElementSibling.classList.remove("active");else if(!g.parentNode.previousElementSibling){const E=g.parentNode.parentNode;E.classList.contains("active")&&E.classList.remove("active")}}};document.querySelectorAll(".is-menu li a").forEach(h=>{h.addEventListener("keydown",s)}),document.querySelectorAll(".is-menu li").forEach(h=>{const g=h.querySelector("span");g&&g.addEventListener("click",y=>{if(window.innerWidth>=1024)return;const w=y.target.closest("li").querySelector("ul");w&&(ce.hasClass(w,"active")?(ce.removeClass(w,"active"),w.style.display=""):ce.addClass(w,"active")),y.preventDefault(),y.stopImmediatePropagation()}),h.addEventListener("click",y=>{const E=h.querySelector("ul"),M=window.innerWidth;let w=y.target.tagName.toLowerCase();if(M>1024){if((w==="a"||w==="i")&&!y.target.getAttribute("href")){y.preventDefault(),y.stopImmediatePropagation();return}}else{let C=!0;if((w==="a"||w==="i")&&(y.target.getAttribute("href")||(y.preventDefault(),C=!1)),C){const b=document.querySelector(".is-menu");if(b.style.right==="0px"){ce.removeClass(r,"active"),b.style.right="-1000px";const _=document.querySelector(".is-menu-overlay");ce.removeClass(_,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}}}E&&(ce.hasClass(E,"active")?(ce.removeClass(E,"active"),E.style.display=""):(ce.addClass(E,"active"),setTimeout(()=>{},0)))}),h.addEventListener("mouseleave",y=>{window.innerWidth<=1024||(this.timer=setTimeout(()=>{const M=h.querySelector("ul");M&&ce.removeClass(M,"active")},200),y.preventDefault(),y.stopImmediatePropagation())}),h.addEventListener("mouseenter",y=>{const E=window.innerWidth;if(E<=1024||this.staticClose)return;const M=document.querySelector(".is-menu-search-input");if(ce.hasClass(M,"active"))return;clearTimeout(this.timer);const w=h.closest("ul");if(!h.querySelector("ul"))return w.querySelectorAll("li").forEach(_=>{const O=_.querySelector("ul");ce.removeClass(O,"active")}),!0;if(ce.hasClass(w,"is-menu-links")){let b=w.querySelectorAll("li");b.forEach(_=>{if(_!==h){const O=_.querySelector("ul");ce.removeClass(O,"active")}}),b=document.querySelectorAll(".is-menu > ul > li ul"),b.forEach(_=>{const O=_.querySelector("ul");ce.removeClass(O,"active")})}ce.hasClass(w,"active")&&!ce.hasClass(w,"is-menu-links")&&w.querySelectorAll("li").forEach(_=>{if(_!==h){const O=_.querySelector("ul");ce.removeClass(O,"active")}});const C=h.querySelector("ul");if(C&&ce.addClass(C,"active"),C.style.right="",C.classList.contains("active")){const b=C.getBoundingClientRect();b.left+b.width>E&&(C.style.right=0)}y.preventDefault(),y.stopImmediatePropagation()})});const r=document.querySelector("#is-menu-toggle");r.addEventListener("click",h=>{const g=document.querySelector(".is-menu");if(g.style.right==="0px"){ce.removeClass(r,"active"),g.style.right="-1000px";const y=document.querySelector(".is-menu-overlay");ce.removeClass(y,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}else{ce.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"),g.style.right="0px";const E=document.querySelector(".is-menu-overlay");ce.addClass(E,"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");ce.removeClass(h,"active"),document.querySelectorAll(".is-menu li ul").forEach(M=>{ce.removeClass(M,"active")});const y=document.querySelector(".is-menu");if(y.style.transition="none",window.innerWidth>1024){y.style.right="0px",document.querySelectorAll(".is-menu li ul").forEach(C=>{C.style.display=""});const w=document.querySelector(".is-menu-overlay");ce.removeClass(w,"active"),document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""}else y.style.right="-1000px";setTimeout(()=>{y.style.transition=""},30)}),window.addEventListener("scroll",()=>{var h=100,g=this.getCurrentScroll();g>=h?ce.addClass(document.querySelector(".is-topbar"),"shrink"):ce.removeClass(document.querySelector(".is-topbar"),"shrink"),window.innerWidth>=1024&&document.querySelector(".is-topbar.static")&&(g>30?this.staticClose||(document.querySelectorAll(".is-menu li ul").forEach(M=>{ce.removeClass(M,"active")}),this.staticClose=!0):this.staticClose=!1)});const u=h=>{const g=document.querySelector(".is-menu-search-input");ce.addClass(g,"active"),g.querySelector("input").focus(),document.querySelectorAll(".is-menu li ul").forEach(M=>{ce.removeClass(M,"active")}),h.preventDefault(),h.stopImmediatePropagation()},c=document.querySelector(".is-menu-search");c&&(c.addEventListener("click",h=>{u(h)}),c.addEventListener("keydown",h=>{(h.keyCode===13||h.keyCode===32)&&u(h)})),document.addEventListener("click",h=>{const g=h.target;if(!ce.hasClass(g,"is-menu-search")&&g.getAttribute("id")!=="is_btnSearch"&&g.getAttribute("id")!=="is_txtSearch"){const y=document.querySelector(".is-menu-search-input");ce.removeClass(y,"active")}});const d=document.querySelector("#is_txtSearch");d.addEventListener("keydown",h=>{if(h.which==13&&this.settings.onSearch(d.value),h.which==27){const g=document.querySelector(".is-menu-search-input");ce.removeClass(g,"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 As{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=Vn,window.FormViewer=Cs,window.NavBar=Ls,window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{Ni.init({duration:1200})},300),Gi({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 u=a.target.closest(".is-section");if(u){let c=i(u);c&&this.scrollIt(c,1e3,"easeInQuad")}a.preventDefault(),a.stopImmediatePropagation()})}),e&&(e.classList.contains("is-edit")||e.querySelectorAll("a").forEach(function(a){a.addEventListener("click",function(u){let c=a.getAttribute("href");if(c&&c.indexOf("#")===0)if(c.indexOf("#section")===0){let d=c.replace("#section","");if(!isNaN(parseInt(d))){let o=document.querySelectorAll(".is-section"),h,g=0;o.forEach(function(y){y.classList.contains("is-section-navbar")||(g===d-1&&(h=y),g++)}),h&&scrollIt(h,1e3,"easeInQuad"),u.preventDefault()}}else try{let d=document.querySelector(c);d&&(scrollIt(d,1e3,"easeInQuad"),u.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let n=document.querySelectorAll(".is-animated,.is-scale-animated");n.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),n=document.querySelectorAll(".is-container > div"),n.forEach(function(r){let a=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),u=0;a.length>1&&a.forEach(function(c){c.className.indexOf("delay-")===-1&&(u>0&&(c.style.transitionDelay=u+"s",c.style.animationDelay=u+"s"),u=u+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function e(s){var t;return function(n){t&&clearTimeout(t),t=setTimeout(s,100,n)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",e(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var e=document.querySelectorAll(".is-overlay-bg");e.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new Hi({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(e,i=0){const s=e.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(e,i=200,s="linear",t){_scrollTo(e)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(a=>{const u=a.firstElementChild;a.after(u),a.parentNode.removeChild(a)}),document.querySelectorAll(".is-section").forEach(a=>{a.hasAttribute("data-section-clone")&&a.parentNode.removeChild(a),a.hasAttribute("data-section-original")&&(a.style.display="",a.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(u=>{u.outerHTML=u.innerHTML});const t=window.self!==window.top;let n;t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.length>0&&window.scrollTo(0,0),n.forEach(function(a){s<=970&&a.querySelector(".is-box")&&(a.querySelectorAll(".is-box").forEach(c=>{const d=a.cloneNode(!1);c.getAttributeNames().map(o=>{o.indexOf("data-")!==-1&&d.setAttribute(o,c.getAttribute(o))}),d.classList.add("is-box"),c.classList.forEach(o=>{(o.indexOf("is-box-")!==-1||o.indexOf("is-content-")!==-1||o.indexOf("box-autofit")!==-1||o.indexOf("is-light-text")!==-1||o.indexOf("is-dark-text")!==-1||o.indexOf("is-align-")!==-1||o.indexOf("type-")!==-1||o.indexOf("block-click")!==-1||o.indexOf("hover-zoom")!==-1)&&d.classList.add(o)}),d.setAttribute("data-section-clone",""),d.innerHTML=c.innerHTML,a.parentNode.insertBefore(d,a)}),a.setAttribute("data-section-original",""),a.style.display="none")}),t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.forEach(function(a){if(a.parentNode.closest(".section-wrap")||s<=970&&a.hasAttribute("data-section-original"))return;const u=document.createElement("div");u.classList.add("pin-wrap"),a.classList.contains("m-skrollrr-off")&&u.classList.add("m-skrollrr-off"),a.classList.contains("pin-space-lg")&&u.classList.add("pin-space-lg"),a.classList.contains("pin-space-xl")&&u.classList.add("pin-space-xl"),a.classList.contains("xs-hidden")&&u.classList.add("xs-hidden"),a.classList.contains("sm-hidden")&&u.classList.add("sm-hidden"),a.classList.contains("desktop-hidden")&&u.classList.add("desktop-hidden"),a.after(u),u.appendChild(a)});const r=a=>{document.querySelectorAll(".is-section").forEach(c=>{const d=c.getBoundingClientRect().top;let o,h;c.parentNode.classList.contains("pin-wrap")?(o=c.parentNode.nextElementSibling,h=c.parentNode.previousElementSibling):(o=c.nextElementSibling,h=c.previousElementSibling),o&&o.classList.contains("pin-wrap")&&(o=o.querySelector(".is-section")),h&&h.classList.contains("pin-wrap")&&(h=h.querySelector(".is-section")),d<=0&&((c.classList.contains("no-spacing")||c.classList.contains("pin-overlap"))&&c.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(y=>{y!==c&&y.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 Vi({trigger:{once:!0,offset:{element:{x:0,y:(t,n,r)=>.1},viewport:{x:0,y:(t,n,r)=>t.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:t=>{t.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let a=r.parentNode.querySelector(".video-bg-play");r.autoplay?a?a.innerHTML.indexOf("play")===-1&&r.play():r.play():a&&a.innerHTML.indexOf("play")===-1&&r.play()})},out:t=>{t.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let e;window.contentbox?e=window.contentbox.onRender:parent.contentbox&&(e=parent.contentbox.onRender);const i=()=>{e.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(t){t.classList.contains("once")?(t.removeAttribute("data-scroll",""),t.setAttribute("data-scroll-once","")):(t.removeAttribute("data-scroll-once",""),t.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(t){let n=t.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;n.length>1&&n.forEach(function(a){a.className.indexOf("delay-")===-1&&(r>0&&(a.style.transitionDelay=r+"s",a.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const e={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(e),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const t=n=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,e),n.preventDefault(),n.stopImmediatePropagation()};s.addEventListener("click",t),s._lightboxHandler=t})}refreshLightbox(e){this.glightbox&&this.glightbox.destroy(),this.glightbox=si(e),window.GLightbox=si}openLightbox(e,i,s){let t=[],n=0;if(i){const r=i.closest("[data-gallery]");let a=[];r?a=r.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(c=>{c.closest("[data-gallery]")||a.push(c)}),a.forEach((u,c)=>{let d=u.getAttribute("href");d||(d=u.getAttribute("data-modal-url")),t.push({href:d}),e===d&&(n=c)})}t.length>0?(this.glightbox.setElements(t),this.glightbox.openAt(n)):(this.glightbox.setElements([{href:e}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s)})}blockInit(){const e={start:()=>{document.querySelectorAll(".is-block").forEach(t=>{t.hasAttribute("data--t")||t.setAttribute("data--t",t.style.top),t.hasAttribute("data--l")||t.setAttribute("data--l",t.style.left),t.hasAttribute("data--b")||t.setAttribute("data--b",t.style.bottom),t.hasAttribute("data--r")||t.setAttribute("data--r",t.style.right),t.hasAttribute("data--w")||t.setAttribute("data--w",t.style.width),t.hasAttribute("data--h")||t.setAttribute("data--h",t.style.height),t.removeAttribute("data-prev"),t.removeAttribute("data-fluid"),t.removeAttribute("data-fluid-val"),t.classList.remove("fluid"),t.style.transition=""})},apply:(t,n,r)=>{if(n&&t.getAttribute("data-prev")!==n+""){if(r||(t.style.transition="all 0.35s ease"),n!==1e4){if(t.setAttribute("data-breakpoint",n),t.hasAttribute("data--t-"+n)){let a=t.getAttribute("data--t-"+n);t.style.top=a}if(t.hasAttribute("data--l-"+n)){let a=t.getAttribute("data--l-"+n);t.style.left=a}if(t.hasAttribute("data--b-"+n)){let a=t.getAttribute("data--b-"+n);t.style.bottom=a}if(t.hasAttribute("data--r-"+n)){let a=t.getAttribute("data--r-"+n);t.style.right=a}if(t.hasAttribute("data--w-"+n)){let a=t.getAttribute("data--w-"+n);t.style.width=a}if(t.hasAttribute("data--h-"+n)){let a=t.getAttribute("data--h-"+n);t.style.height=a}if(t.hasAttribute("data--transform-"+n)){let a=t.getAttribute("data--transform-"+n);t.style.transform=a,t.setAttribute("data--transform-val",n)}}else{if(t.removeAttribute("data-breakpoint"),t.hasAttribute("data--t")){let a=t.getAttribute("data--t");t.style.top=a}if(t.hasAttribute("data--l")){let a=t.getAttribute("data--l");t.style.left=a}if(t.hasAttribute("data--b")){let a=t.getAttribute("data--b");t.style.bottom=a}if(t.hasAttribute("data--r")){let a=t.getAttribute("data--r");t.style.right=a}if(t.hasAttribute("data--w")){let a=t.getAttribute("data--w");t.style.width=a}if(t.hasAttribute("data--h")){let a=t.getAttribute("data--h");t.style.height=a}if(t.hasAttribute("data--transform")){let a=t.getAttribute("data--transform");t.style.transform=a,t.setAttribute("data--transform-val","")}}t.setAttribute("data-prev",n),setTimeout(()=>{r||(t.style.transition="")},400)}},applyFluid:(t,n)=>{t.classList.toggle("fluid",n==="yes"),t.setAttribute("data-fluid",n)},resize:t=>{const n=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){let o=u[c].name.match(/^data--h-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0){if(n>d){let o=r.getAttribute("data--h");o?r.style.height=o:r.style.height=""}}else{const o=a[c-1];if(o>=n&&n>d){let h=r.getAttribute("data--h-"+o);h&&(r.style.height=h)}}}if(a.length>0&&a[a.length-1]>=n){const d=a[a.length-1];let o=r.getAttribute("data--h-"+d);o&&(r.style.height=o)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>n&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),e.applyFluid(r,"yes"));let c=r.getAttribute("data-fluid-val");c&&parseInt(c)+0<=n&&r.classList.contains("fluid")&&e.applyFluid(r,"no")}let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){const d=u[c].name;let o=d.match(/^data--t-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--w-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--transform-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0)n>d&&e.apply(r,1e4,t);else{const o=a[c-1];o>=n&&n>d&&e.apply(r,o,t)}}if(a.length>0){const c=a[a.length-1];c>=n&&e.apply(r,c,t)}})},render:()=>{e.start(),e.resize(!0)}},s=((t,n)=>{let r;return(...a)=>{clearTimeout(r),r=setTimeout(()=>t(...a),n)}})(()=>{e.resize()},0);window.addEventListener("resize",s),e.start(),e.resize(!0),this.Block=e}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return As})();
|
|
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})();
|