@innovastudio/contentbox-runtime 1.0.0 → 1.0.2
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.css +1 -1
- package/dist/contentbox-runtime.esm.js +984 -920
- package/dist/contentbox-runtime.min.js +49 -49
- package/package.json +1 -1
|
@@ -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:{}},Ri=ht.exports,Kt;function qi(){return Kt||(Kt=1,(function(m,e){(function(i,s){m.exports=s()})(Ri,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,q=Math.min,y=function(){return f.Date.now()};function T(A,j,U){var F,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 qe=F,De=Z;return F=Z=void 0,le=ce,te=A.apply(De,qe)}function $e(ce){var qe=ce-me;return me===void 0||qe>=j||qe<0||pe&&ce-le>=ee}function Ne(){var ce=y();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(qe){var De=j-(qe-me);return pe?q(De,ee-(qe-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&F?Le(ce):(F=Z=void 0,te)}function ke(){var ce=y(),qe=$e(ce);if(F=arguments,Z=this,me=ce,qe){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,F=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(F){return typeof F=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(F)&&v.call(F)==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 F=!0,Z=!0;if(typeof A!="function")throw new TypeError(s);return b(U)&&(F="leading"in U?!!U.leading:F,Z="trailing"in U?!!U.trailing:Z),T(A,j,{leading:F,maxWait:j,trailing:Z})},g="Expected a function",w=NaN,R="[object Symbol]",V=/^\s+|\s+$/g,I=/^[-+]0x[0-9a-f]+$/i,Y=/^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 ne(A){if(typeof A=="number")return A;if((function(F){return typeof F=="symbol"||(function(Z){return!!Z&&typeof Z=="object"})(F)&&P.call(F)==R})(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=Y.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 F,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 qe=F,De=Z;return F=Z=void 0,le=ce,te=A.apply(De,qe)}function $e(ce){var qe=ce-me;return me===void 0||qe>=j||qe<0||pe&&ce-le>=ee}function Ne(){var ce=J();if($e(ce))return Pe(ce);K=setTimeout(Ne,(function(qe){var De=j-(qe-me);return pe?N(De,ee-(qe-le)):De})(ce))}function Pe(ce){return K=void 0,xe&&F?Le(ce):(F=Z=void 0,te)}function ke(){var ce=J(),qe=$e(ce);if(F=arguments,Z=this,me=ce,qe){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=ne(j)||0,Q(U)&&(Ce=!!U.leading,ee=(pe="maxWait"in U)?W(ne(U.maxWait)||0,j):ee,xe="trailing"in U?!!U.trailing:xe),ke.cancel=function(){K!==void 0&&clearTimeout(K),le=0,F=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),F=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(F)))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,F=new(ue())(de);ae=j,F.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 F=0;F<U.length;F++){var Z=U[F];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(j,Z.key,Z)}}return function(j,U,F){return U&&A(j.prototype,U),F&&A(j,F),j}})(),Re=Object.assign||function(A){for(var j=1;j<arguments.length;j++){var U=arguments[j];for(var F in U)Object.prototype.hasOwnProperty.call(U,F)&&(A[F]=U[F])}return A},Te=/(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!(!Te.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(F,Z){var ee=F.options,te=F.position,K=F.node,me=(F.data,function(){F.animated&&((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.remove(pe)})})(K,ee.animatedClassNames),Oe("aos:out",K),F.options.id&&Oe("aos:in:"+F.options.id,K),F.animated=!1)});ee.mirror&&Z>=te.out&&!ee.once?me():Z>=te.in?F.animated||((function(le,Ce){Ce&&Ce.forEach(function(pe){return le.classList.add(pe)})})(K,ee.animatedClassNames),Oe("aos:in",K),F.options.id&&Oe("aos:in:"+F.options.id,K),F.animated=!0):F.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 F=A.getAttribute("data-aos-"+j);if(F!==void 0){if(F==="true")return!0;if(F==="false")return!1}return F||U},se=function(A,j){return A.forEach(function(U,F){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},E=function(){return document.all&&!window.atob},O=function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(p=!0),p&&(l=se(l,x),ye(l),window.addEventListener("scroll",C(function(){ye(l,x.once)},x.throttleDelay)))},D=function(){if(l=Me(),$(x.disable)||E())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=Re(x,A),l=Me(),x.disableMutationObserver||Se.isSupported()||(console.info(`
|
|
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(`
|
|
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||Se.ready("[data-aos]",D),$(x.disable)||
|
|
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,q=c[Symbol.iterator]();!(h=(S=q.next()).done)&&(o.push(S.value),!d||o.length!==d);h=!0);}catch(y){f=!0,v=y}finally{try{h||q.return==null||q.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,q={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,R=2.75;return g<1/R?w*g*g:g<2/R?w*(g-=1.5/R)*g+.75:g<2.5/R?w*(g-=2.25/R)*g+.9375:w*(g-=2.625/R)*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",q),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(R){return R.calculateTransforms()}))}),i(this,"onAnimationFrame",function(R){w.debug&&(w.debugData.frameStart=Date.now());var V,I={};w.drivers.forEach(function(Y){I[Y.name]=Y.getValue(w.frame)}),w.elements.forEach(function(Y){Y.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(Y,G){return Y+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(R,V){var I=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};w.drivers.push(new k(R,V,I))}),i(this,"removeDriver",function(R){w.drivers=w.drivers.filter(function(V){return V.name!==R})}),i(this,"findAndAddElements",function(){w.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 I=i({},"scrollY",{presets:V});w.elements.push(new C(".lax",w,R,I,0,{}))})}),i(this,"addElements",function(R,V,I){document.querySelectorAll(R).forEach(function(Y,G){w.elements.push(new C(R,w,Y,V,G,I))})}),i(this,"removeElements",function(R){w.elements=w.elements.filter(function(V){return V.selector!==R})}),i(this,"addElement",function(R,V,I){w.elements.push(new C("",w,R,V,0,I))}),i(this,"removeElement",function(R){w.elements=w.elements.filter(function(V){return V.domElement!==R})})});function T(g,w){if(Array.isArray(g))return g;for(var R=Object.keys(g).map(function(G){return parseInt(G)}).sort(function(G,B){return B<G?1:-1}),V=R[R.length-1],I=0;I<R.length;I++){var Y=R[I];if(w<Y){V=Y;break}}return g[V]}function b(g,N,R){var V=N.width,I=N.height,L=N.x,W=N.y;if(typeof g=="number")return g;var Y,G=document.body.scrollHeight,B=document.body.scrollWidth,M=window.innerWidth,_=window.innerHeight,P=s((Y=window.pageXOffset!==void 0,P=(document.compatMode||"")==="CSS1Compat",N=Y?window.pageXOffset:(P?document.documentElement:document.body).scrollLeft,[Y?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,R)))()}function k(g,w){var R=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 Y=R.lastValue;return I%R.frameStep==0&&(Y=R.getValueFn(I)),R.inertiaEnabled&&(I=Y-R.lastValue,R.m1=.8*R.m1+I*.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=g,this.getValueFn=w,Object.keys(V).forEach(function(I){R[I]=V[I]}),this.lastValue=this.getValueFn(0)}function C(g,w,R,V){var I=this,Y=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),ne=Q[0],re=Q[1];for(J in N){var ae,Ae=s(N[J],3),de=Ae[0],ue=Ae[1],Re=Ae[2],be=Re===void 0?{}:Re,Se=be.modValue,Te=be.frameStep,Ie=Te===void 0?1:Te,X=be.easing,Ae=be.inertia,Re=be.inertiaMode,Te=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(se){se<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?ne%Se:ne,X),Ae&&(ae=re*Ae,Re==="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]=Te?Te(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 ne,ue=s(de.split(":"),3),re=ue[0],ae=ue[1],de=ue[2],ue=window.lax.presets[re];ue?(ne=ue(ae,de),Object.keys(ne).forEach(function(Se){P[Se]=ne[Se]})):console.error("Lax preset cannot be found with name: ",re)}),delete P.presets;for(var J in P)(function(Q){var ne=s(P[Q],3),de=ne[0],ae=de===void 0?[-1e9,1e9]:de,de=ne[1],de=de===void 0?[-1e9,1e9]:de,ne=ne[2],ne=ne===void 0?{}:ne,re=I.domElement.getBoundingClientRect(),ae=T(ae,_).map(function(ue){return b(ue,re,I.groupIndex)}),de=T(de,_).map(function(ue){return b(ue,re,I.groupIndex)});W[Q]=[ae,de,ne]})(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=R,this.transformsData=V,this.groupIndex=Y;var G=(Y=B.style)===void 0?{}:Y,B=B.onUpdate;Object.keys(G).forEach(function(M){R.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"),q=this.getObjVal(t,"data--150-bottom"),y=this.getObjVal(t,"data--100-bottom"),T=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"),R=this.getObjVal(t,"data-300-bottom"),V=this.getObjVal(t,"data-400-bottom"),I=this.getObjVal(t,"data-bottom-top"),Y=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 ne=!1;t.hasAttribute("data-md")&&(ne=!0),t.hasAttribute("data-lg"),t.hasAttribute("data-xl");let re={},ae={},de={},ue={},Se={},Ie={},Ae={},Re={},Te={},be={},X={},ie={},ge={},ve={},Oe={},ye={},fe={},he={},se={},Me={},l={},p={},x={},E={},O={},D={},H={},$={},A={},j={},U={},F={},Z={};(i>1280||i>970&&i<=1280&&!ne||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"),Re=this.getObjVal(t,"data-t-500"),Te=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"),se=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"),E=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&&ne&&(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")&&(Re=this.getObjVal(t,"data-md-t-500")),t.hasAttribute("data-md-t-600")&&(Te=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")&&(se=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")&&(E=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")&&(Re=this.getObjVal(t,"data-sm-t-500")),t.hasAttribute("data-sm-t-600")&&(Te=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")&&(se=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")&&(E=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")&&(Re=this.getObjVal(t,"data-xs-t-500")),t.hasAttribute("data-xs-t-600")&&(Te=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")&&(se=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")&&(E=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=Re,pe=Te,xe=be,Le=X,$e=ie,Ne=ge,Pe=ve,ke=Oe,ce=ye,qe=fe,De=he,Ge=se,nt=Me,_e=l,He=p,Ue=x,Xe=E,st=O,rt=D,at=H,Ot=$,At=A,Rt=j,qt=U,Ke=window.innerHeight;Ke<730?(re=ee,ae=te,de=K,ue=me,Se=le,Ie=Ce,Ae=pe,Re=xe,Te=Le,be=$e,X=Ne,ie=Pe,ge=ke,ve=ce,Oe=qe,ye=De,fe=Ge,he=nt,se=_e,Me=He,l=Ue,p=Xe,x=st,E=rt,O=at,D=Ot,H=At,$=Rt,A=qt,j={},U={}):Ke>=730&&Ke<790?(ae=ee,de=te,ue=K,Se=me,Ie=le,Ae=Ce,Re=pe,Te=xe,be=Le,X=$e,ie=Ne,ge=Pe,ve=ke,Oe=ce,ye=qe,fe=De,he=Ge,se=nt,Me=_e,l=He,p=Ue,x=Xe,E=st,O=rt,D=at,H=Ot,$=At,A=Rt,j=qt,U={}):Ke>=790&&Ke<840||(Ke>=840&&Ke<1125?(de={},ue=ee,Se=te,Ie=K,Ae=me,Re=le,Te=Ce,be=pe,X=xe,ie=Le,ge=$e,ve=Ne,Oe=Pe,ye=ke,fe=ce,he=qe,se=De,Me=Ge,l=nt,p=_e,x=He,E=Ue,O=Xe,D=st,H=rt,$=at,A=Ot,j=At,U=Rt,F=qt):(de={},ue={},Se=ee,Ie=te,Ae=K,Re=me,Te=le,be=Ce,X=pe,ie=xe,ge=Le,ve=$e,Oe=Ne,ye=Pe,fe=ke,he=ce,se=qe,Me=De,l=Ge,p=nt,x=_e,E=He,O=Ue,D=Xe,H=st,$=rt,A=at,j=Ot,U=At,F=Rt,Z=qt));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(R).length!==0&&(z=this.parseObj(R,"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(T).length!==0&&(z=this.parseObj(T,"elInY+400",z)),Object.keys(y).length!==0&&(z=this.parseObj(y,"elInY+450",z)),Object.keys(q).length!==0&&(z=this.parseObj(q,"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(Y).length!==0&&(z=this.parseObj(Y,"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(Re).length!==0&&(z=this.parseObj(Re,"elInY+500 ",z)),Object.keys(Te).length!==0&&(z=this.parseObj(Te,"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(se).length!==0&&(z=this.parseObj(se,"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(E).length!==0&&(z=this.parseObj(E,"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(F).length!==0&&(z=this.parseObj(F,"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||Se.ready("[data-aos]",D),$(x.disable)||T()?H():(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(){O(!0)}):window.addEventListener("load",function(){O(!0)}),x.startEvent==="DOMContentLoaded"&&["complete","interactive"].indexOf(document.readyState)>-1&&O(!0),window.addEventListener("resize",re(O,x.debounceDelay,!0)),window.addEventListener("orientationchange",re(O,x.debounceDelay,!0)),l)},refresh:O,refreshHard:D}})})(ht)),ht.exports}var Mi=Ri();const ji=dt(Mi);var Mt={exports:{}},ei;function Ii(){return ei||(ei=1,(function(m){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,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){/*!
|
|
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(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function c(B,M){for(var _=0;_<M.length;_++){var L=M[_];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(B,L.key,L)}}function d(B,M,_){return M&&c(B.prototype,M),B}function o(B){return Number(B)===B&&B%1===0}function h(B){return Number(B)===B&&B%1!==0}var f=(function(){function B(M,_){u(this,B),this.element=M,_=a()(new n().trigger,_),this.offset=_.offset,this.toggle=_.toggle,this.once=_.once,this.visible=null,this.active=!0}return d(B,[{key:"checkVisibility",value:function(_,L){if(!this.active)return this.visible;var P=_.offsetWidth||_.innerWidth||0,W=_.offsetHeight||_.innerHeight||0,N={w:P,h:W},J=this.getBounds(),Q=this._checkVisibility(J,N,L);if(Q!==this.visible){this.visible=Q;var
|
|
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(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function c(B,M){for(var _=0;_<M.length;_++){var L=M[_];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(B,L.key,L)}}function d(B,M,_){return M&&c(B.prototype,M),B}function o(B){return Number(B)===B&&B%1===0}function h(B){return Number(B)===B&&B%1!==0}var f=(function(){function B(M,_){u(this,B),this.element=M,_=a()(new n().trigger,_),this.offset=_.offset,this.toggle=_.toggle,this.once=_.once,this.visible=null,this.active=!0}return d(B,[{key:"checkVisibility",value:function(_,L){if(!this.active)return this.visible;var P=_.offsetWidth||_.innerWidth||0,W=_.offsetHeight||_.innerHeight||0,N={w:P,h:W},J=this.getBounds(),Q=this._checkVisibility(J,N,L);if(Q!==this.visible){this.visible=Q;var se=this._toggleCallback();se instanceof Promise?se.then(this._toggleClass.bind(this)).catch(function(re){console.error("Trigger promise failed"),console.error(re)}):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(_,L){var P={x:0,y:0};return typeof this.offset.element.x=="function"?P.x=_.width*this.offset.element.x(this,_,L):h(this.offset.element.x)?P.x=_.width*this.offset.element.x:o(this.offset.element.x)&&(P.x=this.offset.element.x),typeof this.offset.element.y=="function"?P.y=_.height*this.offset.element.y(this,_,L):h(this.offset.element.y)?P.y=_.height*this.offset.element.y:o(this.offset.element.y)&&(P.y=this.offset.element.y),P}},{key:"_getViewportOffset",value:function(_,L){var P={x:0,y:0};return typeof this.offset.viewport.x=="function"?P.x=_.w*this.offset.viewport.x(this,_,L):h(this.offset.viewport.x)?P.x=_.w*this.offset.viewport.x:o(this.offset.viewport.x)&&(P.x=this.offset.viewport.x),typeof this.offset.viewport.y=="function"?P.y=_.h*this.offset.viewport.y(this,_,L):h(this.offset.viewport.y)?P.y=_.h*this.offset.viewport.y:o(this.offset.viewport.y)&&(P.y=this.offset.viewport.y),P}},{key:"_checkVisibility",value:function(_,L,P){var W=this._getElementOffset(_,P),N=this._getViewportOffset(L,P),J=!0;return _.left-N.x<-(_.width-W.x)&&(J=!1),_.left+N.x>L.w-W.x&&(J=!1),_.top-N.y<-(_.height-W.y)&&(J=!1),_.top+N.y>L.h-W.y&&(J=!1),J}},{key:"_toggleClass",value:function(){var _=this;if(this.visible){Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(L){_.element.classList.add(L)}):this.element.classList.add(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(L){_.element.classList.remove(L)}):this.element.classList.remove(this.toggle.class.out);return}Array.isArray(this.toggle.class.in)?this.toggle.class.in.each(function(L){_.element.classList.remove(L)}):this.element.classList.remove(this.toggle.class.in),Array.isArray(this.toggle.class.out)?this.toggle.class.out.each(function(L){_.element.classList.add(L)}):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)}}]),B})();function v(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function S(B,M){for(var _=0;_<M.length;_++){var L=M[_];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(B,L.key,L)}}function R(B,M,_){return M&&S(B.prototype,M),B}var y=(function(){function B(M){v(this,B),this.triggers=M instanceof Array?M:[]}return R(B,[{key:"add",value:function(_){var L=this;if(_ instanceof f)return this.triggers.push(_);_.each(function(P){P instanceof f?L.triggers.push(P):console.error("Object added to TriggerCollection is not a Trigger. Object: ",P)})}},{key:"remove",value:function(_){_ instanceof f&&(_=[_]),this.triggers=this.triggers.filter(function(L){var P=!1;return _.each(function(W){W==L&&(P=!0)}),!P})}},{key:"query",value:function(_){return this.triggers.filter(function(L){var P=L.element,W=P.parentNode,N=[].slice.call(W.querySelectorAll(_));return N.indexOf(P)>-1})}},{key:"search",value:function(_){var L=this.triggers.filter(function(P){if(_ instanceof NodeList||Array.isArray(_)){var W=!1;return _.each(function(N){P.element==N&&(W=!0)}),W}return P.element==_});return L.length==0?null:L.length>1?L:L[0]}},{key:"call",value:function(_){this.triggers.each(_)}}]),B})();function E(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function b(B,M){for(var _=0;_<M.length;_++){var L=M[_];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(B,L.key,L)}}function k(B,M,_){return M&&b(B.prototype,M),B}var C=(function(){function B(M,_){E(this,B),this._parseOptions(M),typeof _=="function"&&(this.callback=_),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 k(B,[{key:"_parseOptions",value:function(_){var L=new n().scroll;typeof _!="function"?(L.callback=function(){},L=a()(L,_)):L.callback=_,this.element=L.element,this.sustain=L.sustain,this.callback=L.callback,this.startCallback=L.start,this.stopCallback=L.stop,this.directionChange=L.directionChange}},{key:"_didScroll",value:function(){var _=this.getPosition();if(this.position!==_){var L=this.direction;_.x!==this.position.x?L=_.x>this.position.x?"right":"left":_.y!==this.position.y?L=_.y>this.position.y?"bottom":"top":L="none",L!==this.direction&&(this.direction=L,typeof this.directionChange=="function"&&this.directionChange(this.direction)),this.position=_,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 _=this.element.pageXOffset||this.element.scrollLeft||document.documentElement.scrollLeft||0,L=this.element.pageYOffset||this.element.scrollTop||document.documentElement.scrollTop||0;return{x:_,y:L}}},{key:"_getTimestamp",value:function(){return Number(Date.now())}},{key:"_tick",value:function(){this.callback(this.position,this.direction);var _=this._getTimestamp();_-this.lastAction>this.sustain&&this._stopRun(),this.running&&this._loop()}},{key:"_loop",value:function(){var _=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(L){setTimeout(L,16.666666666666668)};_(this._tick.bind(this))}},{key:"kill",value:function(){this.running=!1,this.element.removeEventListener("scroll",this._boundListener)}}]),B})();t.d(s,"Trigger",function(){return V}),t.d(s,"TriggerCollection",function(){return I}),t.d(s,"ScrollAnimationLoop",function(){return F}),t.d(s,"default",function(){return G});function g(B,M){if(!(B instanceof M))throw new TypeError("Cannot call a class as a function")}function w(B,M){for(var _=0;_<M.length;_++){var L=M[_];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(B,L.key,L)}}function q(B,M,_){return M&&w(B.prototype,M),B}/*!
|
|
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,Y=C,G=(function(){function B(M){g(this,B),this._parseOptions(M),this._initCollection(),this._initLoop()}return R(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 Y({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 E=p[x];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(l,n(E.key),E)}}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,E){if(typeof x!="object"||!x)return x;var O=x[Symbol.toPrimitive];if(O!==void 0){var D=O.call(x,E);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,E=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<E;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,E=0;E<x&&p.call(l[E],l[E],E,l)!==!1;E++);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,E=l[a]=l[a]||[],O={all:E,evt:null,found:null};return p&&x&&W(E)>0&&c(E,(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,E=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,F=x||[];function Z(ee){I(E)&&E.call(U,ee,this),$&&Z.destroy()}return Y(F)&&(F=document.querySelectorAll(F)),Z.destroy=function(){c(F,(function(ee){var te=d(ee,l,Z);te.found&&te.all.splice(te.evt,1),ee.removeEventListener&&ee.removeEventListener(l,Z,j)}))},c(F,(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 q(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 E=g(),O=p.split(" ");c(O,(function(D){h(l,"g"+D)})),o(E,{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 T(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,E){if(l())p();else{var O;x||(x=100);var D=setInterval((function(){l()&&(clearInterval(D),O&&clearTimeout(O),p())}),x)}}function R(l,p,x){if(L(l))console.error("Inject assets error");else if(I(p)&&(x=p,p=!1),Y(p)&&p in window)I(x)&&x();else{var E;if(l.indexOf(".css")!==-1){if((E=document.querySelectorAll('link[href="'+l+'"]'))&&E.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((E=document.querySelectorAll('script[src="'+l+'"]'))&&E.length>0){if(I(x)){if(Y(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(Y(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 Y(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 E=Math.max.apply(Math,x.map((function($){return parseInt($)}))),O=l<0?1:l+1;O>E&&(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 E=(p=p||window.event).keyCode;if(E==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"))}E==39&&l.nextSlide(),E==37&&l.prevSlide(),E==27&&l.close()}})}var ne=t((function l(p,x){var E=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 E.dragStart(D)}),!1),this.img.addEventListener("mouseup",(function(D){return E.dragEnd(D)}),!1),this.img.addEventListener("mousemove",(function(D){return E.drag(D)}),!1),this.img.addEventListener("click",(function(D){return E.slide.classList.contains("dragging-nav")?(E.zoomOut(),!1):E.zoomedIn?void(E.zoomedIn&&!E.dragging&&E.zoomOut()):E.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 E=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,F=U===void 0?null:U;this.el=E,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=F,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 E=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&E&&(this.doSlideChange=E),this.instance.settings.dragAutoSnap&&E)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),E=="right"&&this.instance.prevSlide(),void(E=="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 E=arguments.length>3&&arguments[3]!==void 0&&arguments[3];l.style.transition=E?"all .2s ease":"",l.style.transform="translate3d(".concat(p,"px, ").concat(x,"px, 0)")}}]);function ae(l,p,x,E){var O=l.querySelector(".gslide-media"),D=new Image,H="gSlideTitle_"+x,$="gSlideDesc_"+x;D.addEventListener("load",(function(){I(E)&&E()}),!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,E){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");R(this.settings.plyr.css,"Plyr");var U=p.href,F=p?.videoProvider,Z=!1;$.style.maxWidth=p.width,R(this.settings.plyr.js,"Plyr",(function(){if(!F&&U.match(/vimeo\.com\/([0-9]*)/)&&(F="vimeo"),!F&&(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\-_]+)/))&&(F="youtube"),F==="local"||!F){F="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(F,'" data-plyr-embed-id="').concat(U,'"></div>'));h(j,"".concat(F,"-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(E)&&E()})),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,E){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&&(Y(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 F=U.cloneNode(!0);F.style.height=p.height,F.style.maxWidth=p.width,h(F,"ginlined-content"),O=F}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(E)&&E()}function Ie(l,p,x,E){var O=l.querySelector(".gslide-media"),D=(function(H){var $=H.url,A=H.allow,j=H.callback,U=H.appendTo,F=document.createElement("iframe");return F.className="vimeo-video gvideo",F.src=$,F.style.width="100%",F.style.height="100%",A&&F.setAttribute("allow",A),F.onload=function(){F.onload=null,h(F,"node-ready"),I(j)&&j()},U&&U.appendChild(F),F})({url:p.href,callback:E});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,E=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(E,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,E.alt=l.alt),E.href=D,c(E,(function(ee,te){P(p,te)&&te!=="width"&&(E[te]=p[te]);var K=l.dataset[te];L(K)||(E[te]=x.sanitizeValue(K))})),E.content&&(E.type="inline"),!E.type&&D&&(E.type=this.sourceType(D)),L(H)){if(!E.title&&$=="a"){var A=l.title;L(A)||A===""||(E.title=A)}if(!E.title&&$=="img"){var j=l.alt;L(j)||j===""||(E.title=j)}}else{var U=[];c(E,(function(ee,te){U.push(";\\s?"+te)})),U=U.join("\\s?:|"),H.trim()!==""&&c(E,(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*$/,"");E[te]=x.sanitizeValue(Ce)}}))}if(E.description&&E.description.substring(0,1)==="."){var F;try{F=document.querySelector(E.description).innerHTML}catch(ee){if(!(ee instanceof DOMException))throw ee}F&&(E.description=F)}if(!E.description){var Z=l.querySelector(".glightbox-desc");Z&&(E.description=Z.innerHTML)}return this.setSize(E,p,l),this.slideConfig=E,E}},{key:"setSize",value:function(l,p){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,E=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):E,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"}}]),Re=t((function l(p,x,E){i(this,l),this.element=p,this.instance=x,this.index=E}),[{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 E=this.instance.settings,O=this.slideConfig,D=V();I(E.beforeSlideLoad)&&E.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"),F=p.querySelector(".gdesc-inner"),Z=x,ee="gSlideTitle_"+this.index,te="gSlideDesc_"+this.index;if(I(E.afterSlideLoad)&&(Z=function(){I(x)&&x(),E.afterSlideLoad({index:l.index,slide:p,player:l.instance.getSlidePlayerInstance(l.index)})}),O.title==""&&O.description==""?F&&F.parentNode.parentNode.removeChild(F.parentNode):(j&&O.title!==""?(j.id=ee,j.innerHTML=O.title):j.parentNode.removeChild(j),U&&O.description!==""?(U.id=te,D&&E.moreLength>0?(O.smallDescription=this.slideShortDesc(O.description,E.moreLength,E.moreText),U.innerHTML=O.smallDescription,this.descriptionEvents(U,O)):U.innerHTML=O.description):U.parentNode.removeChild(U),h(A.parentNode,"desc-".concat($)),h(F.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:E.dragToleranceX,toleranceY:E.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:E.dragToleranceX,toleranceY:E.dragToleranceY,slide:p,instance:l.instance}),O.zoomable&&K.naturalWidth>K.offsetWidth&&(h(K,"zoomable"),new ne(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],E=document.createElement("div");E.innerHTML=l;var O=E.innerText,D=x;if((l=O.trim()).length<=p)return l;var H=l.substr(0,p-1);return D?(E=null,H+'... <a href="#" class="desc-more">'+x+"</a>"):H}},{key:"descriptionEvents",value:function(l,p){var x=this,E=l.querySelector(".desc-more");if(!E)return!1;o("click",{onElement:E,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 Te(l){return Math.sqrt(l.x*l.x+l.y*l.y)}function be(l,p){var x=(function(E,O){var D=Te(E)*Te(O);if(D===0)return 0;var H=(function($,A){return $.x*A.x+$.y*A.y})(E,O)/D;return H>1&&(H=1),Math.acos(H)})(l,p);return(function(E,O){return E.x*O.y-O.x*E.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 E=function(){};this.rotate=ie(this.element,x.rotate||E),this.touchStart=ie(this.element,x.touchStart||E),this.multipointStart=ie(this.element,x.multipointStart||E),this.multipointEnd=ie(this.element,x.multipointEnd||E),this.pinch=ie(this.element,x.pinch||E),this.swipe=ie(this.element,x.swipe||E),this.tap=ie(this.element,x.tap||E),this.doubleTap=ie(this.element,x.doubleTap||E),this.longTap=ie(this.element,x.longTap||E),this.singleTap=ie(this.element,x.singleTap||E),this.pressMove=ie(this.element,x.pressMove||E),this.twoFingerPressMove=ie(this.element,x.twoFingerPressMove||E),this.touchMove=ie(this.element,x.touchMove||E),this.touchEnd=ie(this.element,x.touchEnd||E),this.touchCancel=ie(this.element,x.touchCancel||E),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=Te(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,E=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-E,y:l.touches[1].pageY-O};p.x!==null&&(this.pinchStartLen>0&&(l.zoom=Te($)/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=(E-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=E-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=E,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,E){return Math.abs(l-p)>=Math.abs(x-E)?l-p>0?"Left":"Right":x-E>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,E=v(l,"gslide-media")?l:l.querySelector(".gslide-media"),O=S(E,".ginner-container"),D=l.querySelector(".gslide-description");x>769&&(E=O),h(E,"greset"),y(E,"translate3d(0, 0, 0)"),o(p,{onElement:E,once:!0,withCallback:function(H,$){f(E,"greset")}}),E.style.opacity="",D&&(D.style.opacity="")}function Oe(l){if(l.events.hasOwnProperty("touch"))return!1;var p,x,E,O=C(),D=O.width,H=O.height,$=!1,A=null,j=null,U=null,F=!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,qe=0,De=document.getElementById("glightbox-slider"),Ge=document.querySelector(".goverlay"),nt=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,qe=_e.targetTouches[0].clientY,A=l.activeSlide,j=A.querySelector(".gslide-media"),E=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(E&&E.offsetHeight>H){var He=Pe.pageX-ke.pageX;if(Math.abs(He)<=13)return!1}F=!0;var Ue,Xe=_e.targetTouches[0].clientX,st=_e.targetTouches[0].clientY,rt=ce-Xe,at=qe-st;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(F=!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||F)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=nt}var ye=V(),fe=V()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,he=document.getElementsByTagName("html")[0],se={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=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">
|
|
27
27
|
<div class="gslide-inner-content">
|
|
28
28
|
<div class="ginner-container">
|
|
29
29
|
<div class="gslide-media">
|
|
@@ -45,15 +45,15 @@ 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(se,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,E){x.preventDefault(),l.open(E)}})),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 E=l.getAttribute("data-gallery");E&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,E)),L(x)&&(x=this.getElementIndex(l))<0&&(x=0)}N(x)||(x=0),this.build(),q(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];T(this.loader),this.index=parseInt(p);var E=this.slidesContainer.querySelector(".current");E&&f(E,"current"),this.slideAnimateOut();var O=this.slidesContainer.querySelectorAll(".gslide")[p];if(v(O,"loaded"))this.slideAnimateIn(O,x),b(this.loader);else{T(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 E=this.elements[l],O=E.type,D={index:l,slide:x,slideNode:x,slideConfig:E.slideConfig,slideIndex:l,trigger:E.node,player:null};this.trigger("slide_before_load",D),O==="video"||O==="external"?setTimeout((function(){E.instance.setContent(x,(function(){p.trigger("slide_after_load",D)}))}),200):E.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 Re(l,this,p),E=x.getConfig(),O=u({},E),D=x.create(),H=this.elements.length-1;O.index=p,O.node=!1,O.instance=x,O.slideConfig=E,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:E,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,E=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(E.offsetWidth>0&&O&&(b(O),O.style.display=""),f(l,this.effectsClasses),p)q(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),q(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),q(l,x,(function(){var E=l.querySelector(".ginner-container"),O=l.querySelector(".gslide-media"),D=l.querySelector(".gslide-description");E.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 E=this.getSlidePlayerInstance(l);E&&!E.playing&&(E.play(),this.settings.autofocusVideos&&E.elements.container.focus())}}},{key:"setElements",value:function(l){var p=this;this.settings.elements=!1;var x=[];l&&l.length&&c(l,(function(E,O){var D=new Re(E,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 E=k(p.settings.slideHTML);p.slidesContainer.appendChild(E)})),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(l){var p=!1;return c(this.elements,(function(x,E){if(P(x,"node")&&x.node==l)return p=E,!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(E,O){var D=new Re(E,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(E,O){var D=new Re(E,l,O),H=D.getConfig(),$=u({},H);$.node=E,$.index=O,$.instance=D,$.slideConfig=H,$.gallery=E.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 E=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,E)).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"),E=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||E){var $=!1;if(O&&(v(O,"description-bottom")||v(O,"description-top"))&&!v(O,"gabsolute")&&($=!0),E){if(D<=768)E.querySelector("img");else if($){var A,j,U=O.offsetHeight,F=E.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),F.setAttribute("style","max-height: calc(".concat(ee," - ").concat(U,"px)")),O.setAttribute("style","max-width: ".concat(F.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"),q(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),q(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 E=document.body;f(he,"glightbox-open"),f(E,"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,E=[];c(this.apiEvents,(function(O,D){var H=O.evt,$=O.once,A=O.callback;H==l&&(A(x),$&&E.push(D))})),E.length&&c(E,(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 ni=dt(Ui);/*!
|
|
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}}/*!
|
|
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 si(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?si(Object(i),!0).forEach(function(s){Fi(m,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(i)):si(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 Bi(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&&Bi(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 Yi(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 Wi(){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 Gi(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function Xi(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 Gi(m)}function Ji(m){var e=Wi();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 Xi(this,t)}}function Zi(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=Zi(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 Qi={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 Ki(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 en(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 tn(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 nn=(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})(),sn=(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 nn,this.disabled=!1,this.selector=e,this.settings=Dt(Qi,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=en(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 rn(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 an(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 on='[data-glide-el="track"]';function ln(m,e,i){var s={mount:function(){this.root=m.selector,this.track=this.root.querySelector(on),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 cn(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 un(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 dn(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 hn(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 pn(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 q=0;q<f.length;q++){var y=f[q].cloneNode(!0);y.classList.add(c.slide.clone),n.push(y)}for(var T=0;T<v.length;T++){var b=v[T].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 fn(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 gn=["ltr","rtl"],mn={">":"<","<":">","=":"="};function bn(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(mn[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){gn.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 vn(m,e){return{modify:function(s){return e.Direction.is("rtl")?-s:s}}}function yn(m,e){return{modify:function(s){var t=Math.floor(s/e.Sizes.slideWidth);return s+e.Gaps.value*t}}}function wn(m,e){return{modify:function(s){return s+e.Clones.grow/2}}}function xn(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 kn(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 _n(m,e,i){var s=[yn,wn,xn,kn].concat(m._t,[vn]);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 Sn(m,e,i){var s={set:function(n){var r=_n(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 En(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 Tn(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,q=this.touches(o),y=ze(q.pageX)-n,T=ze(q.pageY)-r,b=Math.abs(y<<2),k=Math.abs(T<<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*Ki(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,q=this.touches(o),y=this.threshold(o),T=q.pageX-n,b=t*180/Math.PI;this.enable(),T>y&&b<v?e.Run.make(e.Direction.resolve("".concat(f,"<"))):T<-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 Cn(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 Ln(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 On='[data-glide-el="controls[nav]"]',zt='[data-glide-el^="controls"]',An="".concat(zt,' [data-glide-dir*="<"]'),Rn="".concat(zt,' [data-glide-dir*=">"]');function qn(m,e,i){var s=new Je,t=$t?{passive:!0}:!1,n={mount:function(){this._n=e.Html.root.querySelectorAll(On),this._c=e.Html.root.querySelectorAll(zt),this._arrowControls={previous:e.Html.root.querySelectorAll(An),next:e.Html.root.querySelectorAll(Rn)},this.addBindings()},setActive:function(){for(var a=0;a<this._n.length;a++)this.addClass(this._n[a].children)},removeActive:function(){for(var a=0;a<this._n.length;a++)this.removeClass(this._n[a].children)},addClass:function(a){var 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 Mn(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 jn(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)?tn(m):(We("Breakpoints option must be an object"),{})}function In(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 Nn={Html:ln,Translate:Sn,Transition:En,Direction:bn,Peek:cn,Sizes:dn,Gaps:an,Move:un,Clones:pn,Resize:fn,Build:hn,Run:rn,Swipe:Tn,Images:Cn,Anchors:Ln,Controls:qn,Keyboard:Mn,Autoplay:jn,Breakpoints:In},Pn=(function(m){Yi(i,m);var e=Ji(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({},Nn,t))}}]),i})(sn);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 Ee(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")},Dn=/^(?:[ \t]*(?:\n|$))+/,Hn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$n=/^ {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+|$)/,zn=/^ {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=Ee(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(),Vn=Ee(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]+)*)/,Un=/^[^\n]+/,Ft=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Bn=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ft).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fn=Ee(/^( {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",Yt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yn=Ee("^ {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",Yt).replace("tag",kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vi=Ee(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:Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vi).getRegex(),code:Hn,def:Bn,fences:$n,heading:zn,hr:lt,html:Yn,lheading:bi,list:Fn,newline:Dn,paragraph:vi,table:ot,text:Un},yi=Ee("^ *([^\\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(),Wn={...Wt,lheading:Vn,table:yi,paragraph:Ee(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()},Gn={...Wt,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yt).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:Ee(Bt).replace("hr",lt).replace("heading",` *#{1,6} *[^
|
|
53
|
-
]`).replace("lheading",bi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
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",bi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Js=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wi=/^( {2,}|\\)\n(?!\s*$)/,Zs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_t=/[\p{P}\p{S}]/u,Gt=/[\s\p{P}\p{S}]/u,xi=/[^\s\p{P}\p{S}]/u,Qs=Te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gt).getRegex(),ki=/(?!~)[\p{P}\p{S}]/u,Ks=/(?!~)[\s\p{P}\p{S}]/u,en=/(?:[^\s\p{P}\p{S}]|~)/u,tn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,_i=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sn=Te(_i,"u").replace(/punct/g,_t).getRegex(),nn=Te(_i,"u").replace(/punct/g,ki).getRegex(),Si="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rn=Te(Si,"gu").replace(/notPunctSpace/g,xi).replace(/punctSpace/g,Gt).replace(/punct/g,_t).getRegex(),an=Te(Si,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,Ks).replace(/punct/g,ki).getRegex(),on=Te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xi).replace(/punctSpace/g,Gt).replace(/punct/g,_t).getRegex(),ln=Te(/\\(punct)/,"gu").replace(/punct/g,_t).getRegex(),cn=Te(/^<(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(),un=Te(Ft).replace("(?:-->|$)","-->").getRegex(),dn=Te("^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",un).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),St=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,hn=Te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",St).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ti=Te(/^!?\[(label)\]\[(ref)\]/).replace("label",St).replace("ref",Yt).getRegex(),Ei=Te(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yt).getRegex(),pn=Te("reflink|nolink(?!\\()","g").replace("reflink",Ti).replace("nolink",Ei).getRegex(),Xt={_backpedal:ot,anyPunctuation:ln,autolink:cn,blockSkip:tn,br:wi,code:Js,del:ot,emStrongLDelim:sn,emStrongRDelimAst:rn,emStrongRDelimUnd:on,escape:Xs,link:hn,nolink:Ei,punctuation:Qs,reflink:Ti,reflinkSearch:pn,tag:dn,text:Zs,url:ot},fn={...Xt,link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",St).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",St).getRegex()},Jt={...Xt,emStrongRDelimAst:an,emStrongLDelim:nn,url:Te(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},gn={...Jt,br:Te(wi).replace("{2,}","*").getRegex(),text:Te(Jt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tt={normal:Wt,gfm:Ws,pedantic:Gs},ct={normal:Xt,gfm:Jt,breaks:gn,pedantic:fn},mn={"&":"&","<":"<",">":">",'"':""","'":"'"},Ci=m=>mn[m];function Fe(m,e){if(e){if(Ve.escapeTest.test(m))return m.replace(Ve.escapeReplace,Ci)}else if(Ve.escapeTestNoEncode.test(m))return m.replace(Ve.escapeReplaceNoEncode,Ci);return m}function Li(m){try{m=encodeURI(m).replace(Ve.percentDecode,"%")}catch{return null}return m}function Oi(m,e){const i=m.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 ut(m,e,i){const s=m.length;if(s===0)return"";let t=0;for(;t<s&&m.charAt(s-t-1)===e;)t++;return m.slice(0,s-t)}function bn(m,e){if(m.indexOf(e[1])===-1)return-1;let i=0;for(let s=0;s<m.length;s++)if(m[s]==="\\")s++;else if(m[s]===e[0])i++;else if(m[s]===e[1]&&(i--,i<0))return s;return i>0?-2:-1}function Ai(m,e,i,s,t){const n=e.href,r=e.title||null,a=m[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;const u={type:m[0].charAt(0)==="!"?"image":"link",raw:i,href:n,title:r,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,u}function vn(m,e,i){const s=m.match(i.other.indentCodeCompensation);if(s===null)return e;const t=s[1];return e.split(`
|
|
54
54
|
`).map(n=>{const r=n.match(i.other.beginningSpace);if(r===null)return n;const[a]=r;return a.length>=t.length?n.slice(t.length):n}).join(`
|
|
55
|
-
`)}class
|
|
56
|
-
`)}}}fences(e){const i=this.rules.block.fences.exec(e);if(i){const s=i[0],t=
|
|
55
|
+
`)}class Et{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:ut(s,`
|
|
56
|
+
`)}}}fences(e){const i=this.rules.block.fences.exec(e);if(i){const s=i[0],t=vn(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=ut(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:ut(i[0],`
|
|
57
57
|
`)}}blockquote(e){const i=this.rules.block.blockquote.exec(e);if(i){let s=ut(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(`
|
|
@@ -62,19 +62,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
62
62
|
${d}`:d,n=n?`${n}
|
|
63
63
|
${o}`:o;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,r,!0),this.lexer.state.top=h,s.length===0)break;const f=r.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){const v=f,S=v.raw+`
|
|
64
64
|
`+s.join(`
|
|
65
|
-
`),
|
|
65
|
+
`),R=this.blockquote(S);r[r.length-1]=R,t=t.substring(0,t.length-v.raw.length)+R.raw,n=n.substring(0,n.length-v.text.length)+R.text;break}else if(f?.type==="list"){const v=f,S=v.raw+`
|
|
66
66
|
`+s.join(`
|
|
67
|
-
`),
|
|
67
|
+
`),R=this.list(S);r[r.length-1]=R,t=t.substring(0,t.length-f.raw.length)+R.raw,n=n.substring(0,n.length-v.raw.length)+R.raw,s=S.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,
|
|
69
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),f=e.split(`
|
|
70
70
|
`,1)[0],v=!h.trim(),S=0;if(this.options.pedantic?(S=2,o=h.trimStart()):v?S=i[1].length+1:(S=i[2].search(this.rules.other.nonSpaceChar),S=S>4?1:S,o=h.slice(S),S+=i[1].length),v&&this.rules.other.blankLine.test(f)&&(d+=f+`
|
|
71
|
-
`,e=e.substring(f.length+1),c=!0),!c){const
|
|
72
|
-
`,1)[0];let
|
|
73
|
-
`+
|
|
71
|
+
`,e=e.substring(f.length+1),c=!0),!c){const E=this.rules.other.nextBulletRegex(S),b=this.rules.other.hrRegex(S),k=this.rules.other.fencesBeginRegex(S),C=this.rules.other.headingBeginRegex(S),g=this.rules.other.htmlBeginRegex(S);for(;e;){const w=e.split(`
|
|
72
|
+
`,1)[0];let q;if(f=w,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.tabCharGlobal," "),k.test(f)||C.test(f)||g.test(f)||E.test(f)||b.test(f))break;if(q.search(this.rules.other.nonSpaceChar)>=S||!f.trim())o+=`
|
|
73
|
+
`+q.slice(S);else{if(v||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(h)||C.test(h)||b.test(h))break;o+=`
|
|
74
74
|
`+f}!v&&!f.trim()&&(v=!0),d+=w+`
|
|
75
|
-
`,e=e.substring(w.length+1),h=
|
|
75
|
+
`,e=e.substring(w.length+1),h=q.slice(S)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let R=null,y;this.options.gfm&&(R=this.rules.other.listIsTask.exec(o),R&&(y=R[0]!=="[ ] ",o=o.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!R,checked:y,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=Oi(i[1]),t=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
76
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(Oi(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=ut(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{const r=
|
|
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=ut(s.slice(0,-1),"\\");if((s.length-r.length)%2===0)return}else{const r=bn(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)),Ai(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 Ai(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,f=e.slice(0,r+t.index+h+u);if(Math.min(r,u)%2){const S=f.slice(1,-1);return{type:"em",raw:f,text:S,tokens:this.lexer.inlineTokens(S)}}const v=f.slice(2,-2);return{type:"strong",raw:f,text:v,tokens:this.lexer.inlineTokens(v)}}}}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 Be{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 Et,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:Tt.normal,inline:ct.normal};this.options.pedantic?(i.block=Tt.pedantic,i.inline=ct.pedantic):this.options.gfm&&(i.block=Tt.gfm,this.options.breaks?i.inline=ct.breaks:i.inline=ct.gfm),this.tokenizer.rules=i}static get rules(){return{block:Tt,inline:ct}}static lex(e,i){return new Be(i).lex(e)}static lexInline(e,i){return new Be(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-'+Fe(t)+'">'+(s?n:Fe(n,!0))+`</code></pre>
|
|
89
|
+
`:"<pre><code>"+(s?n:Fe(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+" "+Fe(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 Lt{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?Be.lex:Be.lexInline}provideParser(){return this.block?
|
|
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>${Fe(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=Li(e);if(n===null)return t;e=n;let r='<a href="'+e+'"';return i&&(r+=' title="'+Fe(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=Li(e);if(n===null)return Fe(s);e=n;let r=`<img src="${e}" alt="${s}"`;return i&&(r+=` title="${Fe(i)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Fe(e.text)}}class Zt{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 Ye{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 Zt}static parse(e,i){return new Ye(i).parse(e)}static parseInline(e,i){return new Ye(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 Lt{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?Be.lex:Be.lexInline}provideParser(){return this.block?Ye.parse:Ye.parseInline}}class yn{defaults=Vt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ye;Renderer=Ct;TextRenderer=Zt;Lexer=Be;Tokenizer=Et;Hooks=Lt;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 Et(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 Lt;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];Lt.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 Be.lex(e,i??this.defaults)}parser(e,i){return Ye.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?Be.lex:Be.lexInline,c=r.hooks?r.hooks.provideParser():e?Ye.parse:Ye.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>"+Fe(s.message+"",!0)+"</pre>";return i?Promise.resolve(t):t}if(i)return Promise.reject(s);throw s}}}const Qe=new yn;function we(m,e){return Qe.parse(m,e)}we.options=we.setOptions=function(m){return Qe.setOptions(m),we.defaults=Qe.defaults,gi(we.defaults),we},we.getDefaults=Vt,we.defaults=Ze,we.use=function(...m){return Qe.use(...m),we.defaults=Qe.defaults,gi(we.defaults),we},we.walkTokens=function(m,e){return Qe.walkTokens(m,e)},we.parseInline=Qe.parseInline,we.Parser=Ye,we.parser=Ye.parse,we.Renderer=Ct,we.TextRenderer=Zt,we.Lexer=Be,we.lexer=Be.lex,we.Tokenizer=Et,we.Hooks=Lt,we.parse=we,we.options,we.setOptions,we.use,we.walkTokens,we.parseInline,Ye.parse,Be.lex;class wn{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,7 +236,7 @@ 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="",f,v=!1,S=[],
|
|
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="",f,v=!1,S=[],R=[];return d.entries&&d.entries.forEach(y=>{f=y.url.split(".").pop().toLowerCase(),f==="mp4"?(o+=`
|
|
240
240
|
<p class="responsive-video">
|
|
241
241
|
<video controls>
|
|
242
242
|
<source src="${y.url}" type="video/mp4">
|
|
@@ -258,7 +258,7 @@ Check the information and return the details.
|
|
|
258
258
|
<a class="link-download" href="${y.url}" download>${this.out("Download")}</a>
|
|
259
259
|
</div>
|
|
260
260
|
</div>
|
|
261
|
-
`,h+=``,v=!0),S.push(y.url),
|
|
261
|
+
`,h+=``,v=!0),S.push(y.url),R.push(y.file_url)}),v&&(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:S,output2:R}}}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 q=await h.json();this.builder.settings.consoleLog&&console.log(q),this.builder.isMediaGenerating=!1;const y=q.data;this.builder.output.push(q);let T=this.renderResult(y,i,s);return{mediaGenerated:!0,status:"success",markdown:T.markdown,output:T.output,output2:T.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 T=y.value;if(T.length>0)for(const b of T){const k=await new Promise((C,g)=>{const w=new FileReader;w.onload=R=>{const V=R.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 q=this.renderResult(S,i,s);return{mediaGenerated:!0,status:"success",markdown:q.markdown,output:q.output,output2:q.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 q=e.width||1280,y=e.height||768,T=e.aspect_ratio,b=e.num_images||1;if(b>4&&(b=4),T){let{w:ne,h:re}=this.getDimension(T);q=ne,y=re}let k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,R=e.color2_green,V=e.color2_blue,I=e.color3_red,Y=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&&R&&V&&!(w==="0"&&R==="0"&&V==="0")&&N.push({r:w,g:R,b:V}),I&&Y&&G&&!(I==="0"&&Y==="0"&&G==="0")&&N.push({r:I,g:Y,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 ne=[],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 Te=await(await fetch(Ae,{method:"POST",body:Ie})).json();if(Te.ok){const be=Te.url;ne.push(be),this.builder.filesUploaded["file_"+ue]=be}}}}return ne})();n={prompt:S,image_size:{width:q,height:y},num_images:b},v.indexOf("gemini")!==-1&&(n={prompt:S,input_image_urls:Q}),v==="fal-ai/ideogram/v2a"&&(T=this.getClosestAspectRatio(q,y),n={prompt:S,aspect_ratio:T,num_images:b}),v.indexOf("recraft")!==-1&&(n={prompt:S,image_size:{width:q,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 T=y[e.image_url],b=y[e.image_url+"_mask"];if(n={image_url:T,mask_url:b,prompt:S},r.model=v,!b){n={image_url:T,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 q=e.width||1280,y=e.height||768,T=e.num_images||1;T>4&&(T=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,R=e.color2_red,V=e.color2_green,I=e.color2_blue,Y=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}),R&&V&&I&&!(R==="0"&&V==="0"&&I==="0")&&J.push({r:R,g:V,b:I}),Y&&G&&B&&!(Y==="0"&&G==="0"&&B==="0")&&J.push({r:Y,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:q,height:y},num_images:T,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 q=e.width||1280,y=e.height||768,T=e.num_images||1;T>4&&(T=4);let b=e.style||"digital_illustration",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,R=e.color2_green,V=e.color2_blue,I=e.color3_red,Y=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&&R&&V&&!(w==="0"&&R==="0"&&V==="0")&&N.push({r:w,g:R,b:V}),I&&Y&&G&&!(I==="0"&&Y==="0"&&G==="0")&&N.push({r:I,g:Y,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:q,height:y},num_images:T,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 q=e.width||1024,y=e.height||1365,T=e.num_images||1;T>4&&(T=1);let b="digital_illustration/cover",k=e.color1_red,C=e.color1_green,g=e.color1_blue,w=e.color2_red,R=e.color2_green,V=e.color2_blue,I=e.color3_red,Y=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&&R&&V&&!(w==="0"&&R==="0"&&V==="0")&&N.push({r:w,g:R,b:V}),I&&Y&&G&&!(I==="0"&&Y==="0"&&G==="0")&&N.push({r:I,g:Y,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:q,height:y},num_images:T,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 q=await this.builder.upload.getInputURLs(t);if(q.error)return{mediaGenerated:!1,status:"error",message:q.error};let y=q[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 T=y[e.image_url];if(!T)return{mediaGenerated:!1,status:"error",message:this.out("Image not provided.")};n={image_url:T,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 q=e.duration||5;q>10&&(q=5);const y=await this.builder.upload.getInputURLs(t);if(y.error)return{mediaGenerated:!1,status:"error",message:y.error};let T=y[e.image_url];if(!T)return{mediaGenerated:!1,status:"error",message:this.out("Image reference not found.")};n={prompt:S,image_url:T,duration:q,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 q=e.duration||5;q>10&&(q=5),n={prompt:S,duration:q,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,T)=>{const b=k=>{if(Array.isArray(k)){const C=k[0],g=T.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(T=>{if(d[y]===T){let b=S[T];d[y]=b}if(Array.isArray(d[y])){for(let b=0;b<d[y].length;b++)if(d[y][b]===T){let k=S[T];d[y][b]=k}}})}),Object.keys(d).forEach(y=>{let T=d[y];if(v(T))for(const b in T)Object.prototype.hasOwnProperty.call(T,b)&&Object.keys(S).forEach(k=>{if(T[b]===k){let C=S[k];T[b]=C,k===C&&!C.startsWith("http")&&(T[b]="")}});if(Array.isArray(T)){for(let b=0;b<T.length;b++)if(v(T[b]))for(const k in T[b])Object.prototype.hasOwnProperty.call(T[b],k)&&Object.keys(S).forEach(C=>{if(T[b][k]===C){let g=S[C];T[b][k]=g,C===g&&!g.startsWith("http")&&(T[b][k]="")}});d[y]=[...T.filter(b=>b!=="")]}});let q={};if(q.model=o,q.customData=this.builder.settings.customData,s==="replicate"&&o.indexOf(":")!==-1){const y=o.split(":");q.version=y[1]}if(s==="replicate")if(o.indexOf(":")!==-1){let y=this.builder.settings.replicateEndpoint1;q.endpoint=y,q.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 1")}else{let y=this.builder.settings.replicateEndpoint2;y=y.replace("{MODEL}",q.model),q.endpoint=y,q.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD 2")}else if(s==="fal"){let y=`https://queue.fal.run/${q.model}`;q.endpoint=y,q.payload=d,this.builder.settings.consoleLog&&console.log("JSON PAYLOAD")}return this.builder.payloads.push(q),this.builder.settings.consoleLog&&console.log(q),this.generateMediaByJSON(q,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 T=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 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=`
|
|
287
287
|
<div class="image-container">
|
|
288
288
|
<div>
|
|
289
|
-
<img src="${
|
|
289
|
+
<img src="${E}" />
|
|
290
290
|
<div>
|
|
291
|
-
<a class="link-view" href="${
|
|
292
|
-
<a class="link-download" href="${
|
|
291
|
+
<a class="link-view" href="${E}" target="_blank" rel="noopener noreferrer">${this.out("View")}</a>
|
|
292
|
+
<a class="link-download" href="${E}" download>${this.out("Download")}</a>
|
|
293
293
|
</div>
|
|
294
294
|
</div>
|
|
295
|
-
</div>`;let k=``;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:k,output:[E]}}}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 xn{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 kn{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,7 +325,7 @@ 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}),q=document.createElement("canvas"),y=q.getContext("2d",{willReadFrequently:!0}),T=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 ne=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=ne,this.empty||(T.value=ne)};let k=[],C=[];const g=()=>{k.push(q.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,q.width,q.height),y.drawImage(J,0,0,q.width,q.height),b(q)}};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 R=document.createElement("img");n.appendChild(R),n.appendChild(v),this.loaded=()=>{n.style.display="flex";const N=document.querySelector(".imagemask-controls");N.style.display="flex",e.style.display="flex",Y(),k=[],C=[],S.clearRect(0,0,v.width,v.height),y.clearRect(0,0,q.width,q.height),this.empty=!0,T.value="";try{b(q)}catch{}},R.onload=()=>{this.loaded()};let V=null,I=null;const Y=()=>{v.width>0&&v.height>0&&(V=S.getImageData(0,0,v.width,v.height),I=y.getImageData(0,0,q.width,q.height));const N=R.offsetWidth,J=R.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 ne=R.naturalWidth,re=R.naturalHeight;if(q.width=ne*Q,q.height=re*Q,y.scale(Q,Q),q.style.width=`${ne}px`,q.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,q.width,q.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(q)},P=N=>{if(!G)return;const{x:J,y:Q}=M(N),ne=q.width/v.width,re=q.height/v.height,ae=J*ne,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*ne,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,q.width,q.height),this.empty=!0,T.value="",b(q)}),window.addEventListener("resize",Y);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=""),Y()};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 ks{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 ys({lang:this.settings.lang},this),this.upload=new ws({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:q,google:y}=this.settings.templatesConfig;return!S&&h.includes("web")||!y&&h.includes("google")||!q&&h.includes("openai")?!1:!f&&!v?!(h.includes("fal")||h.includes("replicate")):!f&&h.includes("fal")?h.includes("replicate"):!v&&h.includes("replicate")?h.includes("fal"):!0});const r=this.settings.templateFilters,a={all:{desc:this.out("All")},image:{desc:this.out("Image")},video:{desc:this.out("Video")},audio:{desc:this.out("Audio")},web:{desc:this.out("Web")},text:{desc:this.out("Text")}},u=document.createElement("div");u.className="app-filters",e.appendChild(u);const c=document.createElement("ul");c.className="app-list",e.appendChild(c);const d=o=>{let h=t.filter(v=>o==="all"||v.categories.includes(o));const f=this.settings.templateOutput||["image","video","audio","text"];h=h.filter(v=>v.categories.every(S=>f.includes(S))),this.renderList(h,c)};r.forEach(o=>{const h=document.createElement("button");h.textContent=a[o].desc,h.setAttribute("data-value",o),o==="all"&&h.classList.add("active"),h.addEventListener("click",()=>{u.querySelectorAll("button").forEach(v=>v.classList.remove("active")),h.classList.add("active"),d(o)}),u.appendChild(h)}),d("all")}}async selectFile(e){const i=this.element.querySelector(".file-input-wrapper");if(!i)return;const s=i.querySelector('input[type="file"]');if(!s||!this.acceptsImagesOnly(s))return;let t;e.startsWith("http")?t=this.settings.viewFileUrl+"?url="+e:t=e;const r=await(await fetch(t)).blob(),a=new File([r],e.split("/").pop(),{type:r.type});this.element.querySelector(".div-selected-preview")||(this.selectedFiles=[]),s&&s.hasAttribute("multiple")?this.selectedFiles.some(d=>d.name===a.name)||this.selectedFiles.push(a):this.selectedFiles=[a],this.setSelectedFiles(this.selectedFiles),this.renderSelectedFiles(),i.closest(".image-mask")&&this.objImageMask&&this.objImageMask.loadImage(a)}setSelectedFiles(e){this.selectedFiles=e;const i=this.element.querySelector('input[type="file"]');i&&i.removeAttribute("required")}renderSelectedFiles(){const e=this.element.querySelector(".file-input-wrapper");if(!e)return;let i=this.element.querySelector(".div-selected-preview");i?i.innerHTML="":(i=document.createElement("div"),i.classList.add("div-selected-preview"),e.appendChild(i)),this.clearFileInput(),this.selectedFiles&&this.selectedFiles.forEach((s,t)=>{const n=document.createElement("div"),r=document.createElement("img");r.src=URL.createObjectURL(s);const a=document.createElement("button");a.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" class="">
|
|
328
|
+
</svg>`,r.appendChild(h);const f=document.createElement("input");f.type="hidden",f.name=this.settings.name,f.className="inp-imagemask",f.value="",t.appendChild(f);const 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="">
|
|
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
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",f=>{if(f.preventDefault(),this.isGenerating){alert(this.out("Please wait until generation is complete."));return}this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateView",s)}),d=!0}if(this.settings.templateButtons&&this.settings.templateButtons.useButton&&this.settings.templateButtons.useButton.text){const h=document.createElement("button");h.className="btn-template-use",h.innerText=this.out(this.settings.templateButtons.useButton.text),c.appendChild(h),h.addEventListener("click",f=>{f.preventDefault(),this.settings.onSelectTemplate&&this.settings.onSelectTemplate(s),this.trigger("templateUse",s)}),o=!0}n.innerHTML=`
|
|
331
331
|
${u}
|
|
@@ -344,7 +344,7 @@ Check the information and return the details.
|
|
|
344
344
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
|
|
345
345
|
</svg>
|
|
346
346
|
<span>${this.out("Clear")}</span>
|
|
347
|
-
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const f=e.cloneNode(!0),v=f.querySelector(".result-tool");v&&v.remove(),f.querySelectorAll(".link-view, .link-download").forEach(y=>{y.remove()}),f.style.position="fixed",f.style.left="-9999px",document.body.appendChild(f);const
|
|
347
|
+
`,c.appendChild(o),d&&d.addEventListener("click",h=>{h.preventDefault();const f=e.cloneNode(!0),v=f.querySelector(".result-tool");v&&v.remove(),f.querySelectorAll(".link-view, .link-download").forEach(y=>{y.remove()}),f.style.position="fixed",f.style.left="-9999px",document.body.appendChild(f);const R=f.innerText.trim();document.body.removeChild(f),navigator.clipboard.writeText(R),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,15 +354,15 @@ 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 T=document.createElement("source");T.src=o.url,T.type="audio/mp3",y.appendChild(T),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 T=document.createElement("source");T.src=o.url,T.type="video/mp4",y.appendChild(T),o.displayInOutput||r.appendChild(y);return}if(o.type==="audio"){const y=document.createElement("audio");y.controls=!0;let T=document.createElement("source");T.src=o.url,T.type="audio/mp3",y.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`short_text_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`long_text_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`number_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`number_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 R=document.createElement("div");R.className="current-value",b.appendChild(R),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 T=document.createElement("div");if(T.id=`radio_group_label_${y}`,T.className="field-label-normal",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 R=document.createElement("input");R.type="radio",R.className="peer",R.id=`${y}_${C}`,R.name=S,R.value=k,w.appendChild(R),C===o.selected&&(R.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&&R.setAttribute("required","required");const Y=document.createElement("span");Y.innerText=g,w.appendChild(Y),R.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 R=document.createElement("span");R.innerText=o.otherText,k.appendChild(R);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 T=document.createElement("div");if(T.id=`checkbox_group_label_${y}`,T.className="field-label-normal",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 R=document.createElement("input");R.type="checkbox",R.className="peer",R.id=`${y}_${C}`,R.name=S+"[]",R.value=k,w.appendChild(R);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 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">
|
|
358
358
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" />
|
|
359
|
-
</svg>`;V.innerHTML=I;const
|
|
359
|
+
</svg>`;V.innerHTML=I;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="checkbox",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-square",k.appendChild(g);const w=`<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>`;g.innerHTML=w;const
|
|
361
|
+
</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==="switch"){let y=this.getId();const E=document.createElement("label");if(E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),E.id=`switch_${y}`,f.appendChild(E),o.fieldNote){const w=document.createElement("div");w.className="field-note",w.innerHTML=o.fieldNote,f.appendChild(w)}const b=document.createElement("div");b.className="switch",b.tabIndex=0,b.role="switch",b.setAttribute("aria-labelledby",`switch_${y}`),b.setAttribute("aria-checked","false"),b.setAttribute("data-checked","false"),f.appendChild(b);const k=document.createElement("div");k.className="switch-thumb",b.appendChild(k);const C=document.createElement("input");C.id=`switch_${y}`,C.type="text",C.name=S,C.style.cssText="opacity:0.01;width:1px;height:1px;position:absolute;bottom:0px;left:25px;",C.setAttribute("tabindex","-1"),o.isRequired&&(C.setAttribute("required","required"),C.setCustomValidity(this.out("Please toggle this switch to proceed."))),b.appendChild(C),o.value==="true"?(b.setAttribute("aria-checked","true"),b.setAttribute("data-checked","true"),C.value="true",o.isRequired&&C.setCustomValidity("")):(b.setAttribute("aria-checked","false"),b.setAttribute("data-checked","false"),C.value="false",o.isRequired&&C.setCustomValidity(this.out("Please toggle this switch to proceed."))),E.addEventListener("click",()=>{b.focus()});const g=()=>{const w=b.getAttribute("aria-checked")==="true";b.setAttribute("aria-checked",!w),b.setAttribute("data-checked",!w),w?(C.value="false",o.isRequired&&C.setCustomValidity(this.out("Please toggle this switch to proceed."))):(C.value="true",o.isRequired&&C.setCustomValidity(""));const q=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(q)};b.addEventListener("keydown",w=>{(w.key===" "||w.key==="Enter")&&(w.preventDefault(),g())}),b.addEventListener("click",()=>{g()})}if(v==="dropdown"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`dropdown_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const F=document.createElement("div");F.className="field-note",F.innerHTML=o.fieldNote,f.appendChild(F)}const b=document.createElement("div");b.className="relative",f.appendChild(b);const k=document.createElement("div");k.className="relative inline-block",b.appendChild(k);const C=document.createElement("select");C.id=`dropdown_${y}`,C.name=S,o.isRequired&&C.setAttribute("required","required"),k.appendChild(C);const g=document.createElement("option");if(g.setAttribute("selected","selected"),g.setAttribute("disabled","disabled"),g.value="",g.innerText=o.placeholder,C.appendChild(g),o.choices&&o.choices.forEach((F,G)=>{let B=F;o.choicesText&&(B=o.choicesText[G]||F);const M=document.createElement("option");M.value=F,M.innerText=B,C.appendChild(M),G===o.selected&&(g.remove(),M.setAttribute("selected","selected"))}),o.showOtherItem){const F=document.createElement("option");F.value="other",F.innerText=o.otherText,C.appendChild(F)}const w=document.createElement("div");w.className="select-arrow",k.appendChild(w),this.appendHtml(w,`
|
|
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 q=document.createElement("input");q.type="text",q.id=`input_other_${y}`,q.name=S+"_other",q.className="input-other hidden inp-base",f.appendChild(q);const V=f.querySelector(`#dropdown_${y}`),I=f.querySelector(`#input_other_${y}`);V.addEventListener("change",()=>{V.value==="other"?(I.classList.remove("hidden"),I.focus()):I.classList.add("hidden");const F=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(F)}),q.addEventListener("input",this.inputListener)}if(v==="date"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`date_${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=`date_${y}`,b.type="date",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("change",this.changeListener)}if(v==="time"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`time_${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=`time_${y}`,b.type="time",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("change",this.changeListener)}if(v==="datetime"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`datetime_${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=`datetime_${y}`,b.type="datetime-local",b.name=S,b.className="inp-base",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("change",this.changeListener)}if(v==="color"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`color_${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=`color_${y}`,b.type="color",b.name=S,b.value=o.value||"",b.className="input-color",b.placeholder=o.placeholder,o.isRequired&&b.setAttribute("required","required"),f.appendChild(b),b.addEventListener("input",this.inputListener)}if(v==="file"||v==="multifile"){let y=this.getId();const E=document.createElement("label");if(E.setAttribute("for",`file_${y}`),E.className="field-label",E.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(E),o.fieldNote){const X=document.createElement("div");X.className="field-note",X.innerHTML=o.fieldNote,f.appendChild(X)}const b=document.createElement("div");b.className="file-input-wrapper",v==="file"&&b.setAttribute("aria-label",this.out(this.settings.fileUploadText)),v==="multifile"&&b.setAttribute("aria-label",this.out(this.settings.multiFileUploadText)),f.appendChild(b);const k=document.createElement("input");k.id=`input_url_label_${y}`,k.type="text",k.name=S+"__url",k.value=o.value||"",k.className="inp-base input-file-url",k.placeholder=o.placeholder||this.out("Enter URL."),f.appendChild(k),k.addEventListener("input",()=>{const X=f.querySelector(".btn-clearfile");X&&X.click(),this.inputListener(),k.value!==""?o.isRequired&&C.removeAttribute("required"):o.isRequired&&C.setAttribute("required","required"),qe(k.value),this.clearSelectedFiles()}),o.useURL?k.style.display="":k.style.display="none";const C=document.createElement("input");C.id=`file_${y}`,C.type="file",v==="multifile"&&(C.multiple=!0),C.name=S,o.isRequired&&C.setAttribute("required","required"),C.className="peer",b.appendChild(C);const g=document.createElement("div");g.className="file-drop-area",b.appendChild(g);const w=document.createElement("div");w.className="file-controls",w.id=`drag_message_${y}`,b.appendChild(w);let q;(!o.source||o.source&&o.source==="local"||o.source&&o.source==="local_and_camera")&&(q=document.createElement("div"),q.className="file-drop-info",v==="file"&&(q.innerHTML=this.out(this.settings.fileUploadText)),v==="multifile"&&(q.innerHTML=this.out(this.settings.multiFileUploadText)),w.appendChild(q));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>
|
|
@@ -372,7 +372,7 @@ Check the information and return the details.
|
|
|
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
|
-
`,w.appendChild(I));const
|
|
375
|
+
`,w.appendChild(I));const F=document.createElement("div");F.className="file-preview-container",b.appendChild(F);const G=document.createElement("div");G.className="file-drop-info-highlight",G.id=`file_name_${y}`,b.appendChild(G),V&&V.addEventListener("click",X=>{X.preventDefault(),C.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")}),v==="file"?b.addEventListener("drop",X=>{if(X.preventDefault(),X.dataTransfer.files&&X.dataTransfer.files.length>0){b.classList.remove("drag-over");const ie=X.dataTransfer.files[0];ie&&(C.files=X.dataTransfer.files,Ee(ie),this.clearSelectedFiles())}}):v==="multifile"&&b.addEventListener("drop",X=>{if(X.preventDefault(),X.dataTransfer.files&&X.dataTransfer.files.length>0){b.classList.remove("drag-over"),F.innerHTML="";const ie=X.dataTransfer.files;ie.length>0&&(C.files=ie,Array.from(ie).forEach(ge=>{be(ge)}),this.clearSelectedFiles())}})),v==="file"?C.addEventListener("change",()=>{const X=C.files[0];X&&(Ee(X),this.clearSelectedFiles())}):v==="multifile"&&C.addEventListener("change",()=>{F.innerHTML="";const X=C.files;Array.from(X).forEach(ie=>{ie&&(be(ie),this.clearSelectedFiles())})});const B={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 M=[];(o.allowedFileTypes||["images","videos","audio","documents","others"]).forEach(X=>{switch(X){case"images":M=M.concat(B.images);break;case"videos":M=M.concat(B.videos);break;case"audio":M=M.concat(B.audio);break;case"documents":M=M.concat(B.documents);break;case"others":M=M.concat(B.others);break}});const L=M.map(X=>X.type).join(",");C.setAttribute("accept",L);let P;if(o.useImageMask){f.classList.add("image-mask");const X=document.createElement("div");f.appendChild(X),P=new kn(X,{lang:this.settings.lang,name:S+"_mask"}),this.objImageMask=P}o.largePreview&&f.classList.add("large-preview");const W=()=>{const X=b.querySelector(".img-preview");X&&(X.remove(),o.useImageMask&&P.clearImage())};let N=`
|
|
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,N);const J=f.querySelector(".livevideo"),Q=f.querySelector(".photo-captured"),
|
|
407
|
+
`;this.appendHtml(b,N);const J=f.querySelector(".livevideo"),Q=f.querySelector(".photo-captured"),se=f.querySelector(".btn-selectfile2"),re=f.querySelector(".btn-takephoto2"),ae=f.querySelector(".btn-capturephoto"),de=f.querySelector(".btn-clearphoto"),ue=f.querySelector(".btn-stopcamera");this.photoBlob={};let Se;se&&se.addEventListener("click",X=>{X.preventDefault(),V.click()});const Ie=async()=>{const X=f.querySelector(".btn-clearfile");X&&X.click();try{Se=await navigator.mediaDevices.getUserMedia({video:!0}),J.srcObject=Se}catch{alert("Unable to access the camera."),J.style.display="none",ae.style.display="none",ue.style.display="none",w.style.display="none",G.style.display="none"}setTimeout(()=>{re.style.display="none",Q.style.display="none",J.style.display="",ae.style.display="",de.style.display="none",se&&(se.style.display="none"),re.style.display="none",ue.style.display="",w.style.display="none",G.style.display="none"},100)};I&&I.addEventListener("click",async X=>{X.preventDefault(),Ie()}),re.addEventListener("click",async X=>{X.preventDefault(),Ie()}),ue.addEventListener("click",()=>{Se&&Se.getTracks().forEach(X=>X.stop()),J.style.display="none",ae.style.display="none",ue.style.display="none",re.style.display="none",w.style.display="",G.style.display=""}),ae.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),Se.getTracks().forEach(ie=>ie.stop()),J.style.display="none",ae.style.display="none",de.style.display="",se&&(se.style.display=""),re.style.display="",ue.style.display="none",Q.toBlob(ie=>{this.photoBlob[S]=ie,C.removeAttribute("required")},"image/jpeg"),re.style.display="",o.useImageMask){const ie=Q.toDataURL("image/jpeg");P.setImage(ie)}this.clearSelectedFiles()});const Ae=()=>{this.photoBlob[S]=null,Q.style.display="none",Q.getContext("2d").clearRect(0,0,Q.width,Q.height),k.value!==""?o.isRequired&&C.removeAttribute("required"):o.isRequired&&C.setAttribute("required","required"),de.style.display="none",se&&(se.style.display="none"),re.style.display="none",w.style.display="",G.style.display=""};de.addEventListener("click",()=>{Ae()});const qe=(X,ie)=>{const ge=`.${X.split(".").pop().toLowerCase()}`;if(!M.some(ne=>ne.extensions.split(", ").includes(ge)))return;let Oe=B.images.some(ne=>ne.extensions.split(", ").includes(ge));if(o.useImageMask){if(!Oe)return;P.loadUrl(X)}Ae(),G.innerHTML="";const ye=document.createElement("div");G.appendChild(ye);const fe=document.createElement("button");if(fe.className="btn-clearfile",fe.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(fe),fe.addEventListener("click",
|
|
411
|
+
`,G.appendChild(fe),fe.addEventListener("click",ne=>{let l=fe.closest(".form-field").querySelector(".img-preview");l&&l.remove(),k.value="",C.value="",G.innerHTML="",q.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&P.clearImage();const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),ne.preventDefault(),ne.stopImmediatePropagation()}),Oe){let ne=b.querySelector(".formview-container .img-preview");ne||(ne=document.createElement("img"),ne.className="img-preview",b.appendChild(ne)),ne.src=X}else W();if(!ie){const ne=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(ne)}const he=document.querySelector(".formview-container .submit-container");he&&setTimeout(()=>{this.stickyElement(he)},1e3)};o.value&&qe(o.value,!0);const Ee=X=>{if(X){if(!M.some(fe=>fe.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}P.loadImage(X)}Ae(),k.value="",G.innerHTML="";const ge=document.createElement("div");ge.innerText=X.name,G.appendChild(ge);const ve=document.createElement("button");if(ve.className="btn-clearfile",ve.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(ve),ve.addEventListener("click",fe=>{let
|
|
415
|
+
`,G.appendChild(ve),ve.addEventListener("click",fe=>{let ne=ve.closest(".form-field").querySelector(".img-preview");ne&&ne.remove(),C.value="",G.innerHTML="",q.innerText=this.out(this.settings.fileUploadText),o.useImageMask&&P.clearImage();const Me=document.querySelector(".formview-container .submit-container");Me&&setTimeout(()=>{this.stickyElement(Me)},1e3),fe.preventDefault(),fe.stopImmediatePropagation()}),X.type.startsWith("image/")){const fe=new FileReader;fe.onload=function(he){let ne=b.querySelector(".formview-container .img-preview");ne||(ne=document.createElement("img"),ne.className="img-preview",b.appendChild(ne)),ne.src=he.target.result},fe.readAsDataURL(X)}else W();const Oe=this.getFormValues();this.settings.onInputChange&&this.settings.onInputChange(Oe);const ye=document.querySelector(".formview-container .submit-container");ye&&setTimeout(()=>{this.stickyElement(ye)},1e3)}},be=X=>{if(X){if(M=M.concat(B.images),!M.some(ne=>ne.type===X.type)){alert(this.out("Invalid file type."));return}const ge=document.createElement("div");ge.className="image-item",F.appendChild(ge);const ve=document.createElement("div");ve.className="file-drop-info-highlight",ge.appendChild(ve);const Oe=document.createElement("div");Oe.innerText=X.name,ve.appendChild(Oe);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",se=>{const Me=ye.closest(".image-item");Me&&Me.remove(),(x=>{const E=new DataTransfer,O=C.files;Array.from(O).forEach(D=>{D!==x&&E.items.add(D)}),C.files=E.files})(X);const p=document.querySelector(".formview-container .submit-container");p&&setTimeout(()=>{this.stickyElement(p)},1e3),se.preventDefault(),se.stopImmediatePropagation()}),X.type.startsWith("image/")){const se=new FileReader;se.onload=function(Me){let l=document.createElement("img");l.className="img-preview",ge.appendChild(l),l.src=Me.target.result},se.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 T=document.createElement("label");if(T.setAttribute("for",`email_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`phone_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");if(T.setAttribute("for",`url_label_${y}`),T.className="field-label",T.innerHTML=o.title+(o.isRequired?' <span class="text-red-500">*</span>':""),f.appendChild(T),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 T=document.createElement("label");T.setAttribute("for",`hidden_label_${y}`),T.className="field-label hidden",T.innerText=o.title,f.appendChild(T);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 q=document.createElement("button");q.className="btn-resetform";const y=i.resetText||this.settings.resetText;q.innerText=y,o.appendChild(q),q.addEventListener("click",b=>{b.preventDefault();const k=q.closest("form");k&&(k.reset(),k.querySelectorAll(".btn-clearfile").forEach(w=>{w.click()}),k.querySelectorAll(".slider-container").forEach(w=>{const R=w.querySelector("input");w.querySelector(".current-value").textContent=R.value}))}),(i.fullWidthButton||!1)&&q.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 q=>{q.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 q=document.createElement("label");q.setAttribute("for",`short_text_label_${S}`),q.className="field-label",q.innerHTML=o,v.appendChild(q);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 T=this.settings.captchaContainerClassName,b=document.createElement("div");b.className="captcha-container",T&&b.classList.add(T),r.appendChild(b)}if(i.useSubmitButton){const T=document.createElement("div");T.className="submit-container",r.appendChild(T);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,T.appendChild(R),R.addEventListener("click",Y=>{Y.preventDefault();const G=R.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)&&R.classList.add("w-full")}const k=document.createElement("button");k.className="btn-submitform";const C=i.submitText;k.innerText=C,T.appendChild(k),(i.fullWidthButton||!1)&&k.classList.add("w-full"),this.settings.alwaysVisibleSubmit&&T.classList.add("always-visible"),this.stickyElement(T),k.addEventListener("click",async R=>{this.trigger("submit",R)});const w=r.closest("form");w?w.addEventListener("submit",async R=>{this.steps&&this.steps.length>0&&(R.preventDefault(),R.stopImmediatePropagation(),this.process())}):k.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 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
|
+
`,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+=`
|
|
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(y=>{let
|
|
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(y=>{let E=new URL(y.link).hostname;return!o.some(b=>E.includes(b))});const f=this.settings.scrapeLimit,v=h.slice(0,f);t.innerHTML="",c=document.createElement("p"),c.innerHTML=this.out("Getting more information..."),t.appendChild(c);let S=[];for(let y=0;y<v.length;y++)S.push(d[y].link);let R=await this.scrapeUrls(S);n+=R.data,a=R.urls,u=R.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>
|
|
@@ -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=(k,C)=>{if(k===void 0)return"";if(!isNaN(k))return k;let g=k;return C&&C.trim().startsWith("{")&&(g=JSON.stringify(k).slice(1,-1)),g};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 k of o){let C=k.prompt;if(k.provider==="google"){for(const w of h)if(w.value instanceof FileList&&w.value.length>0){const V=w.value[0];if(!V)continue;const I=await new Promise((
|
|
506
|
+
`,this.isNormal=!0),this.isGenerating=!0;let d=(k,C)=>{if(k===void 0)return"";if(!isNaN(k))return k;let g=k;return C&&C.trim().startsWith("{")&&(g=JSON.stringify(k).slice(1,-1)),g};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 k of o){let C=k.prompt;if(k.provider==="google"){for(const w of h)if(w.value instanceof FileList&&w.value.length>0){const V=w.value[0];if(!V)continue;const I=await new Promise((F,G)=>{const B=new FileReader;B.onload=M=>{const _=M.target.result.split(",")[1];F(_)},B.onerror=G,B.readAsDataURL(V)});C=C.replaceAll(`{{${w.name}}}`,I),C=C.replaceAll(`{{${w.name.toUpperCase()}}}`,I)}}k.prompt=C}o.forEach(k=>{let C=k.prompt;h.forEach(g=>{if(g.value===void 0&&(g.value=""),typeof g.value=="object"&&Array.isArray(g.value)){const w=g.value.join(", ");C=C.replaceAll(`{{${g.name}}}`,w),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,w)}else g.value instanceof FileList||typeof g.value=="string"&&g.value.indexOf("base64")!==-1?(C=C.replaceAll(`{{${g.name}}}`,g.name),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,g.name)):(C=C.replaceAll(`{{${g.name}}}`,d(g.value,k.prompt)),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,d(g.value,k.prompt)))}),k.prompt=C}),o.forEach(k=>{let C=k.context;h.forEach(g=>{if(g.value||(g.value=""),typeof g.value=="object"&&Array.isArray(g.value)){const w=g.value.join(", ");C=C.replaceAll(`{{${g.name}}}`,w),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,w)}else g.value instanceof FileList||typeof g.value=="string"&&g.value.indexOf("base64")!==-1?(C=C.replaceAll(`{{${g.name}}}`,g.name),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,g.name)):(C=C.replaceAll(`{{${g.name}}}`,d(g.value,k.prompt)),C=C.replaceAll(`{{${g.name.toUpperCase()}}}`,d(g.value,k.prompt)))}),k.context=C})}const f=async(k,C,g,w,q,V,I,F)=>{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>
|
|
@@ -527,10 +527,10 @@ ${e}`);this.settings.consoleLog&&console.log(r);let a=[],u=[];if(r.url&&r.needsc
|
|
|
527
527
|
Use the following information to answer the request:
|
|
528
528
|
|
|
529
529
|
${P.data}
|
|
530
|
-
`)),I&&(I.image||I.video||I.audio)||B){const W=await this.media.generate(k,C,g,w,I,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(k,C,R,V,async W=>{if(!(W&&typeof W=="object")){if(_+=W,!Y){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)}),Y&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`;else if(this.settings.assistantUrl){let W=await this.assistant(k,C,R,V);if(!W)return!1;if(_=W,Y)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 ne=>{let re=0;for(;re<ne.length;){if(J=W.slice(0,J.length+1),re++,!Y){const ae=we.parse(J);G.innerHTML=ae,N=ae}await new Promise(ae=>setTimeout(ae,50))}};await this.sendStream(k,C,R,w,V,async ne=>{_+=ne,W+=ne,await Q(ne)}),await new Promise(ne=>{const re=setInterval(()=>{J.length===W.length&&(clearInterval(re),ne())},10)}),Y&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${N}</div>`}else{let W=await this.send(k,C,R,w,V);if(!W)return!1;if(_=W,Y)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}if(!Y){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:R,model:V,system:I,functs:Y,tools:G,hideOutput:B}=k[C];R=R||"",w=w||"",I=I||"You are an assistant",Y=Y||[];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,R,V,I,Y,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:R,provider:V,model:I,system:Y,functs:G,tools:B,hideOutput:M}=C[g];R=R||"",Y=Y||"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),_=R,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)}),R=_,R=R.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(R);let L=await f(w,R,V,I,Y,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 q=(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 T=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(k=>T.indexOf(k)!==-1),this.trigger("resultReady",{previewText:q(T),markdown:this.previousResults,html:T,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",T)),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 R=await w.blob(),V=g.substring(g.lastIndexOf("/")+1),I=document.createElement("a");I.href=URL.createObjectURL(R),I.download=V,I.click(),URL.revokeObjectURL(I.href)}catch(w){console.error("Error downloading the image:",w)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:u,value:c,checked:d,files:o}=r;if(u==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(u==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(u==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(u==="file")s[a]=o;else if(u==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(f=>f.value)}else if(u==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,u=r.name,c=r.type;if(u==="")return;let d=s[u],o={questions:a,name:u,value:d,type:c};t.push(o);let h=u+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(u=u+"_mask",d=s[u],o={questions:a,name:u,value:d},t.push(o));let f=u+"_red";d=s[f],d!==void 0&&(o={questions:a,name:f,value:d},t.push(o));let v=u+"_green";d=s[v],d!==void 0&&(o={questions:a,name:v,value:d},t.push(o));let S=u+"_blue";d=s[S],d!==void 0&&(o={questions:a,name:S,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,u=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:u,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
-
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let f;return h.answer.choices.forEach(v=>{f=v.message.content}),f}else return h.answer}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async sendStream(e,i,s,t,n,r){this.controller=new AbortController,this.signal=this.controller.signal;let a=.6,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 f=h.body.getReader(),v=new TextDecoder;let S="",
|
|
532
|
-
`);S="";let C=0,g=0;for(const w of k)if(w.trim()!==""&&w.startsWith("data:")){const
|
|
530
|
+
`)),I&&(I.image||I.video||I.audio)||B){const W=await this.media.generate(k,C,g,w,I,G,F);return this.needCleanup=!0,this.settings.consoleLog&&console.log(W),W.mediaGenerated?{media:W.output,media2:W.output2,markdown:W.markdown}:(G.innerHTML=`<p>${W.message}</p>`,!1)}if(this.settings.assistantId){if(this.settings.assistantStreamUrl)await this.assistantStream(k,C,q,V,async W=>{if(!(W&&typeof W=="object")){if(_+=W,!F){const N=we.parse(_);G.innerHTML=N,L+=N}await new Promise(N=>setTimeout(N,50))}}),await new Promise(W=>{const N=setInterval(()=>{G.innerHTML===we.parse(_)&&(clearInterval(N),W())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${L}</div>`;else if(this.settings.assistantUrl){let W=await this.assistant(k,C,q,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}}else if(this.settings.sendCommandStreamUrl){let W="",N="",J="";const Q=async se=>{let re=0;for(;re<se.length;){if(J=W.slice(0,J.length+1),re++,!F){const ae=we.parse(J);G.innerHTML=ae,N=ae}await new Promise(ae=>setTimeout(ae,50))}};await this.sendStream(k,C,q,w,V,async se=>{_+=se,W+=se,await Q(se)}),await new Promise(se=>{const re=setInterval(()=>{J.length===W.length&&(clearInterval(re),se())},10)}),F&&(G.innerHTML="",G.remove()),this.outputHtml+=`<div class="result-container">${N}</div>`}else{let W=await this.send(k,C,q,w,V);if(!W)return!1;if(_=W,F)G.innerHTML="",G.remove();else{const N=we.parse(W);G.innerHTML=N,this.outputHtml+=`<div class="result-container">${N}</div>`}}if(!F){let W="";if(P&&P.urls.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" href="${J}">${Q}</url></div>`}),P&&P.failed.forEach(J=>{let Q=J;Q.length>75&&(Q=Q.slice(0,75)+"..."),W+=`<div><a class="source_url" style="opacity:0.5" href="${J}">${Q}</url></div>`}),W!==""){const J=document.createElement("div");J.classList.add("result-container"),i.appendChild(J),J.innerHTML=W}}return this.payloads.push({prompt:k,context:C}),this.output.push(_),{media:[],markdown:_}};c||await(async k=>{this.previousResults=[],this.outputHtml="";for(let C=0;C<k.length;C++){if(!this.isGenerating)return;let{prompt:g,context:w,provider:q,model:V,system:I,functs:F,tools:G,hideOutput:B}=k[C];q=q||"",w=w||"",I=I||"You are an assistant",F=F||[];let M=g;this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),g=M,g=g.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(g),M=w,this.previousResults.forEach((L,P)=>{const W=`{{output_step_${P+1}}}`;M=M.replace(new RegExp(W,"g"),d(L,g)),M=M.replace(new RegExp(W.toUpperCase(),"g"),d(L,g))}),w=M,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim();let _=await f(g,w,q,V,I,F,G,B);if(!_)break;if(this.mediaGenerated.push(..._.media),_.media&&_.media.length===1){let L=_.media[0],P=_.media2&&_.media2.length===1&&_.media2[0];this.previousResults.push(P||L),B&&(this.filesUploaded[`output_step_${C}`]=L)}else this.previousResults.push(_.markdown)}})(o),c&&(e===0&&(this.previousResults=[]),await(async(C,g)=>{if(!this.isGenerating)return;let{prompt:w,context:q,provider:V,model:I,system:F,functs:G,tools:B,hideOutput:M}=C[g];q=q||"",F=F||"You are an assistant",G=G||[];let _=w;this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),w=_,w=w.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(w),_=q,this.previousResults&&this.previousResults.forEach((P,W)=>{const N=`{{output_step_${W+1}}}`;_=_.replace(new RegExp(N,"g"),P),_=_.replace(new RegExp(N.toUpperCase(),"g"),P)}),q=_,q=q.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000\uFEFF]/g," ").trim(),this.settings.consoleLog&&console.log(q);let L=await f(w,q,V,I,F,G,B,M);if(L&&(this.mediaGenerated.push(...L.media),!!this.previousResults))if(L.media&&L.media.length===1){let P=L.media[0],W=L.media2&&L.media2.length===1&&L.media2[0];this.previousResults[g]=W||P,M&&(this.filesUploaded[`output_step_${g}`]=P)}else this.previousResults[g]=L.markdown})(o,e)),a.innerHTML=u,a.removeAttribute("disabled"),this.isGenerating=!1;const S=this.calculateCost();this.settings.onUsage&&this.settings.onUsage(S),this.trigger("usage",S),this.isNormal=!1,this.isSingle=!1;const R=(k,C=100)=>{const g=document.createElement("div");if(g.innerHTML=k,g.querySelector("video"))return"Video";if(g.querySelector("img"))return"Image";if(g.querySelector("audio"))return"Audio";const w=g.textContent.trim();return w.length>C?w.substring(0,C)+"...":w},y=Object.keys(this.filesUploaded).length===0&&this.filesUploaded.constructor===Object;if(this.needCleanup&&!y){this.settings.consoleLog&&(console.log("Cleanup"),console.log(this.filesUploaded));let k={"Content-Type":"application/json",...this.settings.headers};await fetch(this.settings.cleanup,{method:"POST",headers:k,body:JSON.stringify(this.filesUploaded)})}let E=this.outputHtml;this.mediaGenerated=this.mediaGenerated.filter(k=>E.indexOf(k)!==-1),this.trigger("resultReady",{previewText:R(E),markdown:this.previousResults,html:E,media:this.mediaGenerated,input:this.payloads,output:this.output}),this.settings.saveResults&&(localStorage.setItem("_results",JSON.stringify(this.previousResults)),localStorage.setItem("_results_html",E)),this.addResultTool(),i.querySelectorAll(".link-download").forEach(k=>{k.addEventListener("click",async C=>{C.preventDefault();const g=C.target.href;try{const w=await fetch(g,{mode:"cors"});if(!w.ok)throw new Error("Failed to fetch the image.");const q=await w.blob(),V=g.substring(g.lastIndexOf("/")+1),I=document.createElement("a");I.href=URL.createObjectURL(q),I.download=V,I.click(),URL.revokeObjectURL(I.href)}catch(w){console.error("Error downloading the image:",w)}})})}calculateCost(){const e=this.settings.inputCost/1e6,i=this.settings.outputCost/1e6,s=this.tokenInput*e,t=this.tokenOutput*i;return s+t}loadWorkflow(e){if(!e)return;const s=JSON.parse(e).steps;s.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"context")||(t.context="")}),this.steps=s}getFileInput(e){let i;if(this.settings.isBuilder){if(!this.settings.previewSelector){this.settings.consoleLog&&console.log("previewSelector not set.");return}i=document.querySelector(this.settings.previewSelector)}else i=this.element;return i?e?i.querySelector(`input[type="file"][name="${e}"]`):i.querySelector('input[type="file"]'):null}getFormValues(){const e=this.element;if(!e)return[];const i=e.querySelectorAll("[name]");if(i.length===0)return{};const s={};i.forEach(r=>{let{name:a,type:u,value:c,checked:d,files:o}=r;if(u==="checkbox")a=a.replace("[]",""),d&&(s[a]=s[a]||[],c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a].push(c));else if(u==="radio")d&&(c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c);else if(u==="select-one")c==="other"&&(c=e.querySelector(`[name="${a+"_other"}"]`).value),s[a]=c;else if(u==="file")s[a]=o;else if(u==="select-multiple"){const h=Array.from(r.selectedOptions);s[a]=h.map(f=>f.value)}else if(u==="color"){s[a]=c;const h=this.hexToRgb(c);s[a+"_red"]=h.red,s[a+"_green"]=h.green,s[a+"_blue"]=h.blue}else s[a]=c});let t=[];return this.json.elements.forEach(r=>{let a=r.title,u=r.name,c=r.type;if(u==="")return;let d=s[u],o={questions:a,name:u,value:d,type:c};t.push(o);let h=u+"__url";d=s[h],d&&(o={questions:a,name:h,value:d},t.push(o)),r.useImageMask&&(u=u+"_mask",d=s[u],o={questions:a,name:u,value:d},t.push(o));let f=u+"_red";d=s[f],d!==void 0&&(o={questions:a,name:f,value:d},t.push(o));let v=u+"_green";d=s[v],d!==void 0&&(o={questions:a,name:v,value:d},t.push(o));let S=u+"_blue";d=s[S],d!==void 0&&(o={questions:a,name:S,value:d},t.push(o))}),this.settings.consoleLog&&console.log(t),t}setTheme(e,i){let s;if(!e)s={};else try{s=JSON.parse(e)}catch{s={}}this.themeData=e;const t=s.cssVariables;let n,r=document.documentElement;i&&(r=i),n=t&&t["--form-text-color"]||"",r.style.setProperty("--form-text-color",n),n=t&&t["--form-primary-color"]||"#3b82f6",r.style.setProperty("--form-primary-color",n),n=t&&t["--form-title-color"]||"",r.style.setProperty("--form-title-color",n),n=t&&t["--form-desc-color"]||"",r.style.setProperty("--form-desc-color",n),n=t&&t["--form-label-color"]||"",r.style.setProperty("--form-label-color",n),n=t&&t["--form-label-font-size"]||"",r.style.setProperty("--form-label-font-size",n),n=t&&t["--form-input-font-size"]||"",r.style.setProperty("--form-input-font-size",n),n=t&&t["--form-input-border-color"]||"",r.style.setProperty("--form-input-border-color",n),n=t&&t["--form-primary-border-width"]||"1px",r.style.setProperty("--form-primary-border-width",n),n=t&&t["--form-secondary-border-width"]||"2px",r.style.setProperty("--form-secondary-border-width",n),n=t&&t["--form-input-background-color"]||"",r.style.setProperty("--form-input-background-color",n),n=t&&t["--form-input-text-color"]||"",r.style.setProperty("--form-input-text-color",n),n=t&&t["--form-input-placeholder-color"]||"",r.style.setProperty("--form-input-placeholder-color",n),n=t&&t["--form-choice-border-color"]||"",r.style.setProperty("--form-choice-border-color",n),n=t&&t["--form-switch-background-color"]||"",r.style.setProperty("--form-switch-background-color",n),n=t&&t["--form-switch-knob-color"]||"",r.style.setProperty("--form-switch-knob-color",n),n=t&&t["--form-switch-focus-offset-color"]||"",r.style.setProperty("--form-switch-focus-offset-color",n),n=t&&t["--form-dropfile-border-color"]||"rgb(194 194 194)",r.style.setProperty("--form-dropfile-border-color",n),n=t&&t["--form-dropfile-hover-color"]||"",r.style.setProperty("--form-dropfile-hover-color",n),n=t&&t["--form-button-background-color"]||"",r.style.setProperty("--form-button-background-color",n),n=t&&t["--form-button-hover-background-color"]||"",r.style.setProperty("--form-button-hover-background-color",n),n=t&&t["--form-button-text-color"]||"",r.style.setProperty("--form-button-text-color",n),n=t&&t["--form-button-hover-text-color"]||"",r.style.setProperty("--form-button-hover-text-color",n),n=t&&t["--form-button-border-width"]||"1px",r.style.setProperty("--form-button-border-width",n),n=t&&t["--form-button-border-color"]||"",r.style.setProperty("--form-button-border-color",n),n=t&&t["--form-button-hover-border-color"]||"",r.style.setProperty("--form-button-hover-border-color",n),n=t&&t["--form-reset-background-color"]||"",r.style.setProperty("--form-reset-background-color",n),n=t&&t["--form-reset-hover-background-color"]||"",r.style.setProperty("--form-reset-hover-background-color",n),n=t&&t["--form-reset-text-color"]||"",r.style.setProperty("--form-reset-text-color",n),n=t&&t["--form-reset-hover-text-color"]||"",r.style.setProperty("--form-reset-hover-text-color",n),n=t&&t["--form-reset-border-width"]||"1px",r.style.setProperty("--form-reset-border-width",n),n=t&&t["--form-reset-border-color"]||"",r.style.setProperty("--form-reset-border-color",n),n=t&&t["--form-reset-hover-border-color"]||"",r.style.setProperty("--form-reset-hover-border-color",n)}async send(e,i,s,t,n){this.controller=new AbortController,this.signal=this.controller.signal;let r=.6,a=.9,u=1;n||(n=[]),t=t||this.settings.model,n.length>0&&(t=this.settings.model2);const c={question:e,context:i,system:s,functs:n,temperature:r,topP:a,num:u,model:t,customData:this.settings.customData};try{let d={"Content-Type":"application/json",...this.settings.headers},h=await(await fetch(this.settings.sendCommandUrl,{signal:this.signal,method:"POST",headers:d,body:JSON.stringify(c)})).json();if(h.error)return console.log(`Error:
|
|
531
|
+
`+h.error),!1;if(h.answer.usage&&(this.tokenInput+=h.answer.usage.prompt_tokens,this.tokenOutput+=h.answer.usage.completion_tokens),n.length===0){let f;return h.answer.choices.forEach(v=>{f=v.message.content}),f}else return h.answer}catch(d){return d.name==="AbortError"?this.settings.consoleLog&&console.log("Request aborted by user."):console.error("Error:",d),!1}}async sendStream(e,i,s,t,n,r){this.controller=new AbortController,this.signal=this.controller.signal;let a=.6,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 f=h.body.getReader(),v=new TextDecoder;let S="",R=!1;for(;!R;){const{done:y,value:E}=await f.read();if(R=y,R)break;const b=v.decode(E,{stream:!0});S+=b;const k=S.split(`
|
|
532
|
+
`);S="";let C=0,g=0;for(const w of k)if(w.trim()!==""&&w.startsWith("data:")){const q=w.slice(5).trim();if(q==="[DONE]"){this.settings.consoleLog&&console.log("Stream completed.");break}try{const V=JSON.parse(q);if(V.usage&&(C=V.usage.prompt_tokens,g=V.usage.completion_tokens),V.choices&&V.choices[0].delta&&V.choices[0].delta.content){const I=V.choices[0].delta.content;r&&r(I)}}catch{S+=w+`
|
|
533
533
|
`}}this.tokenInput+=C,this.tokenOutput+=g}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(),f=new TextDecoder;let v="",S=!1;for(;!S;){const{done:
|
|
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(),f=new TextDecoder;let v="",S=!1;for(;!S;){const{done:R,value:y}=await h.read();if(S=R,S)break;const E=f.decode(y,{stream:!0});v+=E;const b=v.split(`
|
|
535
535
|
`);v="";for(const k of b)if(k.trim()!=="")if(k.startsWith("data:")){const C=k.slice(5).trim();C==="[DONE]"&&this.settings.consoleLog&&console.log("Stream completed.");try{const g=JSON.parse(C);if(g.choices&&g.choices[0].delta&&g.choices[0].delta.content){const w=g.choices[0].delta.content;n&&n(w)}}catch{v+=k+`
|
|
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 _s{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 _s;class Ss{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 q=v.querySelectorAll("li");q.forEach(y=>{if(y!==f){const T=y.querySelector("ul");oe.removeClass(T,"active")}}),q=document.querySelectorAll(".is-menu > ul > li ul"),q.forEach(y=>{const T=y.querySelector("ul");oe.removeClass(T,"active")})}oe.hasClass(v,"active")&&!oe.hasClass(v,"is-menu-links")&&v.querySelectorAll("li").forEach(y=>{if(y!==f){const T=y.querySelector("ul");oe.removeClass(T,"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"),q=window.innerWidth;let y=v.target.tagName.toLowerCase();if(q>1024){if((y==="a"||y==="i")&&!v.target.getAttribute("href")){v.preventDefault(),v.stopImmediatePropagation();return}}else{let T=!0;if((y==="a"||y==="i")&&(v.target.getAttribute("href")||(v.preventDefault(),T=!1)),T){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 q=h.querySelector("ul");q&&oe.removeClass(q,"active")},200),v.preventDefault(),v.stopImmediatePropagation())}),h.addEventListener("mouseenter",v=>{const S=window.innerWidth;if(S<=1024||this.staticClose)return;const q=document.querySelector(".is-menu-search-input");if(oe.hasClass(q,"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 T=h.querySelector("ul");if(T&&oe.addClass(T,"active"),T.style.right="",T.classList.contains("active")){const b=T.getBoundingClientRect();b.left+b.width>S&&(T.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(q=>{oe.removeClass(q,"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(T=>{T.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(q=>{oe.removeClass(q,"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(q=>{oe.removeClass(q,"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 Es{constructor(e={}){const i={skin:"light"};this.settings=Object.assign(this,i,e),window.Glide=Pn,window.FormViewer=ks,window.NavBar=Ss,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)}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=ni(e),window.GLightbox=ni}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 Es})();
|
|
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})();
|