@innovastudio/contentbox-runtime 1.0.2 → 1.0.3
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 +3177 -2930
- package/dist/contentbox-runtime.min.js +69 -69
- package/package.json +3 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var ContentBoxRuntime=(function(){"use strict";var Qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var ht={exports:{}},qi=ht.exports,Kt;function Ri(){return Kt||(Kt=1,(function(m,e){(function(i,s){m.exports=s()})(qi,function(){var i=typeof window<"u"?window:typeof Qt<"u"?Qt:typeof self<"u"?self:{},s="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,o=typeof i=="object"&&i&&i.Object===Object&&i,h=typeof self=="object"&&self&&self.Object===Object&&self,f=o||h||Function("return this")(),v=Object.prototype.toString,S=Math.max,R=Math.min,y=function(){return f.Date.now()};function E(A,j,U){var Y,Z,ee,te,K,me,le=0,Ce=!1,pe=!1,xe=!0;if(typeof A!="function")throw new TypeError(s);function Le(ce){var Re=Y,De=Z;return Y=Z=void 0,le=ce,te=A.apply(De,Re)}function $e(ce){var Re=ce-me;return me===void 0||Re>=j||Re<0||pe&&ce-le>=ee}function Ne(){var ce=y();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(Re){var De=j-(Re-me);return pe?R(De,ee-(Re-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&Y?Le(ce):(Y=Z=void 0,te)}function ke(){var ce=y(),Re=$e(ce);if(Y=arguments,Z=this,me=ce,Re){if(K===void 0)return(function(De){return le=De,K=setTimeout(Ne,j),Ce?Le(De):te})(me);if(pe)return K=setTimeout(Ne,j),Le(me)}return K===void 0&&(K=setTimeout(Ne,j)),te}return j=k(j)||0,b(U)&&(Ce=!!U.leading,ee=(pe="maxWait"in U)?S(k(U.maxWait)||0,j):ee,xe="trailing"in U?!!U.trailing:xe),ke.cancel=function(){K!==void 0&&clearTimeout(K),le=0,Y=me=Z=K=void 0},ke.flush=function(){return K===void 0?te:Pe(y())},ke}function b(A){var j=typeof A;return!!A&&(j=="object"||j=="function")}function k(A){if(typeof A=="number")return A;if((function(Y){return typeof Y=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(Y)&&v.call(Y)==n})(A))return t;if(b(A)){var j=typeof A.valueOf=="function"?A.valueOf():A;A=b(j)?j+"":j}if(typeof A!="string")return A===0?A:+A;A=A.replace(r,"");var U=u.test(A);return U||c.test(A)?d(A.slice(2),U?2:8):a.test(A)?t:+A}var C=function(A,j,U){var Y=!0,Z=!0;if(typeof A!="function")throw new TypeError(s);return b(U)&&(Y="leading"in U?!!U.leading:Y,Z="trailing"in U?!!U.trailing:Z),E(A,j,{leading:Y,maxWait:j,trailing:Z})},g="Expected a function",w=NaN,q="[object Symbol]",V=/^\s+|\s+$/g,I=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,G=/^0o[0-7]+$/i,B=parseInt,M=typeof i=="object"&&i&&i.Object===Object&&i,_=typeof self=="object"&&self&&self.Object===Object&&self,L=M||_||Function("return this")(),P=Object.prototype.toString,W=Math.max,N=Math.min,J=function(){return L.Date.now()};function Q(A){var j=typeof A;return!!A&&(j=="object"||j=="function")}function se(A){if(typeof A=="number")return A;if((function(Y){return typeof Y=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(Y)&&P.call(Y)==q})(A))return w;if(Q(A)){var j=typeof A.valueOf=="function"?A.valueOf():A;A=Q(j)?j+"":j}if(typeof A!="string")return A===0?A:+A;A=A.replace(V,"");var U=F.test(A);return U||G.test(A)?B(A.slice(2),U?2:8):I.test(A)?w:+A}var re=function(A,j,U){var Y,Z,ee,te,K,me,le=0,Ce=!1,pe=!1,xe=!0;if(typeof A!="function")throw new TypeError(g);function Le(ce){var Re=Y,De=Z;return Y=Z=void 0,le=ce,te=A.apply(De,Re)}function $e(ce){var Re=ce-me;return me===void 0||Re>=j||Re<0||pe&&ce-le>=ee}function Ne(){var ce=J();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(Re){var De=j-(Re-me);return pe?N(De,ee-(Re-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&Y?Le(ce):(Y=Z=void 0,te)}function ke(){var ce=J(),Re=$e(ce);if(Y=arguments,Z=this,me=ce,Re){if(K===void 0)return(function(De){return le=De,K=setTimeout(Ne,j),Ce?Le(De):te})(me);if(pe)return K=setTimeout(Ne,j),Le(me)}return K===void 0&&(K=setTimeout(Ne,j)),te}return j=se(j)||0,Q(U)&&(Ce=!!U.leading,ee=(pe="maxWait"in U)?W(se(U.maxWait)||0,j):ee,xe="trailing"in U?!!U.trailing:xe),ke.cancel=function(){K!==void 0&&clearTimeout(K),le=0,Y=me=Z=K=void 0},ke.flush=function(){return K===void 0?te:Pe(J())},ke},ae=function(){};function de(A){A&&A.forEach(function(j){var U=Array.prototype.slice.call(j.addedNodes),Y=Array.prototype.slice.call(j.removedNodes);if((function Z(ee){var te=void 0,K=void 0;for(te=0;te<ee.length;te+=1)if((K=ee[te]).dataset&&K.dataset.aos||K.children&&Z(K.children))return!0;return!1})(U.concat(Y)))return ae()})}function ue(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var Se={isSupported:function(){return!!ue()},ready:function(A,j){var U=window.document,Y=new(ue())(de);ae=j,Y.observe(U.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},Ie=function(A,j){if(!(A instanceof j))throw new TypeError("Cannot call a class as a function")},Ae=(function(){function A(j,U){for(var Y=0;Y<U.length;Y++){var Z=U[Y];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(j,Z.key,Z)}}return function(j,U,Y){return U&&A(j.prototype,U),Y&&A(j,Y),j}})(),qe=Object.assign||function(A){for(var j=1;j<arguments.length;j++){var U=arguments[j];for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(A[Y]=U[Y])}return A},Ee=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,be=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,X=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,ie=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function ge(){return navigator.userAgent||navigator.vendor||window.opera||""}var ve=new((function(){function A(){Ie(this,A)}return Ae(A,[{key:"phone",value:function(){var j=ge();return!(!Ee.test(j)&&!be.test(j.substr(0,4)))}},{key:"mobile",value:function(){var j=ge();return!(!X.test(j)&&!ie.test(j.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),A})()),Oe=function(A,j){var U=void 0;return ve.ie11()?(U=document.createEvent("CustomEvent")).initCustomEvent(A,!0,!0,{detail:j}):U=new CustomEvent(A,{detail:j}),document.dispatchEvent(U)},ye=function(A){return A.forEach(function(j,U){return(function(Y,Z){var ee=Y.options,te=Y.position,K=Y.node,me=(Y.data,function(){Y.animated&&((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.remove(pe)})})(K,ee.animatedClassNames),Oe("aos:out",K),Y.options.id&&Oe("aos:in:"+Y.options.id,K),Y.animated=!1)});ee.mirror&&Z>=te.out&&!ee.once?me():Z>=te.in?Y.animated||((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.add(pe)})})(K,ee.animatedClassNames),Oe("aos:in",K),Y.options.id&&Oe("aos:in:"+Y.options.id,K),Y.animated=!0):Y.animated&&!ee.once&&me()})(j,window.pageYOffset)})},fe=function(A){for(var j=0,U=0;A&&!isNaN(A.offsetLeft)&&!isNaN(A.offsetTop);)j+=A.offsetLeft-(A.tagName!="BODY"?A.scrollLeft:0),U+=A.offsetTop-(A.tagName!="BODY"?A.scrollTop:0),A=A.offsetParent;return{top:U,left:j}},he=function(A,j,U){var Y=A.getAttribute("data-aos-"+j);if(Y!==void 0){if(Y==="true")return!0;if(Y==="false")return!1}return Y||U},ne=function(A,j){return A.forEach(function(U,Y){var Z=he(U.node,"mirror",j.mirror),ee=he(U.node,"once",j.once),te=he(U.node,"id"),K=j.useClassNames&&U.node.getAttribute("data-aos"),me=[j.animatedClassName].concat(K?K.split(" "):[]).filter(function(le){return typeof le=="string"});j.initClassName&&U.node.classList.add(j.initClassName),U.position={in:(function(le,Ce,pe){var xe=window.innerHeight,Le=he(le,"anchor"),$e=he(le,"anchor-placement"),Ne=Number(he(le,"offset",$e?0:Ce)),Pe=$e||pe,ke=le;Le&&document.querySelectorAll(Le)&&(ke=document.querySelectorAll(Le)[0]);var ce=fe(ke).top-xe;switch(Pe){case"top-bottom":break;case"center-bottom":ce+=ke.offsetHeight/2;break;case"bottom-bottom":ce+=ke.offsetHeight;break;case"top-center":ce+=xe/2;break;case"center-center":ce+=xe/2+ke.offsetHeight/2;break;case"bottom-center":ce+=xe/2+ke.offsetHeight;break;case"top-top":ce+=xe;break;case"bottom-top":ce+=xe+ke.offsetHeight;break;case"center-top":ce+=xe+ke.offsetHeight/2}return ce+Ne})(U.node,j.offset,j.anchorPlacement),out:Z&&(function(le,Ce){var pe=he(le,"anchor"),xe=he(le,"offset",Ce),Le=le;return pe&&document.querySelectorAll(pe)&&(Le=document.querySelectorAll(pe)[0]),fe(Le).top+Le.offsetHeight-xe})(U.node,j.offset)},U.options={once:ee,mirror:Z,animatedClassNames:me,id:te}}),A},Me=function(){var A=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(A,function(j){return{node:j}})},l=[],p=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},T=function(){return document.all&&!window.atob},O=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(p=!0),p&&(l=ne(l,x),ye(l),window.addEventListener("scroll",C(function(){ye(l,x.once)},x.throttleDelay)))},D=function(){if(l=Me(),$(x.disable)||T())return H();O()},H=function(){l.forEach(function(A,j){A.node.removeAttribute("data-aos"),A.node.removeAttribute("data-aos-easing"),A.node.removeAttribute("data-aos-duration"),A.node.removeAttribute("data-aos-delay"),x.initClassName&&A.node.classList.remove(x.initClassName),x.animatedClassName&&A.node.classList.remove(x.animatedClassName)})},$=function(A){return A===!0||A==="mobile"&&ve.mobile()||A==="phone"&&ve.phone()||A==="tablet"&&ve.tablet()||typeof A=="function"&&A()===!0};return{init:function(A){return x=qe(x,A),l=Me(),x.disableMutationObserver||Se.isSupported()||(console.info(`
|
|
1
|
+
var ContentBoxRuntime=(function(){"use strict";var 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(`
|
|
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
|
-
`),x.disableMutationObserver=!0),x.disableMutationObserver||
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(c,d){if(c){if(typeof c=="string")return r(c,d);var o=Object.prototype.toString.call(c).slice(8,-1);return o==="Object"&&c.constructor&&(o=c.constructor.name),o==="Map"||o==="Set"?Array.from(c):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(c,d):void 0}}function r(c,d){(d==null||d>c.length)&&(d=c.length);for(var o=0,h=new Array(d);o<d;o++)h[o]=c[o];return h}function a(c,d){if(typeof Symbol<"u"&&Symbol.iterator in Object(c)){var o=[],h=!0,f=!1,v=void 0;try{for(var S,R=c[Symbol.iterator]();!(h=(S=R.next()).done)&&(o.push(S.value),!d||o.length!==d);h=!0);}catch(y){f=!0,v=y}finally{try{h||R.return==null||R.return()}finally{if(f)throw v}}return o}}function u(c){if(Array.isArray(c))return c}(function(){function c(g){return["elInY+elHeight","elCenterY-".concat(g=0<arguments.length&&g!==void 0?g:30),"elCenterY","elCenterY+".concat(g),"elOutY-elHeight"]}var d,o,h,f,v,S,R={fadeInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:0,{opacity:[c(0<arguments.length&&g!==void 0?g:30),[w,1,1,1,w]]}},fadeIn:function(g,w){return{opacity:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:0,1]]}},fadeOut:function(g,w){return{opacity:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&w!==void 0?w:0]]}},blurInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:20,{blur:[c(0<arguments.length&&g!==void 0?g:100),[w,0,0,0,w]]}},blurIn:function(g,w){return{blur:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:20,0]]}},blurOut:function(g,w){return{opacity:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[0,1<arguments.length&&w!==void 0?w:20]]}},scaleInOut:function(g,w){return w=1<arguments.length&&w!==void 0?w:.6,{scale:[c(0<arguments.length&&g!==void 0?g:100),[w,1,1,1,w]]}},scaleIn:function(g,w){return{scale:[["elInY+elHeight",0<arguments.length&&g!==void 0?g:"elCenterY"],[1<arguments.length&&w!==void 0?w:.6,1]]}},scaleOut:function(g,w){return{scale:[[0<arguments.length&&g!==void 0?g:"elCenterY","elOutY-elHeight"],[1,1<arguments.length&&w!==void 0?w:.6]]}},slideX:function(g,w){return{translateX:[["elInY",0<arguments.length&&g!==void 0?g:0],[0,1<arguments.length&&w!==void 0?w:500]]}},slideY:function(g,w){return{translateY:[["elInY",0<arguments.length&&g!==void 0?g:0],[0,1<arguments.length&&w!==void 0?w:500]]}},spin:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotate:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},flipX:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotateX:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},flipY:function(g,w){return g=0<arguments.length&&g!==void 0?g:1e3,{rotateY:[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}},jiggle:function(g,w){return g=0<arguments.length&&g!==void 0?g:50,w=1<arguments.length&&w!==void 0?w:40,{skewX:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},seesaw:function(g,w){return g=0<arguments.length&&g!==void 0?g:50,w=1<arguments.length&&w!==void 0?w:40,{skewY:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},zigzag:function(g,w){return g=0<arguments.length&&g!==void 0?g:100,w=1<arguments.length&&w!==void 0?w:100,{translateX:[[0,+g,2*g,3*g,4*g],[0,w,0,-w,0],{modValue:4*g}]}},hueRotate:function(g,w){return g=0<arguments.length&&g!==void 0?g:600,{"hue-rotate":[[0,g],[0,1<arguments.length&&w!==void 0?w:360],{modValue:g}]}}},y=(d=["perspective","scaleX","scaleY","scale","skewX","skewY","skew","rotateX","rotateY","rotate"],o=["blur","hue-rotate","brightness"],h=["translateX","translateY","translateZ"],f=["perspective","border-radius","blur","translateX","translateY","translateZ"],v=["hue-rotate","rotate","rotateX","rotateY","skew","skewX","skewY"],S={easeInQuad:function(g){return g*g},easeOutQuad:function(g){return g*(2-g)},easeInOutQuad:function(g){return g<.5?2*g*g:(4-2*g)*g-1},easeInCubic:function(g){return g*g*g},easeOutCubic:function(g){return--g*g*g+1},easeInOutCubic:function(g){return g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1},easeInQuart:function(g){return g*g*g*g},easeOutQuart:function(g){return 1- --g*g*g*g},easeInOutQuart:function(g){return g<.5?8*g*g*g*g:1-8*--g*g*g*g},easeInQuint:function(g){return g*g*g*g*g},easeOutQuint:function(g){return 1+--g*g*g*g*g},easeInOutQuint:function(g){return g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g},easeOutBounce:function(g){var w=7.5625,q=2.75;return g<1/q?w*g*g:g<2/q?w*(g-=1.5/q)*g+.75:g<2.5/q?w*(g-=2.25/q)*g+.9375:w*(g-=2.625/q)*g+.984375},easeInBounce:function(g){return 1-S.easeOutBounce(1-g)},easeOutBack:function(g){return 1+2.70158*Math.pow(g-1,3)+1.70158*Math.pow(g-1,2)},easeInBack:function(g){return 2.70158*g*g*g-1.70158*g*g}},new function g(){var w=this;e(this,g),i(this,"drivers",[]),i(this,"elements",[]),i(this,"frame",0),i(this,"debug",!1),i(this,"windowWidth",0),i(this,"windowHeight",0),i(this,"presets",R),i(this,"debugData",{frameLengths:[]}),i(this,"init",function(){w.findAndAddElements(),window.requestAnimationFrame(w.onAnimationFrame),w.windowWidth=document.body.clientWidth,w.windowHeight=document.body.clientHeight,window.onresize=w.onWindowResize}),i(this,"onWindowResize",function(){document.body.clientWidth===w.windowWidth&&document.body.clientHeight===w.windowHeight||(w.windowWidth=document.body.clientWidth,w.windowHeight=document.body.clientHeight,w.elements.forEach(function(q){return q.calculateTransforms()}))}),i(this,"onAnimationFrame",function(q){w.debug&&(w.debugData.frameStart=Date.now());var V,I={};w.drivers.forEach(function(F){I[F.name]=F.getValue(w.frame)}),w.elements.forEach(function(F){F.update(I,w.frame)}),w.debug&&w.debugData.frameLengths.push(Date.now()-w.debugData.frameStart),w.frame%60==0&&w.debug&&(V=Math.ceil(w.debugData.frameLengths.reduce(function(F,G){return F+G},0)/60),console.log("Average frame calculation time: ".concat(V,"ms")),w.debugData.frameLengths=[]),w.frame++,window.requestAnimationFrame(w.onAnimationFrame)}),i(this,"addDriver",function(q,V){var I=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};w.drivers.push(new k(q,V,I))}),i(this,"removeDriver",function(q){w.drivers=w.drivers.filter(function(V){return V.name!==q})}),i(this,"findAndAddElements",function(){w.elements=[],document.querySelectorAll(".lax").forEach(function(q){var V=[];q.classList.forEach(function(F){F.includes("lax_preset")&&(F=F.replace("lax_preset_",""),V.push(F))});var I=i({},"scrollY",{presets:V});w.elements.push(new C(".lax",w,q,I,0,{}))})}),i(this,"addElements",function(q,V,I){document.querySelectorAll(q).forEach(function(F,G){w.elements.push(new C(q,w,F,V,G,I))})}),i(this,"removeElements",function(q){w.elements=w.elements.filter(function(V){return V.selector!==q})}),i(this,"addElement",function(q,V,I){w.elements.push(new C("",w,q,V,0,I))}),i(this,"removeElement",function(q){w.elements=w.elements.filter(function(V){return V.domElement!==q})})});function E(g,w){if(Array.isArray(g))return g;for(var q=Object.keys(g).map(function(G){return parseInt(G)}).sort(function(G,B){return B<G?1:-1}),V=q[q.length-1],I=0;I<q.length;I++){var F=q[I];if(w<F){V=F;break}}return g[V]}function b(g,N,q){var V=N.width,I=N.height,L=N.x,W=N.y;if(typeof g=="number")return g;var F,G=document.body.scrollHeight,B=document.body.scrollWidth,M=window.innerWidth,_=window.innerHeight,P=s((F=window.pageXOffset!==void 0,P=(document.compatMode||"")==="CSS1Compat",N=F?window.pageXOffset:(P?document.documentElement:document.body).scrollLeft,[F?window.pageYOffset:(P?document.documentElement:document.body).scrollTop,N]),2),N=P[0],L=L+P[1],P=L+V,W=W+N,N=W+I;return Function("return ".concat(g.replace(/screenWidth/g,M).replace(/screenHeight/g,_).replace(/pageHeight/g,G).replace(/pageWidth/g,B).replace(/elWidth/g,V).replace(/elHeight/g,I).replace(/elInY/g,W-_).replace(/elOutY/g,N).replace(/elCenterY/g,W+I/2-_/2).replace(/elInX/g,L-M).replace(/elOutX/g,P).replace(/elCenterX/g,L+V/2-M/2).replace(/index/g,q)))()}function k(g,w){var q=this,V=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};e(this,k),i(this,"getValueFn",void 0),i(this,"name",""),i(this,"lastValue",0),i(this,"frameStep",1),i(this,"m1",0),i(this,"m2",0),i(this,"inertia",0),i(this,"inertiaEnabled",!1),i(this,"getValue",function(I){var F=q.lastValue;return I%q.frameStep==0&&(F=q.getValueFn(I)),q.inertiaEnabled&&(I=F-q.lastValue,q.m1=.8*q.m1+I*.19999999999999996,q.m2=.8*q.m2+q.m1*.19999999999999996,q.inertia=Math.round(5e3*q.m2)/15e3),q.lastValue=F,[q.lastValue,q.inertia]}),this.name=g,this.getValueFn=w,Object.keys(V).forEach(function(I){q[I]=V[I]}),this.lastValue=this.getValueFn(0)}function C(g,w,q,V){var I=this,F=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,B=5<arguments.length&&arguments[5]!==void 0?arguments[5]:{};e(this,C),i(this,"domElement",void 0),i(this,"transformsData",void 0),i(this,"styles",{}),i(this,"selector",""),i(this,"groupIndex",0),i(this,"laxInstance",void 0),i(this,"onUpdate",void 0),i(this,"update",function(M,_){var L,P=I.transforms,W={};for(L in P){var N=P[L];M[L]||console.error("No lax driver with name: ",L);var J,Q=s(M[L],2),se=Q[0],re=Q[1];for(J in N){var ae,Ae=s(N[J],3),de=Ae[0],ue=Ae[1],qe=Ae[2],be=qe===void 0?{}:qe,Se=be.modValue,Ee=be.frameStep,Ie=Ee===void 0?1:Ee,X=be.easing,Ae=be.inertia,qe=be.inertiaMode,Ee=be.cssFn,be=be.cssUnit,be=be===void 0?"":be,X=S[X];_%Ie==0&&(X=(function(ie,ge,ve,Oe){var ye=0;if(ie.forEach(function(ne){ne<ve&&ye++}),ye<=0)return ge[0];if(ye>=ie.length)return ge[ie.length-1];var fe,he=(he=ie[fe=ye-1],ie=ie[ye],(ve-he)/(ie-he));return Oe&&(he=Oe(he)),fe=ge[fe],ge=ge[ye],fe*(1-(he=he))+ge*he})(de,ue,Se?se%Se:se,X),Ae&&(ae=re*Ae,qe==="absolute"&&(ae=Math.abs(ae)),X+=ae),ae=(be||f.includes(J)?"px":v.includes(J)?"deg":"")=="px"?0:3,ae=X.toFixed(ae),W[J]=Ee?Ee(ae,I.domElement):ae+be)}}I.applyStyles(W),I.onUpdate&&I.onUpdate(M,I.domElement)}),i(this,"calculateTransforms",function(){I.transforms={};var M,_=I.laxInstance.windowWidth;for(M in I.transformsData)(function(L){var P=I.transformsData[L],W={},N=P.presets;(N===void 0?[]:N).forEach(function(de){var se,ue=s(de.split(":"),3),re=ue[0],ae=ue[1],de=ue[2],ue=window.lax.presets[re];ue?(se=ue(ae,de),Object.keys(se).forEach(function(Se){P[Se]=se[Se]})):console.error("Lax preset cannot be found with name: ",re)}),delete P.presets;for(var J in P)(function(Q){var se=s(P[Q],3),de=se[0],ae=de===void 0?[-1e9,1e9]:de,de=se[1],de=de===void 0?[-1e9,1e9]:de,se=se[2],se=se===void 0?{}:se,re=I.domElement.getBoundingClientRect(),ae=E(ae,_).map(function(ue){return b(ue,re,I.groupIndex)}),de=E(de,_).map(function(ue){return b(ue,re,I.groupIndex)});W[Q]=[ae,de,se]})(J);I.transforms[L]=W})(M)}),i(this,"applyStyles",function(M){var _,L,P,W=(_=M,L={transform:"",filter:""},P={translateX:1e-5,translateY:1e-5,translateZ:1e-5},Object.keys(_).forEach(function(N){var J=_[N],Q=f.includes(N)?"px":v.includes(N)?"deg":"";h.includes(N)?P[N]=J:d.includes(N)?L.transform+="".concat(N,"(").concat(J).concat(Q,") "):o.includes(N)?L.filter+="".concat(N,"(").concat(J).concat(Q,") "):L[N]="".concat(J).concat(Q," ")}),L.transform="translate3d(".concat(P.translateX,"px, ").concat(P.translateY,"px, ").concat(P.translateZ,"px) ").concat(L.transform),L);Object.keys(W).forEach(function(N){I.domElement.style.setProperty(N,W[N])})}),this.selector=g,this.laxInstance=w,this.domElement=q,this.transformsData=V,this.groupIndex=F;var G=(F=B.style)===void 0?{}:F,B=B.onUpdate;Object.keys(G).forEach(function(M){q.style.setProperty(M,G[M])}),B&&(this.onUpdate=B),this.calculateTransforms()}m.exports!==void 0?m.exports=y:window.lax=y})()})(Mt)),Mt.exports}var Ni=Ii();const et=dt(Ni);class Pi{constructor(e={}){const i={};this.settings=Object.assign(this,i,e),this.elements=[]}init(){et.init(),et.addDriver("scrollY",function(){return window.scrollY}),this.refresh(),this.lax=et,Object.assign(this,et)}refresh(){let e=!1;document.body.hasAttribute("data-skrollrr-off")&&(e=!0),this.elements.forEach(t=>{et.removeElement(t),t.style&&(t.style.transition&&(t.style.transition=""),t.style.transform&&(t.style.transform=""))}),this.elements=[];let i=window.innerWidth;document.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]").forEach(t=>{let n=!1;if(i<=760&&t.closest(".m-skrollrr-off")&&(n=!0),e||n){t.style.transform="",t.style.transition="",t.style.opacity="";return}t.style.transform="";let r=this.getObjVal(t,"data-top-bottom"),a=this.getObjVal(t,"data-top"),u=this.getObjVal(t,"data-50-top"),c=this.getObjVal(t,"data-100-top"),d=this.getObjVal(t,"data-center-bottom"),o=this.getObjVal(t,"data-center"),h=this.getObjVal(t,"data-center-top"),f=this.getObjVal(t,"data--400-bottom"),v=this.getObjVal(t,"data--300-bottom"),S=this.getObjVal(t,"data--200-bottom"),R=this.getObjVal(t,"data--150-bottom"),y=this.getObjVal(t,"data--100-bottom"),E=this.getObjVal(t,"data--50-bottom"),b=this.getObjVal(t,"data-bottom"),k=this.getObjVal(t,"data-50-bottom"),C=this.getObjVal(t,"data-100-bottom"),g=this.getObjVal(t,"data-150-bottom"),w=this.getObjVal(t,"data-200-bottom"),q=this.getObjVal(t,"data-300-bottom"),V=this.getObjVal(t,"data-400-bottom"),I=this.getObjVal(t,"data-bottom-top"),F=this.getObjVal(t,"data-in"),G=this.getObjVal(t,"data-in-150"),B=this.getObjVal(t,"data-in-300"),M=this.getObjVal(t,"data-cen--150"),_=this.getObjVal(t,"data-cen"),L=this.getObjVal(t,"data-cen-150"),P=this.getObjVal(t,"data-out--300"),W=this.getObjVal(t,"data-out--150"),N=this.getObjVal(t,"data-out"),J=!1;t.hasAttribute("data-xs")&&(J=!0);let Q=!1;t.hasAttribute("data-sm")&&(Q=!0);let se=!1;t.hasAttribute("data-md")&&(se=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let re={},ae={},de={},ue={},Se={},Ie={},Ae={},qe={},Ee={},be={},X={},ie={},ge={},ve={},Oe={},ye={},fe={},he={},ne={},Me={},l={},p={},x={},T={},O={},D={},H={},$={},A={},j={},U={},Y={},Z={};(i>1280||i>970&&i<=1280&&!se||i>760&&i<=970&&!Q||i<=760&&!J)&&(de=this.getObjVal(t,"data-t"),ue=this.getObjVal(t,"data-t-100"),Se=this.getObjVal(t,"data-t-200"),Ie=this.getObjVal(t,"data-t-300"),Ae=this.getObjVal(t,"data-t-400"),qe=this.getObjVal(t,"data-t-500"),Ee=this.getObjVal(t,"data-t-600"),be=this.getObjVal(t,"data-t-700"),X=this.getObjVal(t,"data-t-800"),ie=this.getObjVal(t,"data-t-900"),ge=this.getObjVal(t,"data-t-1000"),ve=this.getObjVal(t,"data-t-1100"),Oe=this.getObjVal(t,"data-t-1200"),ye=this.getObjVal(t,"data-t-1300"),fe=this.getObjVal(t,"data-t-1400"),he=this.getObjVal(t,"data-t-1500"),ne=this.getObjVal(t,"data-t-1600"),Me=this.getObjVal(t,"data-t-1700"),l=this.getObjVal(t,"data-t-1800"),p=this.getObjVal(t,"data-t-1900"),x=this.getObjVal(t,"data-t-2000"),T=this.getObjVal(t,"data-t-2100"),O=this.getObjVal(t,"data-t-2200"),D=this.getObjVal(t,"data-t-2300"),H=this.getObjVal(t,"data-t-2400"),$=this.getObjVal(t,"data-t-2500"),A=this.getObjVal(t,"data-t-2600"),j=this.getObjVal(t,"data-t-2700"),U=this.getObjVal(t,"data-t-2800")),i>970&&i<=1280&&se&&(t.hasAttribute("data-md-t")&&(de=this.getObjVal(t,"data-md-t")),t.hasAttribute("data-md-t-100")&&(ue=this.getObjVal(t,"data-md-t-100")),t.hasAttribute("data-md-t-200")&&(Se=this.getObjVal(t,"data-md-t-200")),t.hasAttribute("data-md-t-300")&&(Ie=this.getObjVal(t,"data-md-t-300")),t.hasAttribute("data-md-t-400")&&(Ae=this.getObjVal(t,"data-md-t-400")),t.hasAttribute("data-md-t-500")&&(qe=this.getObjVal(t,"data-md-t-500")),t.hasAttribute("data-md-t-600")&&(Ee=this.getObjVal(t,"data-md-t-600")),t.hasAttribute("data-md-t-700")&&(be=this.getObjVal(t,"data-md-t-700")),t.hasAttribute("data-md-t-800")&&(X=this.getObjVal(t,"data-md-t-800")),t.hasAttribute("data-md-t-900")&&(ie=this.getObjVal(t,"data-md-t-900")),t.hasAttribute("data-md-t-1000")&&(ge=this.getObjVal(t,"data-md-t-1000")),t.hasAttribute("data-md-t-1100")&&(ve=this.getObjVal(t,"data-md-t-1100")),t.hasAttribute("data-md-t-1200")&&(Oe=this.getObjVal(t,"data-md-t-1200")),t.hasAttribute("data-md-t-1300")&&(ye=this.getObjVal(t,"data-md-t-1300")),t.hasAttribute("data-md-t-1400")&&(fe=this.getObjVal(t,"data-md-t-1400")),t.hasAttribute("data-md-t-1500")&&(he=this.getObjVal(t,"data-md-t-1500")),t.hasAttribute("data-md-t-1600")&&(ne=this.getObjVal(t,"data-md-t-1600")),t.hasAttribute("data-md-t-1700")&&(Me=this.getObjVal(t,"data-md-t-1700")),t.hasAttribute("data-md-t-1800")&&(l=this.getObjVal(t,"data-md-t-1800")),t.hasAttribute("data-md-t-1900")&&(p=this.getObjVal(t,"data-md-t-1900")),t.hasAttribute("data-md-t-2000")&&(x=this.getObjVal(t,"data-md-t-2000")),t.hasAttribute("data-md-t-2100")&&(T=this.getObjVal(t,"data-md-t-2100")),t.hasAttribute("data-md-t-2200")&&(O=this.getObjVal(t,"data-md-t-2200")),t.hasAttribute("data-md-t-2300")&&(D=this.getObjVal(t,"data-md-t-2300")),t.hasAttribute("data-md-t-2400")&&(H=this.getObjVal(t,"data-md-t-2400")),t.hasAttribute("data-md-t-2500")&&($=this.getObjVal(t,"data-md-t-2500")),t.hasAttribute("data-md-t-2600")&&(A=this.getObjVal(t,"data-md-t-2600")),t.hasAttribute("data-md-t-2700")&&(j=this.getObjVal(t,"data-md-t-2700")),t.hasAttribute("data-md-t-2800")&&(U=this.getObjVal(t,"data-md-t-2800"))),i<=970&&t.hasAttribute("m-data-out")&&(N=this.getObjVal(t,"m-data-out")),(i>760&&i<=970&&Q||i<=760&&!J&&Q)&&(t.hasAttribute("data-sm-t")&&(de=this.getObjVal(t,"data-sm-t")),t.hasAttribute("data-sm-t-100")&&(ue=this.getObjVal(t,"data-sm-t-100")),t.hasAttribute("data-sm-t-200")&&(Se=this.getObjVal(t,"data-sm-t-200")),t.hasAttribute("data-sm-t-300")&&(Ie=this.getObjVal(t,"data-sm-t-300")),t.hasAttribute("data-sm-t-400")&&(Ae=this.getObjVal(t,"data-sm-t-400")),t.hasAttribute("data-sm-t-500")&&(qe=this.getObjVal(t,"data-sm-t-500")),t.hasAttribute("data-sm-t-600")&&(Ee=this.getObjVal(t,"data-sm-t-600")),t.hasAttribute("data-sm-t-700")&&(be=this.getObjVal(t,"data-sm-t-700")),t.hasAttribute("data-sm-t-800")&&(X=this.getObjVal(t,"data-sm-t-800")),t.hasAttribute("data-sm-t-900")&&(ie=this.getObjVal(t,"data-sm-t-900")),t.hasAttribute("data-sm-t-1000")&&(ge=this.getObjVal(t,"data-sm-t-1000")),t.hasAttribute("data-sm-t-1100")&&(ve=this.getObjVal(t,"data-sm-t-1100")),t.hasAttribute("data-sm-t-1200")&&(Oe=this.getObjVal(t,"data-sm-t-1200")),t.hasAttribute("data-sm-t-1300")&&(ye=this.getObjVal(t,"data-sm-t-1300")),t.hasAttribute("data-sm-t-1400")&&(fe=this.getObjVal(t,"data-sm-t-1400")),t.hasAttribute("data-sm-t-1500")&&(he=this.getObjVal(t,"data-sm-t-1500")),t.hasAttribute("data-sm-t-1600")&&(ne=this.getObjVal(t,"data-sm-t-1600")),t.hasAttribute("data-sm-t-1700")&&(Me=this.getObjVal(t,"data-sm-t-1700")),t.hasAttribute("data-sm-t-1800")&&(l=this.getObjVal(t,"data-sm-t-1800")),t.hasAttribute("data-sm-t-1900")&&(p=this.getObjVal(t,"data-sm-t-1900")),t.hasAttribute("data-sm-t-2000")&&(x=this.getObjVal(t,"data-sm-t-2000")),t.hasAttribute("data-sm-t-2100")&&(T=this.getObjVal(t,"data-sm-t-2100")),t.hasAttribute("data-sm-t-2200")&&(O=this.getObjVal(t,"data-sm-t-2200")),t.hasAttribute("data-sm-t-2300")&&(D=this.getObjVal(t,"data-sm-t-2300")),t.hasAttribute("data-sm-t-2400")&&(H=this.getObjVal(t,"data-sm-t-2400")),t.hasAttribute("data-sm-t-2500")&&($=this.getObjVal(t,"data-sm-t-2500")),t.hasAttribute("data-sm-t-2600")&&(A=this.getObjVal(t,"data-sm-t-2600")),t.hasAttribute("data-sm-t-2700")&&(j=this.getObjVal(t,"data-sm-t-2700")),t.hasAttribute("data-sm-t-2800")&&(U=this.getObjVal(t,"data-sm-t-2800"))),i<=414&&J&&(t.hasAttribute("data-xs-t")&&(de=this.getObjVal(t,"data-xs-t")),t.hasAttribute("data-xs-t-100")&&(ue=this.getObjVal(t,"data-xs-t-100")),t.hasAttribute("data-xs-t-200")&&(Se=this.getObjVal(t,"data-xs-t-200")),t.hasAttribute("data-xs-t-300")&&(Ie=this.getObjVal(t,"data-xs-t-300")),t.hasAttribute("data-xs-t-400")&&(Ae=this.getObjVal(t,"data-xs-t-400")),t.hasAttribute("data-xs-t-500")&&(qe=this.getObjVal(t,"data-xs-t-500")),t.hasAttribute("data-xs-t-600")&&(Ee=this.getObjVal(t,"data-xs-t-600")),t.hasAttribute("data-xs-t-700")&&(be=this.getObjVal(t,"data-xs-t-700")),t.hasAttribute("data-xs-t-800")&&(X=this.getObjVal(t,"data-xs-t-800")),t.hasAttribute("data-xs-t-900")&&(ie=this.getObjVal(t,"data-xs-t-900")),t.hasAttribute("data-xs-t-1000")&&(ge=this.getObjVal(t,"data-xs-t-1000")),t.hasAttribute("data-xs-t-1100")&&(ve=this.getObjVal(t,"data-xs-t-1100")),t.hasAttribute("data-xs-t-1200")&&(Oe=this.getObjVal(t,"data-xs-t-1200")),t.hasAttribute("data-xs-t-1300")&&(ye=this.getObjVal(t,"data-xs-t-1300")),t.hasAttribute("data-xs-t-1400")&&(fe=this.getObjVal(t,"data-xs-t-1400")),t.hasAttribute("data-xs-t-1500")&&(he=this.getObjVal(t,"data-xs-t-1500")),t.hasAttribute("data-xs-t-1600")&&(ne=this.getObjVal(t,"data-xs-t-1600")),t.hasAttribute("data-xs-t-1700")&&(Me=this.getObjVal(t,"data-xs-t-1700")),t.hasAttribute("data-xs-t-1800")&&(l=this.getObjVal(t,"data-xs-t-1800")),t.hasAttribute("data-xs-t-1900")&&(p=this.getObjVal(t,"data-xs-t-1900")),t.hasAttribute("data-xs-t-2000")&&(x=this.getObjVal(t,"data-xs-t-2000")),t.hasAttribute("data-xs-t-2100")&&(T=this.getObjVal(t,"data-xs-t-2100")),t.hasAttribute("data-xs-t-2200")&&(O=this.getObjVal(t,"data-xs-t-2200")),t.hasAttribute("data-xs-t-2300")&&(D=this.getObjVal(t,"data-xs-t-2300")),t.hasAttribute("data-xs-t-2400")&&(H=this.getObjVal(t,"data-xs-t-2400")),t.hasAttribute("data-xs-t-2500")&&($=this.getObjVal(t,"data-xs-t-2500")),t.hasAttribute("data-xs-t-2600")&&(A=this.getObjVal(t,"data-xs-t-2600")),t.hasAttribute("data-xs-t-2700")&&(j=this.getObjVal(t,"data-xs-t-2700")),t.hasAttribute("data-xs-t-2800")&&(U=this.getObjVal(t,"data-xs-t-2800")));let ee=de,te=ue,K=Se,me=Ie,le=Ae,Ce=qe,pe=Ee,xe=be,Le=X,$e=ie,Ne=ge,Pe=ve,ke=Oe,ce=ye,Re=fe,De=he,Ge=ne,st=Me,_e=l,He=p,Ue=x,Xe=T,nt=O,rt=D,at=H,Ot=$,At=A,qt=j,Rt=U,Ke=window.innerHeight;Ke<730?(re=ee,ae=te,de=K,ue=me,Se=le,Ie=Ce,Ae=pe,qe=xe,Ee=Le,be=$e,X=Ne,ie=Pe,ge=ke,ve=ce,Oe=Re,ye=De,fe=Ge,he=st,ne=_e,Me=He,l=Ue,p=Xe,x=nt,T=rt,O=at,D=Ot,H=At,$=qt,A=Rt,j={},U={}):Ke>=730&&Ke<790?(ae=ee,de=te,ue=K,Se=me,Ie=le,Ae=Ce,qe=pe,Ee=xe,be=Le,X=$e,ie=Ne,ge=Pe,ve=ke,Oe=ce,ye=Re,fe=De,he=Ge,ne=st,Me=_e,l=He,p=Ue,x=Xe,T=nt,O=rt,D=at,H=Ot,$=At,A=qt,j=Rt,U={}):Ke>=790&&Ke<840||(Ke>=840&&Ke<1125?(de={},ue=ee,Se=te,Ie=K,Ae=me,qe=le,Ee=Ce,be=pe,X=xe,ie=Le,ge=$e,ve=Ne,Oe=Pe,ye=ke,fe=ce,he=Re,ne=De,Me=Ge,l=st,p=_e,x=He,T=Ue,O=Xe,D=nt,H=rt,$=at,A=Ot,j=At,U=qt,Y=Rt):(de={},ue={},Se=ee,Ie=te,Ae=K,qe=me,Ee=le,be=Ce,X=pe,ie=xe,ge=Le,ve=$e,Oe=Ne,ye=Pe,fe=ke,he=ce,ne=Re,Me=De,l=Ge,p=st,x=_e,T=He,O=Ue,D=Xe,H=nt,$=rt,A=at,j=Ot,U=At,Y=qt,Z=Rt));let z={};Object.keys(I).length!==0&&(z=this.parseObj(I,"elInY",z)),Object.keys(V).length!==0&&(z=this.parseObj(V,"elInY+50",z)),Object.keys(q).length!==0&&(z=this.parseObj(q,"elInY+100",z)),Object.keys(w).length!==0&&(z=this.parseObj(w,"elInY+150",z)),Object.keys(g).length!==0&&(z=this.parseObj(g,"elInY+200",z)),Object.keys(C).length!==0&&(z=this.parseObj(C,"elInY+250",z)),Object.keys(k).length!==0&&(z=this.parseObj(k,"elInY+300",z)),Object.keys(b).length!==0&&(z=this.parseObj(b,"elInY+350",z)),Object.keys(E).length!==0&&(z=this.parseObj(E,"elInY+400",z)),Object.keys(y).length!==0&&(z=this.parseObj(y,"elInY+450",z)),Object.keys(R).length!==0&&(z=this.parseObj(R,"elInY+500",z)),Object.keys(S).length!==0&&(z=this.parseObj(S,"elInY+550",z)),Object.keys(v).length!==0&&(z=this.parseObj(v,"elInY+600",z)),Object.keys(f).length!==0&&(z=this.parseObj(f,"elInY+650",z)),Object.keys(h).length!==0&&(z=this.parseObj(h,"elCenterY-300",z)),Object.keys(o).length!==0&&(z=this.parseObj(o,"elCenterY",z)),Object.keys(d).length!==0&&(z=this.parseObj(d,"elCenterY+100",z)),Object.keys(c).length!==0&&(z=this.parseObj(c,"elCenterY+200",z)),Object.keys(u).length!==0&&(z=this.parseObj(u,"elCenterY+300",z)),Object.keys(a).length!==0&&(z=this.parseObj(a,"elOutY-300",z)),Object.keys(r).length!==0&&(z=this.parseObj(r,"elOutY",z)),Object.keys(F).length!==0&&(z=this.parseObj(F,"elInY",z)),Object.keys(G).length!==0&&(z=this.parseObj(G,"elInY+150",z)),Object.keys(B).length!==0&&(z=this.parseObj(B,"elInY+300 ",z)),Object.keys(M).length!==0&&(z=this.parseObj(M,"elCenterY-150",z)),Object.keys(_).length!==0&&(z=this.parseObj(_,"elCenterY",z)),Object.keys(L).length!==0&&(z=this.parseObj(L,"elCenterY+150",z)),Object.keys(P).length!==0&&(z=this.parseObj(P,"elOutY-300 ",z)),Object.keys(W).length!==0&&(z=this.parseObj(W,"elOutY-150 ",z)),Object.keys(N).length!==0&&(z=this.parseObj(N,"elOutY",z)),Object.keys(re).length!==0&&(z=this.parseObj(re,"elInY-200",z)),Object.keys(ae).length!==0&&(z=this.parseObj(ae,"elInY-100",z)),Object.keys(de).length!==0&&(z=this.parseObj(de,"elInY",z)),Object.keys(ue).length!==0&&(z=this.parseObj(ue,"elInY+100",z)),Object.keys(Se).length!==0&&(z=this.parseObj(Se,"elInY+200",z)),Object.keys(Ie).length!==0&&(z=this.parseObj(Ie,"elInY+300 ",z)),Object.keys(Ae).length!==0&&(z=this.parseObj(Ae,"elInY+400 ",z)),Object.keys(qe).length!==0&&(z=this.parseObj(qe,"elInY+500 ",z)),Object.keys(Ee).length!==0&&(z=this.parseObj(Ee,"elInY+600 ",z)),Object.keys(be).length!==0&&(z=this.parseObj(be,"elInY+700 ",z)),Object.keys(X).length!==0&&(z=this.parseObj(X,"elInY+800 ",z)),Object.keys(ie).length!==0&&(z=this.parseObj(ie,"elInY+900 ",z)),Object.keys(ge).length!==0&&(z=this.parseObj(ge,"elInY+1000 ",z)),Object.keys(ve).length!==0&&(z=this.parseObj(ve,"elInY+1100 ",z)),Object.keys(Oe).length!==0&&(z=this.parseObj(Oe,"elInY+1200 ",z)),Object.keys(ye).length!==0&&(z=this.parseObj(ye,"elInY+1300 ",z)),Object.keys(fe).length!==0&&(z=this.parseObj(fe,"elInY+1400 ",z)),Object.keys(he).length!==0&&(z=this.parseObj(he,"elInY+1500 ",z)),Object.keys(ne).length!==0&&(z=this.parseObj(ne,"elInY+1600 ",z)),Object.keys(Me).length!==0&&(z=this.parseObj(Me,"elInY+1700 ",z)),Object.keys(l).length!==0&&(z=this.parseObj(l,"elInY+1800 ",z)),Object.keys(p).length!==0&&(z=this.parseObj(p,"elInY+1900 ",z)),Object.keys(x).length!==0&&(z=this.parseObj(x,"elInY+2000 ",z)),Object.keys(T).length!==0&&(z=this.parseObj(T,"elInY+2100 ",z)),Object.keys(O).length!==0&&(z=this.parseObj(O,"elInY+2200 ",z)),Object.keys(D).length!==0&&(z=this.parseObj(D,"elInY+2300 ",z)),Object.keys(H).length!==0&&(z=this.parseObj(H,"elInY+2400 ",z)),Object.keys($).length!==0&&(z=this.parseObj($,"elInY+2500 ",z)),Object.keys(A).length!==0&&(z=this.parseObj(A,"elInY+2600 ",z)),Object.keys(j).length!==0&&(z=this.parseObj(j,"elInY+2700 ",z)),Object.keys(U).length!==0&&(z=this.parseObj(U,"elInY+2800 ",z)),Object.keys(Y).length!==0&&(z=this.parseObj(Y,"elInY+2900 ",z)),Object.keys(Z).length!==0&&(z=this.parseObj(Z,"elInY+3000 ",z)),t.style.transition="",t.setAttribute("data-dummy-selector","1"),et.addElements("[data-dummy-selector]",{scrollY:z}),this.elements.push(document.querySelector("[data-dummy-selector]")),t.removeAttribute("data-dummy-selector"),setTimeout(()=>{t.style.opacity=1,t.getAttribute("data-smooth-scrolling")==="off"||this.settings.transition&&(t.style.transition=this.settings.transition)},100)})}parseTransformProperty(e){for(var i=/(\w+)\((.+?)\)/g,s={},t;t=i.exec(e);)s[t[1]]=s[t[1]]?s[t[1]].concat([t[2]]):[t[2]];return s}getObjVal(e,i){let s={},t=e.getAttribute(i);return t&&t.split(";").forEach(r=>{if(r.indexOf("transform")!==-1&&(s=this.parseTransformProperty(r)),r.indexOf("opacity")!==-1){let a=r.replace("opacity:","").replace(";","");s.opacity=[parseFloat(a)]}}),s}parseObj(e,i,s){if(e.translateY){let t;e.translateY[0].indexOf("%")!==-1?t=parseFloat(e.translateY[0])/100*window.innerHeight:t=parseFloat(e.translateY[0]),s.translateY||(s.translateY=[[],[]]),s.translateY[0].push(i),s.translateY[1].push(t)}if(e.translateX){let t;e.translateX[0].indexOf("%")!==-1?t=parseFloat(e.translateX[0])/100*window.innerWidth:t=parseFloat(e.translateX[0]),s.translateX||(s.translateX=[[],[]]),s.translateX[0].push(i),s.translateX[1].push(t)}if(e.scale){let t=parseFloat(e.scale[0]);s.scale||(s.scale=[[],[]]),s.scale[0].push(i),s.scale[1].push(t)}if(e.rotate){let t=parseFloat(e.rotate[0]);s.rotate||(s.rotate=[[],[]]),s.rotate[0].push(i),s.rotate[1].push(t)}if(e.opacity){let t=parseFloat(e.opacity[0]);s.opacity||(s.opacity=[[],[]]),s.opacity[0].push(i),s.opacity[1].push(t)}return s}}var jt={exports:{}},ti;function Di(){return ti||(ti=1,(function(m,e){(function(s,t){m.exports=t()})(window,function(){return(function(i){var s={};function t(n){if(s[n])return s[n].exports;var r=s[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=s,t.d=function(n,r,a){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:a})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var u in n)t.d(a,u,(function(c){return n[c]}).bind(null,u));return a},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=2)})([(function(i,s){/*!
|
|
5
|
+
`),x.disableMutationObserver=!0),x.disableMutationObserver||xe.ready("[data-aos]",q),H(x.disable)||f()?P():(document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),["DOMContentLoaded","load"].indexOf(x.startEvent)===-1?document.addEventListener(x.startEvent,function(){S(!0)}):window.addEventListener("load",function(){S(!0)}),x.startEvent==="DOMContentLoaded"&&["complete","interactive"].indexOf(document.readyState)>-1&&S(!0),window.addEventListener("resize",se(S,x.debounceDelay,!0)),window.addEventListener("orientationchange",se(S,x.debounceDelay,!0)),l)},refresh:S,refreshHard:q}})})(ht)),ht.exports}var Ii=ji();const Ni=ot(Ii);var Mt={exports:{}},ti;function Pi(){return ti||(ti=1,(function(v){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 u(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,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){/*!
|
|
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 u(
|
|
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 u(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function c(F,I){for(var T=0;T<I.length;T++){var A=I[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(F,A.key,A)}}function d(F,I,T){return I&&c(F.prototype,I),F}function o(F){return Number(F)===F&&F%1===0}function h(F){return Number(F)===F&&F%1!==0}var g=(function(){function F(I,T){u(this,F),this.element=I,T=a()(new n().trigger,T),this.offset=T.offset,this.toggle=T.toggle,this.once=T.once,this.visible=null,this.active=!0}return d(F,[{key:"checkVisibility",value:function(T,A){if(!this.active)return this.visible;var $=T.offsetWidth||T.innerWidth||0,W=T.offsetHeight||T.innerHeight||0,D={w:$,h:W},J=this.getBounds(),Q=this._checkVisibility(J,D,A);if(Q!==this.visible){this.visible=Q;var ne=this._toggleCallback();ne instanceof Promise?ne.then(this._toggleClass.bind(this)).catch(function(se){console.error("Trigger promise failed"),console.error(se)}):this._toggleClass(),this.visible&&this.once&&(this.active=!1)}else if(Q&&typeof this.toggle.callback.visible=="function")return this.toggle.callback.visible.call(this.element,this);return Q}},{key:"getBounds",value:function(){return this.element.getBoundingClientRect()}},{key:"_getElementOffset",value:function(T,A){var $={x:0,y:0};return typeof this.offset.element.x=="function"?$.x=T.width*this.offset.element.x(this,T,A):h(this.offset.element.x)?$.x=T.width*this.offset.element.x:o(this.offset.element.x)&&($.x=this.offset.element.x),typeof this.offset.element.y=="function"?$.y=T.height*this.offset.element.y(this,T,A):h(this.offset.element.y)?$.y=T.height*this.offset.element.y:o(this.offset.element.y)&&($.y=this.offset.element.y),$}},{key:"_getViewportOffset",value:function(T,A){var $={x:0,y:0};return typeof this.offset.viewport.x=="function"?$.x=T.w*this.offset.viewport.x(this,T,A):h(this.offset.viewport.x)?$.x=T.w*this.offset.viewport.x:o(this.offset.viewport.x)&&($.x=this.offset.viewport.x),typeof this.offset.viewport.y=="function"?$.y=T.h*this.offset.viewport.y(this,T,A):h(this.offset.viewport.y)?$.y=T.h*this.offset.viewport.y:o(this.offset.viewport.y)&&($.y=this.offset.viewport.y),$}},{key:"_checkVisibility",value:function(T,A,$){var W=this._getElementOffset(T,$),D=this._getViewportOffset(A,$),J=!0;return T.left-D.x<-(T.width-W.x)&&(J=!1),T.left+D.x>A.w-W.x&&(J=!1),T.top-D.y<-(T.height-W.y)&&(J=!1),T.top+D.y>A.h-W.y&&(J=!1),J}},{key:"_toggleClass",value:function(){var T=this;if(this.visible){Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(A){T.element.classList.add(A)}):this.element.classList.add(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(A){T.element.classList.remove(A)}):this.element.classList.remove(this.toggle.class.out);return}Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(A){T.element.classList.remove(A)}):this.element.classList.remove(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(A){T.element.classList.add(A)}):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)}}]),F})();function y(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function E(F,I){for(var T=0;T<I.length;T++){var A=I[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(F,A.key,A)}}function M(F,I,T){return I&&E(F.prototype,I),F}var w=(function(){function F(I){y(this,F),this.triggers=I instanceof Array?I:[]}return M(F,[{key:"add",value:function(T){var A=this;if(T instanceof g)return this.triggers.push(T);T.each(function($){$ instanceof g?A.triggers.push($):console.error("Object added to TriggerCollection is not a Trigger. Object: ",$)})}},{key:"remove",value:function(T){T instanceof g&&(T=[T]),this.triggers=this.triggers.filter(function(A){var $=!1;return T.each(function(W){W==A&&($=!0)}),!$})}},{key:"query",value:function(T){return this.triggers.filter(function(A){var $=A.element,W=$.parentNode,D=[].slice.call(W.querySelectorAll(T));return D.indexOf($)>-1})}},{key:"search",value:function(T){var A=this.triggers.filter(function($){if(T instanceof NodeList||Array.isArray(T)){var W=!1;return T.each(function(D){$.element==D&&(W=!0)}),W}return $.element==T});return A.length==0?null:A.length>1?A:A[0]}},{key:"call",value:function(T){this.triggers.each(T)}}]),F})();function C(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function b(F,I){for(var T=0;T<I.length;T++){var A=I[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(F,A.key,A)}}function _(F,I,T){return I&&b(F.prototype,I),F}var O=(function(){function F(I,T){C(this,F),this._parseOptions(I),typeof T=="function"&&(this.callback=T),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 _(F,[{key:"_parseOptions",value:function(T){var A=new n().scroll;typeof T!="function"?(A.callback=function(){},A=a()(A,T)):A.callback=T,this.element=A.element,this.sustain=A.sustain,this.callback=A.callback,this.startCallback=A.start,this.stopCallback=A.stop,this.directionChange=A.directionChange}},{key:"_didScroll",value:function(){var T=this.getPosition();if(this.position!==T){var A=this.direction;T.x!==this.position.x?A=T.x>this.position.x?"right":"left":T.y!==this.position.y?A=T.y>this.position.y?"bottom":"top":A="none",A!==this.direction&&(this.direction=A,typeof this.directionChange=="function"&&this.directionChange(this.direction)),this.position=T,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 T=this.element.pageXOffset||this.element.scrollLeft||document.documentElement.scrollLeft||0,A=this.element.pageYOffset||this.element.scrollTop||document.documentElement.scrollTop||0;return{x:T,y:A}}},{key:"_getTimestamp",value:function(){return Number(Date.now())}},{key:"_tick",value:function(){this.callback(this.position,this.direction);var T=this._getTimestamp();T-this.lastAction>this.sustain&&this._stopRun(),this.running&&this._loop()}},{key:"_loop",value:function(){var T=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(A){setTimeout(A,16.666666666666668)};T(this._tick.bind(this))}},{key:"kill",value:function(){this.running=!1,this.element.removeEventListener("scroll",this._boundListener)}}]),F})();t.d(s,"Trigger",function(){return V}),t.d(s,"TriggerCollection",function(){return N}),t.d(s,"ScrollAnimationLoop",function(){return Y}),t.d(s,"default",function(){return G});function m(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function k(F,I){for(var T=0;T<I.length;T++){var A=I[T];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(F,A.key,A)}}function R(F,I,T){return I&&k(F.prototype,I),F}/*!
|
|
17
17
|
* ScrollTrigger
|
|
18
18
|
*
|
|
19
19
|
*
|
|
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
* Released under the MIT license.
|
|
24
24
|
*
|
|
25
25
|
* Date: 2017-07-09
|
|
26
|
-
*/var V=f,I=y,F=C,G=(function(){function B(M){g(this,B),this._parseOptions(M),this._initCollection(),this._initLoop()}return q(B,[{key:"_parseOptions",value:function(_){_=a()(new n,_),this.defaultTrigger=_.trigger,this.scrollOptions=_.scroll}},{key:"_initCollection",value:function(){var _=document.querySelectorAll("[data-scroll]"),L=[];_.length>0&&(L=this.createTriggers(_)),this.collection=new I(L)}},{key:"_initLoop",value:function(){var _=this;this.loop=new F({sustain:this.scrollOptions.sustain,element:this.scrollOptions.element,callback:function(P,W){_._scrollCallback(P,W)},start:function(){_._scrollStart()},stop:function(){_._scrollStop()},directionChange:function(P){_._scrollDirectionChange(P)}})}},{key:"_scrollCallback",value:function(_,L){var P=this;this.collection.call(function(W){W.checkVisibility(P.scrollOptions.element,L)}),this.scrollOptions.callback(_,L)}},{key:"_scrollStart",value:function(){this.scrollOptions.start()}},{key:"_scrollStop",value:function(){this.scrollOptions.stop()}},{key:"_scrollDirectionChange",value:function(_){this.scrollOptions.directionChange(_)}},{key:"createTrigger",value:function(_,L){return new V(_,a()(this.defaultTrigger,L))}},{key:"createTriggers",value:function(_,L){var P=this,W=[];return _.each(function(N){W.push(P.createTrigger(N,L))}),W}},{key:"add",value:function(_,L){return _ instanceof HTMLElement?(this.collection.add(this.createTrigger(_,L)),this):_ instanceof V?(this.collection.add(_),this):_ instanceof NodeList?(this.collection.add(this.createTriggers(_,L)),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.add(_),this):Array.isArray(_)&&_.length&&_[0]instanceof HTMLElement?(this.collection.add(this.createTriggers(_,L)),this):(this.collection.add(this.createTriggers(document.querySelectorAll(_),L)),this)}},{key:"remove",value:function(_){return _ instanceof V?(this.collection.remove(_),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.remove(_),this):_ instanceof HTMLElement?(this.collection.remove(this.search(_)),this):Array.isArray(_)&&_.length&&_[0]instanceof HTMLElement?(this.collection.remove(this.search(_)),this):_ instanceof NodeList?(this.collection.remove(this.search(_)),this):Array.isArray(_)&&_.length&&_[0]instanceof V?(this.collection.remove(_),this):(this.collection.remove(this.query(_.toString())),this)}},{key:"query",value:function(_){return this.collection.query(_)}},{key:"search",value:function(_){return this.collection.search(_)}},{key:"listen",value:function(){this.loop||this._initLoop()}},{key:"kill",value:function(){this.loop.kill(),this.loop=null}}]),B})()})])})})(jt)),jt.exports}var Hi=Di();const $i=dt(Hi);var pt={exports:{}},zi=pt.exports,ii;function Vi(){return ii||(ii=1,(function(m,e){(function(i,s){m.exports=s()})(zi,(function(){function i(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}function s(l,p){for(var x=0;x<p.length;x++){var T=p[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(l,n(T.key),T)}}function t(l,p,x){return p&&s(l.prototype,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function n(l){var p=(function(x,T){if(typeof x!="object"||!x)return x;var O=x[Symbol.toPrimitive];if(O!==void 0){var D=O.call(x,T);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)})(l,"string");return typeof p=="symbol"?p:p+""}function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(l)}var a=Date.now();function u(){var l={},p=!0,x=0,T=arguments.length;Object.prototype.toString.call(arguments[0])==="[object Boolean]"&&(p=arguments[0],x++);for(var O=function(H){for(var $ in H)Object.prototype.hasOwnProperty.call(H,$)&&(p&&Object.prototype.toString.call(H[$])==="[object Object]"?l[$]=u(!0,l[$],H[$]):l[$]=H[$])};x<T;x++){var D=arguments[x];O(D)}return l}function c(l,p){if((G(l)||l===window||l===document)&&(l=[l]),M(l)||_(l)||(l=[l]),W(l)!=0){if(M(l)&&!_(l))for(var x=l.length,T=0;T<x&&p.call(l[T],l[T],T,l)!==!1;T++);else if(_(l)){for(var O in l)if(P(l,O)&&p.call(l[O],l[O],O,l)===!1)break}}}function d(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,T=l[a]=l[a]||[],O={all:T,evt:null,found:null};return p&&x&&W(T)>0&&c(T,(function(D,H){if(D.eventName==p&&D.fn.toString()==x.toString())return O.found=!0,O.evt=H,!1})),O}function o(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=p.onElement,T=p.withCallback,O=p.avoidDuplicate,D=O===void 0||O,H=p.once,$=H!==void 0&&H,A=p.useCapture,j=A!==void 0&&A,U=arguments.length>2?arguments[2]:void 0,Y=x||[];function Z(ee){I(T)&&T.call(U,ee,this),$&&Z.destroy()}return F(Y)&&(Y=document.querySelectorAll(Y)),Z.destroy=function(){c(Y,(function(ee){var te=d(ee,l,Z);te.found&&te.all.splice(te.evt,1),ee.removeEventListener&&ee.removeEventListener(l,Z,j)}))},c(Y,(function(ee){var te=d(ee,l,Z);(ee.addEventListener&&D&&!te.found||!D)&&(ee.addEventListener(l,Z,j),te.all.push({eventName:l,fn:Z}))})),Z}function h(l,p){c(p.split(" "),(function(x){return l.classList.add(x)}))}function f(l,p){c(p.split(" "),(function(x){return l.classList.remove(x)}))}function v(l,p){return l.classList.contains(p)}function S(l,p){for(;l!==document.body;){if(!(l=l.parentElement))return!1;if(typeof l.matches=="function"?l.matches(p):l.msMatchesSelector(p))return l}}function R(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||p==="")return!1;if(p==="none")return I(x)&&x(),!1;var T=g(),O=p.split(" ");c(O,(function(D){h(l,"g"+D)})),o(T,{onElement:l,avoidDuplicate:!1,once:!0,withCallback:function(D,H){c(O,(function($){f(H,"g"+$)})),I(x)&&x()}})}function y(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(p==="")return l.style.webkitTransform="",l.style.MozTransform="",l.style.msTransform="",l.style.OTransform="",l.style.transform="",!1;l.style.webkitTransform=p,l.style.MozTransform=p,l.style.msTransform=p,l.style.OTransform=p,l.style.transform=p}function E(l){l.style.display="block"}function b(l){l.style.display="none"}function k(l){var p=document.createDocumentFragment(),x=document.createElement("div");for(x.innerHTML=l;x.firstChild;)p.appendChild(x.firstChild);return p}function C(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function g(){var l,p=document.createElement("fakeelement"),x={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(l in x)if(p.style[l]!==void 0)return x[l]}function w(l,p,x,T){if(l())p();else{var O;x||(x=100);var D=setInterval((function(){l()&&(clearInterval(D),O&&clearTimeout(O),p())}),x)}}function q(l,p,x){if(L(l))console.error("Inject assets error");else if(I(p)&&(x=p,p=!1),F(p)&&p in window)I(x)&&x();else{var T;if(l.indexOf(".css")!==-1){if((T=document.querySelectorAll('link[href="'+l+'"]'))&&T.length>0)return void(I(x)&&x());var O=document.getElementsByTagName("head")[0],D=O.querySelectorAll('link[rel="stylesheet"]'),H=document.createElement("link");return H.rel="stylesheet",H.type="text/css",H.href=l,H.media="all",D?O.insertBefore(H,D[0]):O.appendChild(H),void(I(x)&&x())}if((T=document.querySelectorAll('script[src="'+l+'"]'))&&T.length>0){if(I(x)){if(F(p))return w((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}}else{var $=document.createElement("script");$.type="text/javascript",$.src=l,$.onload=function(){if(I(x)){if(F(p))return w((function(){return window[p]!==void 0}),(function(){x()})),!1;x()}},document.body.appendChild($)}}}function V(){return"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function I(l){return typeof l=="function"}function F(l){return typeof l=="string"}function G(l){return!(!l||!l.nodeType||l.nodeType!=1)}function B(l){return Array.isArray(l)}function M(l){return l&&l.length&&isFinite(l.length)}function _(l){return r(l)==="object"&&l!=null&&!I(l)&&!B(l)}function L(l){return l==null}function P(l,p){return l!==null&&hasOwnProperty.call(l,p)}function W(l){if(_(l)){if(l.keys)return l.keys().length;var p=0;for(var x in l)P(l,x)&&p++;return p}return l.length}function N(l){return!isNaN(parseFloat(l))&&isFinite(l)}function J(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,p=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!p.length)return!1;if(p.length==1)return p[0];typeof l=="string"&&(l=parseInt(l));var x=[];c(p,(function($){x.push($.getAttribute("data-taborder"))}));var T=Math.max.apply(Math,x.map((function($){return parseInt($)}))),O=l<0?1:l+1;O>T&&(O="1");var D=x.filter((function($){return $>=parseInt(O)})),H=D.sort()[0];return document.querySelector('.gbtn[data-taborder="'.concat(H,'"]'))}function Q(l){if(l.events.hasOwnProperty("keyboard"))return!1;l.events.keyboard=o("keydown",{onElement:window,withCallback:function(p,x){var T=(p=p||window.event).keyCode;if(T==9){var O=document.querySelector(".gbtn.focused");if(!O){var D=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if(D=="input"||D=="textarea"||D=="button")return}p.preventDefault();var H=document.querySelectorAll(".gbtn[data-taborder]");if(!H||H.length<=0)return;if(!O){var $=J();return void($&&($.focus(),h($,"focused")))}var A=J(O.getAttribute("data-taborder"));f(O,"focused"),A&&(A.focus(),h(A,"focused"))}T==39&&l.nextSlide(),T==37&&l.prevSlide(),T==27&&l.close()}})}var se=t((function l(p,x){var T=this,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(i(this,l),this.img=p,this.slide=x,this.onclose=O,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener("mousedown",(function(D){return T.dragStart(D)}),!1),this.img.addEventListener("mouseup",(function(D){return T.dragEnd(D)}),!1),this.img.addEventListener("mousemove",(function(D){return T.drag(D)}),!1),this.img.addEventListener("click",(function(D){return T.slide.classList.contains("dragging-nav")?(T.zoomOut(),!1):T.zoomedIn?void(T.zoomedIn&&!T.dragging&&T.zoomOut()):T.zoomIn()}),!1),this.img.setZoomEvents=!0}),[{key:"zoomIn",value:function(){var l=this.widowWidth();if(!(this.zoomedIn||l<=768)){var p=this.img;if(p.setAttribute("data-style",p.getAttribute("style")),p.style.maxWidth=p.naturalWidth+"px",p.style.maxHeight=p.naturalHeight+"px",p.naturalWidth>l){var x=l/2-p.naturalWidth/2;this.setTranslate(this.img.parentNode,x,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}}},{key:"zoomOut",value:function(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&typeof this.onclose=="function"&&this.onclose()}},{key:"dragStart",value:function(l){l.preventDefault(),this.zoomedIn?(l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset),l.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))):this.active=!1}},{key:"dragEnd",value:function(l){var p=this;l.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout((function(){p.dragging=!1,p.img.isDragging=!1,p.img.classList.remove("dragging")}),100)}},{key:"drag",value:function(l){this.active&&(l.preventDefault(),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:"onMove",value:function(l){if(this.zoomedIn){var p=l.clientX-this.img.naturalWidth/2,x=l.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,p,x)}}},{key:"setTranslate",value:function(l,p,x){l.style.transform="translate3d("+p+"px, "+x+"px, 0)"}},{key:"widowWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),re=t((function l(){var p=this,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l);var T=x.dragEl,O=x.toleranceX,D=O===void 0?40:O,H=x.toleranceY,$=H===void 0?65:H,A=x.slide,j=A===void 0?null:A,U=x.instance,Y=U===void 0?null:U;this.el=T,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=D,this.toleranceY=$,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=j,this.instance=Y,this.el.addEventListener("mousedown",(function(Z){return p.dragStart(Z)}),!1),this.el.addEventListener("mouseup",(function(Z){return p.dragEnd(Z)}),!1),this.el.addEventListener("mousemove",(function(Z){return p.drag(Z)}),!1)}),[{key:"dragStart",value:function(l){if(this.slide.classList.contains("zoomed"))this.active=!1;else{l.type==="touchstart"?(this.initialX=l.touches[0].clientX-this.xOffset,this.initialY=l.touches[0].clientY-this.yOffset):(this.initialX=l.clientX-this.xOffset,this.initialY=l.clientY-this.yOffset);var p=l.target.nodeName.toLowerCase();l.target.classList.contains("nodrag")||S(l.target,".nodrag")||["input","select","textarea","button","a"].indexOf(p)!==-1?this.active=!1:(l.preventDefault(),(l.target===this.el||p!=="img"&&S(l.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=S(l.target,".ginner-container")))}}},{key:"dragEnd",value:function(l){var p=this;l&&l.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,this.doSlideChange=="right"&&this.instance.prevSlide(),this.doSlideChange=="left"&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout((function(){p.instance.preventOutsideClick=!1,p.toleranceReached=!1,p.lastDirection=null,p.dragging=!1,p.el.isDragging=!1,p.el.classList.remove("dragging"),p.slide.classList.remove("dragging-nav"),p.dragContainer.style.transform="",p.dragContainer.style.transition=""}),100)}},{key:"drag",value:function(l){if(this.active){l.preventDefault(),this.slide.classList.add("dragging-nav"),l.type==="touchmove"?(this.currentX=l.touches[0].clientX-this.initialX,this.currentY=l.touches[0].clientY-this.initialY):(this.currentX=l.clientX-this.initialX,this.currentY=l.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var p=Math.abs(this.currentX),x=Math.abs(this.currentY);if(p>0&&p>=Math.abs(this.currentY)&&(!this.lastDirection||this.lastDirection=="x")){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);var T=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&T&&(this.doSlideChange=T),this.instance.settings.dragAutoSnap&&T)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),T=="right"&&this.instance.prevSlide(),void(T=="left"&&this.instance.nextSlide())}if(this.toleranceY>0&&x>0&&x>=p&&(!this.lastDirection||this.lastDirection=="y")){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);var O=this.shouldClose();return!this.instance.settings.dragAutoSnap&&O&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&O&&this.instance.close())}}}},{key:"shouldChange",value:function(){var l=!1;if(Math.abs(this.currentX)>=this.toleranceX){var p=this.currentX>0?"right":"left";(p=="left"&&this.slide!==this.slide.parentNode.lastChild||p=="right"&&this.slide!==this.slide.parentNode.firstChild)&&(l=p)}return l}},{key:"shouldClose",value:function(){var l=!1;return Math.abs(this.currentY)>=this.toleranceY&&(l=!0),l}},{key:"setTranslate",value:function(l,p,x){var T=arguments.length>3&&arguments[3]!==void 0&&arguments[3];l.style.transition=T?"all .2s ease":"",l.style.transform="translate3d(".concat(p,"px, ").concat(x,"px, 0)")}}]);function ae(l,p,x,T){var O=l.querySelector(".gslide-media"),D=new Image,H="gSlideTitle_"+x,$="gSlideDesc_"+x;D.addEventListener("load",(function(){I(T)&&T()}),!1),D.src=p.href,p.sizes!=""&&p.srcset!=""&&(D.sizes=p.sizes,D.srcset=p.srcset),D.alt="",L(p.alt)||p.alt===""||(D.alt=p.alt),p.title!==""&&D.setAttribute("aria-labelledby",H),p.description!==""&&D.setAttribute("aria-describedby",$),p.hasOwnProperty("_hasCustomWidth")&&p._hasCustomWidth&&(D.style.width=p.width),p.hasOwnProperty("_hasCustomHeight")&&p._hasCustomHeight&&(D.style.height=p.height),O.insertBefore(D,O.firstChild)}function de(l,p,x,T){var O=this,D=l.querySelector(".ginner-container"),H="gvideo"+x,$=l.querySelector(".gslide-media"),A=this.getAllPlayers();h(D,"gvideo-container"),$.insertBefore(k('<div class="gvideo-wrapper"></div>'),$.firstChild);var j=l.querySelector(".gvideo-wrapper");q(this.settings.plyr.css,"Plyr");var U=p.href,Y=p?.videoProvider,Z=!1;$.style.maxWidth=p.width,q(this.settings.plyr.js,"Plyr",(function(){if(!Y&&U.match(/vimeo\.com\/([0-9]*)/)&&(Y="vimeo"),!Y&&(U.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||U.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||U.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||U.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))&&(Y="youtube"),Y==="local"||!Y){Y="local";var ee='<video id="'+H+'" ';ee+='style="background:#000; max-width: '.concat(p.width,';" '),ee+='preload="metadata" ',ee+='x-webkit-airplay="allow" ',ee+="playsinline ",ee+="controls ",ee+='class="gvideo-local">',ee+='<source src="'.concat(U,'">'),Z=k(ee+="</video>")}var te=Z||k('<div id="'.concat(H,'" data-plyr-provider="').concat(Y,'" data-plyr-embed-id="').concat(U,'"></div>'));h(j,"".concat(Y,"-video gvideo")),j.appendChild(te),j.setAttribute("data-id",H),j.setAttribute("data-index",x);var K=P(O.settings.plyr,"config")?O.settings.plyr.config:{},me=new Plyr("#"+H,K);me.on("ready",(function(le){A[H]=le.detail.plyr,I(T)&&T()})),w((function(){return l.querySelector("iframe")&&l.querySelector("iframe").dataset.ready=="true"}),(function(){O.resize(l)})),me.on("enterfullscreen",ue),me.on("exitfullscreen",ue)}))}function ue(l){var p=S(l.target,".gslide-media");l.type==="enterfullscreen"&&h(p,"fullscreen"),l.type==="exitfullscreen"&&f(p,"fullscreen")}function Se(l,p,x,T){var O,D=this,H=l.querySelector(".gslide-media"),$=!(!P(p,"href")||!p.href)&&p.href.split("#").pop().trim(),A=!(!P(p,"content")||!p.content)&&p.content;if(A&&(F(A)&&(O=k('<div class="ginlined-content">'.concat(A,"</div>"))),G(A))){A.style.display=="none"&&(A.style.display="block");var j=document.createElement("div");j.className="ginlined-content",j.appendChild(A),O=j}if($){var U=document.getElementById($);if(!U)return!1;var Y=U.cloneNode(!0);Y.style.height=p.height,Y.style.maxWidth=p.width,h(Y,"ginlined-content"),O=Y}if(!O)return console.error("Unable to append inline slide content",p),!1;H.style.height=p.height,H.style.width=p.width,H.appendChild(O),this.events["inlineclose"+$]=o("click",{onElement:H.querySelectorAll(".gtrigger-close"),withCallback:function(Z){Z.preventDefault(),D.close()}}),I(T)&&T()}function Ie(l,p,x,T){var O=l.querySelector(".gslide-media"),D=(function(H){var $=H.url,A=H.allow,j=H.callback,U=H.appendTo,Y=document.createElement("iframe");return Y.className="vimeo-video gvideo",Y.src=$,Y.style.width="100%",Y.style.height="100%",A&&Y.setAttribute("allow",A),Y.onload=function(){Y.onload=null,h(Y,"node-ready"),I(j)&&j()},U&&U.appendChild(Y),Y})({url:p.href,callback:T});O.parentNode.style.maxWidth=p.width,O.parentNode.style.height=p.height,O.appendChild(D)}var Ae=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},_(p)&&(this.defaults=u(this.defaults,p))}),[{key:"sourceType",value:function(l){var p=l;return(l=l.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)!==null?"image":l.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||l.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||l.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)||l.match(/vimeo\.com\/([0-9]*)/)||l.match(/\.(mp4|ogg|webm|mov)/)!==null?"video":l.match(/\.(mp3|wav|wma|aac|ogg)/)!==null?"audio":l.indexOf("#")>-1&&p.split("#").pop().trim()!==""?"inline":l.indexOf("goajax=true")>-1?"ajax":"external"}},{key:"parseConfig",value:function(l,p){var x=this,T=u({descPosition:p.descPosition},this.defaults);if(_(l)&&!G(l)){P(l,"type")||(P(l,"content")&&l.content?l.type="inline":P(l,"href")&&(l.type=this.sourceType(l.href)));var O=u(T,l);return this.setSize(O,p),O}var D="",H=l.getAttribute("data-glightbox"),$=l.nodeName.toLowerCase();if($==="a"&&(D=l.href),$==="img"&&(D=l.src,T.alt=l.alt),T.href=D,c(T,(function(ee,te){P(p,te)&&te!=="width"&&(T[te]=p[te]);var K=l.dataset[te];L(K)||(T[te]=x.sanitizeValue(K))})),T.content&&(T.type="inline"),!T.type&&D&&(T.type=this.sourceType(D)),L(H)){if(!T.title&&$=="a"){var A=l.title;L(A)||A===""||(T.title=A)}if(!T.title&&$=="img"){var j=l.alt;L(j)||j===""||(T.title=j)}}else{var U=[];c(T,(function(ee,te){U.push(";\\s?"+te)})),U=U.join("\\s?:|"),H.trim()!==""&&c(T,(function(ee,te){var K=H,me=new RegExp("s?"+te+"s?:s?(.*?)("+U+"s?:|$)"),le=K.match(me);if(le&&le.length&&le[1]){var Ce=le[1].trim().replace(/;\s*$/,"");T[te]=x.sanitizeValue(Ce)}}))}if(T.description&&T.description.substring(0,1)==="."){var Y;try{Y=document.querySelector(T.description).innerHTML}catch(ee){if(!(ee instanceof DOMException))throw ee}Y&&(T.description=Y)}if(!T.description){var Z=l.querySelector(".glightbox-desc");Z&&(T.description=Z.innerHTML)}return this.setSize(T,p,l),this.slideConfig=T,T}},{key:"setSize",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,T=l.type=="video"?this.checkSize(p.videosWidth):this.checkSize(p.width),O=this.checkSize(p.height);return l.width=P(l,"width")&&l.width!==""?this.checkSize(l.width):T,l.height=P(l,"height")&&l.height!==""?this.checkSize(l.height):O,x&&l.type=="image"&&(l._hasCustomWidth=!!x.dataset.width,l._hasCustomHeight=!!x.dataset.height),l}},{key:"checkSize",value:function(l){return N(l)?"".concat(l,"px"):l}},{key:"sanitizeValue",value:function(l){return l!=="true"&&l!=="false"?l:l==="true"}}]),qe=t((function l(p,x,T){i(this,l),this.element=p,this.instance=x,this.index=T}),[{key:"setContent",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(v(p,"loaded"))return!1;var T=this.instance.settings,O=this.slideConfig,D=V();I(T.beforeSlideLoad)&&T.beforeSlideLoad({index:this.index,slide:p,player:!1});var H=O.type,$=O.descPosition,A=p.querySelector(".gslide-media"),j=p.querySelector(".gslide-title"),U=p.querySelector(".gslide-desc"),Y=p.querySelector(".gdesc-inner"),Z=x,ee="gSlideTitle_"+this.index,te="gSlideDesc_"+this.index;if(I(T.afterSlideLoad)&&(Z=function(){I(x)&&x(),T.afterSlideLoad({index:l.index,slide:p,player:l.instance.getSlidePlayerInstance(l.index)})}),O.title==""&&O.description==""?Y&&Y.parentNode.parentNode.removeChild(Y.parentNode):(j&&O.title!==""?(j.id=ee,j.innerHTML=O.title):j.parentNode.removeChild(j),U&&O.description!==""?(U.id=te,D&&T.moreLength>0?(O.smallDescription=this.slideShortDesc(O.description,T.moreLength,T.moreText),U.innerHTML=O.smallDescription,this.descriptionEvents(U,O)):U.innerHTML=O.description):U.parentNode.removeChild(U),h(A.parentNode,"desc-".concat($)),h(Y.parentNode,"description-".concat($))),h(A,"gslide-".concat(H)),h(p,"loaded"),H!=="video"){if(H!=="external")return H==="inline"?(Se.apply(this.instance,[p,O,this.index,Z]),void(O.draggable&&new re({dragEl:p.querySelector(".gslide-inline"),toleranceX:T.dragToleranceX,toleranceY:T.dragToleranceY,slide:p,instance:this.instance}))):void(H!=="image"?I(Z)&&Z():ae(p,O,this.index,(function(){var K=p.querySelector("img");O.draggable&&new re({dragEl:K,toleranceX:T.dragToleranceX,toleranceY:T.dragToleranceY,slide:p,instance:l.instance}),O.zoomable&&K.naturalWidth>K.offsetWidth&&(h(K,"zoomable"),new se(K,p,(function(){l.instance.resize()}))),I(Z)&&Z()})));Ie.apply(this,[p,O,this.index,Z])}else de.apply(this.instance,[p,O,this.index,Z])}},{key:"slideShortDesc",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,x=arguments.length>2&&arguments[2]!==void 0&&arguments[2],T=document.createElement("div");T.innerHTML=l;var O=T.innerText,D=x;if((l=O.trim()).length<=p)return l;var H=l.substr(0,p-1);return D?(T=null,H+'... <a href="#" class="desc-more">'+x+"</a>"):H}},{key:"descriptionEvents",value:function(l,p){var x=this,T=l.querySelector(".desc-more");if(!T)return!1;o("click",{onElement:T,withCallback:function(O,D){O.preventDefault();var H=document.body,$=S(D,".gslide-desc");if(!$)return!1;$.innerHTML=p.description,h(H,"gdesc-open");var A=o("click",{onElement:[H,S($,".gslide-description")],withCallback:function(j,U){j.target.nodeName.toLowerCase()!=="a"&&(f(H,"gdesc-open"),h(H,"gdesc-closed"),$.innerHTML=p.smallDescription,x.descriptionEvents($,p),setTimeout((function(){f(H,"gdesc-closed")}),400),A.destroy())}})}})}},{key:"create",value:function(){return k(this.instance.settings.slideHTML)}},{key:"getConfig",value:function(){G(this.element)||this.element.hasOwnProperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var l=new Ae(this.instance.settings.slideExtraAttributes);return this.slideConfig=l.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function Ee(l){return Math.sqrt(l.x*l.x+l.y*l.y)}function be(l,p){var x=(function(T,O){var D=Ee(T)*Ee(O);if(D===0)return 0;var H=(function($,A){return $.x*A.x+$.y*A.y})(T,O)/D;return H>1&&(H=1),Math.acos(H)})(l,p);return(function(T,O){return T.x*O.y-O.x*T.y})(l,p)>0&&(x*=-1),180*x/Math.PI}var X=t((function l(p){i(this,l),this.handlers=[],this.el=p}),[{key:"add",value:function(l){this.handlers.push(l)}},{key:"del",value:function(l){l||(this.handlers=[]);for(var p=this.handlers.length;p>=0;p--)this.handlers[p]===l&&this.handlers.splice(p,1)}},{key:"dispatch",value:function(){for(var l=0,p=this.handlers.length;l<p;l++){var x=this.handlers[l];typeof x=="function"&&x.apply(this.el,arguments)}}}]);function ie(l,p){var x=new X(l);return x.add(p),x}var ge=t((function l(p,x){i(this,l),this.element=typeof p=="string"?document.querySelector(p):p,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var T=function(){};this.rotate=ie(this.element,x.rotate||T),this.touchStart=ie(this.element,x.touchStart||T),this.multipointStart=ie(this.element,x.multipointStart||T),this.multipointEnd=ie(this.element,x.multipointEnd||T),this.pinch=ie(this.element,x.pinch||T),this.swipe=ie(this.element,x.swipe||T),this.tap=ie(this.element,x.tap||T),this.doubleTap=ie(this.element,x.doubleTap||T),this.longTap=ie(this.element,x.longTap||T),this.singleTap=ie(this.element,x.singleTap||T),this.pressMove=ie(this.element,x.pressMove||T),this.twoFingerPressMove=ie(this.element,x.twoFingerPressMove||T),this.touchMove=ie(this.element,x.touchMove||T),this.touchEnd=ie(this.element,x.touchEnd||T),this.touchCancel=ie(this.element,x.touchCancel||T),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}),[{key:"start",value:function(l){if(l.touches)if(l.target&&l.target.nodeName&&["a","button","input"].indexOf(l.target.nodeName.toLowerCase())>=0)console.log("ignore drag for this touched element",l.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=l.touches[0].pageX,this.y1=l.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(l,this.element),this.preTapPosition.x!==null&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var p=this.preV;if(l.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var x={x:l.touches[1].pageX-this.x1,y:l.touches[1].pageY-this.y1};p.x=x.x,p.y=x.y,this.pinchStartLen=Ee(p),this.multipointStart.dispatch(l,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout((function(){this.longTap.dispatch(l,this.element),this._preventTap=!0}).bind(this),750)}}},{key:"move",value:function(l){if(l.touches){var p=this.preV,x=l.touches.length,T=l.touches[0].pageX,O=l.touches[0].pageY;if(this.isDoubleTap=!1,x>1){var D=l.touches[1].pageX,H=l.touches[1].pageY,$={x:l.touches[1].pageX-T,y:l.touches[1].pageY-O};p.x!==null&&(this.pinchStartLen>0&&(l.zoom=Ee($)/this.pinchStartLen,this.pinch.dispatch(l,this.element)),l.angle=be($,p),this.rotate.dispatch(l,this.element)),p.x=$.x,p.y=$.y,this.x2!==null&&this.sx2!==null?(l.deltaX=(T-this.x2+D-this.sx2)/2,l.deltaY=(O-this.y2+H-this.sy2)/2):(l.deltaX=0,l.deltaY=0),this.twoFingerPressMove.dispatch(l,this.element),this.sx2=D,this.sy2=H}else{if(this.x2!==null){l.deltaX=T-this.x2,l.deltaY=O-this.y2;var A=Math.abs(this.x1-this.x2),j=Math.abs(this.y1-this.y2);(A>10||j>10)&&(this._preventTap=!0)}else l.deltaX=0,l.deltaY=0;this.pressMove.dispatch(l,this.element)}this.touchMove.dispatch(l,this.element),this._cancelLongTap(),this.x2=T,this.y2=O,x>1&&l.preventDefault()}}},{key:"end",value:function(l){if(l.changedTouches){this._cancelLongTap();var p=this;l.touches.length<2&&(this.multipointEnd.dispatch(l,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(l.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){p.swipe.dispatch(l,p.element)}),0)):(this.tapTimeout=setTimeout((function(){p._preventTap||p.tap.dispatch(l,p.element),p.isDoubleTap&&(p.doubleTap.dispatch(l,p.element),p.isDoubleTap=!1)}),0),p.isDoubleTap||(p.singleTapTimeout=setTimeout((function(){p.singleTap.dispatch(l,p.element)}),250))),this.touchEnd.dispatch(l,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelAll",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:"cancel",value:function(l){this.cancelAll(),this.touchCancel.dispatch(l,this.element)}},{key:"_cancelLongTap",value:function(){clearTimeout(this.longTapTimeout)}},{key:"_cancelSingleTap",value:function(){clearTimeout(this.singleTapTimeout)}},{key:"_swipeDirection",value:function(l,p,x,T){return Math.abs(l-p)>=Math.abs(x-T)?l-p>0?"Left":"Right":x-T>0?"Up":"Down"}},{key:"on",value:function(l,p){this[l]&&this[l].add(p)}},{key:"off",value:function(l,p){this[l]&&this[l].del(p)}},{key:"destroy",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}]);function ve(l){var p=(function(){var H,$=document.createElement("fakeelement"),A={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(H in A)if($.style[H]!==void 0)return A[H]})(),x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,T=v(l,"gslide-media")?l:l.querySelector(".gslide-media"),O=S(T,".ginner-container"),D=l.querySelector(".gslide-description");x>769&&(T=O),h(T,"greset"),y(T,"translate3d(0, 0, 0)"),o(p,{onElement:T,once:!0,withCallback:function(H,$){f(T,"greset")}}),T.style.opacity="",D&&(D.style.opacity="")}function Oe(l){if(l.events.hasOwnProperty("touch"))return!1;var p,x,T,O=C(),D=O.width,H=O.height,$=!1,A=null,j=null,U=null,Y=!1,Z=1,ee=1,te=!1,K=!1,me=null,le=null,Ce=null,pe=null,xe=0,Le=0,$e=!1,Ne=!1,Pe={},ke={},ce=0,Re=0,De=document.getElementById("glightbox-slider"),Ge=document.querySelector(".goverlay"),st=new ge(De,{touchStart:function(_e){if($=!0,(v(_e.targetTouches[0].target,"ginner-container")||S(_e.targetTouches[0].target,".gslide-desc")||_e.targetTouches[0].target.nodeName.toLowerCase()=="a")&&($=!1),S(_e.targetTouches[0].target,".gslide-inline")&&!v(_e.targetTouches[0].target.parentNode,"gslide-inline")&&($=!1),$){if(ke=_e.targetTouches[0],Pe.pageX=_e.targetTouches[0].pageX,Pe.pageY=_e.targetTouches[0].pageY,ce=_e.targetTouches[0].clientX,Re=_e.targetTouches[0].clientY,A=l.activeSlide,j=A.querySelector(".gslide-media"),T=A.querySelector(".gslide-inline"),U=null,v(j,"gslide-image")&&(U=j.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(j=A.querySelector(".ginner-container")),f(Ge,"greset"),_e.pageX>20&&_e.pageX<window.innerWidth-20)return;_e.preventDefault()}},touchMove:function(_e){if($&&(ke=_e.targetTouches[0],!te&&!K)){if(T&&T.offsetHeight>H){var He=Pe.pageX-ke.pageX;if(Math.abs(He)<=13)return!1}Y=!0;var Ue,Xe=_e.targetTouches[0].clientX,nt=_e.targetTouches[0].clientY,rt=ce-Xe,at=Re-nt;if(Math.abs(rt)>Math.abs(at)?($e=!1,Ne=!0):(Ne=!1,$e=!0),p=ke.pageX-Pe.pageX,xe=100*p/D,x=ke.pageY-Pe.pageY,Le=100*x/H,$e&&U&&(Ue=1-Math.abs(x)/H,Ge.style.opacity=Ue,l.settings.touchFollowAxis&&(xe=0)),Ne&&(Ue=1-Math.abs(p)/D,j.style.opacity=Ue,l.settings.touchFollowAxis&&(Le=0)),!U)return y(j,"translate3d(".concat(xe,"%, 0, 0)"));y(j,"translate3d(".concat(xe,"%, ").concat(Le,"%, 0)"))}},touchEnd:function(){if($){if(Y=!1,K||te)return Ce=me,void(pe=le);var _e=Math.abs(parseInt(Le)),He=Math.abs(parseInt(xe));if(!(_e>29&&U))return _e<29&&He<25?(h(Ge,"greset"),Ge.style.opacity=1,ve(j)):void 0;l.close()}},multipointEnd:function(){setTimeout((function(){te=!1}),50)},multipointStart:function(){te=!0,Z=ee||1},pinch:function(_e){if(!U||Y)return!1;te=!0,U.scaleX=U.scaleY=Z*_e.zoom;var He=Z*_e.zoom;if(K=!0,He<=1)return K=!1,He=1,pe=null,Ce=null,me=null,le=null,void U.setAttribute("style","");He>4.5&&(He=4.5),U.style.transform="scale3d(".concat(He,", ").concat(He,", 1)"),ee=He},pressMove:function(_e){if(K&&!te){var He=ke.pageX-Pe.pageX,Ue=ke.pageY-Pe.pageY;Ce&&(He+=Ce),pe&&(Ue+=pe),me=He,le=Ue;var Xe="translate3d(".concat(He,"px, ").concat(Ue,"px, 0)");ee&&(Xe+=" scale3d(".concat(ee,", ").concat(ee,", 1)")),y(U,Xe)}},swipe:function(_e){if(!K)if(te)te=!1;else{if(_e.direction=="Left"){if(l.index==l.elements.length-1)return ve(j);l.nextSlide()}if(_e.direction=="Right"){if(l.index==0)return ve(j);l.prevSlide()}}}});l.events.touch=st}var ye=V(),fe=V()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,he=document.getElementsByTagName("html")[0],ne={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>'},slideHTML:`<div class="gslide">
|
|
26
|
+
*/var 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">
|
|
27
27
|
<div class="gslide-inner-content">
|
|
28
28
|
<div class="ginner-container">
|
|
29
29
|
<div class="gslide-media">
|
|
@@ -45,36 +45,36 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
45
45
|
<button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
|
|
46
46
|
<button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
|
|
47
47
|
</div>
|
|
48
|
-
</div>`},Me=t((function l(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i(this,l),this.customOptions=p,this.settings=u(ne,p),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}),[{key:"init",value:function(){var l=this,p=this.getSelector();p&&(this.baseEvents=o("click",{onElement:p,withCallback:function(x,T){x.preventDefault(),l.open(T)}})),this.elements=this.getElements()}},{key:"open",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var x=N(p)?p:this.settings.startAt;if(G(l)){var T=l.getAttribute("data-gallery");T&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,T)),L(x)&&(x=this.getElementIndex(l))<0&&(x=0)}N(x)||(x=0),this.build(),R(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);var O=document.body,D=window.innerWidth-document.documentElement.clientWidth;if(D>0){var H=document.createElement("style");H.type="text/css",H.className="gcss-styles",H.innerText=".gscrollbar-fixer {margin-right: ".concat(D,"px}"),document.head.appendChild(H),h(O,"gscrollbar-fixer")}h(O,"glightbox-open"),h(he,"glightbox-open"),ye&&(h(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(x,!0),this.elements.length===1?(h(this.prevButton,"glightbox-button-hidden"),h(this.nextButton,"glightbox-button-hidden")):(f(this.prevButton,"glightbox-button-hidden"),f(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),I(this.settings.onOpen)&&this.settings.onOpen(),fe&&this.settings.touchNavigation&&Oe(this),this.settings.keyboardNavigation&&Q(this)}},{key:"openAt",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.open(null,l)}},{key:"showSlide",value:function(){var l=this,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];E(this.loader),this.index=parseInt(p);var T=this.slidesContainer.querySelector(".current");T&&f(T,"current"),this.slideAnimateOut();var O=this.slidesContainer.querySelectorAll(".gslide")[p];if(v(O,"loaded"))this.slideAnimateIn(O,x),b(this.loader);else{E(this.loader);var D=this.elements[p],H={index:this.index,slide:O,slideNode:O,slideConfig:D.slideConfig,slideIndex:this.index,trigger:D.node,player:null};this.trigger("slide_before_load",H),D.instance.setContent(O,(function(){b(l.loader),l.resize(),l.slideAnimateIn(O,x),l.trigger("slide_after_load",H)}))}this.slideDescription=O.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&v(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(p+1),this.preloadSlide(p-1)),this.updateNavigationClasses(),this.activeSlide=O}},{key:"preloadSlide",value:function(l){var p=this;if(l<0||l>this.elements.length-1||L(this.elements[l]))return!1;var x=this.slidesContainer.querySelectorAll(".gslide")[l];if(v(x,"loaded"))return!1;var T=this.elements[l],O=T.type,D={index:l,slide:x,slideNode:x,slideConfig:T.slideConfig,slideIndex:l,trigger:T.node,player:null};this.trigger("slide_before_load",D),O==="video"||O==="external"?setTimeout((function(){T.instance.setContent(x,(function(){p.trigger("slide_after_load",D)}))}),200):T.instance.setContent(x,(function(){p.trigger("slide_after_load",D)}))}},{key:"prevSlide",value:function(){this.goToSlide(this.index-1)}},{key:"nextSlide",value:function(){this.goToSlide(this.index+1)}},{key:"goToSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(l<0||l>this.elements.length-1))return!1;l<0?l=this.elements.length-1:l>=this.elements.length&&(l=0),this.showSlide(l)}},{key:"insertSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;p<0&&(p=this.elements.length);var x=new qe(l,this,p),T=x.getConfig(),O=u({},T),D=x.create(),H=this.elements.length-1;O.index=p,O.node=!1,O.instance=x,O.slideConfig=T,this.elements.splice(p,0,O);var $=null,A=null;if(this.slidesContainer){if(p>H)this.slidesContainer.appendChild(D);else{var j=this.slidesContainer.querySelectorAll(".gslide")[p];this.slidesContainer.insertBefore(D,j)}(this.settings.preload&&this.index==0&&p==0||this.index-1==p||this.index+1==p)&&this.preloadSlide(p),this.index===0&&p===0&&(this.index=1),this.updateNavigationClasses(),$=this.slidesContainer.querySelectorAll(".gslide")[p],A=this.getSlidePlayerInstance(p),O.slideNode=$}this.trigger("slide_inserted",{index:p,slide:$,slideNode:$,slideConfig:T,slideIndex:p,trigger:null,player:A}),I(this.settings.slideInserted)&&this.settings.slideInserted({index:p,slide:$,player:A})}},{key:"removeSlide",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;if(l<0||l>this.elements.length-1)return!1;var p=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[l];p&&(this.getActiveSlideIndex()==l&&(l==this.elements.length-1?this.prevSlide():this.nextSlide()),p.parentNode.removeChild(p)),this.elements.splice(l,1),this.trigger("slide_removed",l),I(this.settings.slideRemoved)&&this.settings.slideRemoved(l)}},{key:"slideAnimateIn",value:function(l,p){var x=this,T=l.querySelector(".gslide-media"),O=l.querySelector(".gslide-description"),D={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},H={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(T.offsetWidth>0&&O&&(b(O),O.style.display=""),f(l,this.effectsClasses),p)R(l,this.settings.cssEfects[this.settings.openEffect].in,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:D,current:H}),I(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[D,H])}));else{var $=this.settings.slideEffect,A=$!=="none"?this.settings.cssEfects[$].in:$;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(A=this.settings.cssEfects.slideBack.in),R(l,A,(function(){x.settings.autoplayVideos&&x.slidePlayerPlay(l),x.trigger("slide_changed",{prev:D,current:H}),I(x.settings.afterSlideChange)&&x.settings.afterSlideChange.apply(x,[D,H])}))}setTimeout((function(){x.resize(l)}),100),h(l,"current")}},{key:"slideAnimateOut",value:function(){if(!this.prevActiveSlide)return!1;var l=this.prevActiveSlide;f(l,this.effectsClasses),h(l,"prev");var p=this.settings.slideEffect,x=p!=="none"?this.settings.cssEfects[p].out:p;this.slidePlayerPause(l),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:L(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),I(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(x=this.settings.cssEfects.slideBack.out),R(l,x,(function(){var T=l.querySelector(".ginner-container"),O=l.querySelector(".gslide-media"),D=l.querySelector(".gslide-description");T.style.transform="",O.style.transform="",f(O,"greset"),O.style.opacity="",D&&(D.style.opacity=""),f(l,"prev")}))}},{key:"getAllPlayers",value:function(){return this.videoPlayers}},{key:"getSlidePlayerInstance",value:function(l){var p="gvideo"+l,x=this.getAllPlayers();return!(!P(x,p)||!x[p])&&x[p]}},{key:"stopSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"slidePlayerPause",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}var x=this.getSlidePlayerInstance(l);x&&x.playing&&x.pause()}},{key:"playSlideVideo",value:function(l){if(G(l)){var p=l.querySelector(".gvideo-wrapper");p&&(l=p.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");var x=this.getSlidePlayerInstance(l);x&&!x.playing&&x.play()}},{key:"slidePlayerPlay",value:function(l){var p;if(!ye||(p=this.settings.plyr.config)!==null&&p!==void 0&&p.muted){if(G(l)){var x=l.querySelector(".gvideo-wrapper");x&&(l=x.getAttribute("data-index"))}var T=this.getSlidePlayerInstance(l);T&&!T.playing&&(T.play(),this.settings.autofocusVideos&&T.elements.container.focus())}}},{key:"setElements",value:function(l){var p=this;this.settings.elements=!1;var x=[];l&&l.length&&c(l,(function(T,O){var D=new qe(T,p,O),H=D.getConfig(),$=u({},H);$.slideConfig=H,$.instance=D,$.index=O,x.push($)})),this.elements=x,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(c(this.elements,(function(){var T=k(p.settings.slideHTML);p.slidesContainer.appendChild(T)})),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(l){var p=!1;return c(this.elements,(function(x,T){if(P(x,"node")&&x.node==l)return p=T,!0})),p}},{key:"getElements",value:function(){var l=this,p=[];this.elements=this.elements?this.elements:[],!L(this.settings.elements)&&B(this.settings.elements)&&this.settings.elements.length&&c(this.settings.elements,(function(T,O){var D=new qe(T,l,O),H=D.getConfig(),$=u({},H);$.node=!1,$.index=O,$.instance=D,$.slideConfig=H,p.push($)}));var x=!1;return this.getSelector()&&(x=document.querySelectorAll(this.getSelector())),x&&c(x,(function(T,O){var D=new qe(T,l,O),H=D.getConfig(),$=u({},H);$.node=T,$.index=O,$.instance=D,$.slideConfig=H,$.gallery=T.getAttribute("data-gallery"),p.push($)})),p}},{key:"getGalleryElements",value:function(l,p){return l.filter((function(x){return x.gallery==p}))}},{key:"getSelector",value:function(){return!this.settings.elements&&(this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getActiveSlide",value:function(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}},{key:"getActiveSlideIndex",value:function(){return this.index}},{key:"getAnimationClasses",value:function(){var l=[];for(var p in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(p)){var x=this.settings.cssEfects[p];l.push("g".concat(x.in)),l.push("g".concat(x.out))}return l.join(" ")}},{key:"build",value:function(){var l=this;if(this.built)return!1;var p=document.body.childNodes,x=[];c(p,(function(j){j.parentNode==document.body&&j.nodeName.charAt(0)!=="#"&&j.hasAttribute&&!j.hasAttribute("aria-hidden")&&(x.push(j),j.setAttribute("aria-hidden","true"))}));var T=P(this.settings.svg,"next")?this.settings.svg.next:"",O=P(this.settings.svg,"prev")?this.settings.svg.prev:"",D=P(this.settings.svg,"close")?this.settings.svg.close:"",H=this.settings.lightboxHTML;H=k(H=(H=(H=H.replace(/{nextSVG}/g,T)).replace(/{prevSVG}/g,O)).replace(/{closeSVG}/g,D)),document.body.appendChild(H);var $=document.getElementById("glightbox-body");this.modal=$;var A=$.querySelector(".gclose");this.prevButton=$.querySelector(".gprev"),this.nextButton=$.querySelector(".gnext"),this.overlay=$.querySelector(".goverlay"),this.loader=$.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=x,this.events={},h(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&A&&(this.events.close=o("click",{onElement:A,withCallback:function(j,U){j.preventDefault(),l.close()}})),A&&!this.settings.closeButton&&A.parentNode.removeChild(A),this.nextButton&&(this.events.next=o("click",{onElement:this.nextButton,withCallback:function(j,U){j.preventDefault(),l.nextSlide()}})),this.prevButton&&(this.events.prev=o("click",{onElement:this.prevButton,withCallback:function(j,U){j.preventDefault(),l.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=o("click",{onElement:$,withCallback:function(j,U){l.preventOutsideClick||v(document.body,"glightbox-mobile")||S(j.target,".ginner-container")||S(j.target,".gbtn")||v(j.target,"gnext")||v(j.target,"gprev")||l.close()}})),c(this.elements,(function(j,U){l.slidesContainer.appendChild(j.instance.create()),j.slideNode=l.slidesContainer.querySelectorAll(".gslide")[U]})),fe&&h(document.body,"glightbox-touch"),this.events.resize=o("resize",{onElement:window,withCallback:function(){l.resize()}}),this.built=!0}},{key:"resize",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if((l=l||this.activeSlide)&&!v(l,"zoomed")){var p=C(),x=l.querySelector(".gvideo-wrapper"),T=l.querySelector(".gslide-image"),O=this.slideDescription,D=p.width,H=p.height;if(D<=768?h(document.body,"glightbox-mobile"):f(document.body,"glightbox-mobile"),x||T){var $=!1;if(O&&(v(O,"description-bottom")||v(O,"description-top"))&&!v(O,"gabsolute")&&($=!0),T){if(D<=768)T.querySelector("img");else if($){var A,j,U=O.offsetHeight,Y=T.querySelector("img"),Z=(A=this.elements[this.index])===null||A===void 0?void 0:A.node,ee="100vh";Z&&(ee=(j=Z.getAttribute("data-height"))!==null&&j!==void 0?j:ee),Y.setAttribute("style","max-height: calc(".concat(ee," - ").concat(U,"px)")),O.setAttribute("style","max-width: ".concat(Y.offsetWidth,"px;"))}}if(x){var te=P(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!te){var K=x.clientWidth,me=x.clientHeight,le=K/me;te="".concat(K/le,":").concat(me/le)}var Ce=te.split(":"),pe=this.settings.videosWidth,xe=this.settings.videosWidth,Le=(xe=N(pe)||pe.indexOf("px")!==-1?parseInt(pe):pe.indexOf("vw")!==-1?D*parseInt(pe)/100:pe.indexOf("vh")!==-1?H*parseInt(pe)/100:pe.indexOf("%")!==-1?D*parseInt(pe)/100:parseInt(x.clientWidth))/(parseInt(Ce[0])/parseInt(Ce[1]));if(Le=Math.floor(Le),$&&(H-=O.offsetHeight),xe>D||Le>H||H<Le&&D>xe){var $e=x.offsetWidth,Ne=x.offsetHeight,Pe=H/Ne,ke={width:$e*Pe,height:Ne*Pe};x.parentNode.setAttribute("style","max-width: ".concat(ke.width,"px")),$&&O.setAttribute("style","max-width: ".concat(ke.width,"px;"))}else x.parentNode.style.maxWidth="".concat(pe),$&&O.setAttribute("style","max-width: ".concat(pe,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updateNavigationClasses",value:function(){var l=this.loop();f(this.nextButton,"disabled"),f(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(h(this.prevButton,"disabled"),h(this.nextButton,"disabled")):this.index!==0||l?this.index!==this.elements.length-1||l||h(this.nextButton,"disabled"):h(this.prevButton,"disabled")}},{key:"loop",value:function(){var l=P(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return l=P(this.settings,"loop")?this.settings.loop:l,l}},{key:"close",value:function(){var l=this;if(!this.lightboxOpen){if(this.events){for(var p in this.events)this.events.hasOwnProperty(p)&&this.events[p].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&c(this.bodyHiddenChildElms,(function(x){x.removeAttribute("aria-hidden")})),h(this.modal,"glightbox-closing"),R(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),R(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,(function(){if(l.activeSlide=null,l.prevActiveSlideIndex=null,l.prevActiveSlide=null,l.built=!1,l.events){for(var x in l.events)l.events.hasOwnProperty(x)&&l.events[x].destroy();l.events=null}var T=document.body;f(he,"glightbox-open"),f(T,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),l.modal.parentNode.removeChild(l.modal),l.trigger("close"),I(l.settings.onClose)&&l.settings.onClose();var O=document.querySelector(".gcss-styles");O&&O.parentNode.removeChild(O),l.lightboxOpen=!1,l.closing=null}))}},{key:"destroy",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:"on",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!l||!I(p))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:l,once:x,callback:p})}},{key:"once",value:function(l,p){this.on(l,p,!0)}},{key:"trigger",value:function(l){var p=this,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,T=[];c(this.apiEvents,(function(O,D){var H=O.evt,$=O.once,A=O.callback;H==l&&(A(x),$&&T.push(D))})),T.length&&c(T,(function(O){return p.apiEvents.splice(O,1)}))}},{key:"clearAllEvents",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:"version",value:function(){return"3.3.1"}}]);return function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=new Me(l);return p.init(),p}}))})(pt)),pt.exports}var Ui=Vi();const si=dt(Ui);class Bi{constructor(e={}){this.animationTime=e.animationTime??800,this.frameRate=e.frameRate??150,this.stepSize=e.stepSize??120,this.accelerationDelta=e.accelerationDelta??300,this.accelerationMax=e.accelerationMax??2,this.pulseScale=e.pulseScale??4,this.pulseNormalize=1/this._pulseRaw(1),this.queue=[],this.pending=!1,this.lastScrollTime=0,this.direction={x:0,y:0},this._init()}_init(){window.addEventListener("wheel",this._onWheel.bind(this),{passive:!1})}destroy(){window.removeEventListener("wheel",this._onWheel.bind(this)),this.queue=[],this.pending=!1}_onWheel(e){if(e.ctrlKey||e.defaultPrevented)return;let i=e.deltaX,s=e.deltaY;!i&&!s&&(s=-e.wheelDelta||0),e.deltaMode===1&&(i*=40,s*=40),Math.abs(i)>1.2&&(i=i/120*this.stepSize),Math.abs(s)>1.2&&(s=s/120*this.stepSize);const t=e.target,n=this._findScrollableAncestor(t);if(!n)return;const r=Date.now(),a=r-this.lastScrollTime;let u=1;a<this.accelerationDelta&&(u=Math.min(1+50/a,this.accelerationMax),i*=u,s*=u),this.lastScrollTime=r;const c=Math.sign(i),d=Math.sign(s);(c!==this.direction.x||d!==this.direction.y)&&(this.direction={x:c,y:d},this.queue=[]),this._enqueueScroll(n,i,s),e.preventDefault()}_findScrollableAncestor(e){const i=document.scrollingElement||document.documentElement;let s=e;for(;s&&s!==document.body;){const n=window.getComputedStyle(s).overflowY,r=["auto","scroll"].includes(n),a=s.scrollHeight>s.clientHeight;if(r&&a)return s;if(s===i)return i;s=s.parentElement}return i}_enqueueScroll(e,i,s){this.queue.push({element:e,x:i,y:s,lastX:i<0?.99:-.99,lastY:s<0?.99:-.99,start:Date.now()}),this.pending||(this._animate(e),this.pending=!0)}_animate(e){const i=Date.now();let s=0,t=0;for(let n=this.queue.length-1;n>=0;n--){const r=this.queue[n],a=i-r.start,u=a>=this.animationTime,c=u?1:a/this.animationTime,d=this._pulse(c),o=r.x*d-r.lastX|0,h=r.y*d-r.lastY|0;s+=o,t+=h,r.lastX+=o,r.lastY+=h,u&&this.queue.splice(n,1)}e===document.scrollingElement||e===document.documentElement?window.scrollBy(s,t):(s&&(e.scrollLeft+=s),t&&(e.scrollTop+=t)),this.queue.length>0?(1e3/this.frameRate,requestAnimationFrame(()=>this._animate(e))):this.pending=!1}_pulseRaw(e){if(e*=this.pulseScale,e<1)return e-(1-Math.exp(-e));{const i=Math.exp(-1),s=1-Math.exp(-(e-1));return i+s*(1-i)}}_pulse(e){return e<=0?0:e>=1?1:this._pulseRaw(e)*this.pulseNormalize}}/*!
|
|
48
|
+
</div>`},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);/*!
|
|
49
49
|
* Glide.js v3.7.1
|
|
50
50
|
* (c) 2013-2024 Jędrzej Chałubek (https://github.com/jedrzejchalubek/)
|
|
51
51
|
* Released under the MIT License.
|
|
52
|
-
*/function ni(m,e){var i=Object.keys(m);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(m);e&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(m,t).enumerable})),i.push.apply(i,s)}return i}function ri(m){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?ni(Object(i),!0).forEach(function(s){Fi(m,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(i)):ni(Object(i)).forEach(function(s){Object.defineProperty(m,s,Object.getOwnPropertyDescriptor(i,s))})}return m}function ft(m){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ft=function(e){return typeof e}:ft=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(m)}function gt(m,e){if(!(m instanceof e))throw new TypeError("Cannot call a class as a function")}function Yi(m,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(m,s.key,s)}}function mt(m,e,i){return e&&Yi(m.prototype,e),m}function Fi(m,e,i){return e in m?Object.defineProperty(m,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):m[e]=i,m}function Wi(m,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(e&&e.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),e&&It(m,e)}function tt(m){return tt=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},tt(m)}function It(m,e){return It=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},It(m,e)}function Gi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xi(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function Ji(m,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xi(m)}function Zi(m){var e=Gi();return function(){var s=tt(m),t;if(e){var n=tt(this).constructor;t=Reflect.construct(s,arguments,n)}else t=s.apply(this,arguments);return Ji(this,t)}}function Qi(m,e){for(;!Object.prototype.hasOwnProperty.call(m,e)&&(m=tt(m),m!==null););return m}function bt(){return typeof Reflect<"u"&&Reflect.get?bt=Reflect.get:bt=function(e,i,s){var t=Qi(e,i);if(t){var n=Object.getOwnPropertyDescriptor(t,i);return n.get?n.get.call(arguments.length<3?e:s):n.value}},bt.apply(this,arguments)}var Ki={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function We(m){console.error("[Glide warn]: ".concat(m))}function ze(m){return parseInt(m)}function es(m){return parseFloat(m)}function Nt(m){return typeof m=="string"}function it(m){var e=ft(m);return e==="function"||e==="object"&&!!m}function vt(m){return typeof m=="function"}function ai(m){return typeof m>"u"}function Pt(m){return m.constructor===Array}function ts(m,e,i){var s={};for(var t in e)vt(e[t])?s[t]=e[t](m,s,i):We("Extension must be a function");for(var n in s)vt(s[n].mount)&&s[n].mount();return s}function je(m,e,i){Object.defineProperty(m,e,i)}function is(m){return Object.keys(m).sort().reduce(function(e,i){return e[i]=m[i],e[i],e},{})}function Dt(m,e){var i=Object.assign({},m,e);if(e.hasOwnProperty("classes")){i.classes=Object.assign({},m.classes,e.classes);var s=["direction","type","slide","arrow","nav"];s.forEach(function(t){e.classes.hasOwnProperty(t)&&(i.classes[t]=ri(ri({},m.classes[t]),e.classes[t]))})}return e.hasOwnProperty("breakpoints")&&(i.breakpoints=Object.assign({},m.breakpoints,e.breakpoints)),i}var ss=(function(){function m(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,m),this.events=e,this.hop=e.hasOwnProperty}return mt(m,[{key:"on",value:function(i,s){if(Pt(i)){for(var t=0;t<i.length;t++)this.on(i[t],s);return}this.hop.call(this.events,i)||(this.events[i]=[]);var n=this.events[i].push(s)-1;return{remove:function(){delete this.events[i][n]}}}},{key:"emit",value:function(i,s){if(Pt(i)){for(var t=0;t<i.length;t++)this.emit(i[t],s);return}this.hop.call(this.events,i)&&this.events[i].forEach(function(n){n(s||{})})}}]),m})(),ns=(function(){function m(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gt(this,m),this._c={},this._t=[],this._e=new ss,this.disabled=!1,this.selector=e,this.settings=Dt(Ki,i),this.index=this.settings.startAt}return mt(m,[{key:"mount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),it(i)?this._c=ts(this,i,this._e):We("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Pt(i)?this._t=i:We("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=Dt(this.settings,i),i.hasOwnProperty("startAt")&&(this.index=i.startAt),this._e.emit("update"),this}},{key:"go",value:function(i){return this._c.Run.make(i),this}},{key:"move",value:function(i){return this._c.Transition.disable(),this._c.Move.make(i),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i&&(this.settings.autoplay=i),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(i,s){return this._e.on(i,s),this}},{key:"isType",value:function(i){return this.settings.type===i}},{key:"settings",get:function(){return this._o},set:function(i){it(i)?this._o=i:We("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(i){this._i=ze(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(i){this._d=!!i}}]),m})();function rs(m,e,i){var s={mount:function(){this._o=!1},make:function(c){var d=this;m.disabled||(!m.settings.waitForTransition||m.disable(),this.move=c,i.emit("run.before",this.move),this.calculate(),i.emit("run",this.move),e.Transition.after(function(){d.isStart()&&i.emit("run.start",d.move),d.isEnd()&&i.emit("run.end",d.move),d.isOffset()&&(d._o=!1,i.emit("run.offset",d.move)),i.emit("run.after",d.move),m.enable()}))},calculate:function(){var c=this.move,d=this.length,o=c.steps,h=c.direction,f=1;if(h==="="){if(m.settings.bound&&ze(o)>d){m.index=d;return}m.index=o;return}if(h===">"&&o===">"){m.index=d;return}if(h==="<"&&o==="<"){m.index=0;return}if(h==="|"&&(f=m.settings.perView||1),h===">"||h==="|"&&o===">"){var v=t(f);v>d&&(this._o=!0),m.index=n(v,f);return}if(h==="<"||h==="|"&&o==="<"){var S=r(f);S<0&&(this._o=!0),m.index=a(S,f);return}We("Invalid direction pattern [".concat(h).concat(o,"] has been used"))},isStart:function(){return m.index<=0},isEnd:function(){return m.index>=this.length},isOffset:function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return c?this._o?c==="|>"?this.move.direction==="|"&&this.move.steps===">":c==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===c:!1:this._o},isBound:function(){return m.isType("slider")&&m.settings.focusAt!=="center"&&m.settings.bound}};function t(u){var c=m.index;return m.isType("carousel")?c+u:c+(u-c%u)}function n(u,c){var d=s.length;return u<=d?u:m.isType("carousel")?u-(d+1):m.settings.rewind?s.isBound()&&!s.isEnd()?d:0:s.isBound()?d:Math.floor(d/c)*c}function r(u){var c=m.index;if(m.isType("carousel"))return c-u;var d=Math.ceil(c/u);return(d-1)*u}function a(u,c){var d=s.length;return u>=0?u:m.isType("carousel")?u+(d+1):m.settings.rewind?s.isBound()&&s.isStart()?d:Math.floor(d/c)*c:0}return je(s,"move",{get:function(){return this._m},set:function(c){var d=c.substr(1);this._m={direction:c.substr(0,1),steps:d?ze(d)?ze(d):d:0}}}),je(s,"length",{get:function(){var c=m.settings,d=e.Html.slides.length;return this.isBound()?d-1-(ze(c.perView)-1)+ze(c.focusAt):d-1}}),je(s,"offset",{get:function(){return this._o}}),s}function oi(){return new Date().getTime()}function yt(m,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,t,n,r,a=0,u=function(){a=i.leading===!1?0:oi(),s=null,r=m.apply(t,n),s||(t=n=null)},c=function(){var o=oi();!a&&i.leading===!1&&(a=o);var h=e-(o-a);return t=this,n=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=o,r=m.apply(t,n),s||(t=n=null)):!s&&i.trailing!==!1&&(s=setTimeout(u,h)),r};return c.cancel=function(){clearTimeout(s),a=0,s=t=n=null},c}var wt={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function as(m,e,i){var s={apply:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style,c=e.Direction.value;r!==0?u[wt[c][0]]="".concat(this.value/2,"px"):u[wt[c][0]]="",r!==n.length-1?u[wt[c][1]]="".concat(this.value/2,"px"):u[wt[c][1]]=""}},remove:function(n){for(var r=0,a=n.length;r<a;r++){var u=n[r].style;u.marginLeft="",u.marginRight=""}}};return je(s,"value",{get:function(){return ze(m.settings.gap)}}),je(s,"grow",{get:function(){return s.value*e.Sizes.length}}),je(s,"reductor",{get:function(){var n=m.settings.perView;return s.value*(n-1)/n}}),i.on(["build.after","update"],yt(function(){s.apply(e.Html.wrapper.children)},30)),i.on("destroy",function(){s.remove(e.Html.wrapper.children)}),s}function li(m){if(m&&m.parentNode){for(var e=m.parentNode.firstChild,i=[];e;e=e.nextSibling)e.nodeType===1&&e!==m&&i.push(e);return i}return[]}function Ht(m){return Array.prototype.slice.call(m)}var os='[data-glide-el="track"]';function ls(m,e,i){var s={mount:function(){this.root=m.selector,this.track=this.root.querySelector(os),this.collectSlides()},collectSlides:function(){this.slides=Ht(this.wrapper.children).filter(function(n){return!n.classList.contains(m.settings.classes.slide.clone)})}};return je(s,"root",{get:function(){return s._r},set:function(n){Nt(n)&&(n=document.querySelector(n)),n!==null?s._r=n:We("Root element must be a existing Html node")}}),je(s,"track",{get:function(){return s._t},set:function(n){s._t=n}}),je(s,"wrapper",{get:function(){return s.track.children[0]}}),i.on("update",function(){s.collectSlides()}),s}function cs(m,e,i){var s={mount:function(){this.value=m.settings.peek}};return je(s,"value",{get:function(){return s._v},set:function(n){it(n)?(n.before=ze(n.before),n.after=ze(n.after)):n=ze(n),s._v=n}}),je(s,"reductor",{get:function(){var n=s.value,r=m.settings.perView;return it(n)?n.before/r+n.after/r:n*2/r}}),i.on(["resize","update"],function(){s.mount()}),s}function us(m,e,i){var s={mount:function(){this._o=0},make:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=r,i.emit("move",{movement:this.value}),e.Transition.after(function(){i.emit("move.after",{movement:n.value})})}};return je(s,"offset",{get:function(){return s._o},set:function(n){s._o=ai(n)?0:ze(n)}}),je(s,"translate",{get:function(){return e.Sizes.slideWidth*m.index}}),je(s,"value",{get:function(){var n=this.offset,r=this.translate;return e.Direction.is("rtl")?r+n:r-n}}),i.on(["build.before","run"],function(){s.make()}),s}function ds(m,e,i){var s={setupSlides:function(){for(var n="".concat(this.slideWidth,"px"),r=e.Html.slides,a=0;a<r.length;a++)r[a].style.width=n},setupWrapper:function(){e.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var n=e.Html.slides,r=0;r<n.length;r++)n[r].style.width="";e.Html.wrapper.style.width=""}};return je(s,"length",{get:function(){return e.Html.slides.length}}),je(s,"width",{get:function(){return e.Html.track.offsetWidth}}),je(s,"wrapperSize",{get:function(){return s.slideWidth*s.length+e.Gaps.grow+e.Clones.grow}}),je(s,"slideWidth",{get:function(){return s.width/m.settings.perView-e.Peek.reductor-e.Gaps.reductor}}),i.on(["build.before","resize","update"],function(){s.setupSlides(),s.setupWrapper()}),i.on("destroy",function(){s.remove()}),s}function hs(m,e,i){var s={mount:function(){i.emit("build.before"),this.typeClass(),this.activeClass(),i.emit("build.after")},typeClass:function(){e.Html.root.classList.add(m.settings.classes.type[m.settings.type])},activeClass:function(){var n=m.settings.classes,r=e.Html.slides[m.index];r&&(r.classList.add(n.slide.active),li(r).forEach(function(a){a.classList.remove(n.slide.active)}))},removeClasses:function(){var n=m.settings.classes,r=n.type,a=n.slide;e.Html.root.classList.remove(r[m.settings.type]),e.Html.slides.forEach(function(u){u.classList.remove(a.active)})}};return i.on(["destroy","update"],function(){s.removeClasses()}),i.on(["resize","update"],function(){s.mount()}),i.on("move.after",function(){s.activeClass()}),s}function ps(m,e,i){var s={mount:function(){this.items=[],m.isType("carousel")&&(this.items=this.collect())},collect:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=e.Html.slides,a=m.settings,u=a.perView,c=a.classes,d=a.cloningRatio;if(r.length>0)for(var o=+!!m.settings.peek,h=u+o+Math.round(u/2),f=r.slice(0,h).reverse(),v=r.slice(h*-1),S=0;S<Math.max(d,Math.floor(u/r.length));S++){for(var R=0;R<f.length;R++){var y=f[R].cloneNode(!0);y.classList.add(c.slide.clone),n.push(y)}for(var E=0;E<v.length;E++){var b=v[E].cloneNode(!0);b.classList.add(c.slide.clone),n.unshift(b)}}return n},append:function(){for(var n=this.items,r=e.Html,a=r.wrapper,u=r.slides,c=Math.floor(n.length/2),d=n.slice(0,c).reverse(),o=n.slice(c*-1).reverse(),h="".concat(e.Sizes.slideWidth,"px"),f=0;f<o.length;f++)a.appendChild(o[f]);for(var v=0;v<d.length;v++)a.insertBefore(d[v],u[0]);for(var S=0;S<n.length;S++)n[S].style.width=h},remove:function(){for(var n=this.items,r=0;r<n.length;r++)e.Html.wrapper.removeChild(n[r])}};return je(s,"grow",{get:function(){return(e.Sizes.slideWidth+e.Gaps.value)*s.items.length}}),i.on("update",function(){s.remove(),s.mount(),s.append()}),i.on("build.before",function(){m.isType("carousel")&&s.append()}),i.on("destroy",function(){s.remove()}),s}var Je=(function(){function m(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(this,m),this.listeners=e}return mt(m,[{key:"on",value:function(i,s,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Nt(i)&&(i=[i]);for(var r=0;r<i.length;r++)this.listeners[i[r]]=t,s.addEventListener(i[r],this.listeners[i[r]],n)}},{key:"off",value:function(i,s){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Nt(i)&&(i=[i]);for(var n=0;n<i.length;n++)s.removeEventListener(i[n],this.listeners[i[n]],t)}},{key:"destroy",value:function(){delete this.listeners}}]),m})();function fs(m,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("resize",window,yt(function(){i.emit("resize")},m.settings.throttle))},unbind:function(){s.off("resize",window)}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}var gs=["ltr","rtl"],ms={">":"<","<":">","=":"="};function bs(m,e,i){var s={mount:function(){this.value=m.settings.direction},resolve:function(n){var r=n.slice(0,1);return this.is("rtl")?n.split(r).join(ms[r]):n},is:function(n){return this.value===n},addClass:function(){e.Html.root.classList.add(m.settings.classes.direction[this.value])},removeClass:function(){e.Html.root.classList.remove(m.settings.classes.direction[this.value])}};return je(s,"value",{get:function(){return s._v},set:function(n){gs.indexOf(n)>-1?s._v=n:We("Direction value must be `ltr` or `rtl`")}}),i.on(["destroy","update"],function(){s.removeClass()}),i.on("update",function(){s.mount()}),i.on(["build.before","update"],function(){s.addClass()}),s}function vs(m,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function ys(m,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function ws(m,e){return{modify:function(s){return s+e.Clones.grow/2}}}function xs(m,e){return{modify:function(s){if(m.settings.focusAt>=0){var t=e.Peek.value;return it(t)?s-t.before:s-t}return s}}}function ks(m,e){return{modify:function(s){var t=e.Gaps.value,n=e.Sizes.width,r=m.settings.focusAt,a=e.Sizes.slideWidth;return r==="center"?s-(n/2-a/2):s-a*r-t*r}}}function _s(m,e,i){var s=[ys,ws,xs,ks].concat(m._t,[vs]);return{mutate:function(n){for(var r=0;r<s.length;r++){var a=s[r];vt(a)&&vt(a().modify)?n=a(m,e,i).modify(n):We("Transformer should be a function that returns an object with `modify()` method")}return n}}}function Ss(m,e,i){var s={set:function(n){var r=_s(m,e).mutate(n),a="translate3d(".concat(-1*r,"px, 0px, 0px)");e.Html.wrapper.style.mozTransform=a,e.Html.wrapper.style.webkitTransform=a,e.Html.wrapper.style.transform=a},remove:function(){e.Html.wrapper.style.transform=""},getStartIndex:function(){var n=e.Sizes.length,r=m.index,a=m.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n+(r-a):(r+a)%n},getTravelDistance:function(){var n=e.Sizes.slideWidth*m.settings.perView;return e.Run.isOffset(">")||e.Run.isOffset("|>")?n*-1:n}};return i.on("move",function(t){if(!m.isType("carousel")||!e.Run.isOffset())return s.set(t.movement);e.Transition.after(function(){i.emit("translate.jump"),s.set(e.Sizes.slideWidth*m.index)});var n=e.Sizes.slideWidth*e.Translate.getStartIndex();return s.set(n-e.Translate.getTravelDistance())}),i.on("destroy",function(){s.remove()}),s}function Ts(m,e,i){var s=!1,t={compose:function(r){var a=m.settings;return s?"".concat(r," 0ms ").concat(a.animationTimingFunc):"".concat(r," ").concat(this.duration,"ms ").concat(a.animationTimingFunc)},set:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";e.Html.wrapper.style.transition=this.compose(r)},remove:function(){e.Html.wrapper.style.transition=""},after:function(r){setTimeout(function(){r()},this.duration)},enable:function(){s=!1,this.set()},disable:function(){s=!0,this.set()}};return je(t,"duration",{get:function(){var r=m.settings;return m.isType("slider")&&e.Run.offset?r.rewindDuration:r.animationDuration}}),i.on("move",function(){t.set()}),i.on(["build.before","resize","translate.jump"],function(){t.disable()}),i.on("run",function(){t.enable()}),i.on("destroy",function(){t.remove()}),t}var ci=!1;try{var ui=Object.defineProperty({},"passive",{get:function(){ci=!0}});window.addEventListener("testPassive",null,ui),window.removeEventListener("testPassive",null,ui)}catch{}var $t=ci,xt=["touchstart","mousedown"],di=["touchmove","mousemove"],hi=["touchend","touchcancel","mouseup","mouseleave"],pi=["mousedown","mousemove","mouseup","mouseleave"];function Es(m,e,i){var s=new Je,t=0,n=0,r=0,a=!1,u=$t?{passive:!0}:!1,c={mount:function(){this.bindSwipeStart()},start:function(o){if(!a&&!m.disabled){this.disable();var h=this.touches(o);t=null,n=ze(h.pageX),r=ze(h.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),i.emit("swipe.start")}},move:function(o){if(!m.disabled){var h=m.settings,f=h.touchAngle,v=h.touchRatio,S=h.classes,R=this.touches(o),y=ze(R.pageX)-n,E=ze(R.pageY)-r,b=Math.abs(y<<2),k=Math.abs(E<<2),C=Math.sqrt(b+k),g=Math.sqrt(k);if(t=Math.asin(g/C),t*180/Math.PI<f)o.stopPropagation(),e.Move.make(y*es(v)),e.Html.root.classList.add(S.dragging),i.emit("swipe.move");else return!1}},end:function(o){if(!m.disabled){var h=m.settings,f=h.perSwipe,v=h.touchAngle,S=h.classes,R=this.touches(o),y=this.threshold(o),E=R.pageX-n,b=t*180/Math.PI;this.enable(),E>y&&b<v?e.Run.make(e.Direction.resolve("".concat(f,"<"))):E<-y&&b<v?e.Run.make(e.Direction.resolve("".concat(f,">"))):e.Move.make(),e.Html.root.classList.remove(S.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),i.emit("swipe.end")}},bindSwipeStart:function(){var o=this,h=m.settings,f=h.swipeThreshold,v=h.dragThreshold;f&&s.on(xt[0],e.Html.wrapper,function(S){o.start(S)},u),v&&s.on(xt[1],e.Html.wrapper,function(S){o.start(S)},u)},unbindSwipeStart:function(){s.off(xt[0],e.Html.wrapper,u),s.off(xt[1],e.Html.wrapper,u)},bindSwipeMove:function(){var o=this;s.on(di,e.Html.wrapper,yt(function(h){o.move(h)},m.settings.throttle),u)},unbindSwipeMove:function(){s.off(di,e.Html.wrapper,u)},bindSwipeEnd:function(){var o=this;s.on(hi,e.Html.wrapper,function(h){o.end(h)})},unbindSwipeEnd:function(){s.off(hi,e.Html.wrapper)},touches:function(o){return pi.indexOf(o.type)>-1?o:o.touches[0]||o.changedTouches[0]},threshold:function(o){var h=m.settings;return pi.indexOf(o.type)>-1?h.dragThreshold:h.swipeThreshold},enable:function(){return a=!1,e.Transition.enable(),this},disable:function(){return a=!0,e.Transition.disable(),this}};return i.on("build.after",function(){e.Html.root.classList.add(m.settings.classes.swipeable)}),i.on("destroy",function(){c.unbindSwipeStart(),c.unbindSwipeMove(),c.unbindSwipeEnd(),s.destroy()}),c}function Cs(m,e,i){var s=new Je,t={mount:function(){this.bind()},bind:function(){s.on("dragstart",e.Html.wrapper,this.dragstart)},unbind:function(){s.off("dragstart",e.Html.wrapper)},dragstart:function(r){r.preventDefault()}};return i.on("destroy",function(){t.unbind(),s.destroy()}),t}function Ls(m,e,i){var s=new Je,t=!1,n=!1,r={mount:function(){this._a=e.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){s.on("click",e.Html.wrapper,this.click)},unbind:function(){s.off("click",e.Html.wrapper)},click:function(u){n&&(u.stopPropagation(),u.preventDefault())},detach:function(){if(n=!0,!t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!1;t=!0}return this},attach:function(){if(n=!1,t){for(var u=0;u<this.items.length;u++)this.items[u].draggable=!0;t=!1}return this}};return je(r,"items",{get:function(){return r._a}}),i.on("swipe.move",function(){r.detach()}),i.on("swipe.end",function(){e.Transition.after(function(){r.attach()})}),i.on("destroy",function(){r.attach(),r.unbind(),s.destroy()}),r}var Os='[data-glide-el="controls[nav]"]',zt='[data-glide-el^="controls"]',As="".concat(zt,' [data-glide-dir*="<"]'),qs="".concat(zt,' [data-glide-dir*=">"]');function Rs(m,e,i){var s=new Je,t=$t?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(Os),this._c=e.Html.root.querySelectorAll(zt),this._arrowControls={previous:e.Html.root.querySelectorAll(As),next:e.Html.root.querySelectorAll(qs)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var u=m.settings,c=a[m.index];c&&(c.classList.add(u.classes.nav.active),li(c).forEach(function(d){d.classList.remove(u.classes.nav.active)}))},removeClass:function(a){var u=a[m.index];u?.classList.remove(m.settings.classes.nav.active)},setArrowState:function(){if(!m.settings.rewind){var a=n._arrowControls.next,u=n._arrowControls.previous;this.resetArrowState(a,u),m.index===0&&this.disableArrow(u),m.index===e.Run.length&&this.disableArrow(a)}},resetArrowState:function(){for(var a=m.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){Ht(o).forEach(function(h){h.classList.remove(a.classes.arrow.disabled)})})},disableArrow:function(){for(var a=m.settings,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];c.forEach(function(o){Ht(o).forEach(function(h){h.classList.add(a.classes.arrow.disabled)})})},addBindings:function(){for(var a=0;a<this._c.length;a++)this.bind(this._c[a].children)},removeBindings:function(){for(var a=0;a<this._c.length;a++)this.unbind(this._c[a].children)},bind:function(a){for(var u=0;u<a.length;u++)s.on("click",a[u],this.click),s.on("touchstart",a[u],this.click,t)},unbind:function(a){for(var u=0;u<a.length;u++)s.off(["click","touchstart"],a[u])},click:function(a){!$t&&a.type==="touchstart"&&a.preventDefault();var u=a.currentTarget.getAttribute("data-glide-dir");e.Run.make(e.Direction.resolve(u))}};return je(n,"items",{get:function(){return n._c}}),i.on(["mount.after","move.after"],function(){n.setActive()}),i.on(["mount.after","run"],function(){n.setArrowState()}),i.on("destroy",function(){n.removeBindings(),n.removeActive(),s.destroy()}),n}function Ms(m,e,i){var s=new Je,t={mount:function(){m.settings.keyboard&&this.bind()},bind:function(){s.on("keyup",document,this.press)},unbind:function(){s.off("keyup",document)},press:function(r){var a=m.settings.perSwipe,u={ArrowRight:">",ArrowLeft:"<"};["ArrowRight","ArrowLeft"].includes(r.code)&&e.Run.make(e.Direction.resolve("".concat(a).concat(u[r.code])))}};return i.on(["destroy","update"],function(){t.unbind()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function js(m,e,i){var s=new Je,t={mount:function(){this.enable(),this.start(),m.settings.hoverpause&&this.bind()},enable:function(){this._e=!0},disable:function(){this._e=!1},start:function(){var r=this;this._e&&(this.enable(),m.settings.autoplay&&ai(this._i)&&(this._i=setInterval(function(){r.stop(),e.Run.make(">"),r.start(),i.emit("autoplay")},this.time)))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var r=this;s.on("mouseover",e.Html.root,function(){r._e&&r.stop()}),s.on("mouseout",e.Html.root,function(){r._e&&r.start()})},unbind:function(){s.off(["mouseover","mouseout"],e.Html.root)}};return je(t,"time",{get:function(){var r=e.Html.slides[m.index].getAttribute("data-glide-autoplay");return ze(r||m.settings.autoplay)}}),i.on(["destroy","update"],function(){t.unbind()}),i.on(["run.before","swipe.start","update"],function(){t.stop()}),i.on(["pause","destroy"],function(){t.disable(),t.stop()}),i.on(["run.after","swipe.end"],function(){t.start()}),i.on(["play"],function(){t.enable(),t.start()}),i.on("update",function(){t.mount()}),i.on("destroy",function(){s.destroy()}),t}function fi(m){return it(m)?is(m):(We("Breakpoints option must be an object"),{})}function Is(m,e,i){var s=new Je,t=m.settings,n=fi(t.breakpoints),r=Object.assign({},t),a={match:function(c){if(typeof window.matchMedia<"u"){for(var d in c)if(c.hasOwnProperty(d)&&window.matchMedia("(max-width: ".concat(d,"px)")).matches)return c[d]}return r}};return Object.assign(t,a.match(n)),s.on("resize",window,yt(function(){m.settings=Dt(t,a.match(n))},m.settings.throttle)),i.on("update",function(){n=fi(n),r=Object.assign({},t)}),i.on("destroy",function(){s.off("resize",window)}),a}var Ns={Html:ls,Translate:Ss,Transition:Ts,Direction:bs,Peek:cs,Sizes:ds,Gaps:as,Move:us,Clones:ps,Resize:fs,Build:hs,Run:rs,Swipe:Es,Images:Cs,Anchors:Ls,Controls:Rs,Keyboard:Ms,Autoplay:js,Breakpoints:Is},Ps=(function(m){Wi(i,m);var e=Zi(i);function i(){return gt(this,i),e.apply(this,arguments)}return mt(i,[{key:"mount",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return bt(tt(i.prototype),"mount",this).call(this,Object.assign({},Ns,t))}}]),i})(ns);function Vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Ze=Vt();function gi(m){Ze=m}const ot={exec:()=>null};function Te(m,e=""){let i=typeof m=="string"?m:m.source;const s={replace:(t,n)=>{let r=typeof n=="string"?n:n.source;return r=r.replace(Ve.caret,"$1"),i=i.replace(t,r),s},getRegex:()=>new RegExp(i,e)};return s}const Ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:m=>new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}#`),htmlBeginRegex:m=>new RegExp(`^ {0,${Math.min(3,m-1)}}<(?:[a-z].*>|!--)`,"i")},Ds=/^(?:[ \t]*(?:\n|$))+/,Hs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$s=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ut=/(?:[*+-]|\d{1,9}[.)])/,mi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bi=Te(mi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vs=Te(mi).replace(/bull/g,Ut).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Us=/^[^\n]+/,Yt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Bs=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ys=Te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ut).getRegex(),kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ft=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fs=Te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ft).replace("tag",kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vi=Te(Bt).replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Wt={blockquote:Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vi).getRegex(),code:Hs,def:Bs,fences:$s,heading:zs,hr:lt,html:Fs,lheading:bi,list:Ys,newline:Ds,paragraph:vi,table:ot,text:Us},yi=Te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex(),Ws={...Wt,lheading:Vs,table:yi,paragraph:Te(Bt).replace("hr",lt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kt).getRegex()},Gs={...Wt,html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ft).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ot,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Te(Bt).replace("hr",lt).replace("heading",` *#{1,6} *[^
|
|
53
|
-
]`).replace("lheading",
|
|
52
|
+
*/function 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",yi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},es=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ts=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ki=/^( {2,}|\\)\n(?!\s*$)/,is=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_t=/[\p{P}\p{S}]/u,Xt=/[\s\p{P}\p{S}]/u,_i=/[^\s\p{P}\p{S}]/u,ns=Ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xt).getRegex(),Si=/(?!~)[\p{P}\p{S}]/u,ss=/(?!~)[\s\p{P}\p{S}]/u,rs=/(?:[^\s\p{P}\p{S}]|~)/u,as=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ei=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,os=Ae(Ei,"u").replace(/punct/g,_t).getRegex(),ls=Ae(Ei,"u").replace(/punct/g,Si).getRegex(),Ti="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cs=Ae(Ti,"gu").replace(/notPunctSpace/g,_i).replace(/punctSpace/g,Xt).replace(/punct/g,_t).getRegex(),us=Ae(Ti,"gu").replace(/notPunctSpace/g,rs).replace(/punctSpace/g,ss).replace(/punct/g,Si).getRegex(),ds=Ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_i).replace(/punctSpace/g,Xt).replace(/punct/g,_t).getRegex(),hs=Ae(/\\(punct)/,"gu").replace(/punct/g,_t).getRegex(),ps=Ae(/^<(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(),fs=Ae(Wt).replace("(?:-->|$)","-->").getRegex(),gs=Ae("^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",fs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),St=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ms=Ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",St).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ci=Ae(/^!?\[(label)\]\[(ref)\]/).replace("label",St).replace("ref",Yt).getRegex(),Oi=Ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yt).getRegex(),bs=Ae("reflink|nolink(?!\\()","g").replace("reflink",Ci).replace("nolink",Oi).getRegex(),Jt={_backpedal:lt,anyPunctuation:hs,autolink:ps,blockSkip:as,br:ki,code:ts,del:lt,emStrongLDelim:os,emStrongRDelimAst:cs,emStrongRDelimUnd:ds,escape:es,link:ms,nolink:Oi,punctuation:ns,reflink:Ci,reflinkSearch:bs,tag:gs,text:is,url:lt},vs={...Jt,link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",St).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",St).getRegex()},Zt={...Jt,emStrongRDelimAst:us,emStrongLDelim:ls,url:Ae(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ys={...Zt,br:Ae(ki).replace("{2,}","*").getRegex(),text:Ae(Zt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Et={normal:Gt,gfm:Qn,pedantic:Kn},ut={normal:Jt,gfm:Zt,breaks:ys,pedantic:vs},ws={"&":"&","<":"<",">":">",'"':""","'":"'"},Li=v=>ws[v];function Ye(v,e){if(e){if(Ve.escapeTest.test(v))return v.replace(Ve.escapeReplace,Li)}else if(Ve.escapeTestNoEncode.test(v))return v.replace(Ve.escapeReplaceNoEncode,Li);return v}function Ai(v){try{v=encodeURI(v).replace(Ve.percentDecode,"%")}catch{return null}return v}function Ri(v,e){const i=v.replace(Ve.findPipe,(n,r,a)=>{let u=!1,c=r;for(;--c>=0&&a[c]==="\\";)u=!u;return u?"|":" |"}),s=i.split(Ve.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(Ve.slashPipe,"|");return s}function dt(v,e,i){const s=v.length;if(s===0)return"";let t=0;for(;t<s&&v.charAt(s-t-1)===e;)t++;return v.slice(0,s-t)}function xs(v,e){if(v.indexOf(e[1])===-1)return-1;let i=0;for(let s=0;s<v.length;s++)if(v[s]==="\\")s++;else if(v[s]===e[0])i++;else if(v[s]===e[1]&&(i--,i<0))return s;return i>0?-2:-1}function qi(v,e,i,s,t){const n=e.href,r=e.title||null,a=v[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;const u={type:v[0].charAt(0)==="!"?"image":"link",raw:i,href:n,title:r,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,u}function ks(v,e,i){const s=v.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 Tt{options;rules;lexer;constructor(e){this.options=e||Ze}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:dt(s,`
|
|
56
|
+
`)}}}fences(e){const i=this.rules.block.fences.exec(e);if(i){const s=i[0],t=ks(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=dt(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:dt(i[0],`
|
|
57
|
+
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=dt(i[0],`
|
|
58
58
|
`).split(`
|
|
59
59
|
`),t="",n="";const r=[];for(;s.length>0;){let a=!1;const u=[];let c;for(c=0;c<s.length;c++)if(this.rules.other.blockquoteStart.test(s[c]))u.push(s[c]),a=!0;else if(!a)u.push(s[c]);else break;s=s.slice(c);const d=u.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 g=r.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){const y=g,E=y.raw+`
|
|
64
64
|
`+s.join(`
|
|
65
|
-
`),
|
|
65
|
+
`),M=this.blockquote(E);r[r.length-1]=M,t=t.substring(0,t.length-y.raw.length)+M.raw,n=n.substring(0,n.length-y.text.length)+M.text;break}else if(g?.type==="list"){const y=g,E=y.raw+`
|
|
66
66
|
`+s.join(`
|
|
67
|
-
`),
|
|
67
|
+
`),M=this.list(E);r[r.length-1]=M,t=t.substring(0,t.length-g.raw.length)+M.raw,n=n.substring(0,n.length-y.raw.length)+M.raw,s=E.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=
|
|
69
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),g=e.split(`
|
|
70
|
+
`,1)[0],y=!h.trim(),E=0;if(this.options.pedantic?(E=2,o=h.trimStart()):y?E=i[1].length+1:(E=i[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,o=h.slice(E),E+=i[1].length),y&&this.rules.other.blankLine.test(g)&&(d+=g+`
|
|
71
|
+
`,e=e.substring(g.length+1),c=!0),!c){const C=this.rules.other.nextBulletRegex(E),b=this.rules.other.hrRegex(E),_=this.rules.other.fencesBeginRegex(E),O=this.rules.other.headingBeginRegex(E),m=this.rules.other.htmlBeginRegex(E);for(;e;){const k=e.split(`
|
|
72
|
+
`,1)[0];let R;if(g=k,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),R=g):R=g.replace(this.rules.other.tabCharGlobal," "),_.test(g)||O.test(g)||m.test(g)||C.test(g)||b.test(g))break;if(R.search(this.rules.other.nonSpaceChar)>=E||!g.trim())o+=`
|
|
73
|
+
`+R.slice(E);else{if(y||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(h)||O.test(h)||b.test(h))break;o+=`
|
|
74
|
+
`+g}!y&&!g.trim()&&(y=!0),d+=k+`
|
|
75
|
+
`,e=e.substring(k.length+1),h=R.slice(E)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let M=null,w;this.options.gfm&&(M=this.rules.other.listIsTask.exec(o),M&&(w=M[0]!=="[ ] ",o=o.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!M,checked:w,loose:!1,text:o,tokens:[]}),n.raw+=d}const u=n.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.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=Ri(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(Ri(a,r.header.length).map((u,c)=>({text:u,tokens:this.lexer.inline(u),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=dt(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{const r=xs(i[2],"()");if(r===-2)return;if(r>-1){const u=(i[0].indexOf("!")===0?5:4)+i[1].length+r;i[2]=i[2].substring(0,r),i[0]=i[0].substring(0,u).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)),qi(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 qi(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,u,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(u=[...a].length,t[3]||t[4]){c+=u;continue}else if((t[5]||t[6])&&r%3&&!((r+u)%3)){d+=u;continue}if(c-=u,c>0)continue;u=Math.min(u,u+c+d);const h=[...t[0]][0].length,g=e.slice(0,r+t.index+h+u);if(Math.min(r,u)%2){const E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}const y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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 Ue{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ze,this.options.tokenizer=this.options.tokenizer||new Tt,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:Ve,block:Et.normal,inline:ut.normal};this.options.pedantic?(i.block=Et.pedantic,i.inline=ut.pedantic):this.options.gfm&&(i.block=Et.gfm,this.options.breaks?i.inline=ut.breaks:i.inline=ut.gfm),this.tokenizer.rules=i}static get rules(){return{block:Et,inline:ut}}static lex(e,i){return new Ue(i).lex(e)}static lexInline(e,i){return new Ue(i).inlineTokens(e)}lex(e){e=e.replace(Ve.carriageReturn,`
|
|
78
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(Ve.tabCharGlobal," ").replace(Ve.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+=`
|
|
@@ -85,15 +85,15 @@ ${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
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
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 u=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&&(u=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(u)){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 Ct{options;parser;constructor(e){this.options=e||Ze}space(e){return""}code({text:e,lang:i,escaped:s}){const t=(i||"").match(Ve.notSpaceStart)?.[0],n=e.replace(Ve.endingNewline,"")+`
|
|
88
|
-
`;return t?'<pre><code class="language-'+
|
|
89
|
-
`:"<pre><code>"+(s?n:
|
|
88
|
+
`;return t?'<pre><code class="language-'+Ye(t)+'">'+(s?n:Ye(n,!0))+`</code></pre>
|
|
89
|
+
`:"<pre><code>"+(s?n:Ye(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
94
|
`}list(e){const i=e.ordered,s=e.start;let t="";for(let a=0;a<e.items.length;a++){const u=e.items[a];t+=this.listitem(u)}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+" "+Ye(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,9 +102,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
102
102
|
`}tablerow({text:e}){return`<tr>
|
|
103
103
|
${e}</tr>
|
|
104
104
|
`}tablecell(e){const i=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+i+`</${s}>
|
|
105
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
106
|
-
`+this.renderer.text(a);i?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;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
|
|
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>${Ye(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=Ai(e);if(n===null)return t;e=n;let r='<a href="'+e+'"';return i&&(r+=' title="'+Ye(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=Ai(e);if(n===null)return Ye(s);e=n;let r=`<img src="${e}" alt="${s}"`;return i&&(r+=` title="${Ye(i)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ye(e.text)}}class Qt{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 Fe{options;renderer;textRenderer;constructor(e){this.options=e||Ze,this.options.renderer=this.options.renderer||new Ct,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qt}static parse(e,i){return new Fe(i).parse(e)}static parseInline(e,i){return new Fe(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,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){s+=u||"";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,u=this.renderer.text(a);for(;t+1<e.length&&e[t+1].type==="text";)a=e[++t],u+=`
|
|
106
|
+
`+this.renderer.text(a);i?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;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 Ot{options;block;constructor(e){this.options=e||Ze}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ue.lex:Ue.lexInline}provideParser(){return this.block?Fe.parse:Fe.parseInline}}class _s{defaults=Bt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Fe;Renderer=Ct;TextRenderer=Qt;Lexer=Ue;Tokenizer=Tt;Hooks=Ot;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 u=n.renderer.apply(this,a);return u===!1&&(u=r.apply(this,a)),u}: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 Ct(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,u=s.renderer[a],c=n[a];n[a]=(...d)=>{let o=u.apply(n,d);return o===!1&&(o=c.apply(n,d)),o||""}}t.renderer=n}if(s.tokenizer){const n=this.defaults.tokenizer||new Tt(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,u=s.tokenizer[a],c=n[a];n[a]=(...d)=>{let o=u.apply(n,d);return o===!1&&(o=c.apply(n,d)),o}}t.tokenizer=n}if(s.hooks){const n=this.defaults.hooks||new Ot;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,u=s.hooks[a],c=n[a];Ot.passThroughHooks.has(r)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(u.call(n,d)).then(h=>c.call(n,h));const o=u.call(n,d);return c.call(n,o)}:n[a]=(...d)=>{let o=u.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 u=[];return u.push(r.call(this,a)),n&&(u=u.concat(n.call(this,a))),u}}this.defaults={...this.defaults,...t}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,i){return Ue.lex(e,i??this.defaults)}parser(e,i){return Fe.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 u=r.hooks?r.hooks.provideLexer():e?Ue.lex:Ue.lexInline,c=r.hooks?r.hooks.provideParser():e?Fe.parse:Fe.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(s):s).then(d=>u(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=u(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>"+Ye(s.message+"",!0)+"</pre>";return i?Promise.resolve(t):t}if(i)return Promise.reject(s);throw s}}}const Qe=new _s;function ke(v,e){return Qe.parse(v,e)}ke.options=ke.setOptions=function(v){return Qe.setOptions(v),ke.defaults=Qe.defaults,bi(ke.defaults),ke},ke.getDefaults=Bt,ke.defaults=Ze,ke.use=function(...v){return Qe.use(...v),ke.defaults=Qe.defaults,bi(ke.defaults),ke},ke.walkTokens=function(v,e){return Qe.walkTokens(v,e)},ke.parseInline=Qe.parseInline,ke.Parser=Fe,ke.parser=Fe.parse,ke.Renderer=Ct,ke.TextRenderer=Qt,ke.Lexer=Ue,ke.lexer=Ue.lex,ke.Tokenizer=Tt,ke.Hooks=Ot,ke.parse=ke,ke.options,ke.setOptions,ke.use,ke.walkTokens,ke.parseInline,Fe.parse,Ue.lex;class Ss{constructor(e={},i){const s={lang:[]};this.builder=i,this.opts=Object.assign({},s,e)}async checkIntent(e,i,s){let t="You are an assistant",n="",r=`This is the user's request:
|
|
108
108
|
|
|
109
109
|
${e}`,a,u,c;if(s.image&&i==="openai")return r+=`
|
|
110
110
|
Extract some information.
|
|
@@ -236,29 +236,29 @@ Check the request and return the details.
|
|
|
236
236
|
${e}
|
|
237
237
|
|
|
238
238
|
Check the information and return the details.
|
|
239
|
-
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let u={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Fal,{signal:this.builder.mediaSignal,method:"POST",headers:u,body:JSON.stringify(e)});let c=await n.text();try{r=JSON.parse(c)}catch{return{mediaGenerated:!1,status:"error",message:c}}if(this.builder.output.push(r),r.error)return this.builder.settings.consoleLog&&console.log(r.error),{mediaGenerated:!1,status:"error",message:r.error};{const d=r.data;let o="",h="",
|
|
239
|
+
`,n=[{name:"check_request",description:"Check information.",parameters:{type:"object",properties:{model:{type:"string",description:"Return the model name."}},required:["model"]}}],r=await this.builder.send(t,s,i,"",n);return r?JSON.parse(r):!1}getDimension(e){let i,s;return e?e==="1:1"?(i=1024,s=1024):e==="3:2"?(i=1216,s=832):e==="4:3"?(i=1152,s=896):e==="5:4"?(i=1088,s=896):e==="16:9"?(i=1344,s=768):e==="21:9"?(i=1536,s=640):e==="2:3"?(i=832,s=1216):e==="3:4"?(i=896,s=1152):e==="4:5"?(i=896,s=1088):e==="9:16"?(i=768,s=1344):e==="9:21"?(i=640,s=1536):(i=1344,s=768):(i=1344,s=768),{w:i,h:s}}getEndpoint(e,i,s){s=s.replace("{REQUEST_ID}",i);let t=e.split("/").slice(0,2).join("/");return s=s.replace("{MODEL}",t),s}async waitingResultFal(e,i,s,t){let n,r;e.request_id=i;const a=this.getEndpoint(e.model,i,this.builder.settings.falResultEndpoint);e.endpoint=a;let u={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Fal,{signal:this.builder.mediaSignal,method:"POST",headers:u,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="",g,y=!1,E=[],M=[];return d.entries&&d.entries.forEach(w=>{g=w.url.split(".").pop().toLowerCase(),g==="mp4"?(o+=`
|
|
240
240
|
<p class="responsive-video">
|
|
241
241
|
<video controls>
|
|
242
|
-
<source src="${
|
|
242
|
+
<source src="${w.url}" type="video/mp4">
|
|
243
243
|
Your browser does not support the video tag.
|
|
244
244
|
</video>
|
|
245
245
|
</p>
|
|
246
|
-
`,h+=``):g==="wav"||g==="mp3"?(o+=`
|
|
247
247
|
<p class="responsive-audio">
|
|
248
248
|
<audio controls>
|
|
249
|
-
<source src="${
|
|
249
|
+
<source src="${w.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="${w.url}" />
|
|
256
256
|
<div>
|
|
257
|
-
<a class="link-view" href="${
|
|
258
|
-
<a class="link-download" href="${
|
|
257
|
+
<a class="link-view" href="${w.url}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
258
|
+
<a class="link-download" href="${w.url}" download>${this.out("Download")}</a>
|
|
259
259
|
</div>
|
|
260
260
|
</div>
|
|
261
|
-
`,h+=``,y=!0),E.push(w.url),M.push(w.file_url)}),y&&(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:E,output2:M}}}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 u={"Content-Type":"application/json",...this.builder.settings.headers};n=await fetch(this.builder.settings.getResultUrl_Replicate,{signal:this.builder.mediaSignal,method:"POST",headers:u,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,u=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:u,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,u=e.model;const c=this.getEndpoint(u,i,this.builder.settings.falStatusEndpoint);let d={"Content-Type":"application/json",...this.builder.settings.headers},o={model:u,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 u,c=!1;e.entries.forEach(d=>{u=d.url.split(".").pop().toLowerCase(),u==="mp4"?(t+=`
|
|
262
262
|
<p class="responsive-video">
|
|
263
263
|
<video controls>
|
|
264
264
|
<source src="${d.url}" type="video/mp4">
|
|
@@ -283,16 +283,16 @@ Check the information and return the details.
|
|
|
283
283
|
`,n+=``,r.push(d.url),a.push(d.file_url),c=!0)}),c&&(t=`<div class="image-container">${t}</div>`)}else typeof e=="string"&&(t=`
|
|
284
284
|
<p>
|
|
285
285
|
${e}
|
|
286
|
-
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let u=this.validateModel(e.model,r,"text_to_image_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.aspect_ratio||"16:9",o=e.num_images||1;o>4&&(o=4),t={prompt:c,aspect_ratio:d,num_outputs:o},n.model=u,n.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let u=this.validateModel(e.model,o,"edit_area_in_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o,!0);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url],v=h[e.image_url+"_mask"];if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Image mask not found.")};t={prompt:c,image:f,mask:v},n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let u=this.validateModel(e.model,r,"text_to_digital_illustration_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.width||1280,o=e.height||768;e.num_images,t={prompt:c,size:`${d}x${o}`,style:"digital_illustration"},n.model=u,n.customData=this.builder.settings.customData}else if(e.upscale_image){let u=this.validateModel(e.model,d,"upscale_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let d="replicate";const o=await this.builder.upload.getInputURLs(d);if(o.error)return{mediaGenerated:!1,status:"error",message:o.error};let h=o[e.image_url];if(!h)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:h},n.model=u,n.customData=this.builder.settings.customData}else if(e.describe_image){let u=this.validateModel(e.model,o,"describe_image");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};t={image:f,prompt:`${c}. No talk. Answer only.`},n.model=u,n.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let u=this.validateModel(e.model,o,"image_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt||"stunning video",d=e.duration||5;d>10&&(d=5);let o="replicate";const h=await this.builder.upload.getInputURLs(o);if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let f=h[e.image_url];if(!f)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};u==="kwaivgi/kling-v1.6-pro"&&(t={start_image:f,prompt:c,duration:d}),u==="kwaivgi/kling-v1.6-standard"&&(t={start_image:f,prompt:c,duration:d}),u==="minimax/video-01-live"&&(t={first_frame_image:f,prompt:c}),u==="luma/ray"&&(t={start_image_url:f,prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let u=this.validateModel(e.model,r,"text_to_video_generation");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let c=e.prompt;if(!c)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let d=e.duration||5;d>10&&(d=5),u==="kwaivgi/kling-v1.6-standard"&&(t={prompt:c,duration:d}),u==="minimax/video-01"&&(t={prompt:c}),u==="luma/ray"&&(t={prompt:c}),n.model=u,n.customData=this.builder.settings.customData}else if(e.text_to_speech){let u=this.validateModel(e.model,r,"text_to_speech");if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};t={text:e.text,voice:e.voice||"af_nicole",speed:parseFloat(e.speed)||1},n.model=u,n.customData=this.builder.settings.customData}if(n.model.indexOf(":")!==-1){const c=n.model.split(":")[1];n.version=c;let d=this.builder.settings.replicateEndpoint1;n.endpoint=d,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 1")}else{let u=this.builder.settings.replicateEndpoint2;u=u.replace("{MODEL}",n.model),n.endpoint=u,n.payload=t,this.builder.settings.consoleLog&&console.log("PAYLOAD 2")}this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);let a=!1;if(this.builder.settings.generateMediaUrl_Replicate&&(a=!0),a){let u=this.builder.settings.generateMediaUrl_Replicate;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(n)})).json();if(h.ok){if(c=h.data.id,!c)return{mediaGenerated:!1,status:"error",message:h.data&&h.data.detail}}else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingReplicate(n,c,i,s);return this.builder.isMediaGenerating=!1,f}else{let u=this.builder.settings.generateMediaUrl;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl.")};let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(n)})).json();if(this.builder.isMediaGenerating=!1,o.error)return this.builder.settings.consoleLog&&console.log(o.error),{mediaGenerated:!1,status:"error",message:o.error};{const h=o.data;let f=this.renderResult(h,i,s);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}}}async generateOpenAI(e,i,s){let t,n={},a=this.validateModel(e.model,"openai","image_generation"),u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};const c=new FormData;c.append("customData",JSON.stringify(this.builder.settings.customData)),c.append("model",a),c.append("prompt",u);let d=!1,o=this.builder.getFormValues();for(const b of o){if(b.value instanceof FileList&&b.type==="multifile"){const k=b.value;if(k.length>0)for(const C of k)c.append("file[]",C),d=!0}if(b.value instanceof FileList&&b.type==="file"){const k=b.value;if(k.length>0){const C=k[0];c.append("file[]",C),d=!0}}if(typeof b.value=="string"&&b.value.indexOf("base64")!==-1){let k=b.value.replace(/^data:image\/(png|svg\+xml|jpeg|gif|webp);base64,/,"");c.append("mask",k)}}if(this.builder.selectedFiles&&this.builder.selectedFiles.length>0)for(let b=0;b<this.builder.selectedFiles.length;b++){const k=this.builder.selectedFiles[b];c.append("file[]",k),d=!0}let h,f=e.size||"auto",v=e.quality||"auto",S=e.num_images||1;if(d){c.append("size",f),c.append("n",S),c.append("quality",v),t={prompt:u,size:f,quality:v,n:S},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n);let b=this.builder.settings.generateMediaUrl_OpenAI_CreateImageEdit;h=await fetch(b,{method:"POST",body:c})}else{let b=e.background||"auto",k=e.output_format||"png";t={prompt:u,background:b,output_format:k,size:f,quality:v,n:S},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const C=this.builder.settings.generateMediaUrl_OpenAI_CreateImage;let g={"Content-Type":"application/json",...this.builder.settings.headers};h=await fetch(C,{signal:this.builder.mediaSignal,method:"POST",headers:g,body:JSON.stringify(n)})}const R=await h.json();this.builder.settings.consoleLog&&console.log(R),this.builder.isMediaGenerating=!1;const y=R.data;this.builder.output.push(R);let E=this.renderResult(y,i,s);return{mediaGenerated:!0,status:"success",markdown:E.markdown,output:E.output,output2:E.output2}}async generateGoogle(e,i,s){let t,n={},a=this.validateModel(e.model,"google","edit_area_in_image");if(!a)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let u=e.prompt;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let c=[];c.push({text:u});let d=this.builder.getFormValues();if(!(d&&Object.keys(d).length===0)){for(const y of d)if(y.value instanceof FileList&&y.type==="multifile"){const E=y.value;if(E.length>0)for(const b of E){const k=await new Promise((C,g)=>{const w=new FileReader;w.onload=q=>{const V=q.target.result.split(",")[1];C(V)},w.onerror=g,w.readAsDataURL(b)});c.push({inlineData:{mimeType:"image/png",data:k}})}}}t={contents:c},n.model=a,n.customData=this.builder.settings.customData,n.payload=t,this.builder.payloads.push(n),this.builder.settings.consoleLog&&console.log(n);const o=this.builder.settings.generateMediaUrl_Google;let h={"Content-Type":"application/json",...this.builder.settings.headers};const v=await(await fetch(o,{signal:this.builder.mediaSignal,method:"POST",headers:h,body:JSON.stringify(n)})).json();this.builder.settings.consoleLog&&console.log(v),this.builder.isMediaGenerating=!1;const S=v.data;let R=this.renderResult(S,i,s);return{mediaGenerated:!0,status:"success",markdown:R.markdown,output:R.output,output2:R.output2}}async generateFal(e,i,s){let t="fal",n,r={};if(e.text_to_image_generation){let v=this.validateModel(e.model,t,"text_to_image_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.aspect_ratio,b=e.num_images||1;if(b>4&&(b=4),E){let{w:se,h:re}=this.getDimension(E);R=se,y=re}let k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W});let Q=await(async()=>{let se=[],re=this.builder.getFormValues();for(const ae of re)if(ae.value instanceof FileList&&ae.type==="multifile"){const de=ae.value;if(de.length>0){let ue=0;for(const Se of de){ue++;const Ie=new FormData;Ie.append("file",Se),Ie.append("customData",this.builder.settings.customData);let Ae=this.builder.settings.uploadMediaUrl_Fal;const Ee=await(await fetch(Ae,{method:"POST",body:Ie})).json();if(Ee.ok){const be=Ee.url;se.push(be),this.builder.filesUploaded["file_"+ue]=be}}}}return se})();n={prompt:S,image_size:{width:R,height:y},num_images:b},v.indexOf("gemini")!==-1&&(n={prompt:S,input_image_urls:Q}),v==="fal-ai/ideogram/v2a"&&(E=this.getClosestAspectRatio(R,y),n={prompt:S,aspect_ratio:E,num_images:b}),v.indexOf("recraft")!==-1&&(n={prompt:S,image_size:{width:R,height:y},num_images:b,colors:N}),r.model=v,r.customData=this.builder.settings.customData}else if(e.edit_area_in_image){let v=this.validateModel(e.model,t,"edit_area_in_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url],b=y[e.image_url+"_mask"];if(n={image_url:E,mask_url:b,prompt:S},r.model=v,!b){n={image_url:E,prompt:S};let k=this.validateModel(e.model,t,"edit_image");r.model=k}r.customData=this.builder.settings.customData}else if(e.text_to_2d_illustration_generation){let v=this.validateModel(e.model,t,"text_to_2d_illustration_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.num_images||1;E>4&&(E=4);let b=e.style||"any",k=e.style_id||this.builder.settings._2dIllustrationStyleId,C=e.color1_red,g=e.color1_green,w=e.color1_blue,q=e.color2_red,V=e.color2_green,I=e.color2_blue,F=e.color3_red,G=e.color3_green,B=e.color3_blue,M=e.color4_red,_=e.color4_green,L=e.color4_blue,P=e.color5_red,W=e.color5_green,N=e.color5_blue,J=[];C&&g&&w&&!(C==="0"&&g==="0"&&w==="0")&&J.push({r:C,g,b:w}),q&&V&&I&&!(q==="0"&&V==="0"&&I==="0")&&J.push({r:q,g:V,b:I}),F&&G&&B&&!(F==="0"&&G==="0"&&B==="0")&&J.push({r:F,g:G,b:B}),M&&_&&L&&!(M==="0"&&_==="0"&&L==="0")&&J.push({r:M,g:_,b:L}),P&&W&&N&&!(P==="0"&&W==="0"&&N==="0")&&J.push({r:P,g:W,b:N}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,style_id:k,colors:J},r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_digital_illustration_generation){let v=this.validateModel(e.model,t,"text_to_digital_illustration_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1280,y=e.height||768,E=e.num_images||1;E>4&&(E=4);let b=e.style||"digital_illustration",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,colors:N},r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_book_cover_generation){let v=this.validateModel(e.model,t,"text_to_book_cover_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.width||1024,y=e.height||1365,E=e.num_images||1;E>4&&(E=1);let b="digital_illustration/cover",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,q=e.color2_green,V=e.color2_blue,I=e.color3_red,F=e.color3_green,G=e.color3_blue,B=e.color4_red,M=e.color4_green,_=e.color4_blue,L=e.color5_red,P=e.color5_green,W=e.color5_blue,N=[];k&&C&&g&&!(k==="0"&&C==="0"&&g==="0")&&N.push({r:k,g:C,b:g}),w&&q&&V&&!(w==="0"&&q==="0"&&V==="0")&&N.push({r:w,g:q,b:V}),I&&F&&G&&!(I==="0"&&F==="0"&&G==="0")&&N.push({r:I,g:F,b:G}),B&&M&&_&&!(B==="0"&&M==="0"&&_==="0")&&N.push({r:B,g:M,b:_}),L&&P&&W&&!(L==="0"&&P==="0"&&W==="0")&&N.push({r:L,g:P,b:W}),n={prompt:S,image_size:{width:R,height:y},num_images:E,style:b,colors:N},r.model=v,r.customData=this.builder.settings.customData}else if(e.upscale_image){let v=this.validateModel(e.model,t,"upscale_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const R=await this.builder.upload.getInputURLs(t);if(R.error)return{mediaGenerated:!1,status:"error",message:R.error};let y=R[e.image_url];if(!y)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:y,upscale_factor:2},r.model=v,r.customData=this.builder.settings.customData}else if(e.describe_image){let v=this.validateModel(e.model,t,"describe_image");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};if(!e.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url];if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:E,prompt:`${S}. No talk. Answer only.`},r.model=v,r.customData=this.builder.settings.customData}else if(e.image_to_video_generation){let v=this.validateModel(e.model,t,"image_to_video_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;S=e.prompt||"stunning video";let R=e.duration||5;R>10&&(R=5);const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let E=y[e.image_url];if(!E)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};n={prompt:S,image_url:E,duration:R,aspect_ratio:"16:9"},v.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_video_generation){let v=this.validateModel(e.model,t,"text_to_video_generation");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};let S=e.prompt;if(!S)return{mediaGenerated:!1,status:"error",message:this.out("Please input a prompt.")};let R=e.duration||5;R>10&&(R=5),n={prompt:S,duration:R,aspect_ratio:"16:9"},v.indexOf("fal-ai/luma-dream-machine")!==-1&&delete n.duration,r.model=v,r.customData=this.builder.settings.customData}else if(e.text_to_speech){let v=this.validateModel(e.model,t,"text_to_speech");if(!v)return{mediaGenerated:!1,status:"error",message:this.out("Model not found.")};if(e.text.length>this.builder.settings.ttsMaxCharacters)return{mediaGenerated:!1,status:"error",message:this.out("The text exceeds the allowed limit.")};n={text:e.text,voice:e.voice||"Matilda"},r.model=v,r.customData=this.builder.settings.customData}let a=`https://queue.fal.run/${r.model}`;r.endpoint=a,r.payload=n,this.builder.payloads.push(r),this.builder.settings.consoleLog&&console.log(r);let u=this.builder.settings.generateMediaUrl_Fal;if(!u)return{mediaGenerated:!1,status:"error",message:this.out("Endpoint not configured: generateMediaUrl_Fal.")};let c,d={"Content-Type":"application/json",...this.builder.settings.headers},h=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:d,body:JSON.stringify(r)})).json();if(h.ok)c=h.request_id;else return{mediaGenerated:!1,status:"error",message:h.error};const f=this.waitingFal(r,c,i,s);return this.builder.isMediaGenerating=!1,f}validateModel(e,i,s){const n=this.builder.settings.defaultModels[s][i];return this.builder.settings.modelFallback?n.length===1?(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0]):e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):n.length>=1?(this.builder.settings.consoleLog&&console.log("Use default: "+n[0]),n[0]):!1:e?e&&n&&n.includes(e)?(this.builder.settings.consoleLog&&console.log("Model is valid: "+e),e):!1:(this.builder.settings.consoleLog&&console.log("Fixed model: "+n[0]),n[0])}async generate_GoogleMediaByJSON(e,i,s,t){this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let n;if(e.trim().startsWith("{"))try{n=JSON.parse(e)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}let r=i.trim();if(!r)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let a={};a.model=r,a.customData=this.builder.settings.customData,a.payload=n,this.builder.payloads.push(a),this.builder.settings.consoleLog&&console.log(a);const u=this.builder.settings.generateMediaUrl_Google;let c={"Content-Type":"application/json",...this.builder.settings.headers};const o=await(await fetch(u,{signal:this.builder.mediaSignal,method:"POST",headers:c,body:JSON.stringify(a)})).json();this.builder.settings.consoleLog&&console.log(o);const h=o.data;let f=this.renderResult(h,s,t);return{mediaGenerated:!0,status:"success",markdown:f.markdown,output:f.output,output2:f.output2}}async uploadMultiple(){let e=[],i=this.builder.getFormValues();for(const s of i)if(s.value instanceof FileList&&s.type==="multifile"){const t={};if(t.name=s.name,t.files=[],this.builder.selectedFiles&&this.builder.selectedFiles.length>0){const r=[];for(let a=0;a<this.builder.selectedFiles.length;a++){const u=this.builder.selectedFiles[a],c=new FormData;c.append("file",u),c.append("customData",this.builder.settings.customData);let d=this.builder.settings.uploadMediaUrl_Fal;const h=await(await fetch(d,{method:"POST",body:c})).json();if(h.ok){const f=h.url;t.files.push(f),this.builder.filesUploaded["file_"+a]=f}r.push(t)}return r}const n=s.value;if(n.length>0){let r=0;for(const a of n){r++;const u=new FormData;u.append("file",a),u.append("customData",this.builder.settings.customData);let c=this.builder.settings.uploadMediaUrl_Fal;const o=await(await fetch(c,{method:"POST",body:u})).json();if(o.ok){const h=o.url;t.files.push(h),this.builder.filesUploaded["file_"+r]=h}}}e.push(t)}return e}async generate(e,i,s,t,n,r,a){if(s=s||this.builder.settings.defaultMediaGenerationProvider,s==="google"&&e.trim().startsWith("{"))return this.generate_GoogleMediaByJSON(e,i,r,a);this.builder.isMediaGenerating=!0,this.mediaController=new AbortController,this.builder.mediaSignal=this.mediaController.signal;let u,c=!1,d;if(e.trim().startsWith("{"))try{d=JSON.parse(e),d&&typeof d=="object"&&(c=!0)}catch{return{mediaGenerated:!1,status:"error",message:this.out("Incorrect JSON format.")}}if(c){let o=i.trim();if(!o)return{mediaGenerated:!1,status:"error",message:this.out("Please provide model information in the context.")};let h=await this.uploadMultiple();((y,E)=>{const b=k=>{if(Array.isArray(k)){const C=k[0],g=E.find(w=>w.name===C);if(g&&k.every(w=>w===C))return g.files;for(let w=0;w<k.length;w++)k[w]=b(k[w])}else if(typeof k=="object"&&k!==null)for(let C in k)k[C]=b(k[C]);return k};return b(y)})(d,h),s||(o.startsWith("fal")?s="fal":s="replicate");const v=y=>typeof y=="object"&&y!==null&&!Array.isArray(y),S=await this.builder.upload.getInputURLs(s);if(S.error)return{mediaGenerated:!1,status:"error",message:S.error};Object.keys(d).forEach(y=>{Object.keys(S).forEach(E=>{if(d[y]===E){let b=S[E];d[y]=b}if(Array.isArray(d[y])){for(let b=0;b<d[y].length;b++)if(d[y][b]===E){let k=S[E];d[y][b]=k}}})}),Object.keys(d).forEach(y=>{let E=d[y];if(v(E))for(const b in E)Object.prototype.hasOwnProperty.call(E,b)&&Object.keys(S).forEach(k=>{if(E[b]===k){let C=S[k];E[b]=C,k===C&&!C.startsWith("http")&&(E[b]="")}});if(Array.isArray(E)){for(let b=0;b<E.length;b++)if(v(E[b]))for(const k in E[b])Object.prototype.hasOwnProperty.call(E[b],k)&&Object.keys(S).forEach(C=>{if(E[b][k]===C){let g=S[C];E[b][k]=g,C===g&&!g.startsWith("http")&&(E[b][k]="")}});d[y]=[...E.filter(b=>b!=="")]}});let R={};if(R.model=o,R.customData=this.builder.settings.customData,s==="replicate"&&o.indexOf(":")!==-1){const y=o.split(":");R.version=y[1]}if(s==="replicate")if(o.indexOf(":")!==-1){let y=this.builder.settings.replicateEndpoint1;R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 1")}else{let y=this.builder.settings.replicateEndpoint2;y=y.replace("{MODEL}",R.model),R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 2")}else if(s==="fal"){let y=`https://queue.fal.run/${R.model}`;R.endpoint=y,R.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD")}return this.builder.payloads.push(R),this.builder.settings.consoleLog&&console.log(R),this.generateMediaByJSON(R,s,r,a)}try{if(u=await this.checkIntent(e,s,n),this.builder.settings.consoleLog&&console.log(u),!u)return{mediaGenerated:!1,status:"aborted",message:this.out("Request aborted.")};if(u.minimize_image){if(!u.image_url)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};const h=await this.builder.upload.getInputURLs();if(h.error)return{mediaGenerated:!1,status:"error",message:h.error};let v={image_url:h[u.image_url]||u.image_url,customData:this.builder.settings.customData};this.builder.payloads.push(v),this.builder.settings.consoleLog&&console.log(v);let S={"Content-Type":"application/json",...this.builder.settings.headers};const y=await(await fetch(this.builder.settings.minimizeImageUrl,{signal:this.builder.mediaSignal,method:"POST",headers:S,body:JSON.stringify(v)})).json();if(this.builder.output.push(y),y.error)return this.builder.settings.consoleLog&&console.log(y.error),this.builder.isMediaGenerating=!1,{mediaGenerated:!1,status:"error",message:y.error};{const E=y.url,b=`
|
|
286
|
+
</p>`,n=e);return s?(i.innerHTML="",i.remove()):(i.innerHTML=t,this.builder.outputHtml+=`<div class="result-container">${t}</div>`),{markdown:n,output:r,output2:a}}async generateReplicate(e,i,s){let t,n={};const r="replicate";if(e.text_to_image_generation){let 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=`
|
|
287
287
|
<div class="image-container">
|
|
288
288
|
<div>
|
|
289
|
-
<img src="${
|
|
289
|
+
<img src="${C}" />
|
|
290
290
|
<div>
|
|
291
|
-
<a class="link-view" href="${
|
|
292
|
-
<a class="link-download" href="${
|
|
291
|
+
<a class="link-view" href="${C}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
292
|
+
<a class="link-download" href="${C}" download>${this.out("Download")}</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
</div>`;let
|
|
295
|
+
</div>`;let _=``;return a?(r.innerHTML="",r.remove()):(r.innerHTML=b,this.builder.outputHtml+=`<div class="result-container">${b}</div>`),this.builder.isMediaGenerating=!1,{mediaGenerated:!0,status:"success",markdown:_,output:[C]}}}else{if(s==="fal")return this.generateFal(u,r,a);if(s==="replicate")return this.generateReplicate(u,r,a);if(s==="google")return this.generateGoogle(u,r,a);if(s==="openai")return this.generateOpenAI(u,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 u=Math.abs(s-t[a].ratio);u<r&&(r=u,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 Es{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(),u={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(u)})).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 u;i==="replicate"?u=this.builder.settings.uploadMediaUrl:i==="fal"?u=this.builder.settings.uploadMediaUrl_Fal:u=this.builder.settings.uploadMediaUrl_Fal||this.builder.settings.uploadMediaUrl;const d=await(await fetch(u,{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 u;i==="replicate"?u=this.builder.settings.uploadMediaUrl:i==="fal"?u=this.builder.settings.uploadMediaUrl_Fal:u=this.builder.settings.uploadMediaUrl_Fal||this.builder.settings.uploadMediaUrl;const d=await(await fetch(u,{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 Ts{constructor(e,i={}){const s={lang:[]};this.settings=Object.assign({},s,i),this.empty=!0,this.element=e,this.init()}loadUrl(e){const i=this.element.querySelector("img");i.src=e,this.loaded()}loadImage(e){if(e){const i=new FileReader;i.onload=s=>{this.element.querySelector("img").setAttribute("src",s.target.result)},i.readAsDataURL(e)}}setImage(e){if(e){const i=this.element.querySelector("img");i.src=e}}clearImage(){this.element.style.display=""}out(e){let i=this.settings.lang[e];return i||e}init(){const e=this.element;e.className="imagemask-wrapper";const i=document.createElement("div");i.className="imagemask-overlay",e.appendChild(i);const s=document.createElement("button");s.className="btn-close-imagemask",s.title=this.out("Close"),s.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
296
296
|
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"
|
|
297
297
|
stroke-linejoin="round" class="icon-close">
|
|
298
298
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
|
@@ -325,9 +325,9 @@ Check the information and return the details.
|
|
|
325
325
|
<path d="M8 20l-4 0l0 -4" /><path d="M4 20l6 -6" />
|
|
326
326
|
<path d="M16 20l4 0l0 -4" /><path d="M14 14l6 6" />
|
|
327
327
|
<path d="M8 4l-4 0l0 4" /><path d="M4 4l6 6" />
|
|
328
|
-
</svg>`,r.appendChild(h);const f=document.createElement("input");f.type="hidden",f.name=this.settings.name,f.className="inp-imagemask",f.value="",t.appendChild(f);const v=document.createElement("canvas");v.className="imagemask";const S=v.getContext("2d",{willReadFrequently:!0}),R=document.createElement("canvas"),y=R.getContext("2d",{willReadFrequently:!0}),E=this.element.querySelector(".inp-imagemask"),b=N=>{const J=document.createElement("canvas"),Q=J.getContext("2d",{willReadFrequently:!0});J.width=N.width,J.height=N.height,Q.clearRect(0,0,N.width,N.height),Q.fillStyle="black",Q.fillRect(0,0,N.width,N.height),Q.drawImage(N,0,0);const se=J.toDataURL("image/png");let re=document.querySelector(".imagemask-output");re||(re=document.createElement("img"),re.className="imagemask-output",document.body.appendChild(re)),re.src=se,this.empty||(E.value=se)};let k=[],C=[];const g=()=>{k.push(R.toDataURL()),k.length>10&&k.shift(),C=[]},w=N=>{const J=new Image;J.src=N,J.onload=()=>{S.clearRect(0,0,v.width,v.height),S.drawImage(J,0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),y.drawImage(J,0,0,R.width,R.height),b(R)}};v.addEventListener("mousedown",()=>{g()}),c.addEventListener("click",N=>{N.preventDefault(),k.length>0&&(C.push(v.toDataURL()),w(k.pop()))}),d.addEventListener("click",N=>{N.preventDefault(),C.length>0&&(k.push(v.toDataURL()),w(C.pop()))});const q=document.createElement("img");n.appendChild(q),n.appendChild(v),this.loaded=()=>{n.style.display="flex";const N=document.querySelector(".imagemask-controls");N.style.display="flex",e.style.display="flex",F(),k=[],C=[],S.clearRect(0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),this.empty=!0,E.value="";try{b(R)}catch{}},q.onload=()=>{this.loaded()};let V=null,I=null;const F=()=>{v.width>0&&v.height>0&&(V=S.getImageData(0,0,v.width,v.height),I=y.getImageData(0,0,R.width,R.height));const N=q.offsetWidth,J=q.offsetHeight,Q=window.devicePixelRatio||1;v.width=N*Q,v.height=J*Q,S.scale(Q,Q),v.style.width=`${N}px`,v.style.height=`${J}px`;const se=q.naturalWidth,re=q.naturalHeight;if(R.width=se*Q,R.height=re*Q,y.scale(Q,Q),R.style.width=`${se}px`,R.style.height=`${re}px`,V){const ae=document.createElement("canvas");ae.width=V.width,ae.height=V.height,ae.getContext("2d").putImageData(V,0,0);const ue=document.createElement("canvas");ue.width=I.width,ue.height=I.height,ue.getContext("2d").putImageData(I,0,0),S.drawImage(ae,0,0,V.width,V.height,0,0,v.width,v.height),y.drawImage(ue,0,0,I.width,I.height,0,0,R.width,R.height)}};let G=!1,B=parseInt(u.value,10);u.addEventListener("input",N=>{B=parseInt(N.target.value,10)});const M=N=>{const J=v.getBoundingClientRect();if(N.touches){const Q=N.touches[0];return{x:Q.clientX-J.left,y:Q.clientY-J.top}}return{x:N.clientX-J.left,y:N.clientY-J.top}},_=N=>{G=!0,P(N)},L=()=>{G=!1,S.beginPath(),this.empty=!1,b(R)},P=N=>{if(!G)return;const{x:J,y:Q}=M(N),se=R.width/v.width,re=R.height/v.height,ae=J*se,de=Q*re;S.fillStyle="rgb(255, 255, 255)",S.beginPath(),S.arc(J,Q,B/2,0,Math.PI*2),S.fill(),y.fillStyle="rgb(255, 255, 255)",y.beginPath(),y.arc(ae,de,B/2*se,0,Math.PI*2),y.fill()};v.addEventListener("mousedown",_),v.addEventListener("mouseup",L),v.addEventListener("mousemove",P),v.addEventListener("touchstart",N=>{_(N),N.preventDefault()},{passive:!1}),v.addEventListener("touchend",N=>{L(),N.preventDefault()}),v.addEventListener("touchmove",N=>{P(N),N.preventDefault()},{passive:!1}),o.addEventListener("click",N=>{N.preventDefault(),g(),S.clearRect(0,0,v.width,v.height),y.clearRect(0,0,R.width,R.height),this.empty=!0,E.value="",b(R)}),window.addEventListener("resize",F);const W=N=>{N?(e.setAttribute("aria-modal","true"),e.setAttribute("role","dialog"),e.classList.add("fullscreen"),i.style.display="block",s.style.display="flex",h.style.display="none"):(e.removeAttribute("aria-modal"),e.removeAttribute("role"),e.classList.remove("fullscreen"),i.style.display="none",s.style.display="none",h.style.display=""),F()};h.addEventListener("click",N=>{N.preventDefault(),W(!0)}),s.addEventListener("click",N=>{N.preventDefault(),W(!1)}),document.addEventListener("keydown",N=>{N.key==="Escape"&&W(!1)})}}class _n{constructor(e,i={}){const s={lang:[],headers:{},fileUploadText:"Drag and drop your file here.",multiFileUploadText:"Drag and drop your files here.",model:"gpt-4o-mini",model2:"gpt-4o-mini",sendCommandUrl:"/sendcommand",sendCommandStreamUrl:"/getstream",consoleLog:!1,saveResults:!1,disableMediaGeneration:!1,disableMediaGenerationTitle:"Demo Info",disableMediaGenerationMessage:"This is an online demo and media generation is currently disabled. Get the full version for complete functionality.",submitText:"Submit",resetText:"Reset",scrapeProvider:"firecrawl",scrapeLimit:6,scrapeExclude:["youtube.com","reddit.com","microsoft.com","mozilla.org"],inputCost:.15,outputCost:.6,_2dIllustrationStyleId:"bcaa0104-98ef-4cb8-a012-124dad015756",templateFilters:["all","image","video","audio","text"],templatesConfig:{fal:!0,replicate:!1,web:!1},defaultMediaGenerationProvider:"fal",replicateEndpoint1:"https://api.replicate.com/v1/predictions",replicateEndpoint2:"https://api.replicate.com/v1/models/{MODEL}/predictions",falStatusEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}/status",falResultEndpoint:"https://queue.fal.run/{MODEL}/requests/{REQUEST_ID}",replicateStatusEndpoint:"https://api.replicate.com/v1/predictions/{REQUEST_ID}",modelFallback:!1,defaultModels:{image_generation:{openai:["gpt-image-1"]},image_variation_generation:{openai:["gpt-image-1"]},text_to_image_generation:{fal:["fal-ai/flux-1/schnell","fal-ai/flux-1/dev","fal-ai/flux-pro/v1.1","fal-ai/flux-pro/v1.1-ultra","fal-ai/recraft-v3","fal-ai/recraft-20b","fal-ai/ideogram/v2a","fal-ai/hidream-i1-fast","fal-ai/hidream-i1-dev","fal-ai/hidream-i1-full","fal-ai/gemini-flash-edit/multi"],replicate:["black-forest-labs/flux-schnell","black-forest-labs/flux-dev","black-forest-labs/flux-1.1-pro","black-forest-labs/flux-1.1-pro-ultra","recraft-ai/recraft-v3","ideogram-ai/ideogram-v2a"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},image_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/image-to-video","fal-ai/kling-video/v1.6/pro/image-to-video","fal-ai/kling-video/v2.1/standard/image-to-video","fal-ai/kling-video/v2.1/pro/image-to-video","fal-ai/kling-video/v2.1/master/image-to-video","fal-ai/minimax/video-01-live/image-to-video","fal-ai/luma-dream-machine/ray-2/image-to-video"],replicate:["kwaivgi/kling-v1.6-standard","kwaivgi/kling-v1.6-pro","minimax/video-01-live","luma/ray"]},text_to_video_generation:{fal:["fal-ai/kling-video/v1.6/standard/text-to-video","fal-ai/kling-video/v2.1/master/text-to-video","fal-ai/minimax/video-01-live ","fal-ai/luma-dream-machine/ray-2"],replicate:["kwaivgi/kling-v1.6-standard","minimax/video-01","luma/ray"]},upscale_image:{fal:["fal-ai/clarity-upscaler"],replicate:["recraft-ai/recraft-crisp-upscale"]},describe_image:{fal:["fal-ai/any-llm/vision"],replicate:[]},edit_area_in_image:{fal:["fal-ai/flux-pro/v1/fill"],replicate:["black-forest-labs/flux-fill-pro"],google:["gemini-2.0-flash-exp-image-generation"],openai:["gpt-image-1"]},edit_image:{fal:["fal-ai/gemini-flash-edit"],replicate:[],openai:["gpt-image-1"]},text_to_2d_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_digital_illustration_generation:{fal:["fal-ai/recraft-v3"],replicate:["recraft-ai/recraft-v3"]},text_to_book_cover_generation:{fal:["fal-ai/recraft-v3"],replicate:[]},text_to_speech:{fal:["fal-ai/elevenlabs/tts/multilingual-v2"],replicate:["jaaari/kokoro-82m:f559560eb822dc509045f3921a1921234918b91739db4bf3daab2169b71c7a13"]}},ttsMaxCharacters:3e3,alwaysVisibleSubmit:!1};this.settings=Object.assign({},s,i),this.listeners={},window._txt&&(this.settings.lang=window._txt),this.steps=[];let t=this.settings.onChange;if(this.settings.onChange=n=>{t&&t.call(this,n)},!e)throw new Error("A valid DOM element is required.");e.classList.add("formview-container"),e.classList.add("fb-ui"),this.element=e,this.media=new wn({lang:this.settings.lang},this),this.upload=new xn({lang:this.settings.lang},this)}on(e,i){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(i),this}off(e,i){this.listeners[e]&&this.listeners[e].delete(i)}trigger(e,i){this.listeners[e]&&this.listeners[e].forEach(s=>s(i))}async loadTemplates(){if(!this.settings.templatesUrl){console.log(this.out("Template URL is not set."));return}let e=document.querySelector(this.settings.templatesSelector);if(e){e.classList.remove("hidden"),e.classList.add("formtemplates-container"),e.classList.add("fb-ui");let t=(await(await fetch(this.settings.templatesUrl,{method:"GET"})).json()).data;e.innerHTML="",t=t.filter(o=>{const h=o.supports||[];if(h.length===0)return!0;const{fal:f,replicate:v,web:S,openai:R,google:y}=this.settings.templatesConfig;return!S&&h.includes("web")||!y&&h.includes("google")||!R&&h.includes("openai")?!1:!f&&!v?!(h.includes("fal")||h.includes("replicate")):!f&&h.includes("fal")?h.includes("replicate"):!v&&h.includes("replicate")?h.includes("fal"):!0});const r=this.settings.templateFilters,a={all:{desc:this.out("All")},image:{desc:this.out("Image")},video:{desc:this.out("Video")},audio:{desc:this.out("Audio")},web:{desc:this.out("Web")},text:{desc:this.out("Text")}},u=document.createElement("div");u.className="app-filters",e.appendChild(u);const c=document.createElement("ul");c.className="app-list",e.appendChild(c);const d=o=>{let h=t.filter(v=>o==="all"||v.categories.includes(o));const f=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(v=>v.categories.every(S=>f.includes(S))),this.renderList(h,c)};r.forEach(o=>{const h=document.createElement("button");h.textContent=a[o].desc,h.setAttribute("data-value",o),o==="all"&&h.classList.add("active"),h.addEventListener("click",()=>{u.querySelectorAll("button").forEach(v=>v.classList.remove("active")),h.classList.add("active"),d(o)}),u.appendChild(h)}),d("all")}}async selectFile(e){const i=this.element.querySelector(".file-input-wrapper");if(!i)return;const s=i.querySelector('input[type="file"]');if(!s||!this.acceptsImagesOnly(s))return;let t;e.startsWith("http")?t=this.settings.viewFileUrl+"?url="+e:t=e;const r=await(await fetch(t)).blob(),a=new File([r],e.split("/").pop(),{type:r.type});this.element.querySelector(".div-selected-preview")||(this.selectedFiles=[]),s&&s.hasAttribute("multiple")?this.selectedFiles.some(d=>d.name===a.name)||this.selectedFiles.push(a):this.selectedFiles=[a],this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),i.closest(".image-mask")&&this.objImageMask&&this.objImageMask.loadImage(a)}setSelectedFiles(e){this.selectedFiles=e;const i=this.element.querySelector('input[type="file"]');i&&i.removeAttribute("required")}renderSelectedFiles(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;let i=this.element.querySelector(".div-selected-preview");i?i.innerHTML="":(i=document.createElement("div"),i.classList.add("div-selected-preview"),e.appendChild(i)),this.clearFileInput(),this.selectedFiles&&this.selectedFiles.forEach((s,t)=>{const n=document.createElement("div"),r=document.createElement("img");r.src=URL.createObjectURL(s);const a=document.createElement("button");a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
328
|
+
</svg>`,r.appendChild(h);const 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="">
|
|
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 u=new DataTransfer;i.files=u.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,u="";if(r&&a){let h=r+a;u=`<img class="thumbnail" src="${h}" alt="${s.name}" />`,s.form.thumbnailFit&&(u=`<img class="thumbnail" style="object-fit:${s.form.thumbnailFit}" src="${h}" alt="${s.name}" />`)}const c=document.createElement("div");c.className="div-template-buttons";let d=!1,o=!1;if(this.settings.templateButtons&&this.settings.templateButtons.viewButton&&this.settings.templateButtons.viewButton.text){const h=document.createElement("button");h.className="btn-template-view",h.innerText=this.out(this.settings.templateButtons.viewButton.text),c.appendChild(h),h.addEventListener("click",
|
|
330
|
+
</svg>`,a.addEventListener("click",()=>{this.selectedFiles.splice(t,1),this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),e.closest(".image-mask")&&this.objImageMask&&this.objImageMask.clearImage()}),n.appendChild(r),n.appendChild(a),i.appendChild(n)})}clearSelectedFiles(){this.selectedFiles=[],this.setSelectedFiles(this.selectedFiles);let e=this.element.querySelector(".div-selected-preview");e&&(e.innerHTML="")}clearFileInput(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;const i=e.querySelector('input[type="file"]');if(!i)return;try{if(i.value="",i.files&&i.files.length>0){const u=new DataTransfer;i.files=u.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,u="";if(r&&a){let h=r+a;u=`<img class="thumbnail" src="${h}" alt="${s.name}" />`,s.form.thumbnailFit&&(u=`<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",g=>{if(g.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",g=>{g.preventDefault(),this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateUse",s)}),o=!0}n.innerHTML=`
|
|
331
331
|
${u}
|
|
332
332
|
<div class="card-text">
|
|
333
333
|
<div class="title">${s.name}</div>
|
|
@@ -344,7 +344,7 @@ Check the information and return the details.
|
|
|
344
344
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
|
|
345
345
|
</svg>
|
|
346
346
|
<span>${this.out("Clear")}</span>
|
|
347
|
-
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const
|
|
347
|
+
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const g=e.cloneNode(!0),y=g.querySelector(".result-tool");y&&y.remove(),g.querySelectorAll(".link-view, .link-download").forEach(w=>{w.remove()}),g.style.position="fixed",g.style.left="-9999px",document.body.appendChild(g);const M=g.innerText.trim();document.body.removeChild(g),navigator.clipboard.writeText(M),d.innerHTML=`
|
|
348
348
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">
|
|
349
349
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path stroke="none" d="M0 0h24v24H0z" /><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2 2 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" /><path d="M11 14l2 2l4 -4" />
|
|
350
350
|
</svg>
|
|
@@ -354,25 +354,25 @@ Check the information and return the details.
|
|
|
354
354
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" />
|
|
355
355
|
</svg>
|
|
356
356
|
<span>${this.out("Copy")}</span>
|
|
357
|
-
`},600)}),o.addEventListener("click",h=>{h.preventDefault(),localStorage.removeItem("_results"),localStorage.removeItem("_results_html"),e.innerHTML=""})}getScrollableParent(e){for(;e.parentElement;){const s=window.getComputedStyle(e.parentElement).overflowY;if((s==="auto"||s==="scroll")&&e.parentElement.scrollHeight>e.parentElement.clientHeight)return e.parentElement;e=e.parentElement}return null}stickyElement(e){if(!this.settings.alwaysVisibleSubmit)return;const i=this.getScrollableParent(e);this._scrollListener&&(i?i.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._resizeListener));let s;const t=()=>{e.style.position="",i?s=e.offsetTop+e.offsetHeight-i.offsetTop:s=e.offsetTop+e.offsetHeight},n=()=>{if(i)if(i.offsetHeight+i.scrollTop>s)e.style.position="",e.style.top="";else{const u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}else if(window.innerHeight+window.scrollY>s)e.style.position="",e.style.top="";else{const u=window.innerHeight-e.offsetHeight;e.style.position="fixed",e.style.top=`${u}px`}e.parentNode.offsetWidth!==0&&(e.style.width=`${e.parentNode.offsetWidth}px`)};this._scrollListener=n;let r;this._resizeListener=()=>{r&&clearTimeout(r),r=setTimeout(()=>{let a=null;const u=()=>{const c=e.offsetTop;c===a?(t(),n()):(a=c,requestAnimationFrame(u))};u()},200)},t(),n(),i?i.addEventListener("scroll",n):window.addEventListener("scroll",n),window.addEventListener("resize",this._resizeListener)}view(e){if(!e)return;let i;try{i=JSON.parse(e)}catch{console.log("Invalid JSON Form.");return}this.json=i,this.inputListener=()=>{clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)},300)},this.changeListener=()=>{const n=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(n)};let s;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}s=document.querySelector(this.settings.previewSelector)}else s=this.element;if(s){if(s.classList.remove("hidden"),s.classList.add("formview-container"),s.classList.add("fb-ui"),s.innerHTML="",!(i.hideHeader||!1)){const o=document.createElement("div");o.className="form-header",s.appendChild(o);const h=document.createElement("h1");h.className="form-title",h.innerText=i.title||this.out("Your Form Title Here"),o.appendChild(h);const f=document.createElement("p");f.className="form-desc",f.innerText=i.description||this.out("Your Description Here"),o.appendChild(f)}let r;this.settings.isBuilder?r=document.createElement("form"):r=document.createElement("div"),r.className="form-wrapper",r.style.flexFlow="wrap",s.appendChild(r);let a=1;i.elements&&i.elements.forEach(o=>{if(o.type==="spacer"){const y=document.createElement("div");y.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(y.style.height=o.spacerHeight+"px"),o.displayInOutput||r.appendChild(y);return}if(o.type==="separator"){const y=document.createElement("hr");y.style.borderTopColor=o.color,o.displayInOutput||r.appendChild(y);return}if(o.type==="html"){if(o.html){const y=document.createElement("div");y.innerHTML=o.html,o.displayInOutput||r.appendChild(y)}return}if(o.type==="heading"){const y=document.createElement(o.heading||"h2");y.innerHTML=o.headingText||this.out("Your Heading Here!"),o.displayInOutput||r.appendChild(y);return}if(o.type==="paragraph"){const y=document.createElement("p");y.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),o.displayInOutput||r.appendChild(y);return}if(o.type==="media"){if(o.tag==="video"){const y=document.createElement("video");y.style.width="100%",y.style.height="auto",y.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",y.appendChild(h),o.displayInOutput||r.appendChild(y)}else if(o.tag==="audio"){const y=document.createElement("audio");y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="audio/mp3",y.appendChild(E),o.displayInOutput||r.appendChild(y)}else if(o.tag==="img"){const y=document.createElement("img");y.src=o.url,y.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(y)}return}if(o.type==="image"){const y=document.createElement("img");y.src=o.url,y.setAttribute("alt",this.out("Output Image")),o.displayInOutput||r.appendChild(y);return}if(o.type==="video"){const y=document.createElement("video");y.style.width="100%",y.style.height="auto",y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="video/mp4",y.appendChild(E),o.displayInOutput||r.appendChild(y);return}if(o.type==="audio"){const y=document.createElement("audio");y.controls=!0;let E=document.createElement("source");E.src=o.url,E.type="audio/mp3",y.appendChild(E),o.displayInOutput||r.appendChild(y);return}const f=document.createElement("div");f.className="form-field",o.type==="hidden"&&(f.className="hidden"),o.displayInOutput||r.appendChild(f),o.type==="color"&&f.classList.add("field-color");const v=o.type;let S=o.name;if(r.querySelector(`[name="${S}"]`)&&(a++,S=S+"_"+a),v==="short-text"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`short_text_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`short_text_label_${y}`,b.type="text",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="long-text"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`long_text_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("textarea");b.id=`long_text_label_${y}`,b.name=S,b.value=o.value||"",b.className="inp-base",b.style.height=o.height+"px",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="number"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`number_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`number_label_${y}`,b.type="number",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="slider"){f.classList.add("input-slider");let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`number_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const V=document.createElement("div");V.className="field-note",V.innerHTML=o.fieldNote,f.appendChild(V)}const b=document.createElement("div");b.className="slider-container",f.appendChild(b);const k=document.createElement("div");k.className="slider-values",b.appendChild(k);const C=document.createElement("span");k.appendChild(C),C.innerText=o.minValue;const g=document.createElement("span");k.appendChild(g),g.innerText=o.maxValue;const w=document.createElement("input");w.id=`number_label_${y}`,w.type="range",w.name=S,w.setAttribute("min",o.minValue),w.setAttribute("max",o.maxValue),w.setAttribute("step",o.step),w.setAttribute("value",o.value||0),b.appendChild(w);const q=document.createElement("div");q.className="current-value",b.appendChild(q),b.querySelector(".current-value").textContent=o.value||0,w.addEventListener("input",()=>{b.querySelector(".current-value").textContent=w.value})}if(v==="select"){let y=this.getId();const E=document.createElement("div");if(E.id=`radio_group_label_${y}`,E.className="field-label-normal",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`radio_group_label_${y}`),b.setAttribute("role","group"),b.className="div-options",f.appendChild(b),o.choices&&o.choices.forEach((k,C)=>{let g=k;o.choicesText&&(g=o.choicesText[C]||k);const w=document.createElement("label");w.setAttribute("for",`${y}_${C}`),w.className="option-label",b.appendChild(w);const q=document.createElement("input");q.type="radio",q.className="peer",q.id=`${y}_${C}`,q.name=S,q.value=k,w.appendChild(q),C===o.selected&&(q.checked=!0);const V=document.createElement("span");V.className="peer-span-rounded",w.appendChild(V);const I='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';V.innerHTML=I,C===0&&o.isRequired&&q.setAttribute("required","required");const F=document.createElement("span");F.innerText=g,w.appendChild(F),q.addEventListener("change",this.changeListener)}),o.showOtherItem){const k=document.createElement("label");k.setAttribute("for",y+"_other"),k.className="option-label",b.appendChild(k);const C=document.createElement("input");C.type="radio",C.className="peer",C.id=y+"_other",C.name=S,C.value="other",k.appendChild(C);const g=document.createElement("span");g.className="peer-span-rounded",k.appendChild(g);const w='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z"></path></svg>';g.innerHTML=w;const q=document.createElement("span");q.innerText=o.otherText,k.appendChild(q);const V=document.createElement("div");f.appendChild(V);const I=document.createElement("input");I.type="text",I.name=S+"_other",I.className="inp-base",V.appendChild(I),C.addEventListener("change",this.changeListener),I.addEventListener("input",this.inputListener)}}if(v==="multi-select"){let y=this.getId();const E=document.createElement("div");if(E.id=`checkbox_group_label_${y}`,E.className="field-label-normal",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("div");if(b.setAttribute("aria-labelledby",`checkbox_group_label_${y}`),b.setAttribute("role","group"),b.className="div-options",f.appendChild(b),o.choices&&o.choices.forEach((k,C)=>{let g=k;o.choicesText&&(g=o.choicesText[C]||k);const w=document.createElement("label");w.setAttribute("for",`${y}_${C}`),w.className="option-label",b.appendChild(w);const q=document.createElement("input");q.type="checkbox",q.className="peer",q.id=`${y}_${C}`,q.name=S+"[]",q.value=k,w.appendChild(q);const V=document.createElement("span");V.className="peer-span-square",w.appendChild(V);const I=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
|
|
357
|
+
`},600)}),o.addEventListener("click",h=>{h.preventDefault(),localStorage.removeItem("_results"),localStorage.removeItem("_results_html"),e.innerHTML=""})}getScrollableParent(e){for(;e.parentElement;){const s=window.getComputedStyle(e.parentElement).overflowY;if((s==="auto"||s==="scroll")&&e.parentElement.scrollHeight>e.parentElement.clientHeight)return e.parentElement;e=e.parentElement}return null}stickyElement(e){if(!this.settings.alwaysVisibleSubmit)return;const i=this.getScrollableParent(e);this._scrollListener&&(i?i.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._resizeListener));let s;const t=()=>{e.style.position="",i?s=e.offsetTop+e.offsetHeight-i.offsetTop:s=e.offsetTop+e.offsetHeight},n=()=>{if(i)if(i.offsetHeight+i.scrollTop>s)e.style.position="",e.style.top="";else{const 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">
|
|
358
358
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />
|
|
359
|
-
</svg>`;V.innerHTML=
|
|
359
|
+
</svg>`;V.innerHTML=N;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="checkbox",O.className="peer",O.id=w+"_other",O.name=E,O.value="other",_.appendChild(O);const m=document.createElement("span");m.className="peer-span-square",_.appendChild(m);const k=`<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>`;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==="switch"){let w=this.getId();const C=document.createElement("label");if(C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),C.id=`switch_${w}`,g.appendChild(C),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,g.appendChild(k)}const b=document.createElement("div");b.className="switch",b.tabIndex=0,b.role="switch",b.setAttribute("aria-labelledby",`switch_${w}`),b.setAttribute("aria-checked","false"),b.setAttribute("data-checked","false"),g.appendChild(b);const _=document.createElement("div");_.className="switch-thumb",b.appendChild(_);const O=document.createElement("input");O.id=`switch_${w}`,O.type="text",O.name=E,O.style.cssText="opacity:0.01;width:1px;height:1px;position:absolute;bottom:0px;left:25px;",O.setAttribute("tabindex","-1"),o.isRequired&&(O.setAttribute("required","required"),O.setCustomValidity(this.out("Please toggle this switch to proceed."))),b.appendChild(O),o.value==="true"?(b.setAttribute("aria-checked","true"),b.setAttribute("data-checked","true"),O.value="true",o.isRequired&&O.setCustomValidity("")):(b.setAttribute("aria-checked","false"),b.setAttribute("data-checked","false"),O.value="false",o.isRequired&&O.setCustomValidity(this.out("Please toggle this switch to proceed."))),C.addEventListener("click",()=>{b.focus()});const m=()=>{const k=b.getAttribute("aria-checked")==="true";b.setAttribute("aria-checked",!k),b.setAttribute("data-checked",!k),k?(O.value="false",o.isRequired&&O.setCustomValidity(this.out("Please toggle this switch to proceed."))):(O.value="true",o.isRequired&&O.setCustomValidity(""));const R=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(R)};b.addEventListener("keydown",k=>{(k.key===" "||k.key==="Enter")&&(k.preventDefault(),m())}),b.addEventListener("click",()=>{m()})}if(y==="dropdown"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`dropdown_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const Y=document.createElement("div");Y.className="field-note",Y.innerHTML=o.fieldNote,g.appendChild(Y)}const b=document.createElement("div");b.className="relative",g.appendChild(b);const _=document.createElement("div");_.className="relative inline-block",b.appendChild(_);const O=document.createElement("select");O.id=`dropdown_${w}`,O.name=E,o.isRequired&&O.setAttribute("required","required"),_.appendChild(O);const m=document.createElement("option");if(m.setAttribute("selected","selected"),m.setAttribute("disabled","disabled"),m.value="",m.innerText=o.placeholder,O.appendChild(m),o.choices&&o.choices.forEach((Y,G)=>{let F=Y;o.choicesText&&(F=o.choicesText[G]||Y);const I=document.createElement("option");I.value=Y,I.innerText=F,O.appendChild(I),G===o.selected&&(m.remove(),I.setAttribute("selected","selected"))}),o.showOtherItem){const Y=document.createElement("option");Y.value="other",Y.innerText=o.otherText,O.appendChild(Y)}const k=document.createElement("div");k.className="select-arrow",_.appendChild(k),this.appendHtml(k,`
|
|
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 R=document.createElement("input");R.type="text",R.id=`input_other_${w}`,R.name=E+"_other",R.className="input-other hidden inp-base",g.appendChild(R);const V=g.querySelector(`#dropdown_${w}`),N=g.querySelector(`#input_other_${w}`);V.addEventListener("change",()=>{V.value==="other"?(N.classList.remove("hidden"),N.focus()):N.classList.add("hidden");const Y=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(Y)}),R.addEventListener("input",this.inputListener)}if(y==="date"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`date_${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=`date_${w}`,b.type="date",b.name=E,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("change",this.changeListener)}if(y==="time"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`time_${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=`time_${w}`,b.type="time",b.name=E,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("change",this.changeListener)}if(y==="datetime"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`datetime_${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=`datetime_${w}`,b.type="datetime-local",b.name=E,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("change",this.changeListener)}if(y==="color"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`color_${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=`color_${w}`,b.type="color",b.name=E,b.value=o.value||"",b.className="input-color",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),g.appendChild(b),b.addEventListener("input",this.inputListener)}if(y==="file"||y==="multifile"){let w=this.getId();const C=document.createElement("label");if(C.setAttribute("for",`file_${w}`),C.className="field-label",C.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),g.appendChild(C),o.fieldNote){const X=document.createElement("div");X.className="field-note",X.innerHTML=o.fieldNote,g.appendChild(X)}const b=document.createElement("div");b.className="file-input-wrapper",y==="file"&&b.setAttribute("aria-label",this.out(this.settings.fileUploadText)),y==="multifile"&&b.setAttribute("aria-label",this.out(this.settings.multiFileUploadText)),g.appendChild(b);const _=document.createElement("input");_.id=`input_url_label_${w}`,_.type="text",_.name=E+"__url",_.value=o.value||"",_.className="inp-base input-file-url",_.placeholder=o.placeholder||this.out("Enter URL."),g.appendChild(_),_.addEventListener("input",()=>{const X=g.querySelector(".btn-clearfile");X&&X.click(),this.inputListener(),_.value!==""?o.isRequired&&O.removeAttribute("required"):o.isRequired&&O.setAttribute("required","required"),Re(_.value),this.clearSelectedFiles()}),o.useURL?_.style.display="":_.style.display="none";const O=document.createElement("input");O.id=`file_${w}`,O.type="file",y==="multifile"&&(O.multiple=!0),O.name=E,o.isRequired&&O.setAttribute("required","required"),O.className="peer",b.appendChild(O);const m=document.createElement("div");m.className="file-drop-area",b.appendChild(m);const k=document.createElement("div");k.className="file-controls",k.id=`drag_message_${w}`,b.appendChild(k);let R;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(R=document.createElement("div"),R.className="file-drop-info",y==="file"&&(R.innerHTML=this.out(this.settings.fileUploadText)),y==="multifile"&&(R.innerHTML=this.out(this.settings.multiFileUploadText)),k.appendChild(R));let V;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(V=document.createElement("button"),V.className="btn-selectfile",V.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
|
+
`,k.appendChild(V));let N;(o.source&&o.source==="camera"||o.source&&o.source==="local_and_camera")&&(N=document.createElement("button"),N.className="btn-takephoto",N.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
|
+
`,k.appendChild(N));const Y=document.createElement("div");Y.className="file-preview-container",b.appendChild(Y);const G=document.createElement("div");G.className="file-drop-info-highlight",G.id=`file_name_${w}`,b.appendChild(G),V&&V.addEventListener("click",X=>{X.preventDefault(),O.click()}),b.classList.add("disabledrop"),(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(b.classList.remove("disabledrop"),b.addEventListener("dragover",X=>{X.preventDefault(),Array.from(X.dataTransfer.items).some(ge=>ge.kind==="file")&&b.classList.add("drag-over")}),b.addEventListener("dragleave",()=>{b.classList.remove("drag-over")}),y==="file"?b.addEventListener("drop",X=>{if(X.preventDefault(),X.dataTransfer.files&&X.dataTransfer.files.length>0){b.classList.remove("drag-over");const te=X.dataTransfer.files[0];te&&(O.files=X.dataTransfer.files,_e(te),this.clearSelectedFiles())}}):y==="multifile"&&b.addEventListener("drop",X=>{if(X.preventDefault(),X.dataTransfer.files&&X.dataTransfer.files.length>0){b.classList.remove("drag-over"),Y.innerHTML="";const te=X.dataTransfer.files;te.length>0&&(O.files=te,Array.from(te).forEach(ge=>{ve(ge)}),this.clearSelectedFiles())}})),y==="file"?O.addEventListener("change",()=>{const X=O.files[0];X&&(_e(X),this.clearSelectedFiles())}):y==="multifile"&&O.addEventListener("change",()=>{Y.innerHTML="";const X=O.files;Array.from(X).forEach(te=>{te&&(ve(te),this.clearSelectedFiles())})});const F={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 I=[];(o.allowedFileTypes||["images","videos","audio","documents","others"]).forEach(X=>{switch(X){case"images":I=I.concat(F.images);break;case"videos":I=I.concat(F.videos);break;case"audio":I=I.concat(F.audio);break;case"documents":I=I.concat(F.documents);break;case"others":I=I.concat(F.others);break}});const A=I.map(X=>X.type).join(",");O.setAttribute("accept",A);let $;if(o.useImageMask){g.classList.add("image-mask");const X=document.createElement("div");g.appendChild(X),$=new Ts(X,{lang:this.settings.lang,name:E+"_mask"}),this.objImageMask=$}o.largePreview&&g.classList.add("large-preview");const W=()=>{const X=b.querySelector(".img-preview");X&&(X.remove(),o.useImageMask&&$.clearImage())};let D=`
|
|
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(b,
|
|
407
|
+
`;this.appendHtml(b,D);const J=g.querySelector(".livevideo"),Q=g.querySelector(".photo-captured"),ne=g.querySelector(".btn-selectfile2"),se=g.querySelector(".btn-takephoto2"),le=g.querySelector(".btn-capturephoto"),de=g.querySelector(".btn-clearphoto"),oe=g.querySelector(".btn-stopcamera");this.photoBlob={};let xe;ne&&ne.addEventListener("click",X=>{X.preventDefault(),V.click()});const je=async()=>{const X=g.querySelector(".btn-clearfile");X&&X.click();try{xe=await navigator.mediaDevices.getUserMedia({video:!0}),J.srcObject=xe}catch{alert("Unable to access the camera."),J.style.display="none",le.style.display="none",oe.style.display="none",k.style.display="none",G.style.display="none"}setTimeout(()=>{se.style.display="none",Q.style.display="none",J.style.display="",le.style.display="",de.style.display="none",ne&&(ne.style.display="none"),se.style.display="none",oe.style.display="",k.style.display="none",G.style.display="none"},100)};N&&N.addEventListener("click",async X=>{X.preventDefault(),je()}),se.addEventListener("click",async X=>{X.preventDefault(),je()}),oe.addEventListener("click",()=>{xe&&xe.getTracks().forEach(X=>X.stop()),J.style.display="none",le.style.display="none",oe.style.display="none",se.style.display="none",k.style.display="",G.style.display=""}),le.addEventListener("click",X=>{if(X.preventDefault(),Q.style.display="",Q.width=J.videoWidth,Q.height=J.videoHeight,Q.getContext("2d").drawImage(J,0,0,Q.width,Q.height),xe.getTracks().forEach(te=>te.stop()),J.style.display="none",le.style.display="none",de.style.display="",ne&&(ne.style.display=""),se.style.display="",oe.style.display="none",Q.toBlob(te=>{this.photoBlob[E]=te,O.removeAttribute("required")},"image/jpeg"),se.style.display="",o.useImageMask){const te=Q.toDataURL("image/jpeg");$.setImage(te)}this.clearSelectedFiles()});const Le=()=>{this.photoBlob[E]=null,Q.style.display="none",Q.getContext("2d").clearRect(0,0,Q.width,Q.height),_.value!==""?o.isRequired&&O.removeAttribute("required"):o.isRequired&&O.setAttribute("required","required"),de.style.display="none",ne&&(ne.style.display="none"),se.style.display="none",k.style.display="",G.style.display=""};de.addEventListener("click",()=>{Le()});const Re=(X,te)=>{const ge=`.${X.split(".").pop().toLowerCase()}`;if(!I.some(ae=>ae.extensions.split(", ").includes(ge)))return;let Te=F.images.some(ae=>ae.extensions.split(", ").includes(ge));if(o.useImageMask){if(!Te)return;$.loadUrl(X)}Le(),G.innerHTML="";const ye=document.createElement("div");G.appendChild(ye);const me=document.createElement("button");if(me.className="btn-clearfile",me.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
|
-
`,G.appendChild(
|
|
411
|
+
`,G.appendChild(me),me.addEventListener("click",ae=>{let l=me.closest(".form-field").querySelector(".img-preview");l&&l.remove(),_.value="",O.value="",G.innerHTML="",R.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&$.clearImage();const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),ae.preventDefault(),ae.stopImmediatePropagation()}),Te){let ae=b.querySelector(".formview-container .img-preview");ae||(ae=document.createElement("img"),ae.className="img-preview",b.appendChild(ae)),ae.src=X}else W();if(!te){const ae=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(ae)}const fe=document.querySelector(".formview-container .submit-container");fe&&setTimeout(()=>{this.stickyElement(fe)},1e3)};o.value&&Re(o.value,!0);const _e=X=>{if(X){if(!I.some(me=>me.type===X.type)){alert(this.out("Invalid file type."));return}if(o.useImageMask){if(!["image/jpeg","image/png","image/webp"].includes(X.type)){alert(this.out("Invalid file type."));return}$.loadImage(X)}Le(),_.value="",G.innerHTML="";const ge=document.createElement("div");ge.innerText=X.name,G.appendChild(ge);const be=document.createElement("button");if(be.className="btn-clearfile",be.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
|
-
`,G.appendChild(
|
|
415
|
+
`,G.appendChild(be),be.addEventListener("click",me=>{let ae=be.closest(".form-field").querySelector(".img-preview");ae&&ae.remove(),O.value="",G.innerHTML="",R.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&$.clearImage();const qe=document.querySelector(".formview-container .submit-container");qe&&setTimeout(()=>{this.stickyElement(qe)},1e3),me.preventDefault(),me.stopImmediatePropagation()}),X.type.startsWith("image/")){const me=new FileReader;me.onload=function(fe){let ae=b.querySelector(".formview-container .img-preview");ae||(ae=document.createElement("img"),ae.className="img-preview",b.appendChild(ae)),ae.src=fe.target.result},me.readAsDataURL(X)}else W();const Te=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(Te);const ye=document.querySelector(".formview-container .submit-container");ye&&setTimeout(()=>{this.stickyElement(ye)},1e3)}},ve=X=>{if(X){if(I=I.concat(F.images),!I.some(ae=>ae.type===X.type)){alert(this.out("Invalid file type."));return}const ge=document.createElement("div");ge.className="image-item",Y.appendChild(ge);const be=document.createElement("div");be.className="file-drop-info-highlight",ge.appendChild(be);const Te=document.createElement("div");Te.innerText=X.name,be.appendChild(Te);const ye=document.createElement("button");if(ye.className="btn-clearfile",ye.innerHTML=`
|
|
416
416
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
417
417
|
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
|
|
418
418
|
</svg>
|
|
419
|
-
`,ve.appendChild(ye),ye.addEventListener("click",ne=>{const Me=ye.closest(".image-item");Me&&Me.remove(),(x=>{const T=new DataTransfer,O=C.files;Array.from(O).forEach(D=>{D!==x&&T.items.add(D)}),C.files=T.files})(X);const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),ne.preventDefault(),ne.stopImmediatePropagation()}),X.type.startsWith("image/")){const ne=new FileReader;ne.onload=function(Me){let l=document.createElement("img");l.className="img-preview",ge.appendChild(l),l.src=Me.target.result},ne.readAsDataURL(X)}const fe=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(fe);const he=document.querySelector(".formview-container .submit-container");he&&setTimeout(()=>{this.stickyElement(he)},1e3)}}}if(v==="email"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`email_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`email_label_${y}`,b.type="email",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="phone"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`phone_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`phone_label_${y}`,b.type="tel",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="url"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`url_label_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const k=document.createElement("div");k.className="field-note",k.innerHTML=o.fieldNote,f.appendChild(k)}const b=document.createElement("input");b.id=`url_label_${y}`,b.type="url",b.name=S,b.value=o.value||"",b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="hidden"){let y=this.getId();const E=document.createElement("label");E.setAttribute("for",`hidden_label_${y}`),E.className="field-label hidden",E.innerText=o.title,f.appendChild(E);const b=document.createElement("input");b.id=`hidden_label_${y}`,b.type="hidden",b.name=S,b.value=o.value,f.appendChild(b)}});const u=r.closest("[data-site-token]");if(u){const o=u.getAttribute("data-site-token"),h=document.createElement("input");h.type="hidden",h.name="form_token",h.value=o,r.appendChild(h)}if(this.settings.isBuilder){const o=document.createElement("div");o.className="submit-container",r.appendChild(o);let h=!0;if("hideReset"in i&&(h=i.hideReset),!h){const R=document.createElement("button");R.className="btn-resetform";const y=i.resetText||this.settings.resetText;R.innerText=y,o.appendChild(R),R.addEventListener("click",b=>{b.preventDefault();const k=R.closest("form");k&&(k.reset(),k.querySelectorAll(".btn-clearfile").forEach(w=>{w.click()}),k.querySelectorAll(".slider-container").forEach(w=>{const q=w.querySelector("input");w.querySelector(".current-value").textContent=q.value}))}),(i.fullWidthButton||!1)&&R.classList.add("w-full")}const f=document.createElement("button");f.className="btn-submitform";const v=i.submitText||this.settings.submitText;f.innerText=v,o.appendChild(f),(i.fullWidthButton||!1)&&f.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&o.classList.add("always-visible"),this.stickyElement(o),r.addEventListener("submit",async R=>{R.preventDefault(),this.steps&&this.steps.length>0&&this.process()})}else{let o="Reference Code:",h="reference_code",f="reference_code";const v=document.createElement("div");v.className="form-field ",v.classList.add(f),r.appendChild(v);let S=this.getId();const R=document.createElement("label");R.setAttribute("for",`short_text_label_${S}`),R.className="field-label",R.innerHTML=o,v.appendChild(R);const y=document.createElement("input");if(y.id=`short_text_label_${S}`,y.type="text",y.name=h,y.autocomplete="off",y.setAttribute("aria-hidden","true"),y.setAttribute("tabindex","-1"),y.className="inp-base",v.appendChild(y),this.settings.captchaContainer){const E=this.settings.captchaContainerClassName,b=document.createElement("div");b.className="captcha-container",E&&b.classList.add(E),r.appendChild(b)}if(i.useSubmitButton){const E=document.createElement("div");E.className="submit-container",r.appendChild(E);let b=!0;if("hideReset"in i&&(b=i.hideReset),!b){const q=document.createElement("button");q.className="btn-resetform";const V=i.resetText||this.settings.resetText;q.innerText=V,E.appendChild(q),q.addEventListener("click",F=>{F.preventDefault();const G=q.closest("form");G&&(G.reset(),G.querySelectorAll(".btn-clearfile").forEach(_=>{_.click()}),G.querySelectorAll(".slider-container").forEach(_=>{const L=_.querySelector("input");_.querySelector(".current-value").textContent=L.value}))}),(i.fullWidthButton||!1)&&q.classList.add("w-full")}const k=document.createElement("button");k.className="btn-submitform";const C=i.submitText;k.innerText=C,E.appendChild(k),(i.fullWidthButton||!1)&&k.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&E.classList.add("always-visible"),this.stickyElement(E),k.addEventListener("click",async q=>{this.trigger("submit",q)});const w=r.closest("form");w?w.addEventListener("submit",async q=>{this.steps&&this.steps.length>0&&(q.preventDefault(),q.stopImmediatePropagation(),this.process())}):k.addEventListener("click",async q=>{this.steps&&this.steps.length>0&&(q.preventDefault(),this.process())})}}let c,d;this.settings.resultSelector&&(c=document.querySelector(this.settings.resultSelector),c.classList.add("result-wrapper"),c.innerHTML="",d=document.createElement("div"),d.classList.add("result-container"),c.appendChild(d)),i.elements&&c&&i.elements.forEach(o=>{if(o.displayInOutput){if(o.type==="spacer"){const f=document.createElement("div");f.className="form-spacer",o.spacerHeight&&!isNaN(parseFloat(o.spacerHeight))&&(f.style.height=o.spacerHeight+"px"),d.appendChild(f);return}if(o.type==="separator"){const f=document.createElement("hr");f.style.borderTopColor=o.color,d.appendChild(f);return}if(o.type==="html"){if(o.html){const f=document.createElement("div");f.innerHTML=o.html,d.appendChild(f)}return}if(o.type==="heading"){const f=document.createElement(o.heading||"h2");f.innerHTML=o.headingText||this.out("Your Heading Here!"),d.appendChild(f);return}if(o.type==="paragraph"){const f=document.createElement("p");f.innerHTML=o.paragraphText||this.out("Your paragraph content here!"),d.appendChild(f);return}if(o.type==="media"){if(o.tag==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;var h=document.createElement("source");h.src=o.url,h.type="video/mp4",f.appendChild(h),d.appendChild(f)}else if(o.tag==="audio"){const f=document.createElement("audio");f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="audio/mp3",f.appendChild(v),d.appendChild(f)}else if(o.tag==="img"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f)}return}if(o.type==="image"){const f=document.createElement("img");f.src=o.url,f.setAttribute("alt",this.out("Output Image")),d.appendChild(f);return}if(o.type==="video"){const f=document.createElement("video");f.style.width="100%",f.style.height="auto",f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="video/mp4",f.appendChild(v),d.appendChild(f);return}if(o.type==="audio"){const f=document.createElement("audio");f.controls=!0;let v=document.createElement("source");v.src=o.url,v.type="audio/mp3",f.appendChild(v),d.appendChild(f);return}}})}if(this.settings.resultSelector&&document.querySelector(this.settings.resultSelector).classList.add("result-wrapper"),this.settings.saveResults&&this.settings.resultSelector&&localStorage.getItem("_results"))try{this.previousResults=JSON.parse(localStorage.getItem("_results"));let n=localStorage.getItem("_results_html");const r=document.querySelector(this.settings.resultSelector);r.innerHTML=n,this.addResultTool(),r.querySelectorAll(".link-download").forEach(u=>{u.addEventListener("click",async c=>{c.preventDefault();const d=c.target.href;try{const o=await fetch(d,{mode:"cors"});if(!o.ok)throw new Error("Failed to fetch the image.");const h=await o.blob(),f=d.substring(d.lastIndexOf("/")+1),v=document.createElement("a");v.href=URL.createObjectURL(h),v.download=f,v.click(),URL.revokeObjectURL(v.href)}catch(o){console.error("Error downloading the image:",o)}})})}catch{}const t=document.querySelector(".formview-container .submit-container");t&&setTimeout(()=>{this.stickyElement(t)},1e3)}abort(){this.controller&&this.controller.abort()}async search(e){let i={"Content-Type":"application/json",...this.settings.headers};try{const s=await fetch(this.settings.searchUrl,{method:"POST",headers:i,body:JSON.stringify({query:e,customData:this.settings.customData})});if(!s.ok)throw new Error("Failed to fetch data");const t=await s.json(),n=t.organic_results?"organic_results":"organic";return(t[n]||[]).map(r=>({title:r.title,link:r.link,snippet:r.snippet||r.description}))}catch(s){return console.error("Error in search:",s.message||s),[]}}async scrapeUrls(e){if(e.length===0)return{data:"",urls:[],failed:[]};this.settings.consoleLog&&console.log(e);let i={"Content-Type":"application/json",...this.settings.headers};const s=await fetch(this.settings.scrapeUrl,{method:"POST",headers:i,body:JSON.stringify({urls:e,customData:this.settings.customData})});if(!s.ok)throw new Error(`Error: ${s.statusText}`);let t="";const n=await s.json();if(this.settings.consoleLog&&console.log(n),n.error)return this.settings.consoleLog&&console.log(n.error),{data:"",urls:[],failed:[]};let r=[],a=[];if(this.settings.scrapeProvider==="firecrawl"&&n.forEach(u=>{if(u.success){const c=u.metadata.title,d=u.markdown,o=u.metadata.url;r.push(o),t+=`
|
|
419
|
+
`,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+=`
|
|
420
420
|
|
|
421
421
|
|
|
422
422
|
## ${c}
|
|
@@ -451,7 +451,7 @@ Check if the request requires checking certain URLs. If so, returns the URLs.
|
|
|
451
451
|
Also check if the request requires search to find answers by searching on the web to get the current relevant information.
|
|
452
452
|
`,n=[{name:"check_request",description:"Check user request.",parameters:{type:"object",properties:{needscrape:{type:"boolean",description:"Check the if request requires search on the web or not."},url:{type:"string",description:"If request need to check certail URL, return the URL."},url2:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url3:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url4:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url5:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url6:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url7:{type:"string",description:"If the request needs to check a certail URL, return the URL."},url8:{type:"string",description:"If the request needs to check a certail URL, return the URL."},needsearch:{type:"boolean",description:"Check the if request requires search on the web or not."}},required:["needsearch","needscrape"]}}],r=await this.send(t,s,i,n);return r?JSON.parse(r):!1}async getRelevantInfo(e,i,s){if(!this.settings.searchUrl&&!this.settings.scrapeUrl)return{data:"",urls:[],failed:[]};const t=document.createElement("div");t.classList.add("status"),s.appendChild(t);let n="",r=await this.checkPrompt(`${i}
|
|
453
453
|
|
|
454
|
-
${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];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,u=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(
|
|
454
|
+
${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];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,u=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(w=>{let C=new URL(w.link).hostname;return!o.some(b=>C.includes(b))});const g=this.settings.scrapeLimit,y=h.slice(0,g);t.innerHTML="",c=document.createElement("p"),c.innerHTML=this.out("Getting more information..."),t.appendChild(c);let E=[];for(let w=0;w<y.length;w++)E.push(d[w].link);let M=await this.scrapeUrls(E);n+=M.data,a=M.urls,u=M.failed}return{data:n,urls:a,failed:u}}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(_=>{_.prompt.trim().startsWith("{")&&(s=!0),_.tools&&(_.tools.image||_.tools.video||_.tools.audio)&&(s=!0),_.tools&&_.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>
|
|
@@ -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=(_,O)=>{if(_===void 0)return"";if(!isNaN(_))return _;let m=_;return O&&O.trim().startsWith("{")&&(m=JSON.stringify(_).slice(1,-1)),m};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 _ of o){let O=_.prompt;if(_.provider==="google"){for(const k of h)if(k.value instanceof FileList&&k.value.length>0){const V=k.value[0];if(!V)continue;const N=await new Promise((Y,G)=>{const F=new FileReader;F.onload=I=>{const T=I.target.result.split(",")[1];Y(T)},F.onerror=G,F.readAsDataURL(V)});O=O.replaceAll(`{{${k.name}}}`,N),O=O.replaceAll(`{{${k.name.toUpperCase()}}}`,N)}}_.prompt=O}o.forEach(_=>{let O=_.prompt;h.forEach(m=>{if(m.value===void 0&&(m.value=""),typeof m.value=="object"&&Array.isArray(m.value)){const k=m.value.join(", ");O=O.replaceAll(`{{${m.name}}}`,k),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,k)}else m.value instanceof FileList||typeof m.value=="string"&&m.value.indexOf("base64")!==-1?(O=O.replaceAll(`{{${m.name}}}`,m.name),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,m.name)):(O=O.replaceAll(`{{${m.name}}}`,d(m.value,_.prompt)),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,d(m.value,_.prompt)))}),_.prompt=O}),o.forEach(_=>{let O=_.context;h.forEach(m=>{if(m.value||(m.value=""),typeof m.value=="object"&&Array.isArray(m.value)){const k=m.value.join(", ");O=O.replaceAll(`{{${m.name}}}`,k),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,k)}else m.value instanceof FileList||typeof m.value=="string"&&m.value.indexOf("base64")!==-1?(O=O.replaceAll(`{{${m.name}}}`,m.name),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,m.name)):(O=O.replaceAll(`{{${m.name}}}`,d(m.value,_.prompt)),O=O.replaceAll(`{{${m.name.toUpperCase()}}}`,d(m.value,_.prompt)))}),_.context=O})}const g=async(_,O,m,k,R,V,N,Y)=>{const G=document.createElement("div");G.classList.add("result-container"),i.appendChild(G),G.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 F=!1,I;if(_.trim().startsWith("{"))try{I=JSON.parse(_),I&&typeof I=="object"&&(F=!0)}catch{return G.innerHTML=`<p>${this.out("Incorrect JSON format.")}</p>`,!1}(N&&(N.image||N.video||N.audio)||F)&&(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 T="",A="",$;if(N&&N.search&&($=await this.getRelevantInfo(_,O,G),$.data!==""&&(O+=`
|
|
527
527
|
Use the following information to answer the request:
|
|
528
528
|
|
|
529
|
-
${
|
|
530
|
-
`)),I&&(I.image||I.video||I.audio)||B){const W=await this.media.generate(k,C,g,w,I,G,F);return this.needCleanup=!0,this.settings.consoleLog&&console.log(W),W.mediaGenerated?{media:W.output,media2:W.output2,markdown:W.markdown}:(G.innerHTML=`<p>${W.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(k,C,q,V,async W=>{if(!(W&&typeof W=="object")){if(_+=W,!F){const N=we.parse(_);G.innerHTML=N,L+=N}await new Promise(N=>setTimeout(N,50))}}),await new Promise(W=>{const N=setInterval(()=>{G.innerHTML===we.parse(_)&&(clearInterval(N),W())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`;else if(this.settings.assistantUrl){let W=await this.assistant(k,C,q,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}}else if(this.settings.sendCommandStreamUrl){let W="",N="",J="";const Q=async se=>{let re=0;for(;re<se.length;){if(J=W.slice(0,J.length+1),re++,!F){const ae=we.parse(J);G.innerHTML=ae,N=ae}await new Promise(ae=>setTimeout(ae,50))}};await this.sendStream(k,C,q,w,V,async se=>{_+=se,W+=se,await Q(se)}),await new Promise(se=>{const re=setInterval(()=>{J.length===W.length&&(clearInterval(re),se())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${N}</div>`}else{let W=await this.send(k,C,q,w,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}if(!F){let W="";if(P&&P.urls.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" href="${J}">${Q}</url></div>`}),P&&P.failed.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" style="opacity:0.5" href="${J}">${Q}</url></div>`}),W!==""){const J=document.createElement("div");J.classList.add("result-container"),i.appendChild(J),J.innerHTML=W}}return this.payloads.push({prompt:k,context:C}),this.output.push(_),{media:[],markdown:_}};c||await(async k=>{this.previousResults=[],this.outputHtml="";for(let C=0;C<k.length;C++){if(!this.isGenerating)return;let{prompt:g,context:w,provider:q,model:V,system:I,functs:F,tools:G,hideOutput:B}=k[C];q=q||"",w=w||"",I=I||"You are an assistant",F=F||[];let M=g;this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),g=M,g=g.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(g),M=w,this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),w=M,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let _=await f(g,w,q,V,I,F,G,B);if(!_)break;if(this.mediaGenerated.push(..._.media),_.media&&_.media.length===1){let L=_.media[0],P=_.media2&&_.media2.length===1&&_.media2[0];this.previousResults.push(P||L),B&&(this.filesUploaded[`output_step_${C}`]=L)}else this.previousResults.push(_.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(C,g)=>{if(!this.isGenerating)return;let{prompt:w,context:q,provider:V,model:I,system:F,functs:G,tools:B,hideOutput:M}=C[g];q=q||"",F=F||"You are an assistant",G=G||[];let _=w;this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),w=_,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(w),_=q,this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),q=_,q=q.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(q);let L=await f(w,q,V,I,F,G,B,M);if(L&&(this.mediaGenerated.push(...L.media),!!this.previousResults))if(L.media&&L.media.length===1){let P=L.media[0],W=L.media2&&L.media2.length===1&&L.media2[0];this.previousResults[g]=W||P,M&&(this.filesUploaded[`output_step_${g}`]=P)}else this.previousResults[g]=L.markdown})(o,e)),a.innerHTML=u,a.removeAttribute("disabled"),this.isGenerating=!1;const S=this.calculateCost();this.settings.onUsage&&this.settings.onUsage(S),this.trigger("usage",S),this.isNormal=!1,this.isSingle=!1;const R=(k,C=100)=>{const g=document.createElement("div");if(g.innerHTML=k,g.querySelector("video"))return"Video";if(g.querySelector("img"))return"Image";if(g.querySelector("audio"))return"Audio";const w=g.textContent.trim();return w.length>C?w.substring(0,C)+"...":w},y=Object.keys(this.filesUploaded).length===0&&this.filesUploaded.constructor===Object;if(this.needCleanup&&!y){this.settings.consoleLog&&(console.log("Cleanup"),console.log(this.filesUploaded));let k={"Content-Type":"application/json",...this.settings.headers};await fetch(this.settings.cleanup,{method:"POST",headers:k,body:JSON.stringify(this.filesUploaded)})}let E=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(k=>E.indexOf(k)!==-1),this.trigger("resultReady",{previewText:R(E),markdown:this.previousResults,html:E,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",E)),this.addResultTool(),i.querySelectorAll(".link-download").forEach(k=>{k.addEventListener("click",async C=>{C.preventDefault();const g=C.target.href;try{const w=await fetch(g,{mode:"cors"});if(!w.ok)throw new Error("Failed to fetch the image.");const q=await w.blob(),V=g.substring(g.lastIndexOf("/")+1),I=document.createElement("a");I.href=URL.createObjectURL(q),I.download=V,I.click(),URL.revokeObjectURL(I.href)}catch(w){console.error("Error downloading the image:",w)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:u,value:c,checked:d,files:o}=r;if(u==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(u==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(u==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(u==="file")s[a]=o;else if(u==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(f=>f.value)}else if(u==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,u=r.name,c=r.type;if(u==="")return;let d=s[u],o={questions:a,name:u,value:d,type:c};t.push(o);let h=u+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(u=u+"_mask",d=s[u],o={questions:a,name:u,value:d},t.push(o));let f=u+"_red";d=s[f],d!==void 0&&(o={questions:a,name:f,value:d},t.push(o));let v=u+"_green";d=s[v],d!==void 0&&(o={questions:a,name:v,value:d},t.push(o));let S=u+"_blue";d=s[S],d!==void 0&&(o={questions:a,name:S,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,u=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:u,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
-
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let
|
|
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,u=1;t||(t=[]);const c={assistantId:this.settings.assistantId,question:e,context:i,system:s,functs:t,temperature:r,topP:a,num:u,model:this.settings.model,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers};const o=await fetch(this.settings.assistantStreamUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)});if(!o.ok)return console.error("Error:",o.statusText),!1;const h=o.body.getReader(),
|
|
535
|
-
`);
|
|
536
|
-
`}}else{const C=JSON.parse(k);this.tokenInput+=C.prompt_tokens,this.tokenOutput+=C.completion_tokens;break}}return!0}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}hexToRgb(e){const i=e.replace("#",""),s=parseInt(i,16),t=s>>16&255,n=s>>8&255,r=s&255;return{red:t,green:n,blue:r}}getId(e="id"){return`${e}-${Math.random().toString(36).substr(2,9)}`}appendHtml(e,i){e&&i&&e.insertAdjacentHTML("beforeend",i)}cleanup(){if(this.element){let e=this.element.querySelectorAll('input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], textarea');e.forEach(i=>{i.removeEventListener("input",this.inputListener)}),e=this.element.querySelectorAll('input[type="date"], input[type="radio"], input[type="checkbox"]'),e.forEach(i=>{i.removeEventListener("change",this.changeListener)}),this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null)}}destroy(){try{if(this._scrollListener){let e;this.settings.isBuilder?e=document.querySelector(this.settings.previewSelector):e=this.element;const i=e.querySelector(".submit-container"),s=this.getScrollableParent(i);s?s.removeEventListener("scroll",this._scrollListener):window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("resize",this._scrollListener)}}catch{}this.element&&(this.cleanup(),this.element.innerHTML="",this.element=null);for(const e in this.listeners)this.listeners[e].clear();this.listeners={}}out(e){let i=this.settings.lang[e];return i||e}}class Sn{addClass(e,i){e&&(this.hasClass(e,i)||(e.classList.length===0?e.className=i:e.className=e.className+" "+i,e.className=e.className.replace(/ +/g," ")))}removeClass(e,i){if(e&&e.classList.length>0){let s,t,n,r,a=i.split(" ");for(s=0,n=a.length;s<n;++s){if(!a[s])continue;let u=a[s],c="",d=e.className.split(" ");for(t=0,r=d.length;t<r;++t)d[t]&&d[t]!==u&&(c+=d[t]+" ");e.className=c.trim()}e.className===""&&e.removeAttribute("class")}}hasClass(e,i){if(!e)return!1;try{let s=e.getAttribute("class");return new RegExp("\\b"+i+"\\b").test(s)}catch{}}}const oe=new Sn;class Tn{constructor(e={}){const i={};this.settings=Object.assign(this,i,e)}init(){const e=h=>{const f=h.parentNode,v=h.nextElementSibling;if(oe.hasClass(v,"is-menu-links")){let R=v.querySelectorAll("li");R.forEach(y=>{if(y!==f){const E=y.querySelector("ul");oe.removeClass(E,"active")}}),R=document.querySelectorAll(".is-menu > ul > li ul"),R.forEach(y=>{const E=y.querySelector("ul");oe.removeClass(E,"active")})}oe.hasClass(v,"active")&&!oe.hasClass(v,"is-menu-links")&&v.querySelectorAll("li").forEach(y=>{if(y!==f){const E=y.querySelector("ul");oe.removeClass(E,"active")}});const S=f.querySelector("ul");S&&oe.addClass(S,"active")},i=h=>{if(h.nextElementSibling){const f=h.nextElementSibling;if(f)if(oe.hasClass(f,"active"))oe.removeClass(f,"active"),h.focus();else{const S=h.parentNode.parentNode;oe.removeClass(S,"active"),S.previousElementSibling.focus()}else{const S=h.parentNode.parentNode;oe.removeClass(S,"active"),S.previousElementSibling.focus()}}else{const v=h.parentNode.parentNode;oe.removeClass(v,"active"),v.previousElementSibling.focus()}},s=h=>{const f=h.target;if(h.keyCode===27)i(h.target);else if(h.keyCode===13)h.target.nextElementSibling&&(h.target.getAttribute("href")===""||h.target.getAttribute("href")==="javascript:")&&(e(h.target),h.preventDefault());else if(h.keyCode===32)h.target.nextElementSibling&&(e(h.target),h.preventDefault());else if(h.keyCode===40)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(h.keyCode===38)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.classList.remove("active");else{const v=f.parentNode.previousElementSibling;v&&v.querySelector("a").focus()}else if(f.parentNode.previousElementSibling)f.parentNode.previousElementSibling.querySelector("a").focus();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&S.classList.remove("active"),S.previousElementSibling.focus()}else if(h.which===9&&!h.shiftKey)if(f.nextElementSibling)if(f.nextElementSibling.classList.contains("active"))f.nextElementSibling.querySelector("a").focus(),h.preventDefault();else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(f.parentNode.nextElementSibling)f.parentNode.nextElementSibling.querySelector("a").focus(),h.preventDefault();else{const S=f.parentNode.parentNode;S.classList.contains("active")&&(S.classList.remove("active"),S.previousElementSibling.focus(),h.preventDefault())}else if(h.which===9&&h.shiftKey){if(f.nextElementSibling)f.nextElementSibling.classList.contains("active")&&f.nextElementSibling.classList.remove("active");else if(!f.parentNode.previousElementSibling){const S=f.parentNode.parentNode;S.classList.contains("active")&&S.classList.remove("active")}}};document.querySelectorAll(".is-menu li a").forEach(h=>{h.addEventListener("keydown",s)}),document.querySelectorAll(".is-menu li").forEach(h=>{const f=h.querySelector("span");f&&f.addEventListener("click",v=>{if(window.innerWidth>=1024)return;const y=v.target.closest("li").querySelector("ul");y&&(oe.hasClass(y,"active")?(oe.removeClass(y,"active"),y.style.display=""):oe.addClass(y,"active")),v.preventDefault(),v.stopImmediatePropagation()}),h.addEventListener("click",v=>{const S=h.querySelector("ul"),R=window.innerWidth;let y=v.target.tagName.toLowerCase();if(R>1024){if((y==="a"||y==="i")&&!v.target.getAttribute("href")){v.preventDefault(),v.stopImmediatePropagation();return}}else{let E=!0;if((y==="a"||y==="i")&&(v.target.getAttribute("href")||(v.preventDefault(),E=!1)),E){const b=document.querySelector(".is-menu");if(b.style.right==="0px"){oe.removeClass(r,"active"),b.style.right="-1000px";const k=document.querySelector(".is-menu-overlay");oe.removeClass(k,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}}}S&&(oe.hasClass(S,"active")?(oe.removeClass(S,"active"),S.style.display=""):(oe.addClass(S,"active"),setTimeout(()=>{},0)))}),h.addEventListener("mouseleave",v=>{window.innerWidth<=1024||(this.timer=setTimeout(()=>{const R=h.querySelector("ul");R&&oe.removeClass(R,"active")},200),v.preventDefault(),v.stopImmediatePropagation())}),h.addEventListener("mouseenter",v=>{const S=window.innerWidth;if(S<=1024||this.staticClose)return;const R=document.querySelector(".is-menu-search-input");if(oe.hasClass(R,"active"))return;clearTimeout(this.timer);const y=h.closest("ul");if(!h.querySelector("ul"))return y.querySelectorAll("li").forEach(k=>{const C=k.querySelector("ul");oe.removeClass(C,"active")}),!0;if(oe.hasClass(y,"is-menu-links")){let b=y.querySelectorAll("li");b.forEach(k=>{if(k!==h){const C=k.querySelector("ul");oe.removeClass(C,"active")}}),b=document.querySelectorAll(".is-menu > ul > li ul"),b.forEach(k=>{const C=k.querySelector("ul");oe.removeClass(C,"active")})}oe.hasClass(y,"active")&&!oe.hasClass(y,"is-menu-links")&&y.querySelectorAll("li").forEach(k=>{if(k!==h){const C=k.querySelector("ul");oe.removeClass(C,"active")}});const E=h.querySelector("ul");if(E&&oe.addClass(E,"active"),E.style.right="",E.classList.contains("active")){const b=E.getBoundingClientRect();b.left+b.width>S&&(E.style.right=0)}v.preventDefault(),v.stopImmediatePropagation()})});const r=document.querySelector("#is-menu-toggle");r.addEventListener("click",h=>{const f=document.querySelector(".is-menu");if(f.style.right==="0px"){oe.removeClass(r,"active"),f.style.right="-1000px";const v=document.querySelector(".is-menu-overlay");oe.removeClass(v,"active"),document.querySelector(".is-topbar-menu").style.paddingRight="0px",document.body.style.overflowY="auto"}else{oe.addClass(r,"active"),document.querySelector(".is-menu-links .is-menu-search")?(document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""):(document.querySelector(".is-menu-search-input").style.display="none",document.querySelector(".is-menu-links").style.marginTop="70px"),f.style.right="0px";const S=document.querySelector(".is-menu-overlay");oe.addClass(S,"active"),document.querySelector(".is-topbar-menu").style.paddingRight=this.getScrollbarWidth()+"px",document.body.style.overflowY="hidden"}h.stopImmediatePropagation(),h.preventDefault()}),document.querySelector(".is-menu-overlay").addEventListener("click",h=>{document.querySelector("#is-menu-toggle").click(),h.stopImmediatePropagation(),h.preventDefault()}),window.addEventListener("resize",()=>{document.body.style.overflowY="auto",document.querySelector(".is-topbar-menu").style.paddingRight="0px";const h=document.querySelector("#is-menu-toggle");oe.removeClass(h,"active"),document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")});const v=document.querySelector(".is-menu");if(v.style.transition="none",window.innerWidth>1024){v.style.right="0px",document.querySelectorAll(".is-menu li ul").forEach(E=>{E.style.display=""});const y=document.querySelector(".is-menu-overlay");oe.removeClass(y,"active"),document.querySelector(".is-menu-search-input").style.display="",document.querySelector(".is-menu-links").style.marginTop=""}else v.style.right="-1000px";setTimeout(()=>{v.style.transition=""},30)}),window.addEventListener("scroll",()=>{var h=100,f=this.getCurrentScroll();f>=h?oe.addClass(document.querySelector(".is-topbar"),"shrink"):oe.removeClass(document.querySelector(".is-topbar"),"shrink"),window.innerWidth>=1024&&document.querySelector(".is-topbar.static")&&(f>30?this.staticClose||(document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")}),this.staticClose=!0):this.staticClose=!1)});const u=h=>{const f=document.querySelector(".is-menu-search-input");oe.addClass(f,"active"),f.querySelector("input").focus(),document.querySelectorAll(".is-menu li ul").forEach(R=>{oe.removeClass(R,"active")}),h.preventDefault(),h.stopImmediatePropagation()},c=document.querySelector(".is-menu-search");c&&(c.addEventListener("click",h=>{u(h)}),c.addEventListener("keydown",h=>{(h.keyCode===13||h.keyCode===32)&&u(h)})),document.addEventListener("click",h=>{const f=h.target;if(!oe.hasClass(f,"is-menu-search")&&f.getAttribute("id")!=="is_btnSearch"&&f.getAttribute("id")!=="is_txtSearch"){const v=document.querySelector(".is-menu-search-input");oe.removeClass(v,"active")}});const d=document.querySelector("#is_txtSearch");d.addEventListener("keydown",h=>{if(h.which==13&&this.settings.onSearch(d.value),h.which==27){const f=document.querySelector(".is-menu-search-input");oe.removeClass(f,"active"),document.querySelector(".is-menu-search").focus()}}),document.querySelector("#is_btnSearch").addEventListener("click",()=>{this.settings.onSearch(d.value)})}getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}getCurrentScroll(){return window.pageYOffset||document.documentElement.scrollTop}}class En{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=Ps,window.FormViewer=_n,window.NavBar=Tn,window.pageReRender=()=>{this.pageReRender()}}init(){this.prepareContent(),this.updateOnResize(),this.blockInit(),this.initeSkrollrr(),this.contentBoxOnRenderUpdate(),this.functionLightboxInit(),this.inViewSetup(),setTimeout(()=>{ji.init({duration:1200})},300),new Bi}prepareContent(){const e=document.querySelector(".is-wrapper");e.classList.add("box-v2");const i=function(r){let a=r.nextElementSibling;return a?a.classList.contains("is-section")?a:i(a):!1};document.querySelectorAll(".is-arrow-down a").forEach(function(r){r.addEventListener("click",function(a){let u=a.target.closest(".is-section");if(u){let c=i(u);c&&this.scrollIt(c,1e3,"easeInQuad")}a.preventDefault(),a.stopImmediatePropagation()})}),e&&(e.classList.contains("is-edit")||e.querySelectorAll("a").forEach(function(a){a.addEventListener("click",function(u){let c=a.getAttribute("href");if(c&&c.indexOf("#")===0)if(c.indexOf("#section")===0){let d=c.replace("#section","");if(!isNaN(parseInt(d))){let o=document.querySelectorAll(".is-section"),h,f=0;o.forEach(function(v){v.classList.contains("is-section-navbar")||(f===d-1&&(h=v),f++)}),h&&scrollIt(h,1e3,"easeInQuad"),u.preventDefault()}}else try{let d=document.querySelector(c);d&&(scrollIt(d,1e3,"easeInQuad"),u.preventDefault())}catch{}})})),document.querySelectorAll(".section-inview").forEach(function(r){r.classList.remove("section-inview")});let n=document.querySelectorAll(".is-animated,.is-scale-animated");n.forEach(function(r){r.classList.contains("once")?(r.removeAttribute("data-scroll",""),r.setAttribute("data-scroll-once","")):(r.removeAttribute("data-scroll-once",""),r.setAttribute("data-scroll",""))}),n=document.querySelectorAll(".is-container > div"),n.forEach(function(r){let a=r.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),u=0;a.length>1&&a.forEach(function(c){c.className.indexOf("delay-")===-1&&(u>0&&(c.style.transitionDelay=u+"s",c.style.animationDelay=u+"s"),u=u+.2)})}),this.skrollrSetup(),this.adjustBgPos()}updateOnResize(){function e(s){var t;return function(n){t&&clearTimeout(t),t=setTimeout(s,100,n)}}const i=document.querySelector(".is-wrapper");window.addEventListener("resize",e(s=>{document.body.classList.contains("data-editor")&&(i.querySelector(".pin-wrap")&&!window.noRender?this.pageReRender():window.skrollrr&&window.skrollrr.refresh(),window.noRender=!1,this.adjustBgPos())})),i.classList.contains("is-edit")&&(window.onbeforeunload=function(s){localStorage.setItem("_lastscrollpos",document.documentElement.scrollTop),window.scrollTo(0,0)},setTimeout(()=>{localStorage.getItem("_lastscrollpos")&&window.scrollTo(0,localStorage.getItem("_lastscrollpos"))},300))}initeSkrollrr(){var e=document.querySelectorAll(".is-overlay-bg");e.forEach(s=>{s.style&&s.style.filter&&s.style.filter.indexOf("grayscale")!==-1&&(s.parentNode.style.filter="grayscale(1)")});const i=new Pi({transition:"all 0.3s ease-out"});i.init(),window.skrollrr=i}_scrollTo(e,i=0){const s=e.getBoundingClientRect().top+window.pageYOffset+i;window.scrollTo({top:s,behavior:"smooth"})}scrollIt(e,i=200,s="linear",t){_scrollTo(e)}skrollrSetup(){document.querySelectorAll(".pin-wrap").forEach(a=>{const u=a.firstElementChild;a.after(u),a.parentNode.removeChild(a)}),document.querySelectorAll(".is-section").forEach(a=>{a.hasAttribute("data-section-clone")&&a.parentNode.removeChild(a),a.hasAttribute("data-section-original")&&(a.style.display="",a.removeAttribute("data-section-original"))});let s=window.innerWidth;s<=760&&document.querySelectorAll(".section-wrap").forEach(u=>{u.outerHTML=u.innerHTML});const t=window.self!==window.top;let n;t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.length>0&&window.scrollTo(0,0),n.forEach(function(a){s<=970&&a.querySelector(".is-box")&&(a.querySelectorAll(".is-box").forEach(c=>{const d=a.cloneNode(!1);c.getAttributeNames().map(o=>{o.indexOf("data-")!==-1&&d.setAttribute(o,c.getAttribute(o))}),d.classList.add("is-box"),c.classList.forEach(o=>{(o.indexOf("is-box-")!==-1||o.indexOf("is-content-")!==-1||o.indexOf("box-autofit")!==-1||o.indexOf("is-light-text")!==-1||o.indexOf("is-dark-text")!==-1||o.indexOf("is-align-")!==-1||o.indexOf("type-")!==-1||o.indexOf("block-click")!==-1||o.indexOf("hover-zoom")!==-1)&&d.classList.add(o)}),d.setAttribute("data-section-clone",""),d.innerHTML=c.innerHTML,a.parentNode.insertBefore(d,a)}),a.setAttribute("data-section-original",""),a.style.display="none")}),t?n=document.querySelectorAll(".is-wrapper .section-pin"):n=document.querySelectorAll(".is-wrapper:not(.is-edit) .section-pin"),n.forEach(function(a){if(a.parentNode.closest(".section-wrap")||s<=970&&a.hasAttribute("data-section-original"))return;const u=document.createElement("div");u.classList.add("pin-wrap"),a.classList.contains("m-skrollrr-off")&&u.classList.add("m-skrollrr-off"),a.classList.contains("pin-space-lg")&&u.classList.add("pin-space-lg"),a.classList.contains("pin-space-xl")&&u.classList.add("pin-space-xl"),a.classList.contains("xs-hidden")&&u.classList.add("xs-hidden"),a.classList.contains("sm-hidden")&&u.classList.add("sm-hidden"),a.classList.contains("desktop-hidden")&&u.classList.add("desktop-hidden"),a.after(u),u.appendChild(a)});const r=a=>{document.querySelectorAll(".is-section").forEach(c=>{const d=c.getBoundingClientRect().top;let o,h;c.parentNode.classList.contains("pin-wrap")?(o=c.parentNode.nextElementSibling,h=c.parentNode.previousElementSibling):(o=c.nextElementSibling,h=c.previousElementSibling),o&&o.classList.contains("pin-wrap")&&(o=o.querySelector(".is-section")),h&&h.classList.contains("pin-wrap")&&(h=h.querySelector(".is-section")),d<=0&&((c.classList.contains("no-spacing")||c.classList.contains("pin-overlap"))&&c.classList.add("section-inview"),document.querySelectorAll(".is-section").forEach(v=>{v!==c&&v.classList.remove("section-inview")}))})};setTimeout(()=>{(!document.querySelector(".is-wrapper").classList.contains("is-edit")||t)&&!window.funcScroll&&(window.addEventListener("scroll",r),window.funcScroll=!0)},300)}adjustBgPos(){const e=n=>{const r=document.createElement("div");r.style.backgroundPositionX=n.style.backgroundPositionX,r.style.backgroundPositionY=n.style.backgroundPositionY,r.style.backgroundSize=n.style.backgroundSize,n.hasAttribute("data-bg-ori")||n.setAttribute("data-bg-ori",r.style.cssText)},i=n=>{if(n.hasAttribute("data-bg-ori")){const r=document.createElement("div");r.style.cssText=n.getAttribute("data-bg-ori"),n.style.backgroundPositionX=r.style.backgroundPositionX,n.style.backgroundPositionY=r.style.backgroundPositionY,n.style.backgroundSize=r.style.backgroundSize,n.removeAttribute("data-bg-ori")}};let s=window.innerWidth;document.querySelectorAll("[data-bg-xs],[data-bg-sm],[data-bg-md],[data-bg-lg]").forEach(n=>{e(n),s<=760&&(n.hasAttribute("data-bg-xs")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-xs"):i(n)),s>760&&s<=970&&(n.hasAttribute("data-bg-sm")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-sm"):i(n)),s>970&&s<=1280&&(n.hasAttribute("data-bg-md")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-md"):i(n)),s>1280&&(n.hasAttribute("data-bg-lg")?n.style.cssText=n.style.cssText+";"+n.getAttribute("data-bg-lg"):i(n))})}inViewSetup(){document.querySelectorAll(".is-overlay-content").forEach(t=>{t.querySelector("video.is-video-bg")&&t.setAttribute("data-scroll","")}),document.querySelectorAll(".is-container video").forEach(t=>{t.parentNode.setAttribute("data-scroll","")});const s=new $i({trigger:{once:!0,offset:{element:{x:0,y:(t,n,r)=>.1},viewport:{x:0,y:(t,n,r)=>t.visible?0:.1}},toggle:{class:{in:"is-inview",out:[""]},callback:{in:t=>{t.element.querySelectorAll("video").forEach(r=>{if(r.innerHTML.trim()==="")return;let a=r.parentNode.querySelector(".video-bg-play");r.autoplay?a?a.innerHTML.indexOf("play")===-1&&r.play():r.play():a&&a.innerHTML.indexOf("play")===-1&&r.play()})},out:t=>{t.element.querySelectorAll("video").forEach(r=>{!r.paused&&!r.closest("[data-html]")&&r.pause()})}}}}});s.add("[data-scroll-once]"),s.add("[data-scroll]",{once:!1}),window.trigger=s}contentBoxOnRenderUpdate(){try{if(window.contentbox||parent.contentbox){let e;window.contentbox?e=window.contentbox.onRender:parent.contentbox&&(e=parent.contentbox.onRender);const i=()=>{e.call(this);try{window.trigger&&window.trigger.kill()}catch{}let s=document.querySelectorAll(".is-animated,.is-scale-animated");s.forEach(function(t){t.classList.contains("once")?(t.removeAttribute("data-scroll",""),t.setAttribute("data-scroll-once","")):(t.removeAttribute("data-scroll-once",""),t.setAttribute("data-scroll",""))}),s=document.querySelectorAll(".is-container > div"),s.forEach(function(t){let n=t.querySelectorAll(".is-animated[data-scroll],.is-animated[data-scroll-once]"),r=0;n.length>1&&n.forEach(function(a){a.className.indexOf("delay-")===-1&&(r>0&&(a.style.transitionDelay=r+"s",a.style.animationDelay=r+"s"),r=r+.2)})}),setTimeout(()=>{this.inViewSetup()},100)};window.contentbox?window.contentbox.onRender=i:parent.contentbox&&(parent.contentbox.onRender=i)}}catch{}}functionLightboxInit(){const e={touchNavigation:!0,selector:".glightbox",loop:!0,autoplayVideos:!0,zoomable:!0,slideEffect:"slide",descPosition:"bottom",skin:this.settings.skin};this.refreshLightbox(e),document.querySelectorAll(".is-lightbox,.block-click").forEach(s=>{const t=n=>{let r=s.getAttribute("href")||s.getAttribute("data-modal-url");this.openLightbox(r,s,e),n.preventDefault(),n.stopImmediatePropagation()};s.addEventListener("click",t),s._lightboxHandler=t})}refreshLightbox(e){this.glightbox&&this.glightbox.destroy(),this.glightbox=si(e),window.GLightbox=si}openLightbox(e,i,s){let t=[],n=0;if(i){const r=i.closest("[data-gallery]");let a=[];r?a=r.querySelectorAll(".is-lightbox"):document.querySelectorAll(".is-lightbox,.block-click").forEach(c=>{c.closest("[data-gallery]")||a.push(c)}),a.forEach((u,c)=>{let d=u.getAttribute("href");d||(d=u.getAttribute("data-modal-url")),t.push({href:d}),e===d&&(n=c)})}t.length>0?(this.glightbox.setElements(t),this.glightbox.openAt(n)):(this.glightbox.setElements([{href:e}]),this.glightbox.open()),this.glightbox.on("close",()=>{this.refreshLightbox(s)})}blockInit(){const e={start:()=>{document.querySelectorAll(".is-block").forEach(t=>{t.hasAttribute("data--t")||t.setAttribute("data--t",t.style.top),t.hasAttribute("data--l")||t.setAttribute("data--l",t.style.left),t.hasAttribute("data--b")||t.setAttribute("data--b",t.style.bottom),t.hasAttribute("data--r")||t.setAttribute("data--r",t.style.right),t.hasAttribute("data--w")||t.setAttribute("data--w",t.style.width),t.hasAttribute("data--h")||t.setAttribute("data--h",t.style.height),t.removeAttribute("data-prev"),t.removeAttribute("data-fluid"),t.removeAttribute("data-fluid-val"),t.classList.remove("fluid"),t.style.transition=""})},apply:(t,n,r)=>{if(n&&t.getAttribute("data-prev")!==n+""){if(r||(t.style.transition="all 0.35s ease"),n!==1e4){if(t.setAttribute("data-breakpoint",n),t.hasAttribute("data--t-"+n)){let a=t.getAttribute("data--t-"+n);t.style.top=a}if(t.hasAttribute("data--l-"+n)){let a=t.getAttribute("data--l-"+n);t.style.left=a}if(t.hasAttribute("data--b-"+n)){let a=t.getAttribute("data--b-"+n);t.style.bottom=a}if(t.hasAttribute("data--r-"+n)){let a=t.getAttribute("data--r-"+n);t.style.right=a}if(t.hasAttribute("data--w-"+n)){let a=t.getAttribute("data--w-"+n);t.style.width=a}if(t.hasAttribute("data--h-"+n)){let a=t.getAttribute("data--h-"+n);t.style.height=a}if(t.hasAttribute("data--transform-"+n)){let a=t.getAttribute("data--transform-"+n);t.style.transform=a,t.setAttribute("data--transform-val",n)}}else{if(t.removeAttribute("data-breakpoint"),t.hasAttribute("data--t")){let a=t.getAttribute("data--t");t.style.top=a}if(t.hasAttribute("data--l")){let a=t.getAttribute("data--l");t.style.left=a}if(t.hasAttribute("data--b")){let a=t.getAttribute("data--b");t.style.bottom=a}if(t.hasAttribute("data--r")){let a=t.getAttribute("data--r");t.style.right=a}if(t.hasAttribute("data--w")){let a=t.getAttribute("data--w");t.style.width=a}if(t.hasAttribute("data--h")){let a=t.getAttribute("data--h");t.style.height=a}if(t.hasAttribute("data--transform")){let a=t.getAttribute("data--transform");t.style.transform=a,t.setAttribute("data--transform-val","")}}t.setAttribute("data-prev",n),setTimeout(()=>{r||(t.style.transition="")},400)}},applyFluid:(t,n)=>{t.classList.toggle("fluid",n==="yes"),t.setAttribute("data-fluid",n)},resize:t=>{const n=window.innerWidth;document.querySelectorAll(".is-box").forEach(r=>{let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){let o=u[c].name.match(/^data--h-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0){if(n>d){let o=r.getAttribute("data--h");o?r.style.height=o:r.style.height=""}}else{const o=a[c-1];if(o>=n&&n>d){let h=r.getAttribute("data--h-"+o);h&&(r.style.height=h)}}}if(a.length>0&&a[a.length-1]>=n){const d=a[a.length-1];let o=r.getAttribute("data--h-"+d);o&&(r.style.height=o)}}),document.querySelectorAll(".is-block").forEach(r=>{if(!r.classList.contains("locked")){r.offsetWidth+0>n&&!r.classList.contains("fluid")&&(r.setAttribute("data-fluid-val",r.offsetWidth),e.applyFluid(r,"yes"));let c=r.getAttribute("data-fluid-val");c&&parseInt(c)+0<=n&&r.classList.contains("fluid")&&e.applyFluid(r,"no")}let a=[];const u=r.attributes;for(let c=0;c<u.length;c++){const d=u[c].name;let o=d.match(/^data--t-(\d+)$/);if(o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--w-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}if(o=d.match(/^data--transform-(\d+)$/),o){const h=parseInt(o[1],10);a.push(h)}}a=[...new Set(a)],a.sort((c,d)=>d-c);for(let c=0;c<a.length;c++){const d=a[c];if(c===0)n>d&&e.apply(r,1e4,t);else{const o=a[c-1];o>=n&&n>d&&e.apply(r,o,t)}}if(a.length>0){const c=a[a.length-1];c>=n&&e.apply(r,c,t)}})},render:()=>{e.start(),e.resize(!0)}},s=((t,n)=>{let r;return(...a)=>{clearTimeout(r),r=setTimeout(()=>t(...a),n)}})(()=>{e.resize()},0);window.addEventListener("resize",s),e.start(),e.resize(!0),this.Block=e}pageReRender(){this.prepareContent(),this.contentBoxOnRenderUpdate(),window.skrollrr?window.skrollrr.refresh():this.initeSkrollrr(),this.functionLightboxInit(),this.inViewSetup(),this.Block.start(),this.Block.resize()}destroy(){this.glightbox&&(this.glightbox.destroy(),this.glightbox=null),document.querySelectorAll(".is-lightbox,.block-click").forEach(i=>{i._lightboxHandler&&(i.removeEventListener("click",i._lightboxHandler),delete i._lightboxHandler)})}}return En})();
|
|
529
|
+
${$.data}
|
|
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 g;return h.answer.choices.forEach(y=>{g=y.message.content}),g}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,u=.9,c=1;n||(n=[]),t=t||this.settings.model;const d={question:e,context:i,system:s,functs:n,temperature:a,topP:u,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 g=h.body.getReader(),y=new TextDecoder;let E="",M=!1;for(;!M;){const{done:w,value:C}=await g.read();if(M=w,M)break;const b=y.decode(C,{stream:!0});E+=b;const _=E.split(`
|
|
532
|
+
`);E="";let O=0,m=0;for(const k of _)if(k.trim()!==""&&k.startsWith("data:")){const R=k.slice(5).trim();if(R==="[DONE]"){this.settings.consoleLog&&console.log("Stream completed.");break}try{const V=JSON.parse(R);if(V.usage&&(O=V.usage.prompt_tokens,m=V.usage.completion_tokens),V.choices&&V.choices[0].delta&&V.choices[0].delta.content){const N=V.choices[0].delta.content;r&&r(N)}}catch{E+=k+`
|
|
533
|
+
`}}this.tokenInput+=O,this.tokenOutput+=m}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 u=this.settings.model;t.length>0&&(u=this.settings.model2);const c={assistantId:this.settings.assistantId,question:e,context:i,system:s,functs:t,temperature:n,topP:r,num:a,model:u,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,u=1;t||(t=[]);const c={assistantId:this.settings.assistantId,question:e,context:i,system:s,functs:t,temperature:r,topP:a,num:u,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(),g=new TextDecoder;let y="",E=!1;for(;!E;){const{done:M,value:w}=await h.read();if(E=M,E)break;const C=g.decode(w,{stream:!0});y+=C;const b=y.split(`
|
|
535
|
+
`);y="";for(const _ of b)if(_.trim()!=="")if(_.startsWith("data:")){const O=_.slice(5).trim();O==="[DONE]"&&this.settings.consoleLog&&console.log("Stream completed.");try{const m=JSON.parse(O);if(m.choices&&m.choices[0].delta&&m.choices[0].delta.content){const k=m.choices[0].delta.content;n&&n(k)}}catch{y+=_+`
|
|
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})();
|