From 11884ff109572f210f6eac4f11673cce5c8df5ad Mon Sep 17 00:00:00 2001 From: unixvb Date: Mon, 2 Dec 2024 22:08:29 +0000 Subject: [PATCH] deploy: 20775e250dfe8cf6bebc802d2be70c6ae28a71da --- 404.html | 2 +- ...per-C6pnpqIT.js => ads-swiper-GHuLwqAE.js} | 2 +- .../{index-BLrQt2l-.js => index-Bq7ZhbaF.js} | 2 +- .../{index-CEKsu63Q.js => index-CvfyoXEP.js} | 26 +++++++++--------- assets/intract-D00LWARw.png | Bin 0 -> 9391 bytes ...{lottie-D_omF4Ys.js => lottie-BrcSCNm7.js} | 2 +- index.html | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) rename assets/{ads-swiper-C6pnpqIT.js => ads-swiper-GHuLwqAE.js} (99%) rename assets/{index-BLrQt2l-.js => index-Bq7ZhbaF.js} (99%) rename assets/{index-CEKsu63Q.js => index-CvfyoXEP.js} (93%) create mode 100644 assets/intract-D00LWARw.png rename assets/{lottie-D_omF4Ys.js => lottie-BrcSCNm7.js} (99%) diff --git a/404.html b/404.html index 438c14a..58cdc37 100644 --- a/404.html +++ b/404.html @@ -14,7 +14,7 @@ - + diff --git a/assets/ads-swiper-C6pnpqIT.js b/assets/ads-swiper-GHuLwqAE.js similarity index 99% rename from assets/ads-swiper-C6pnpqIT.js rename to assets/ads-swiper-GHuLwqAE.js index 10cf9b7..c9b693a 100644 --- a/assets/ads-swiper-C6pnpqIT.js +++ b/assets/ads-swiper-GHuLwqAE.js @@ -1 +1 @@ -import{r as e,R as t,u as s,j as i,L as r,a,T as n,U as l,s as o,g as d}from"./index-CEKsu63Q.js";function c(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function p(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach((s=>{void 0===e[s]?e[s]=t[s]:c(t[s])&&c(e[s])&&Object.keys(t[s]).length>0&&p(e[s],t[s])}))}const u={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function m(){const e="undefined"!=typeof document?document:{};return p(e,u),e}const f={document:u,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function h(){const e="undefined"!=typeof window?window:{};return p(e,f),e}function v(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function g(){return Date.now()}function w(e,t){void 0===t&&(t="x");const s=h();let i,r,a;const n=function(e){const t=h();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(r=n.transform||n.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map((e=>e.replace(",","."))).join(", ")),a=new s.WebKitCSSMatrix("none"===r?"":r)):(a=n.MozTransform||n.OTransform||n.MsTransform||n.msTransform||n.transform||n.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=a.toString().split(",")),"x"===t&&(r=s.WebKitCSSMatrix?a.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===t&&(r=s.WebKitCSSMatrix?a.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),r||0}function b(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function y(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let i=1;it.indexOf(e)<0));for(let t=0,i=s.length;ta?"next":"prev",c=(e,t)=>"next"===d&&e>=t||"prev"===d&&e<=t,p=()=>{n=(new Date).getTime(),null===l&&(l=n);const e=Math.max(Math.min((n-l)/o,1),0),d=.5-Math.cos(e*Math.PI)/2;let u=a+d*(s-a);if(c(u,s)&&(u=s),t.wrapperEl.scrollTo({[i]:u}),c(u,s))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[i]:u})})),void r.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=r.requestAnimationFrame(p)};p()}function x(e,t){void 0===t&&(t="");const s=[...e.children];return e instanceof HTMLSlotElement&&s.push(...e.assignedElements()),t?s.filter((e=>e.matches(t))):s}function E(e){try{return void console.warn(e)}catch(t){}}function C(e,t){void 0===t&&(t=[]);const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:function(e){return void 0===e&&(e=""),e.trim().split(" ").filter((e=>!!e.trim()))}(t)),s}function M(e,t){return h().getComputedStyle(e,null).getPropertyValue(t)}function P(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function _(e,t){const s=[];let i=e.parentElement;for(;i;)t?i.matches(t)&&s.push(i):s.push(i),i=i.parentElement;return s}function L(e,t,s){const i=h();return e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom"))}function k(e){return(Array.isArray(e)?e:[e]).filter((e=>!!e))}function O(e){return void 0===e&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function I(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const a="swiper-pagination";let n;s({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${a}-bullet`,bulletActiveClass:`${a}-bullet-active`,modifierClass:`${a}-`,currentClass:`${a}-current`,totalClass:`${a}-total`,hiddenClass:`${a}-hidden`,progressbarFillClass:`${a}-progressbar-fill`,progressbarOppositeClass:`${a}-progressbar-opposite`,clickableClass:`${a}-clickable`,lockClass:`${a}-lock`,horizontalClass:`${a}-horizontal`,verticalClass:`${a}-vertical`,paginationDisabledClass:`${a}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;function o(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function d(e,s){const{bulletActiveClass:i}=t.params.pagination;e&&(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${i}-${s}`),(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&e.classList.add(`${i}-${s}-${s}`))}function c(e){const s=e.target.closest(O(t.params.pagination.bulletClass));if(!s)return;e.preventDefault();const i=P(s)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===i)return;const e=(r=t.realIndex,a=i,n=t.slides.length,(a%=n)==1+(r%=n)?"next":a===r-1?"previous":void 0);"next"===e?t.slideNext():"previous"===e?t.slidePrev():t.slideToLoop(i)}else t.slideTo(i);var r,a,n}function p(){const e=t.rtl,s=t.params.pagination;if(o())return;let i,a,c=t.pagination.el;c=k(c);const p=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,u=t.params.loop?Math.ceil(p/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(a=t.previousRealIndex||0,i=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(i=t.snapIndex,a=t.previousSnapIndex):(a=t.previousIndex||0,i=t.activeIndex||0),"bullets"===s.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const r=t.pagination.bullets;let o,p,u;if(s.dynamicBullets&&(n=L(r[0],t.isHorizontal()?"width":"height"),c.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(s.dynamicMainBullets+4)+"px"})),s.dynamicMainBullets>1&&void 0!==a&&(l+=i-(a||0),l>s.dynamicMainBullets-1?l=s.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(i-l,0),p=o+(Math.min(r.length,s.dynamicMainBullets)-1),u=(p+o)/2),r.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`))].map((e=>"string"==typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),c.length>1)r.forEach((e=>{const r=P(e);r===i?e.classList.add(...s.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),s.dynamicBullets&&(r>=o&&r<=p&&e.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),r===o&&d(e,"prev"),r===p&&d(e,"next"))}));else{const e=r[i];if(e&&e.classList.add(...s.bulletActiveClass.split(" ")),t.isElement&&r.forEach(((e,t)=>{e.setAttribute("part",t===i?"bullet-active":"bullet")})),s.dynamicBullets){const e=r[o],t=r[p];for(let i=o;i<=p;i+=1)r[i]&&r[i].classList.add(...`${s.bulletActiveClass}-main`.split(" "));d(e,"prev"),d(t,"next")}}if(s.dynamicBullets){const i=Math.min(r.length,s.dynamicMainBullets+4),a=(n*i-n)/2-u*n,l=e?"right":"left";r.forEach((e=>{e.style[t.isHorizontal()?l:"top"]=`${a}px`}))}}c.forEach(((e,a)=>{if("fraction"===s.type&&(e.querySelectorAll(O(s.currentClass)).forEach((e=>{e.textContent=s.formatFractionCurrent(i+1)})),e.querySelectorAll(O(s.totalClass)).forEach((e=>{e.textContent=s.formatFractionTotal(u)}))),"progressbar"===s.type){let r;r=s.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const a=(i+1)/u;let n=1,l=1;"horizontal"===r?n=a:l=a,e.querySelectorAll(O(s.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${l})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===s.type&&s.renderCustom?(e.innerHTML=s.renderCustom(t,i+1,u),0===a&&r("paginationRender",e)):(0===a&&r("paginationRender",e),r("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass)}))}function u(){const e=t.params.pagination;if(o())return;const s=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let i=t.pagination.el;i=k(i);let a="";if("bullets"===e.type){let i=t.params.loop?Math.ceil(s/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&i>s&&(i=s);for(let s=0;s`}"fraction"===e.type&&(a=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):` / `),"progressbar"===e.type&&(a=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):``),t.pagination.bullets=[],i.forEach((s=>{"custom"!==e.type&&(s.innerHTML=a||""),"bullets"===e.type&&t.pagination.bullets.push(...s.querySelectorAll(O(e.bulletClass)))})),"custom"!==e.type&&r("paginationRender",i[0])}function m(){t.params.pagination=function(e,t,s,i){return e.params.createElements&&Object.keys(i).forEach((r=>{if(!s[r]&&!0===s.auto){let a=x(e.el,`.${i[r]}`)[0];a||(a=C("div",i[r]),a.className=i[r],e.el.append(a)),s[r]=a,t[r]=a}})),s}(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let s;"string"==typeof e.el&&t.isElement&&(s=t.el.querySelector(e.el)),s||"string"!=typeof e.el||(s=[...document.querySelectorAll(e.el)]),s||(s=e.el),s&&0!==s.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(s)&&s.length>1&&(s=[...t.el.querySelectorAll(e.el)],s.length>1&&(s=s.filter((e=>_(e,".swiper")[0]===t.el))[0])),Array.isArray(s)&&1===s.length&&(s=s[0]),Object.assign(t.pagination,{el:s}),s=k(s),s.forEach((s=>{"bullets"===e.type&&e.clickable&&s.classList.add(...(e.clickableClass||"").split(" ")),s.classList.add(e.modifierClass+e.type),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(s.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&s.classList.add(e.progressbarOppositeClass),e.clickable&&s.addEventListener("click",c),t.enabled||s.classList.add(e.lockClass)})))}function f(){const e=t.params.pagination;if(o())return;let s=t.pagination.el;s&&(s=k(s),s.forEach((s=>{s.classList.remove(e.hiddenClass),s.classList.remove(e.modifierClass+e.type),s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&(s.classList.remove(...(e.clickableClass||"").split(" ")),s.removeEventListener("click",c))}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}i("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:s}=t.pagination;s=k(s),s.forEach((s=>{s.classList.remove(e.horizontalClass,e.verticalClass),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),i("init",(()=>{!1===t.params.pagination.enabled?h():(m(),u(),p())})),i("activeIndexChange",(()=>{void 0===t.snapIndex&&p()})),i("snapIndexChange",(()=>{p()})),i("snapGridLengthChange",(()=>{u(),p()})),i("destroy",(()=>{f()})),i("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),i("lock unlock",(()=>{p()})),i("click",((e,s)=>{const i=s.target,a=k(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&a&&a.length>0&&!i.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&i===t.navigation.nextEl||t.navigation.prevEl&&i===t.navigation.prevEl))return;const e=a[0].classList.contains(t.params.pagination.hiddenClass);r(!0===e?"paginationShow":"paginationHide"),a.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const h=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),f()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),m(),u(),p()},disable:h,render:u,update:p,init:m,destroy:f})}function A(e){let t,s,{swiper:i,extendParams:r,on:a,emit:n,params:l}=e;i.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let o,d,c,p,u,f,h,v,g=l&&l.autoplay?l.autoplay.delay:3e3,w=l&&l.autoplay?l.autoplay.delay:3e3,b=(new Date).getTime();function y(e){i&&!i.destroyed&&i.wrapperEl&&e.target===i.wrapperEl&&(i.wrapperEl.removeEventListener("transitionend",y),v||e.detail&&e.detail.bySwiperTouchMove||M())}const S=()=>{if(i.destroyed||!i.autoplay.running)return;i.autoplay.paused?d=!0:d&&(w=o,d=!1);const e=i.autoplay.paused?o:b+w-(new Date).getTime();i.autoplay.timeLeft=e,n("autoplayTimeLeft",e,e/g),s=requestAnimationFrame((()=>{S()}))},T=e=>{if(i.destroyed||!i.autoplay.running)return;cancelAnimationFrame(s),S();let r=void 0===e?i.params.autoplay.delay:e;g=i.params.autoplay.delay,w=i.params.autoplay.delay;const a=(()=>{let e;if(e=i.virtual&&i.params.virtual.enabled?i.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:i.slides[i.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(a)&&a>0&&void 0===e&&(r=a,g=a,w=a),o=r;const l=i.params.speed,d=()=>{i&&!i.destroyed&&(i.params.autoplay.reverseDirection?!i.isBeginning||i.params.loop||i.params.rewind?(i.slidePrev(l,!0,!0),n("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(i.slides.length-1,l,!0,!0),n("autoplay")):!i.isEnd||i.params.loop||i.params.rewind?(i.slideNext(l,!0,!0),n("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(0,l,!0,!0),n("autoplay")),i.params.cssMode&&(b=(new Date).getTime(),requestAnimationFrame((()=>{T()}))))};return r>0?(clearTimeout(t),t=setTimeout((()=>{d()}),r)):requestAnimationFrame((()=>{d()})),r},x=()=>{b=(new Date).getTime(),i.autoplay.running=!0,T(),n("autoplayStart")},E=()=>{i.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(s),n("autoplayStop")},C=(e,s)=>{if(i.destroyed||!i.autoplay.running)return;clearTimeout(t),e||(h=!0);const r=()=>{n("autoplayPause"),i.params.autoplay.waitForTransition?i.wrapperEl.addEventListener("transitionend",y):M()};if(i.autoplay.paused=!0,s)return f&&(o=i.params.autoplay.delay),f=!1,void r();const a=o||i.params.autoplay.delay;o=a-((new Date).getTime()-b),i.isEnd&&o<0&&!i.params.loop||(o<0&&(o=0),r())},M=()=>{i.isEnd&&o<0&&!i.params.loop||i.destroyed||!i.autoplay.running||(b=(new Date).getTime(),h?(h=!1,T(o)):T(),i.autoplay.paused=!1,n("autoplayResume"))},P=()=>{if(i.destroyed||!i.autoplay.running)return;const e=m();"hidden"===e.visibilityState&&(h=!0,C(!0)),"visible"===e.visibilityState&&M()},_=e=>{"mouse"===e.pointerType&&(h=!0,v=!0,i.animating||i.autoplay.paused||C(!0))},L=e=>{"mouse"===e.pointerType&&(v=!1,i.autoplay.paused&&M())};a("init",(()=>{i.params.autoplay.enabled&&(i.params.autoplay.pauseOnMouseEnter&&(i.el.addEventListener("pointerenter",_),i.el.addEventListener("pointerleave",L)),m().addEventListener("visibilitychange",P),x())})),a("destroy",(()=>{i.el&&"string"!=typeof i.el&&(i.el.removeEventListener("pointerenter",_),i.el.removeEventListener("pointerleave",L)),m().removeEventListener("visibilitychange",P),i.autoplay.running&&E()})),a("_freeModeStaticRelease",(()=>{(p||h)&&M()})),a("_freeModeNoMomentumRelease",(()=>{i.params.autoplay.disableOnInteraction?E():C(!0,!0)})),a("beforeTransitionStart",((e,t,s)=>{!i.destroyed&&i.autoplay.running&&(s||!i.params.autoplay.disableOnInteraction?C(!0,!0):E())})),a("sliderFirstMove",(()=>{!i.destroyed&&i.autoplay.running&&(i.params.autoplay.disableOnInteraction?E():(c=!0,p=!1,h=!1,u=setTimeout((()=>{h=!0,p=!0,C(!0)}),200)))})),a("touchEnd",(()=>{if(!i.destroyed&&i.autoplay.running&&c){if(clearTimeout(u),clearTimeout(t),i.params.autoplay.disableOnInteraction)return p=!1,void(c=!1);p&&i.params.cssMode&&M(),p=!1,c=!1}})),a("slideChange",(()=>{!i.destroyed&&i.autoplay.running&&(f=!0)})),Object.assign(i.autoplay,{start:x,stop:E,pause:C,resume:M})}let z,N,G;function D(){return z||(z=function(){const e=h(),t=m();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),z}function j(e){return void 0===e&&(e={}),N||(N=function(e){let{userAgent:t}=void 0===e?{}:e;const s=D(),i=h(),r=i.navigator.platform,a=t||i.navigator.userAgent,n={ios:!1,android:!1},l=i.screen.width,o=i.screen.height,d=a.match(/(Android);?[\s\/]+([\d.]+)?/);let c=a.match(/(iPad).*OS\s([\d_]+)/);const p=a.match(/(iPod)(.*OS\s([\d_]+))?/),u=!c&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),m="Win32"===r;let f="MacIntel"===r;return!c&&f&&s.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${o}`)>=0&&(c=a.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),f=!1),d&&!m&&(n.os="android",n.android=!0),(c||u||p)&&(n.os="ios",n.ios=!0),n}(e)),N}function $(){return G||(G=function(){const e=h(),t=j();let s=!1;function i(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(i()){const t=String(e.navigator.userAgent);if(t.includes("Version/")){const[e,i]=t.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));s=e<16||16===e&&i<2}}const r=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),a=i();return{isSafari:s||a,needPerspectiveFix:s,need3dFix:a||r&&t.ios,isWebView:r}}()),G}const B=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const F=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const V=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){let t=s.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(s.shadowRoot?t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame((()=>{s.shadowRoot&&(t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())}))),t&&t.remove()}},R=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},H=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const i="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),r=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=r,a=[s-t];return a.push(...Array.from({length:t}).map(((e,t)=>s+i+t))),void e.slides.forEach(((t,s)=>{a.includes(t.column)&&R(e,s)}))}const a=r+i-1;if(e.params.rewind||e.params.loop)for(let n=r-t;n<=a+t;n+=1){const t=(n%s+s)%s;(ta)&&R(e,t)}else for(let n=Math.max(r-t,0);n<=Math.min(a+t,s-1);n+=1)n!==r&&(n>a||nn?"next":a=i.innerWidth-n)||"prevent"===a&&(t.preventDefault(),!0)}function Y(e){const t=this,s=m();let i=e;i.originalEvent&&(i=i.originalEvent);const r=t.touchEventsData;if("pointerdown"===i.type){if(null!==r.pointerId&&r.pointerId!==i.pointerId)return;r.pointerId=i.pointerId}else"touchstart"===i.type&&1===i.targetTouches.length&&(r.touchId=i.targetTouches[0].identifier);if("touchstart"===i.type)return void W(t,i,i.targetTouches[0].pageX);const{params:a,touches:n,enabled:l}=t;if(!l)return;if(!a.simulateTouch&&"mouse"===i.pointerType)return;if(t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let o=i.target;if("wrapper"===a.touchEventsTarget&&!function(e,t){const s=t.contains(e);if(!s&&t instanceof HTMLSlotElement)return[...t.assignedElements()].includes(e);return s}(o,t.wrapperEl))return;if("which"in i&&3===i.which)return;if("button"in i&&i.button>0)return;if(r.isTouched&&r.isMoved)return;const d=!!a.noSwipingClass&&""!==a.noSwipingClass,c=i.composedPath?i.composedPath():i.path;d&&i.target&&i.target.shadowRoot&&c&&(o=c[0]);const p=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`,u=!(!i.target||!i.target.shadowRoot);if(a.noSwiping&&(u?function(e,t){return void 0===t&&(t=this),function t(s){if(!s||s===m()||s===h())return null;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(e);return i||s.getRootNode?i||t(s.getRootNode().host):null}(t)}(p,o):o.closest(p)))return void(t.allowClick=!0);if(a.swipeHandler&&!o.closest(a.swipeHandler))return;n.currentX=i.pageX,n.currentY=i.pageY;const f=n.currentX,v=n.currentY;if(!W(t,i,f))return;Object.assign(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),n.startX=f,n.startY=v,r.touchStartTime=g(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(r.allowThresholdMove=!1);let w=!0;o.matches(r.focusableElements)&&(w=!1,"SELECT"===o.nodeName&&(r.isTouched=!1)),s.activeElement&&s.activeElement.matches(r.focusableElements)&&s.activeElement!==o&&("mouse"===i.pointerType||"mouse"!==i.pointerType&&!o.matches(r.focusableElements))&&s.activeElement.blur();const b=w&&t.allowTouchMove&&a.touchStartPreventDefault;!a.touchStartForcePreventDefault&&!b||o.isContentEditable||i.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",i)}function X(e){const t=m(),s=this,i=s.touchEventsData,{params:r,touches:a,rtlTranslate:n,enabled:l}=s;if(!l)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let o,d=e;if(d.originalEvent&&(d=d.originalEvent),"pointermove"===d.type){if(null!==i.touchId)return;if(d.pointerId!==i.pointerId)return}if("touchmove"===d.type){if(o=[...d.changedTouches].filter((e=>e.identifier===i.touchId))[0],!o||o.identifier!==i.touchId)return}else o=d;if(!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",d));const c=o.pageX,p=o.pageY;if(d.preventedByNestedSwiper)return a.startX=c,void(a.startY=p);if(!s.allowTouchMove)return d.target.matches(i.focusableElements)||(s.allowClick=!1),void(i.isTouched&&(Object.assign(a,{startX:c,startY:p,currentX:c,currentY:p}),i.touchStartTime=g()));if(r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(pa.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(ca.startX&&s.translate>=s.minTranslate())return;if(t.activeElement&&t.activeElement.matches(i.focusableElements)&&t.activeElement!==d.target&&"mouse"!==d.pointerType&&t.activeElement.blur(),t.activeElement&&d.target===t.activeElement&&d.target.matches(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);i.allowTouchCallbacks&&s.emit("touchMove",d),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=c,a.currentY=p;const u=a.currentX-a.startX,f=a.currentY-a.startY;if(s.params.threshold&&Math.sqrt(u**2+f**2)=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(u))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",d),void 0===i.startMoving&&(a.currentX===a.startX&&a.currentY===a.startY||(i.startMoving=!0)),i.isScrolling||"touchmove"===d.type&&i.preventTouchMoveFromPointerMove)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&d.cancelable&&d.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&d.stopPropagation();let h=s.isHorizontal()?u:f,v=s.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;r.oneWayMovement&&(h=Math.abs(h)*(n?1:-1),v=Math.abs(v)*(n?1:-1)),a.diff=h,h*=r.touchRatio,n&&(h=-h,v=-v);const w=s.touchesDirection;s.swipeDirection=h>0?"prev":"next",s.touchesDirection=v>0?"prev":"next";const b=s.params.loop&&!r.cssMode,y="next"===s.touchesDirection&&s.allowSlideNext||"prev"===s.touchesDirection&&s.allowSlidePrev;if(!i.isMoved){if(b&&y&&s.loopFix({direction:s.swipeDirection}),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});s.wrapperEl.dispatchEvent(e)}i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",d)}if((new Date).getTime(),i.isMoved&&i.allowThresholdMove&&w!==s.touchesDirection&&b&&y&&Math.abs(h)>=1)return Object.assign(a,{startX:c,startY:p,currentX:c,currentY:p,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,void(i.startTranslate=i.currentTranslate);s.emit("sliderMove",d),i.isMoved=!0,i.currentTranslate=h+i.startTranslate;let S=!0,T=r.resistanceRatio;if(r.touchReleaseOnEdges&&(T=0),h>0?(b&&y&&i.allowThresholdMove&&i.currentTranslate>(r.centeredSlides?s.minTranslate()-s.slidesSizesGrid[s.activeIndex+1]-("auto"!==r.slidesPerView&&s.slides.length-r.slidesPerView>=2?s.slidesSizesGrid[s.activeIndex+1]+s.params.spaceBetween:0)-s.params.spaceBetween:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>s.minTranslate()&&(S=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+h)**T))):h<0&&(b&&y&&i.allowThresholdMove&&i.currentTranslate<(r.centeredSlides?s.maxTranslate()+s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween+("auto"!==r.slidesPerView&&s.slides.length-r.slidesPerView>=2?s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween:0):s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===r.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(h)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,i.currentTranslate=i.startTranslate,void(a.diff=s.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function U(e){const t=this,s=t.touchEventsData;let i,r=e;r.originalEvent&&(r=r.originalEvent);if("touchend"===r.type||"touchcancel"===r.type){if(i=[...r.changedTouches].filter((e=>e.identifier===s.touchId))[0],!i||i.identifier!==s.touchId)return}else{if(null!==s.touchId)return;if(r.pointerId!==s.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)){if(!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return}s.pointerId=null,s.touchId=null;const{params:a,touches:n,rtlTranslate:l,slidesGrid:o,enabled:d}=t;if(!d)return;if(!a.simulateTouch&&"mouse"===r.pointerType)return;if(s.allowTouchCallbacks&&t.emit("touchEnd",r),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&a.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);a.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const c=g(),p=c-s.touchStartTime;if(t.allowClick){const e=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(e&&e[0]||r.target,e),t.emit("tap click",r),p<300&&c-s.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(s.lastClickTime=g(),v((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===n.diff&&!s.loopSwapReset||s.currentTranslate===s.startTranslate&&!s.loopSwapReset)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let u;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,u=a.followFinger?l?t.translate:-t.translate:-s.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:u});const m=u>=-t.maxTranslate()&&!t.params.loop;let f=0,h=t.slidesSizesGrid[0];for(let v=0;v=o[v]&&u=o[v])&&(f=v,h=o[o.length-1]-o[o.length-2])}let w=null,b=null;a.rewind&&(t.isBeginning?b=a.virtual&&a.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(w=0));const y=(u-o[f])/h,S=fa.longSwipesMs){if(!a.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(y>=a.longSwipesRatio?t.slideTo(a.rewind&&t.isEnd?w:f+S):t.slideTo(f)),"prev"===t.swipeDirection&&(y>1-a.longSwipesRatio?t.slideTo(f+S):null!==b&&y<0&&Math.abs(y)>a.longSwipesRatio?t.slideTo(b):t.slideTo(f))}else{if(!a.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(f+S):t.slideTo(f):("next"===t.swipeDirection&&t.slideTo(null!==w?w:f+S),"prev"===t.swipeDirection&&t.slideTo(null!==b?b:f))}}function K(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:r,snapGrid:a}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=r,e.allowSlideNext=i,e.params.watchOverflow&&a!==e.snapGrid&&e.checkOverflow()}function Z(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function J(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:i}=e;if(!i)return;let r;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const a=e.maxTranslate()-e.minTranslate();r=0===a?0:(e.translate-e.minTranslate())/a,r!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function Q(e){const t=this;V(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function ee(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const te=(e,t)=>{const s=m(),{params:i,el:r,wrapperEl:a,device:n}=e,l=!!i.nested,o="on"===t?"addEventListener":"removeEventListener",d=t;r&&"string"!=typeof r&&(s[o]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:l}),r[o]("touchstart",e.onTouchStart,{passive:!1}),r[o]("pointerdown",e.onTouchStart,{passive:!1}),s[o]("touchmove",e.onTouchMove,{passive:!1,capture:l}),s[o]("pointermove",e.onTouchMove,{passive:!1,capture:l}),s[o]("touchend",e.onTouchEnd,{passive:!0}),s[o]("pointerup",e.onTouchEnd,{passive:!0}),s[o]("pointercancel",e.onTouchEnd,{passive:!0}),s[o]("touchcancel",e.onTouchEnd,{passive:!0}),s[o]("pointerout",e.onTouchEnd,{passive:!0}),s[o]("pointerleave",e.onTouchEnd,{passive:!0}),s[o]("contextmenu",e.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&r[o]("click",e.onClick,!0),i.cssMode&&a[o]("scroll",e.onScroll),i.updateOnWindowResize?e[d](n.ios||n.android?"resize orientationchange observerUpdate":"resize observerUpdate",K,!0):e[d]("observerUpdate",K,!0),r[o]("load",e.onLoad,{capture:!0}))};const se=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var ie={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function re(e,t){return function(s){void 0===s&&(s={});const i=Object.keys(s)[0],r=s[i];"object"==typeof r&&null!==r?(!0===e[i]&&(e[i]={enabled:!0}),"navigation"===i&&e[i]&&e[i].enabled&&!e[i].prevEl&&!e[i].nextEl&&(e[i].auto=!0),["pagination","scrollbar"].indexOf(i)>=0&&e[i]&&e[i].enabled&&!e[i].el&&(e[i].auto=!0),i in e&&"enabled"in r?("object"!=typeof e[i]||"enabled"in e[i]||(e[i].enabled=!0),e[i]||(e[i]={enabled:!1}),y(t,s)):y(t,s)):y(t,s)}}const ae={eventsEmitter:{on(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;const r=s?"unshift":"push";return e.split(" ").forEach((e=>{i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][r](t)})),i},once(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;function r(){i.off(e,r),r.__emitterProxy&&delete r.__emitterProxy;for(var s=arguments.length,a=new Array(s),n=0;n=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((i,r)=>{(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&s.eventsListeners[e].splice(r,1)}))})),s):s},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,s,i;for(var r=arguments.length,a=new Array(r),n=0;n{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(i,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(i,s)}))})),e}},update:{updateSize:function(){const e=this;let t,s;const i=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:i.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:i.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(M(i,"padding-left")||0,10)-parseInt(M(i,"padding-right")||0,10),s=s-parseInt(M(i,"padding-top")||0,10)-parseInt(M(i,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t,s){return parseFloat(t.getPropertyValue(e.getDirectionLabel(s))||0)}const s=e.params,{wrapperEl:i,slidesEl:r,size:a,rtlTranslate:n,wrongRTL:l}=e,o=e.virtual&&s.virtual.enabled,d=o?e.virtual.slides.length:e.slides.length,c=x(r,`.${e.params.slideClass}, swiper-slide`),p=o?e.virtual.slides.length:c.length;let u=[];const m=[],f=[];let h=s.slidesOffsetBefore;"function"==typeof h&&(h=s.slidesOffsetBefore.call(e));let v=s.slidesOffsetAfter;"function"==typeof v&&(v=s.slidesOffsetAfter.call(e));const g=e.snapGrid.length,w=e.slidesGrid.length;let b=s.spaceBetween,y=-h,T=0,E=0;if(void 0===a)return;"string"==typeof b&&b.indexOf("%")>=0?b=parseFloat(b.replace("%",""))/100*a:"string"==typeof b&&(b=parseFloat(b)),e.virtualSize=-b,c.forEach((e=>{n?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),s.centeredSlides&&s.cssMode&&(S(i,"--swiper-centered-offset-before",""),S(i,"--swiper-centered-offset-after",""));const C=s.grid&&s.grid.rows>1&&e.grid;let P;C?e.grid.initSlides(c):e.grid&&e.grid.unsetSlides();const _="auto"===s.slidesPerView&&s.breakpoints&&Object.keys(s.breakpoints).filter((e=>void 0!==s.breakpoints[e].slidesPerView)).length>0;for(let S=0;S1&&u.push(e.virtualSize-a)}if(o&&s.loop){const t=f[0]+b;if(s.slidesPerGroup>1){const i=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/s.slidesPerGroup),r=t*s.slidesPerGroup;for(let e=0;e!(s.cssMode&&!s.loop)||t!==c.length-1)).forEach((e=>{e.style[t]=`${b}px`}))}if(s.centeredSlides&&s.centeredSlidesBounds){let e=0;f.forEach((t=>{e+=t+(b||0)})),e-=b;const t=e>a?e-a:0;u=u.map((e=>e<=0?-h:e>t?t+v:e))}if(s.centerInsufficientSlides){let e=0;f.forEach((t=>{e+=t+(b||0)})),e-=b;const t=(s.slidesOffsetBefore||0)+(s.slidesOffsetAfter||0);if(e+t{u[t]=e-s})),m.forEach(((e,t)=>{m[t]=e+s}))}}if(Object.assign(e,{slides:c,snapGrid:u,slidesGrid:m,slidesSizesGrid:f}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){S(i,"--swiper-centered-offset-before",-u[0]+"px"),S(i,"--swiper-centered-offset-after",e.size/2-f[f.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}if(p!==d&&e.emit("slidesLengthChange"),u.length!==g&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),m.length!==w&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(o||s.cssMode||"slide"!==s.effect&&"fade"!==s.effect)){const t=`${s.containerModifierClass}backface-hidden`,i=e.el.classList.contains(t);p<=s.maxBackfaceHiddenSlides?i||e.el.classList.add(t):i&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],i=t.virtual&&t.params.virtual.enabled;let r,a=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>i?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{s.push(e)}));else for(r=0;rt.slides.length&&!i)break;s.push(n(e))}else s.push(n(t.activeIndex));for(r=0;ra?e:a}(a||0===a)&&(t.wrapperEl.style.height=`${a}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let i=0;i=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let o=0;o=0&&u<=t.size-t.slidesSizesGrid[o],h=u>=0&&u1&&m<=t.size||u<=0&&m>=t.size;h&&(t.visibleSlides.push(e),t.visibleSlidesIndexes.push(o)),B(e,h,s.slideVisibleClass),B(e,f,s.slideFullyVisibleClass),e.progress=r?-c:c,e.originalProgress=r?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,i=t.maxTranslate()-t.minTranslate();let{progress:r,isBeginning:a,isEnd:n,progressLoop:l}=t;const o=a,d=n;if(0===i)r=0,a=!0,n=!0;else{r=(e-t.minTranslate())/i;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;a=s||r<=0,n=l||r>=1,s&&(r=0),l&&(r=1)}if(s.loop){const s=t.getSlideIndexByData(0),i=t.getSlideIndexByData(t.slides.length-1),r=t.slidesGrid[s],a=t.slidesGrid[i],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=r?(o-r)/n:(o+n-a)/n,l>1&&(l-=1)}Object.assign(t,{progress:r,progressLoop:l,isBeginning:a,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),a&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!a||d&&!n)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:i,activeIndex:r}=e,a=e.virtual&&s.virtual.enabled,n=e.grid&&s.grid&&s.grid.rows>1,l=e=>x(i,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let o,d,c;if(a)if(s.loop){let t=r-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),o=l(`[data-swiper-slide-index="${t}"]`)}else o=l(`[data-swiper-slide-index="${r}"]`);else n?(o=t.filter((e=>e.column===r))[0],c=t.filter((e=>e.column===r+1))[0],d=t.filter((e=>e.column===r-1))[0]):o=t[r];o&&(n||(c=function(e,t){const s=[];for(;e.nextElementSibling;){const i=e.nextElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!c&&(c=t[0]),d=function(e,t){const s=[];for(;e.previousElementSibling;){const i=e.previousElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&0===!d&&(d=t[t.length-1]))),t.forEach((e=>{F(e,e===o,s.slideActiveClass),F(e,e===c,s.slideNextClass),F(e,e===d,s.slidePrevClass)})),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:i,params:r,activeIndex:a,realIndex:n,snapIndex:l}=t;let o,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,i=e.rtlTranslate?e.translate:-e.translate;let r;for(let a=0;a=t[a]&&i=t[a]&&i=t[a]&&(r=a);return s.normalizeSlideIndex&&(r<0||void 0===r)&&(r=0),r}(t)),i.indexOf(s)>=0)o=i.indexOf(s);else{const e=Math.min(r.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/r.slidesPerGroup)}if(o>=i.length&&(o=i.length-1),d===a&&!t.params.loop)return void(o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")));if(d===a&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(d));const p=t.grid&&r.grid&&r.grid.rows>1;let u;if(t.virtual&&r.virtual.enabled&&r.loop)u=c(d);else if(p){const e=t.slides.filter((e=>e.column===d))[0];let s=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(s)&&(s=Math.max(t.slides.indexOf(e),0)),u=Math.floor(s/r.grid.rows)}else if(t.slides[d]){const e=t.slides[d].getAttribute("data-swiper-slide-index");u=e?parseInt(e,10):d}else u=d;Object.assign(t,{previousSnapIndex:l,snapIndex:o,previousRealIndex:n,realIndex:u,previousIndex:a,activeIndex:d}),t.initialized&&H(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(n!==u&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const s=this,i=s.params;let r=e.closest(`.${i.slideClass}, swiper-slide`);!r&&s.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach((e=>{!r&&e.matches&&e.matches(`.${i.slideClass}, swiper-slide`)&&(r=e)}));let a,n=!1;if(r)for(let l=0;lo?o:i&&e=o.length&&(v=o.length-1);const g=-o[v];if(l.normalizeSlideIndex)for(let y=0;y=t&&e=t&&e=t&&(n=y)}if(a.initialized&&n!==p){if(!a.allowSlideNext&&(u?g>a.translate&&g>a.minTranslate():ga.translate&&g>a.maxTranslate()&&(p||0)!==n)return!1}let w;n!==(c||0)&&s&&a.emit("beforeSlideChangeStart"),a.updateProgress(g),w=n>p?"next":n0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{m[e?"scrollLeft":"scrollTop"]=s}))):m[e?"scrollLeft":"scrollTop"]=s,b&&requestAnimationFrame((()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1}));else{if(!a.support.smoothScroll)return T({swiper:a,targetPosition:s,side:e?"left":"top"}),!0;m.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return a.setTransition(t),a.setTranslate(g),a.updateActiveIndex(n),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,i),a.transitionStart(s,w),0===t?a.transitionEnd(s,w):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(s,w))}),a.wrapperEl.addEventListener("transitionend",a.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,s,i){if(void 0===e&&(e=0),void 0===s&&(s=!0),"string"==typeof e){e=parseInt(e,10)}const r=this;if(r.destroyed)return;void 0===t&&(t=r.params.speed);const a=r.grid&&r.params.grid&&r.params.grid.rows>1;let n=e;if(r.params.loop)if(r.virtual&&r.params.virtual.enabled)n+=r.virtual.slidesBefore;else{let e;if(a){const t=n*r.params.grid.rows;e=r.slides.filter((e=>1*e.getAttribute("data-swiper-slide-index")===t))[0].column}else e=r.getSlideIndexByData(n);const t=a?Math.ceil(r.slides.length/r.params.grid.rows):r.slides.length,{centeredSlides:s}=r.params;let l=r.params.slidesPerView;"auto"===l?l=r.slidesPerViewDynamic():(l=Math.ceil(parseFloat(r.params.slidesPerView,10)),s&&l%2==0&&(l+=1));let o=t-e1*t.getAttribute("data-swiper-slide-index")===e))[0].column}else n=r.getSlideIndexByData(n)}return requestAnimationFrame((()=>{r.slideTo(n,t,s,i)})),r},slideNext:function(e,t,s){void 0===t&&(t=!0);const i=this,{enabled:r,params:a,animating:n}=i;if(!r||i.destroyed)return i;void 0===e&&(e=i.params.speed);let l=a.slidesPerGroup;"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(l=Math.max(i.slidesPerViewDynamic("current",!0),1));const o=i.activeIndex{i.slideTo(i.activeIndex+o,e,t,s)})),!0}return a.rewind&&i.isEnd?i.slideTo(0,e,t,s):i.slideTo(i.activeIndex+o,e,t,s)},slidePrev:function(e,t,s){void 0===t&&(t=!0);const i=this,{params:r,snapGrid:a,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=i;if(!o||i.destroyed)return i;void 0===e&&(e=i.params.speed);const c=i.virtual&&r.virtual.enabled;if(r.loop){if(d&&!c&&r.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(l?i.translate:-i.translate),m=a.map((e=>p(e)));let f=a[m.indexOf(u)-1];if(void 0===f&&r.cssMode){let e;a.forEach(((t,s)=>{u>=t&&(e=s)})),void 0!==e&&(f=a[e>0?e-1:e])}let h=0;if(void 0!==f&&(h=n.indexOf(f),h<0&&(h=i.activeIndex-1),"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(h=h-i.slidesPerViewDynamic("previous",!0)+1,h=Math.max(h,0))),r.rewind&&i.isBeginning){const r=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(r,e,t,s)}return r.loop&&0===i.activeIndex&&r.cssMode?(requestAnimationFrame((()=>{i.slideTo(h,e,t,s)})),!0):i.slideTo(h,e,t,s)},slideReset:function(e,t,s){void 0===t&&(t=!0);const i=this;if(!i.destroyed)return void 0===e&&(e=i.params.speed),i.slideTo(i.activeIndex,e,t,s)},slideToClosest:function(e,t,s,i){void 0===t&&(t=!0),void 0===i&&(i=.5);const r=this;if(r.destroyed)return;void 0===e&&(e=r.params.speed);let a=r.activeIndex;const n=Math.min(r.params.slidesPerGroupSkip,a),l=n+Math.floor((a-n)/r.params.slidesPerGroup),o=r.rtlTranslate?r.translate:-r.translate;if(o>=r.snapGrid[l]){const e=r.snapGrid[l];o-e>(r.snapGrid[l+1]-e)*i&&(a+=r.params.slidesPerGroup)}else{const e=r.snapGrid[l-1];o-e<=(r.snapGrid[l]-e)*i&&(a-=r.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,r.slidesGrid.length-1),r.slideTo(a,e,t,s)},slideToClickedSlide:function(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:s}=e,i="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let r,a=e.clickedIndex;const n=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;r=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?ae.slides.length-e.loopedSlides+i/2?(e.loopFix(),a=e.getSlideIndex(x(s,`${n}[data-swiper-slide-index="${r}"]`)[0]),v((()=>{e.slideTo(a)}))):e.slideTo(a):a>e.slides.length-i?(e.loopFix(),a=e.getSlideIndex(x(s,`${n}[data-swiper-slide-index="${r}"]`)[0]),v((()=>{e.slideTo(a)}))):e.slideTo(a)}else e.slideTo(a)}},loop:{loopCreate:function(e){const t=this,{params:s,slidesEl:i}=t;if(!s.loop||t.virtual&&t.params.virtual.enabled)return;const r=()=>{x(i,`.${s.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)}))},a=t.grid&&s.grid&&s.grid.rows>1,n=s.slidesPerGroup*(a?s.grid.rows:1),l=t.slides.length%n!=0,o=a&&t.slides.length%s.grid.rows!=0,d=e=>{for(let i=0;i1;d.lengthe.classList.contains(m.slideActiveClass)))[0]):S=a;const T="next"===i||!i,x="prev"===i||!i;let C=0,M=0;const P=w?Math.ceil(d.length/m.grid.rows):d.length,_=(w?d[a].column:a)+(f&&void 0===r?-h/2+.5:0);if(_=0;t-=1)d[t].column===e&&b.push(t)}else b.push(P-t-1)}}else if(_+h>P-g){M=Math.max(_-(P-2*g),v);for(let e=0;e{e.column===t&&y.push(s)})):y.push(t)}}if(o.__preventObserver__=!0,requestAnimationFrame((()=>{o.__preventObserver__=!1})),x&&b.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.prepend(d[e]),d[e].swiperLoopMoveDOM=!1})),T&&y.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.append(d[e]),d[e].swiperLoopMoveDOM=!1})),o.recalcSlides(),"auto"===m.slidesPerView?o.updateSlides():w&&(b.length>0&&x||y.length>0&&T)&&o.slides.forEach(((e,t)=>{o.grid.updateSlide(t,e,o.slides)})),m.watchSlidesProgress&&o.updateSlidesOffset(),s)if(b.length>0&&x){if(void 0===t){const e=o.slidesGrid[S],t=o.slidesGrid[S+C]-e;l?o.setTranslate(o.translate-t):(o.slideTo(S+Math.ceil(C),0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else if(r){const e=w?b.length/m.grid.rows:b.length;o.slideTo(o.activeIndex+e,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(y.length>0&&T)if(void 0===t){const e=o.slidesGrid[S],t=o.slidesGrid[S-M]-e;l?o.setTranslate(o.translate-t):(o.slideTo(S-M,0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else{const e=w?y.length/m.grid.rows:y.length;o.slideTo(o.activeIndex-e,0,!1,!0)}if(o.allowSlidePrev=c,o.allowSlideNext=p,o.controller&&o.controller.control&&!n){const e={slideRealIndex:t,direction:i,setTranslate:r,activeSlideIndex:a,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===m.slidesPerView&&s})})):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...e,slideTo:o.controller.control.params.slidesPerView===m.slidesPerView&&s})}o.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const i=[];e.slides.forEach((e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;i[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),i.forEach((e=>{s.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}},grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}},events:{attachEvents:function(){const e=this,{params:t}=e;e.onTouchStart=Y.bind(e),e.onTouchMove=X.bind(e),e.onTouchEnd=U.bind(e),e.onDocumentTouchStart=ee.bind(e),t.cssMode&&(e.onScroll=J.bind(e)),e.onClick=Z.bind(e),e.onLoad=Q.bind(e),te(e,"on")},detachEvents:function(){te(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{realIndex:t,initialized:s,params:i,el:r}=e,a=i.breakpoints;if(!a||a&&0===Object.keys(a).length)return;const n=e.getBreakpoint(a,e.params.breakpointsBase,e.el);if(!n||e.currentBreakpoint===n)return;const l=(n in a?a[n]:void 0)||e.originalParams,o=se(e,i),d=se(e,l),c=e.params.grabCursor,p=l.grabCursor,u=i.enabled;o&&!d?(r.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),e.emitContainerClasses()):!o&&d&&(r.classList.add(`${i.containerModifierClass}grid`),(l.grid.fill&&"column"===l.grid.fill||!l.grid.fill&&"column"===i.grid.fill)&&r.classList.add(`${i.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!p?e.unsetGrabCursor():!c&&p&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach((t=>{if(void 0===l[t])return;const s=i[t]&&i[t].enabled,r=l[t]&&l[t].enabled;s&&!r&&e[t].disable(),!s&&r&&e[t].enable()}));const m=l.direction&&l.direction!==i.direction,f=i.loop&&(l.slidesPerView!==i.slidesPerView||m),h=i.loop;m&&s&&e.changeDirection(),y(e.params,l);const v=e.params.enabled,g=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),u&&!v?e.disable():!u&&v&&e.enable(),e.currentBreakpoint=n,e.emit("_beforeBreakpoint",l),s&&(f?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!h&&g?(e.loopCreate(t),e.updateSlides()):h&&!g&&e.loopDestroy()),e.emit("breakpoint",l)},getBreakpoint:function(e,t,s){if(void 0===t&&(t="window"),!e||"container"===t&&!s)return;let i=!1;const r=h(),a="window"===t?r.innerHeight:s.clientHeight,n=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:a*t,point:e}}return{value:e,point:e}}));n.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let l=0;ls}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:i,el:r,device:a}=e,n=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((i=>{e[i]&&s.push(t+i)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:i},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:a.android},{ios:a.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...n),r.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e&&"string"!=typeof e&&(e.classList.remove(...t),this.emitContainerClasses())}}},ne={};let le=class e{constructor(){let t,s;for(var i=arguments.length,r=new Array(i),a=0;a1){const t=[];return n.querySelectorAll(s.el).forEach((i=>{const r=y({},s,{el:i});t.push(new e(r))})),t}const l=this;l.__swiper__=!0,l.support=D(),l.device=j({userAgent:s.userAgent}),l.browser=$(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],s.modules&&Array.isArray(s.modules)&&l.modules.push(...s.modules);const o={};l.modules.forEach((e=>{e({params:s,swiper:l,extendParams:re(s,o),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})}));const d=y({},ie,o);return l.params=y({},d,ne,s),l.originalParams=y({},l.params),l.passedParams=y({},s),l.params&&l.params.on&&Object.keys(l.params.on).forEach((e=>{l.on(e,l.params.on[e])})),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:s}=this,i=P(x(t,`.${s.slideClass}, swiper-slide`)[0]);return P(e)-i}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=x(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const i=s.minTranslate(),r=(s.maxTranslate()-i)*e+i;s.translateTo(r,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((s=>{const i=e.getSlideClasses(s);t.push({slideEl:s,classNames:i}),e.emit("_slideClass",s,i)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:s,slides:i,slidesGrid:r,slidesSizesGrid:a,size:n,activeIndex:l}=this;let o=1;if("number"==typeof s.slidesPerView)return s.slidesPerView;if(s.centeredSlides){let e,t=i[l]?Math.ceil(i[l].swiperSlideSize):0;for(let s=l+1;sn&&(e=!0));for(let s=l-1;s>=0;s-=1)i[s]&&!e&&(t+=i[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let d=l+1;d=0;d-=1){r[l]-r[d]{t.complete&&V(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),s.freeMode&&s.freeMode.enabled&&!s.cssMode)i(),s.autoHeight&&e.updateAutoHeight();else{if(("auto"===s.slidesPerView||s.slidesPerView>1)&&e.isEnd&&!s.centeredSlides){const t=e.virtual&&s.virtual.enabled?e.virtual.slides:e.slides;r=e.slideTo(t.length-1,0,!1,!0)}else r=e.slideTo(e.activeIndex,0,!1,!0);r||i()}s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const s=this,i=s.params.direction;return e||(e="horizontal"===i?"vertical":"horizontal"),e===i||"horizontal"!==e&&"vertical"!==e||(s.el.classList.remove(`${s.params.containerModifierClass}${i}`),s.el.classList.add(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let s=e||t.params.el;if("string"==typeof s&&(s=document.querySelector(s)),!s)return!1;s.swiper=t,s.parentNode&&s.parentNode.host&&s.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const i=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let r=(()=>{if(s&&s.shadowRoot&&s.shadowRoot.querySelector){return s.shadowRoot.querySelector(i())}return x(s,i())[0]})();return!r&&t.params.createElements&&(r=C("div",t.params.wrapperClass),s.append(r),x(s,`.${t.params.slideClass}`).forEach((e=>{r.append(e)}))),Object.assign(t,{el:s,wrapperEl:r,slidesEl:t.isElement&&!s.parentNode.host.slideSlots?s.parentNode.host:r,hostEl:t.isElement?s.parentNode.host:s,mounted:!0,rtl:"rtl"===s.dir.toLowerCase()||"rtl"===M(s,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===M(s,"direction")),wrongRTL:"-webkit-box"===M(r,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const s=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&s.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach((e=>{e.complete?V(t,e):e.addEventListener("load",(e=>{V(t,e.target)}))})),H(t),t.initialized=!0,H(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const s=this,{params:i,el:r,wrapperEl:a,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),i.loop&&s.loopDestroy(),t&&(s.removeClasses(),r&&"string"!=typeof r&&r.removeAttribute("style"),a&&a.removeAttribute("style"),n&&n.length&&n.forEach((e=>{e.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.el&&"string"!=typeof s.el&&(s.el.swiper=null),function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(s){}try{delete t[e]}catch(s){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){y(ne,e)}static get extendedDefaults(){return ne}static get defaults(){return ie}static installModule(t){e.prototype.__modules__||(e.prototype.__modules__=[]);const s=e.prototype.__modules__;"function"==typeof t&&s.indexOf(t)<0&&s.push(t)}static use(t){return Array.isArray(t)?(t.forEach((t=>e.installModule(t))),e):(e.installModule(t),e)}};Object.keys(ae).forEach((e=>{Object.keys(ae[e]).forEach((t=>{le.prototype[t]=ae[e][t]}))})),le.use([function(e){let{swiper:t,on:s,emit:i}=e;const r=h();let a=null,n=null;const l=()=>{t&&!t.destroyed&&t.initialized&&(i("beforeResize"),i("resize"))},o=()=>{t&&!t.destroyed&&t.initialized&&i("orientationchange")};s("init",(()=>{t.params.resizeObserver&&void 0!==r.ResizeObserver?t&&!t.destroyed&&t.initialized&&(a=new ResizeObserver((e=>{n=r.requestAnimationFrame((()=>{const{width:s,height:i}=t;let r=s,a=i;e.forEach((e=>{let{contentBoxSize:s,contentRect:i,target:n}=e;n&&n!==t.el||(r=i?i.width:(s[0]||s).inlineSize,a=i?i.height:(s[0]||s).blockSize)})),r===s&&a===i||l()}))})),a.observe(t.el)):(r.addEventListener("resize",l),r.addEventListener("orientationchange",o))})),s("destroy",(()=>{n&&r.cancelAnimationFrame(n),a&&a.unobserve&&t.el&&(a.unobserve(t.el),a=null),r.removeEventListener("resize",l),r.removeEventListener("orientationchange",o)}))},function(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const a=[],n=h(),l=function(e,s){void 0===s&&(s={});const i=new(n.MutationObserver||n.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void r("observerUpdate",e[0]);const s=function(){r("observerUpdate",e[0])};n.requestAnimationFrame?n.requestAnimationFrame(s):n.setTimeout(s,0)}));i.observe(e,{attributes:void 0===s.attributes||s.attributes,childList:t.isElement||(void 0===s.childList||s).childList,characterData:void 0===s.characterData||s.characterData}),a.push(i)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=_(t.hostEl);for(let t=0;t{a.forEach((e=>{e.disconnect()})),a.splice(0,a.length)}))}]);const oe=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function de(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!e.__swiper__}function ce(e,t){const s=["__proto__","constructor","prototype"];Object.keys(t).filter((e=>s.indexOf(e)<0)).forEach((s=>{void 0===e[s]?e[s]=t[s]:de(t[s])&&de(e[s])&&Object.keys(t[s]).length>0?t[s].__swiper__?e[s]=t[s]:ce(e[s],t[s]):e[s]=t[s]}))}function pe(e){return void 0===e&&(e={}),e.navigation&&void 0===e.navigation.nextEl&&void 0===e.navigation.prevEl}function ue(e){return void 0===e&&(e={}),e.pagination&&void 0===e.pagination.el}function me(e){return void 0===e&&(e={}),e.scrollbar&&void 0===e.scrollbar.el}function fe(e){void 0===e&&(e="");const t=e.split(" ").map((e=>e.trim())).filter((e=>!!e)),s=[];return t.forEach((e=>{s.indexOf(e)<0&&s.push(e)})),s.join(" ")}function he(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t{ge(e)?s.push(e):e.props&&e.props.children&&we(e.props.children).forEach((e=>s.push(e)))})),s}function be(e){const s=[],i={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return t.Children.toArray(e).forEach((e=>{if(ge(e))s.push(e);else if(e.props&&e.props.slot&&i[e.props.slot])i[e.props.slot].push(e);else if(e.props&&e.props.children){const t=we(e.props.children);t.length>0?t.forEach((e=>s.push(e))):i["container-end"].push(e)}else i["container-end"].push(e)})),{slides:s,slots:i}}function ye(t,s){return"undefined"==typeof window?e.useEffect(t,s):e.useLayoutEffect(t,s)}const Se=e.createContext(null),Te=e.createContext(null),xe=e.forwardRef((function(s,i){let{className:r,tag:a="div",wrapperTag:n="div",children:l,onSwiper:o,...d}=void 0===s?{}:s,c=!1;const[p,u]=e.useState("swiper"),[m,f]=e.useState(null),[h,v]=e.useState(!1),g=e.useRef(!1),w=e.useRef(null),b=e.useRef(null),y=e.useRef(null),S=e.useRef(null),T=e.useRef(null),x=e.useRef(null),E=e.useRef(null),C=e.useRef(null),{params:M,passedParams:P,rest:_,events:L}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const s={on:{}},i={},r={};ce(s,ie),s._emitClasses=!0,s.init=!1;const a={},n=oe.map((e=>e.replace(/_/,""))),l=Object.assign({},e);return Object.keys(l).forEach((l=>{void 0!==e[l]&&(n.indexOf(l)>=0?de(e[l])?(s[l]={},r[l]={},ce(s[l],e[l]),ce(r[l],e[l])):(s[l]=e[l],r[l]=e[l]):0===l.search(/on[A-Z]/)&&"function"==typeof e[l]?t?i[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:s.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:a[l]=e[l])})),["navigation","pagination","scrollbar"].forEach((e=>{!0===s[e]&&(s[e]={}),!1===s[e]&&delete s[e]})),{params:s,passedParams:r,rest:a,events:i}}(d),{slides:k,slots:O}=be(l),I=()=>{v(!h)};Object.assign(M.on,{_containerClasses(e,t){u(t)}});const A=()=>{Object.assign(M.on,L),c=!0;const e={...M};if(delete e.wrapperClass,b.current=new le(e),b.current.virtual&&b.current.params.virtual.enabled){b.current.virtual.slides=k;const e={cache:!1,slides:k,renderExternal:f,renderExternalUpdate:!1};ce(b.current.params.virtual,e),ce(b.current.originalParams.virtual,e)}};w.current||A(),b.current&&b.current.on("_beforeBreakpoint",I);return e.useEffect((()=>()=>{b.current&&b.current.off("_beforeBreakpoint",I)})),e.useEffect((()=>{!g.current&&b.current&&(b.current.emitSlidesClasses(),g.current=!0)})),ye((()=>{if(i&&(i.current=w.current),w.current)return b.current.destroyed&&A(),function(e,t){let{el:s,nextEl:i,prevEl:r,paginationEl:a,scrollbarEl:n,swiper:l}=e;pe(t)&&i&&r&&(l.params.navigation.nextEl=i,l.originalParams.navigation.nextEl=i,l.params.navigation.prevEl=r,l.originalParams.navigation.prevEl=r),ue(t)&&a&&(l.params.pagination.el=a,l.originalParams.pagination.el=a),me(t)&&n&&(l.params.scrollbar.el=n,l.originalParams.scrollbar.el=n),l.init(s)}({el:w.current,nextEl:T.current,prevEl:x.current,paginationEl:E.current,scrollbarEl:C.current,swiper:b.current},M),o&&!b.current.destroyed&&o(b.current),()=>{b.current&&!b.current.destroyed&&b.current.destroy(!0,!1)}}),[]),ye((()=>{!c&&L&&b.current&&Object.keys(L).forEach((e=>{b.current.on(e,L[e])}));const e=function(e,t,s,i,r){const a=[];if(!t)return a;const n=e=>{a.indexOf(e)<0&&a.push(e)};if(s&&i){const e=i.map(r),t=s.map(r);e.join("")!==t.join("")&&n("children"),i.length!==s.length&&n("children")}return oe.filter((e=>"_"===e[0])).map((e=>e.replace(/_/,""))).forEach((s=>{if(s in e&&s in t)if(de(e[s])&&de(t[s])){const i=Object.keys(e[s]),r=Object.keys(t[s]);i.length!==r.length?n(s):(i.forEach((i=>{e[s][i]!==t[s][i]&&n(s)})),r.forEach((i=>{e[s][i]!==t[s][i]&&n(s)})))}else e[s]!==t[s]&&n(s)})),a}(P,y.current,k,S.current,(e=>e.key));return y.current=P,S.current=k,e.length&&b.current&&!b.current.destroyed&&function(e){let{swiper:t,slides:s,passedParams:i,changedParams:r,nextEl:a,prevEl:n,scrollbarEl:l,paginationEl:o}=e;const d=r.filter((e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e)),{params:c,pagination:p,navigation:u,scrollbar:m,virtual:f,thumbs:h}=t;let v,g,w,b,y,S,T,x;r.includes("thumbs")&&i.thumbs&&i.thumbs.swiper&&!i.thumbs.swiper.destroyed&&c.thumbs&&(!c.thumbs.swiper||c.thumbs.swiper.destroyed)&&(v=!0),r.includes("controller")&&i.controller&&i.controller.control&&c.controller&&!c.controller.control&&(g=!0),r.includes("pagination")&&i.pagination&&(i.pagination.el||o)&&(c.pagination||!1===c.pagination)&&p&&!p.el&&(w=!0),r.includes("scrollbar")&&i.scrollbar&&(i.scrollbar.el||l)&&(c.scrollbar||!1===c.scrollbar)&&m&&!m.el&&(b=!0),r.includes("navigation")&&i.navigation&&(i.navigation.prevEl||n)&&(i.navigation.nextEl||a)&&(c.navigation||!1===c.navigation)&&u&&!u.prevEl&&!u.nextEl&&(y=!0);const E=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),c[e].prevEl=void 0,c[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),c[e].el=void 0,t[e].el=void 0))};r.includes("loop")&&t.isElement&&(c.loop&&!i.loop?S=!0:!c.loop&&i.loop?T=!0:x=!0),d.forEach((e=>{if(de(c[e])&&de(i[e]))Object.assign(c[e],i[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in i[e])||i[e].enabled||E(e);else{const t=i[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?c[e]=i[e]:!1===t&&E(e)}})),d.includes("controller")&&!g&&t.controller&&t.controller.control&&c.controller&&c.controller.control&&(t.controller.control=c.controller.control),r.includes("children")&&s&&f&&c.virtual.enabled?(f.slides=s,f.update(!0)):r.includes("virtual")&&f&&c.virtual.enabled&&(s&&(f.slides=s),f.update(!0)),r.includes("children")&&s&&c.loop&&(x=!0),v&&h.init()&&h.update(!0);g&&(t.controller.control=c.controller.control),w&&(!t.isElement||o&&"string"!=typeof o||(o=document.createElement("div"),o.classList.add("swiper-pagination"),o.part.add("pagination"),t.el.appendChild(o)),o&&(c.pagination.el=o),p.init(),p.render(),p.update()),b&&(!t.isElement||l&&"string"!=typeof l||(l=document.createElement("div"),l.classList.add("swiper-scrollbar"),l.part.add("scrollbar"),t.el.appendChild(l)),l&&(c.scrollbar.el=l),m.init(),m.updateSize(),m.setTranslate()),y&&(t.isElement&&(a&&"string"!=typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-next"),a.innerHTML=t.hostEl.constructor.nextButtonSvg,a.part.add("button-next"),t.el.appendChild(a)),n&&"string"!=typeof n||(n=document.createElement("div"),n.classList.add("swiper-button-prev"),n.innerHTML=t.hostEl.constructor.prevButtonSvg,n.part.add("button-prev"),t.el.appendChild(n))),a&&(c.navigation.nextEl=a),n&&(c.navigation.prevEl=n),u.init(),u.update()),r.includes("allowSlideNext")&&(t.allowSlideNext=i.allowSlideNext),r.includes("allowSlidePrev")&&(t.allowSlidePrev=i.allowSlidePrev),r.includes("direction")&&t.changeDirection(i.direction,!1),(S||x)&&t.loopDestroy(),(T||x)&&t.loopCreate(),t.update()}({swiper:b.current,slides:k,passedParams:P,changedParams:e,nextEl:T.current,prevEl:x.current,scrollbarEl:C.current,paginationEl:E.current}),()=>{L&&b.current&&Object.keys(L).forEach((e=>{b.current.off(e,L[e])}))}})),ye((()=>{var e;!(e=b.current)||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())}),[m]),t.createElement(a,ve({ref:w,className:fe(`${p}${r?` ${r}`:""}`)},_),t.createElement(Te.Provider,{value:b.current},O["container-start"],t.createElement(n,{className:he(M.wrapperClass)},O["wrapper-start"],M.virtual?function(e,s,i){if(!i)return null;const r=e=>{let t=e;return e<0?t=s.length+e:t>=s.length&&(t-=s.length),t},a=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${i.offset}px`}:{top:`${i.offset}px`},{from:n,to:l}=i,o=e.params.loop?-s.length:0,d=e.params.loop?2*s.length:s.length,c=[];for(let t=o;t=n&&t<=l&&c.push(s[r(t)]);return c.map(((s,i)=>t.cloneElement(s,{swiper:e,style:a,key:s.props.virtualIndex||s.key||`slide-${i}`})))}(b.current,k,m):k.map(((e,s)=>t.cloneElement(e,{swiper:b.current,swiperSlideIndex:s}))),O["wrapper-end"]),pe(M)&&t.createElement(t.Fragment,null,t.createElement("div",{ref:x,className:"swiper-button-prev"}),t.createElement("div",{ref:T,className:"swiper-button-next"})),me(M)&&t.createElement("div",{ref:C,className:"swiper-scrollbar"}),ue(M)&&t.createElement("div",{ref:E,className:"swiper-pagination"}),O["container-end"]))}));xe.displayName="Swiper";const Ee=e.forwardRef((function(s,i){let{tag:r="div",children:a,className:n="",swiper:l,zoom:o,lazy:d,virtualIndex:c,swiperSlideIndex:p,...u}=void 0===s?{}:s;const m=e.useRef(null),[f,h]=e.useState("swiper-slide"),[v,g]=e.useState(!1);function w(e,t,s){t===m.current&&h(s)}ye((()=>{if(void 0!==p&&(m.current.swiperSlideIndex=p),i&&(i.current=m.current),m.current&&l){if(!l.destroyed)return l.on("_slideClass",w),()=>{l&&l.off("_slideClass",w)};"swiper-slide"!==f&&h("swiper-slide")}})),ye((()=>{l&&m.current&&!l.destroyed&&h(l.getSlideClasses(m.current))}),[l]);const b={isActive:f.indexOf("swiper-slide-active")>=0,isVisible:f.indexOf("swiper-slide-visible")>=0,isPrev:f.indexOf("swiper-slide-prev")>=0,isNext:f.indexOf("swiper-slide-next")>=0},y=()=>"function"==typeof a?a(b):a;return t.createElement(r,ve({ref:m,className:fe(`${f}${n?` ${n}`:""}`),"data-swiper-slide-index":c,onLoad:()=>{g(!0)}},u),o&&t.createElement(Se.Provider,{value:b},t.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"==typeof o?o:void 0},y(),d&&!v&&t.createElement("div",{className:"swiper-lazy-preloader"}))),!o&&t.createElement(Se.Provider,{value:b},y(),d&&!v&&t.createElement("div",{className:"swiper-lazy-preloader"})))}));Ee.displayName="SwiperSlide";const Ce="_container_qyqa1_1",Me="_inner_container_qyqa1_8",Pe="_animationContainer_qyqa1_15",_e="_duck_airdrop_qyqa1_24",Le="_title_qyqa1_29",ke="_list_container_qyqa1_34",Oe="_message_container_qyqa1_42",Ie="_message_qyqa1_42",Ae="_button_qyqa1_54",ze=()=>{const e=s();return i.jsxs("div",{className:Ce,onClick:()=>e.openPointsModal(),children:[i.jsx("p",{className:Le,children:"Earn TON and farm points"}),i.jsxs("div",{className:Me,children:[i.jsxs("div",{className:ke,children:[i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"1"}),i.jsx("p",{className:Ae,children:"Copy link & invite frens"})]}),i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"2"}),i.jsx("p",{className:Ae,children:"Complete tasks"})]}),i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"3"}),i.jsx("p",{className:Ae,children:"Claim rewards"})]})]}),i.jsx("div",{className:Pe,children:i.jsx(r,{speed:.9,src:"animations/duck-money.lottie",className:_e})})]})]})},Ne="_container_ip37z_1",Ge="_header_container_ip37z_8",De="_inner_container_ip37z_14",je="_animationContainer_ip37z_21",$e="_duck_airdrop_ip37z_30",Be="_title_ip37z_35",Fe="_list_container_ip37z_40",Ve="_message_container_ip37z_48",Re="_message_ip37z_48",He="_button_ip37z_60",qe=()=>{const e=new Date(Date.UTC(2024,11,17,11,0,0)),t=new Date,s=e.getTime()-t.getTime();if(s<=0)return"";return`${Math.floor(s/864e5)+1} days left`},We=()=>{const{setInputAssetAddress:e,setOutputAssetAddress:t,setInputAssetAmount:s}=a(),o=()=>{e(n),t(l),s("20")};return i.jsxs("div",{className:Ne,children:[i.jsxs("div",{className:Ge,children:[i.jsx("p",{className:Be,children:"$1,500,000 Airdrop"}),i.jsx("p",{className:Be,children:qe()})]}),i.jsxs("div",{className:De,children:[i.jsxs("div",{className:Fe,children:[i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"1"}),i.jsx("p",{className:He,onClick:()=>window.Telegram.WebApp.openLink("https://society.ton.org/the-open-league-new-year-airdrop"),children:"Get free badge"})]}),i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"2"}),i.jsx("p",{className:He,onClick:o,children:"Swap any tokens"})]}),i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"3"}),i.jsx("p",{className:He,onClick:o,children:"More you swap - more you get"})]})]}),i.jsx("div",{className:je,children:i.jsx(r,{speed:.8,src:"animations/duck-airdrop.lottie",className:$e})})]})]})},Ye=()=>i.jsxs(xe,{className:o.swiper,loop:!0,autoplay:{delay:1e4},speed:1400,effect:"fade",spaceBetween:16,pagination:{clickable:!0},modules:[I,A],children:[i.jsx(Ee,{className:d(o.swiperSlide,o.swiperSlideBlue),children:i.jsx(We,{})}),i.jsx(Ee,{className:d(o.swiperSlide,o.swiperSlideGreen),children:i.jsx(ze,{})})]});export{Ye as default}; +import{r as e,R as t,u as s,j as i,L as r,a,T as n,U as l,s as o,g as d}from"./index-CvfyoXEP.js";function c(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function p(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach((s=>{void 0===e[s]?e[s]=t[s]:c(t[s])&&c(e[s])&&Object.keys(t[s]).length>0&&p(e[s],t[s])}))}const u={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function m(){const e="undefined"!=typeof document?document:{};return p(e,u),e}const f={document:u,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function h(){const e="undefined"!=typeof window?window:{};return p(e,f),e}function v(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function g(){return Date.now()}function w(e,t){void 0===t&&(t="x");const s=h();let i,r,a;const n=function(e){const t=h();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(r=n.transform||n.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map((e=>e.replace(",","."))).join(", ")),a=new s.WebKitCSSMatrix("none"===r?"":r)):(a=n.MozTransform||n.OTransform||n.MsTransform||n.msTransform||n.transform||n.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=a.toString().split(",")),"x"===t&&(r=s.WebKitCSSMatrix?a.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===t&&(r=s.WebKitCSSMatrix?a.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),r||0}function b(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function y(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let i=1;it.indexOf(e)<0));for(let t=0,i=s.length;ta?"next":"prev",c=(e,t)=>"next"===d&&e>=t||"prev"===d&&e<=t,p=()=>{n=(new Date).getTime(),null===l&&(l=n);const e=Math.max(Math.min((n-l)/o,1),0),d=.5-Math.cos(e*Math.PI)/2;let u=a+d*(s-a);if(c(u,s)&&(u=s),t.wrapperEl.scrollTo({[i]:u}),c(u,s))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[i]:u})})),void r.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=r.requestAnimationFrame(p)};p()}function x(e,t){void 0===t&&(t="");const s=[...e.children];return e instanceof HTMLSlotElement&&s.push(...e.assignedElements()),t?s.filter((e=>e.matches(t))):s}function E(e){try{return void console.warn(e)}catch(t){}}function C(e,t){void 0===t&&(t=[]);const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:function(e){return void 0===e&&(e=""),e.trim().split(" ").filter((e=>!!e.trim()))}(t)),s}function M(e,t){return h().getComputedStyle(e,null).getPropertyValue(t)}function P(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function _(e,t){const s=[];let i=e.parentElement;for(;i;)t?i.matches(t)&&s.push(i):s.push(i),i=i.parentElement;return s}function L(e,t,s){const i=h();return e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom"))}function k(e){return(Array.isArray(e)?e:[e]).filter((e=>!!e))}function O(e){return void 0===e&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function I(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const a="swiper-pagination";let n;s({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${a}-bullet`,bulletActiveClass:`${a}-bullet-active`,modifierClass:`${a}-`,currentClass:`${a}-current`,totalClass:`${a}-total`,hiddenClass:`${a}-hidden`,progressbarFillClass:`${a}-progressbar-fill`,progressbarOppositeClass:`${a}-progressbar-opposite`,clickableClass:`${a}-clickable`,lockClass:`${a}-lock`,horizontalClass:`${a}-horizontal`,verticalClass:`${a}-vertical`,paginationDisabledClass:`${a}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;function o(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function d(e,s){const{bulletActiveClass:i}=t.params.pagination;e&&(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${i}-${s}`),(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&e.classList.add(`${i}-${s}-${s}`))}function c(e){const s=e.target.closest(O(t.params.pagination.bulletClass));if(!s)return;e.preventDefault();const i=P(s)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===i)return;const e=(r=t.realIndex,a=i,n=t.slides.length,(a%=n)==1+(r%=n)?"next":a===r-1?"previous":void 0);"next"===e?t.slideNext():"previous"===e?t.slidePrev():t.slideToLoop(i)}else t.slideTo(i);var r,a,n}function p(){const e=t.rtl,s=t.params.pagination;if(o())return;let i,a,c=t.pagination.el;c=k(c);const p=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,u=t.params.loop?Math.ceil(p/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(a=t.previousRealIndex||0,i=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(i=t.snapIndex,a=t.previousSnapIndex):(a=t.previousIndex||0,i=t.activeIndex||0),"bullets"===s.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const r=t.pagination.bullets;let o,p,u;if(s.dynamicBullets&&(n=L(r[0],t.isHorizontal()?"width":"height"),c.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(s.dynamicMainBullets+4)+"px"})),s.dynamicMainBullets>1&&void 0!==a&&(l+=i-(a||0),l>s.dynamicMainBullets-1?l=s.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(i-l,0),p=o+(Math.min(r.length,s.dynamicMainBullets)-1),u=(p+o)/2),r.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`))].map((e=>"string"==typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),c.length>1)r.forEach((e=>{const r=P(e);r===i?e.classList.add(...s.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),s.dynamicBullets&&(r>=o&&r<=p&&e.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),r===o&&d(e,"prev"),r===p&&d(e,"next"))}));else{const e=r[i];if(e&&e.classList.add(...s.bulletActiveClass.split(" ")),t.isElement&&r.forEach(((e,t)=>{e.setAttribute("part",t===i?"bullet-active":"bullet")})),s.dynamicBullets){const e=r[o],t=r[p];for(let i=o;i<=p;i+=1)r[i]&&r[i].classList.add(...`${s.bulletActiveClass}-main`.split(" "));d(e,"prev"),d(t,"next")}}if(s.dynamicBullets){const i=Math.min(r.length,s.dynamicMainBullets+4),a=(n*i-n)/2-u*n,l=e?"right":"left";r.forEach((e=>{e.style[t.isHorizontal()?l:"top"]=`${a}px`}))}}c.forEach(((e,a)=>{if("fraction"===s.type&&(e.querySelectorAll(O(s.currentClass)).forEach((e=>{e.textContent=s.formatFractionCurrent(i+1)})),e.querySelectorAll(O(s.totalClass)).forEach((e=>{e.textContent=s.formatFractionTotal(u)}))),"progressbar"===s.type){let r;r=s.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const a=(i+1)/u;let n=1,l=1;"horizontal"===r?n=a:l=a,e.querySelectorAll(O(s.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${l})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===s.type&&s.renderCustom?(e.innerHTML=s.renderCustom(t,i+1,u),0===a&&r("paginationRender",e)):(0===a&&r("paginationRender",e),r("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass)}))}function u(){const e=t.params.pagination;if(o())return;const s=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let i=t.pagination.el;i=k(i);let a="";if("bullets"===e.type){let i=t.params.loop?Math.ceil(s/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&i>s&&(i=s);for(let s=0;s`}"fraction"===e.type&&(a=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):` / `),"progressbar"===e.type&&(a=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):``),t.pagination.bullets=[],i.forEach((s=>{"custom"!==e.type&&(s.innerHTML=a||""),"bullets"===e.type&&t.pagination.bullets.push(...s.querySelectorAll(O(e.bulletClass)))})),"custom"!==e.type&&r("paginationRender",i[0])}function m(){t.params.pagination=function(e,t,s,i){return e.params.createElements&&Object.keys(i).forEach((r=>{if(!s[r]&&!0===s.auto){let a=x(e.el,`.${i[r]}`)[0];a||(a=C("div",i[r]),a.className=i[r],e.el.append(a)),s[r]=a,t[r]=a}})),s}(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let s;"string"==typeof e.el&&t.isElement&&(s=t.el.querySelector(e.el)),s||"string"!=typeof e.el||(s=[...document.querySelectorAll(e.el)]),s||(s=e.el),s&&0!==s.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(s)&&s.length>1&&(s=[...t.el.querySelectorAll(e.el)],s.length>1&&(s=s.filter((e=>_(e,".swiper")[0]===t.el))[0])),Array.isArray(s)&&1===s.length&&(s=s[0]),Object.assign(t.pagination,{el:s}),s=k(s),s.forEach((s=>{"bullets"===e.type&&e.clickable&&s.classList.add(...(e.clickableClass||"").split(" ")),s.classList.add(e.modifierClass+e.type),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(s.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&s.classList.add(e.progressbarOppositeClass),e.clickable&&s.addEventListener("click",c),t.enabled||s.classList.add(e.lockClass)})))}function f(){const e=t.params.pagination;if(o())return;let s=t.pagination.el;s&&(s=k(s),s.forEach((s=>{s.classList.remove(e.hiddenClass),s.classList.remove(e.modifierClass+e.type),s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&(s.classList.remove(...(e.clickableClass||"").split(" ")),s.removeEventListener("click",c))}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}i("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:s}=t.pagination;s=k(s),s.forEach((s=>{s.classList.remove(e.horizontalClass,e.verticalClass),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),i("init",(()=>{!1===t.params.pagination.enabled?h():(m(),u(),p())})),i("activeIndexChange",(()=>{void 0===t.snapIndex&&p()})),i("snapIndexChange",(()=>{p()})),i("snapGridLengthChange",(()=>{u(),p()})),i("destroy",(()=>{f()})),i("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),i("lock unlock",(()=>{p()})),i("click",((e,s)=>{const i=s.target,a=k(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&a&&a.length>0&&!i.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&i===t.navigation.nextEl||t.navigation.prevEl&&i===t.navigation.prevEl))return;const e=a[0].classList.contains(t.params.pagination.hiddenClass);r(!0===e?"paginationShow":"paginationHide"),a.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const h=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),f()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=k(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),m(),u(),p()},disable:h,render:u,update:p,init:m,destroy:f})}function A(e){let t,s,{swiper:i,extendParams:r,on:a,emit:n,params:l}=e;i.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let o,d,c,p,u,f,h,v,g=l&&l.autoplay?l.autoplay.delay:3e3,w=l&&l.autoplay?l.autoplay.delay:3e3,b=(new Date).getTime();function y(e){i&&!i.destroyed&&i.wrapperEl&&e.target===i.wrapperEl&&(i.wrapperEl.removeEventListener("transitionend",y),v||e.detail&&e.detail.bySwiperTouchMove||M())}const S=()=>{if(i.destroyed||!i.autoplay.running)return;i.autoplay.paused?d=!0:d&&(w=o,d=!1);const e=i.autoplay.paused?o:b+w-(new Date).getTime();i.autoplay.timeLeft=e,n("autoplayTimeLeft",e,e/g),s=requestAnimationFrame((()=>{S()}))},T=e=>{if(i.destroyed||!i.autoplay.running)return;cancelAnimationFrame(s),S();let r=void 0===e?i.params.autoplay.delay:e;g=i.params.autoplay.delay,w=i.params.autoplay.delay;const a=(()=>{let e;if(e=i.virtual&&i.params.virtual.enabled?i.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:i.slides[i.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(a)&&a>0&&void 0===e&&(r=a,g=a,w=a),o=r;const l=i.params.speed,d=()=>{i&&!i.destroyed&&(i.params.autoplay.reverseDirection?!i.isBeginning||i.params.loop||i.params.rewind?(i.slidePrev(l,!0,!0),n("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(i.slides.length-1,l,!0,!0),n("autoplay")):!i.isEnd||i.params.loop||i.params.rewind?(i.slideNext(l,!0,!0),n("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(0,l,!0,!0),n("autoplay")),i.params.cssMode&&(b=(new Date).getTime(),requestAnimationFrame((()=>{T()}))))};return r>0?(clearTimeout(t),t=setTimeout((()=>{d()}),r)):requestAnimationFrame((()=>{d()})),r},x=()=>{b=(new Date).getTime(),i.autoplay.running=!0,T(),n("autoplayStart")},E=()=>{i.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(s),n("autoplayStop")},C=(e,s)=>{if(i.destroyed||!i.autoplay.running)return;clearTimeout(t),e||(h=!0);const r=()=>{n("autoplayPause"),i.params.autoplay.waitForTransition?i.wrapperEl.addEventListener("transitionend",y):M()};if(i.autoplay.paused=!0,s)return f&&(o=i.params.autoplay.delay),f=!1,void r();const a=o||i.params.autoplay.delay;o=a-((new Date).getTime()-b),i.isEnd&&o<0&&!i.params.loop||(o<0&&(o=0),r())},M=()=>{i.isEnd&&o<0&&!i.params.loop||i.destroyed||!i.autoplay.running||(b=(new Date).getTime(),h?(h=!1,T(o)):T(),i.autoplay.paused=!1,n("autoplayResume"))},P=()=>{if(i.destroyed||!i.autoplay.running)return;const e=m();"hidden"===e.visibilityState&&(h=!0,C(!0)),"visible"===e.visibilityState&&M()},_=e=>{"mouse"===e.pointerType&&(h=!0,v=!0,i.animating||i.autoplay.paused||C(!0))},L=e=>{"mouse"===e.pointerType&&(v=!1,i.autoplay.paused&&M())};a("init",(()=>{i.params.autoplay.enabled&&(i.params.autoplay.pauseOnMouseEnter&&(i.el.addEventListener("pointerenter",_),i.el.addEventListener("pointerleave",L)),m().addEventListener("visibilitychange",P),x())})),a("destroy",(()=>{i.el&&"string"!=typeof i.el&&(i.el.removeEventListener("pointerenter",_),i.el.removeEventListener("pointerleave",L)),m().removeEventListener("visibilitychange",P),i.autoplay.running&&E()})),a("_freeModeStaticRelease",(()=>{(p||h)&&M()})),a("_freeModeNoMomentumRelease",(()=>{i.params.autoplay.disableOnInteraction?E():C(!0,!0)})),a("beforeTransitionStart",((e,t,s)=>{!i.destroyed&&i.autoplay.running&&(s||!i.params.autoplay.disableOnInteraction?C(!0,!0):E())})),a("sliderFirstMove",(()=>{!i.destroyed&&i.autoplay.running&&(i.params.autoplay.disableOnInteraction?E():(c=!0,p=!1,h=!1,u=setTimeout((()=>{h=!0,p=!0,C(!0)}),200)))})),a("touchEnd",(()=>{if(!i.destroyed&&i.autoplay.running&&c){if(clearTimeout(u),clearTimeout(t),i.params.autoplay.disableOnInteraction)return p=!1,void(c=!1);p&&i.params.cssMode&&M(),p=!1,c=!1}})),a("slideChange",(()=>{!i.destroyed&&i.autoplay.running&&(f=!0)})),Object.assign(i.autoplay,{start:x,stop:E,pause:C,resume:M})}let z,N,G;function D(){return z||(z=function(){const e=h(),t=m();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),z}function j(e){return void 0===e&&(e={}),N||(N=function(e){let{userAgent:t}=void 0===e?{}:e;const s=D(),i=h(),r=i.navigator.platform,a=t||i.navigator.userAgent,n={ios:!1,android:!1},l=i.screen.width,o=i.screen.height,d=a.match(/(Android);?[\s\/]+([\d.]+)?/);let c=a.match(/(iPad).*OS\s([\d_]+)/);const p=a.match(/(iPod)(.*OS\s([\d_]+))?/),u=!c&&a.match(/(iPhone\sOS|iOS)\s([\d_]+)/),m="Win32"===r;let f="MacIntel"===r;return!c&&f&&s.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${o}`)>=0&&(c=a.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),f=!1),d&&!m&&(n.os="android",n.android=!0),(c||u||p)&&(n.os="ios",n.ios=!0),n}(e)),N}function $(){return G||(G=function(){const e=h(),t=j();let s=!1;function i(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(i()){const t=String(e.navigator.userAgent);if(t.includes("Version/")){const[e,i]=t.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));s=e<16||16===e&&i<2}}const r=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),a=i();return{isSafari:s||a,needPerspectiveFix:s,need3dFix:a||r&&t.ios,isWebView:r}}()),G}const B=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const F=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const V=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){let t=s.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(s.shadowRoot?t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame((()=>{s.shadowRoot&&(t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())}))),t&&t.remove()}},R=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},H=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const i="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),r=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=r,a=[s-t];return a.push(...Array.from({length:t}).map(((e,t)=>s+i+t))),void e.slides.forEach(((t,s)=>{a.includes(t.column)&&R(e,s)}))}const a=r+i-1;if(e.params.rewind||e.params.loop)for(let n=r-t;n<=a+t;n+=1){const t=(n%s+s)%s;(ta)&&R(e,t)}else for(let n=Math.max(r-t,0);n<=Math.min(a+t,s-1);n+=1)n!==r&&(n>a||nn?"next":a=i.innerWidth-n)||"prevent"===a&&(t.preventDefault(),!0)}function Y(e){const t=this,s=m();let i=e;i.originalEvent&&(i=i.originalEvent);const r=t.touchEventsData;if("pointerdown"===i.type){if(null!==r.pointerId&&r.pointerId!==i.pointerId)return;r.pointerId=i.pointerId}else"touchstart"===i.type&&1===i.targetTouches.length&&(r.touchId=i.targetTouches[0].identifier);if("touchstart"===i.type)return void W(t,i,i.targetTouches[0].pageX);const{params:a,touches:n,enabled:l}=t;if(!l)return;if(!a.simulateTouch&&"mouse"===i.pointerType)return;if(t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let o=i.target;if("wrapper"===a.touchEventsTarget&&!function(e,t){const s=t.contains(e);if(!s&&t instanceof HTMLSlotElement)return[...t.assignedElements()].includes(e);return s}(o,t.wrapperEl))return;if("which"in i&&3===i.which)return;if("button"in i&&i.button>0)return;if(r.isTouched&&r.isMoved)return;const d=!!a.noSwipingClass&&""!==a.noSwipingClass,c=i.composedPath?i.composedPath():i.path;d&&i.target&&i.target.shadowRoot&&c&&(o=c[0]);const p=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`,u=!(!i.target||!i.target.shadowRoot);if(a.noSwiping&&(u?function(e,t){return void 0===t&&(t=this),function t(s){if(!s||s===m()||s===h())return null;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(e);return i||s.getRootNode?i||t(s.getRootNode().host):null}(t)}(p,o):o.closest(p)))return void(t.allowClick=!0);if(a.swipeHandler&&!o.closest(a.swipeHandler))return;n.currentX=i.pageX,n.currentY=i.pageY;const f=n.currentX,v=n.currentY;if(!W(t,i,f))return;Object.assign(r,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),n.startX=f,n.startY=v,r.touchStartTime=g(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(r.allowThresholdMove=!1);let w=!0;o.matches(r.focusableElements)&&(w=!1,"SELECT"===o.nodeName&&(r.isTouched=!1)),s.activeElement&&s.activeElement.matches(r.focusableElements)&&s.activeElement!==o&&("mouse"===i.pointerType||"mouse"!==i.pointerType&&!o.matches(r.focusableElements))&&s.activeElement.blur();const b=w&&t.allowTouchMove&&a.touchStartPreventDefault;!a.touchStartForcePreventDefault&&!b||o.isContentEditable||i.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",i)}function X(e){const t=m(),s=this,i=s.touchEventsData,{params:r,touches:a,rtlTranslate:n,enabled:l}=s;if(!l)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let o,d=e;if(d.originalEvent&&(d=d.originalEvent),"pointermove"===d.type){if(null!==i.touchId)return;if(d.pointerId!==i.pointerId)return}if("touchmove"===d.type){if(o=[...d.changedTouches].filter((e=>e.identifier===i.touchId))[0],!o||o.identifier!==i.touchId)return}else o=d;if(!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",d));const c=o.pageX,p=o.pageY;if(d.preventedByNestedSwiper)return a.startX=c,void(a.startY=p);if(!s.allowTouchMove)return d.target.matches(i.focusableElements)||(s.allowClick=!1),void(i.isTouched&&(Object.assign(a,{startX:c,startY:p,currentX:c,currentY:p}),i.touchStartTime=g()));if(r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(pa.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(ca.startX&&s.translate>=s.minTranslate())return;if(t.activeElement&&t.activeElement.matches(i.focusableElements)&&t.activeElement!==d.target&&"mouse"!==d.pointerType&&t.activeElement.blur(),t.activeElement&&d.target===t.activeElement&&d.target.matches(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);i.allowTouchCallbacks&&s.emit("touchMove",d),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=c,a.currentY=p;const u=a.currentX-a.startX,f=a.currentY-a.startY;if(s.params.threshold&&Math.sqrt(u**2+f**2)=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(u))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",d),void 0===i.startMoving&&(a.currentX===a.startX&&a.currentY===a.startY||(i.startMoving=!0)),i.isScrolling||"touchmove"===d.type&&i.preventTouchMoveFromPointerMove)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&d.cancelable&&d.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&d.stopPropagation();let h=s.isHorizontal()?u:f,v=s.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;r.oneWayMovement&&(h=Math.abs(h)*(n?1:-1),v=Math.abs(v)*(n?1:-1)),a.diff=h,h*=r.touchRatio,n&&(h=-h,v=-v);const w=s.touchesDirection;s.swipeDirection=h>0?"prev":"next",s.touchesDirection=v>0?"prev":"next";const b=s.params.loop&&!r.cssMode,y="next"===s.touchesDirection&&s.allowSlideNext||"prev"===s.touchesDirection&&s.allowSlidePrev;if(!i.isMoved){if(b&&y&&s.loopFix({direction:s.swipeDirection}),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});s.wrapperEl.dispatchEvent(e)}i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",d)}if((new Date).getTime(),i.isMoved&&i.allowThresholdMove&&w!==s.touchesDirection&&b&&y&&Math.abs(h)>=1)return Object.assign(a,{startX:c,startY:p,currentX:c,currentY:p,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,void(i.startTranslate=i.currentTranslate);s.emit("sliderMove",d),i.isMoved=!0,i.currentTranslate=h+i.startTranslate;let S=!0,T=r.resistanceRatio;if(r.touchReleaseOnEdges&&(T=0),h>0?(b&&y&&i.allowThresholdMove&&i.currentTranslate>(r.centeredSlides?s.minTranslate()-s.slidesSizesGrid[s.activeIndex+1]-("auto"!==r.slidesPerView&&s.slides.length-r.slidesPerView>=2?s.slidesSizesGrid[s.activeIndex+1]+s.params.spaceBetween:0)-s.params.spaceBetween:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>s.minTranslate()&&(S=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+h)**T))):h<0&&(b&&y&&i.allowThresholdMove&&i.currentTranslate<(r.centeredSlides?s.maxTranslate()+s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween+("auto"!==r.slidesPerView&&s.slides.length-r.slidesPerView>=2?s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween:0):s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===r.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),i.currentTranslatei.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(h)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,i.currentTranslate=i.startTranslate,void(a.diff=s.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function U(e){const t=this,s=t.touchEventsData;let i,r=e;r.originalEvent&&(r=r.originalEvent);if("touchend"===r.type||"touchcancel"===r.type){if(i=[...r.changedTouches].filter((e=>e.identifier===s.touchId))[0],!i||i.identifier!==s.touchId)return}else{if(null!==s.touchId)return;if(r.pointerId!==s.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)){if(!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return}s.pointerId=null,s.touchId=null;const{params:a,touches:n,rtlTranslate:l,slidesGrid:o,enabled:d}=t;if(!d)return;if(!a.simulateTouch&&"mouse"===r.pointerType)return;if(s.allowTouchCallbacks&&t.emit("touchEnd",r),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&a.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);a.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const c=g(),p=c-s.touchStartTime;if(t.allowClick){const e=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(e&&e[0]||r.target,e),t.emit("tap click",r),p<300&&c-s.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(s.lastClickTime=g(),v((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===n.diff&&!s.loopSwapReset||s.currentTranslate===s.startTranslate&&!s.loopSwapReset)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let u;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,u=a.followFinger?l?t.translate:-t.translate:-s.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:u});const m=u>=-t.maxTranslate()&&!t.params.loop;let f=0,h=t.slidesSizesGrid[0];for(let v=0;v=o[v]&&u=o[v])&&(f=v,h=o[o.length-1]-o[o.length-2])}let w=null,b=null;a.rewind&&(t.isBeginning?b=a.virtual&&a.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(w=0));const y=(u-o[f])/h,S=fa.longSwipesMs){if(!a.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(y>=a.longSwipesRatio?t.slideTo(a.rewind&&t.isEnd?w:f+S):t.slideTo(f)),"prev"===t.swipeDirection&&(y>1-a.longSwipesRatio?t.slideTo(f+S):null!==b&&y<0&&Math.abs(y)>a.longSwipesRatio?t.slideTo(b):t.slideTo(f))}else{if(!a.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(f+S):t.slideTo(f):("next"===t.swipeDirection&&t.slideTo(null!==w?w:f+S),"prev"===t.swipeDirection&&t.slideTo(null!==b?b:f))}}function K(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:r,snapGrid:a}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=r,e.allowSlideNext=i,e.params.watchOverflow&&a!==e.snapGrid&&e.checkOverflow()}function Z(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function J(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:i}=e;if(!i)return;let r;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const a=e.maxTranslate()-e.minTranslate();r=0===a?0:(e.translate-e.minTranslate())/a,r!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function Q(e){const t=this;V(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function ee(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const te=(e,t)=>{const s=m(),{params:i,el:r,wrapperEl:a,device:n}=e,l=!!i.nested,o="on"===t?"addEventListener":"removeEventListener",d=t;r&&"string"!=typeof r&&(s[o]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:l}),r[o]("touchstart",e.onTouchStart,{passive:!1}),r[o]("pointerdown",e.onTouchStart,{passive:!1}),s[o]("touchmove",e.onTouchMove,{passive:!1,capture:l}),s[o]("pointermove",e.onTouchMove,{passive:!1,capture:l}),s[o]("touchend",e.onTouchEnd,{passive:!0}),s[o]("pointerup",e.onTouchEnd,{passive:!0}),s[o]("pointercancel",e.onTouchEnd,{passive:!0}),s[o]("touchcancel",e.onTouchEnd,{passive:!0}),s[o]("pointerout",e.onTouchEnd,{passive:!0}),s[o]("pointerleave",e.onTouchEnd,{passive:!0}),s[o]("contextmenu",e.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&r[o]("click",e.onClick,!0),i.cssMode&&a[o]("scroll",e.onScroll),i.updateOnWindowResize?e[d](n.ios||n.android?"resize orientationchange observerUpdate":"resize observerUpdate",K,!0):e[d]("observerUpdate",K,!0),r[o]("load",e.onLoad,{capture:!0}))};const se=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var ie={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function re(e,t){return function(s){void 0===s&&(s={});const i=Object.keys(s)[0],r=s[i];"object"==typeof r&&null!==r?(!0===e[i]&&(e[i]={enabled:!0}),"navigation"===i&&e[i]&&e[i].enabled&&!e[i].prevEl&&!e[i].nextEl&&(e[i].auto=!0),["pagination","scrollbar"].indexOf(i)>=0&&e[i]&&e[i].enabled&&!e[i].el&&(e[i].auto=!0),i in e&&"enabled"in r?("object"!=typeof e[i]||"enabled"in e[i]||(e[i].enabled=!0),e[i]||(e[i]={enabled:!1}),y(t,s)):y(t,s)):y(t,s)}}const ae={eventsEmitter:{on(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;const r=s?"unshift":"push";return e.split(" ").forEach((e=>{i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][r](t)})),i},once(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;function r(){i.off(e,r),r.__emitterProxy&&delete r.__emitterProxy;for(var s=arguments.length,a=new Array(s),n=0;n=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((i,r)=>{(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&s.eventsListeners[e].splice(r,1)}))})),s):s},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,s,i;for(var r=arguments.length,a=new Array(r),n=0;n{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(i,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(i,s)}))})),e}},update:{updateSize:function(){const e=this;let t,s;const i=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:i.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:i.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(M(i,"padding-left")||0,10)-parseInt(M(i,"padding-right")||0,10),s=s-parseInt(M(i,"padding-top")||0,10)-parseInt(M(i,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t,s){return parseFloat(t.getPropertyValue(e.getDirectionLabel(s))||0)}const s=e.params,{wrapperEl:i,slidesEl:r,size:a,rtlTranslate:n,wrongRTL:l}=e,o=e.virtual&&s.virtual.enabled,d=o?e.virtual.slides.length:e.slides.length,c=x(r,`.${e.params.slideClass}, swiper-slide`),p=o?e.virtual.slides.length:c.length;let u=[];const m=[],f=[];let h=s.slidesOffsetBefore;"function"==typeof h&&(h=s.slidesOffsetBefore.call(e));let v=s.slidesOffsetAfter;"function"==typeof v&&(v=s.slidesOffsetAfter.call(e));const g=e.snapGrid.length,w=e.slidesGrid.length;let b=s.spaceBetween,y=-h,T=0,E=0;if(void 0===a)return;"string"==typeof b&&b.indexOf("%")>=0?b=parseFloat(b.replace("%",""))/100*a:"string"==typeof b&&(b=parseFloat(b)),e.virtualSize=-b,c.forEach((e=>{n?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),s.centeredSlides&&s.cssMode&&(S(i,"--swiper-centered-offset-before",""),S(i,"--swiper-centered-offset-after",""));const C=s.grid&&s.grid.rows>1&&e.grid;let P;C?e.grid.initSlides(c):e.grid&&e.grid.unsetSlides();const _="auto"===s.slidesPerView&&s.breakpoints&&Object.keys(s.breakpoints).filter((e=>void 0!==s.breakpoints[e].slidesPerView)).length>0;for(let S=0;S1&&u.push(e.virtualSize-a)}if(o&&s.loop){const t=f[0]+b;if(s.slidesPerGroup>1){const i=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/s.slidesPerGroup),r=t*s.slidesPerGroup;for(let e=0;e!(s.cssMode&&!s.loop)||t!==c.length-1)).forEach((e=>{e.style[t]=`${b}px`}))}if(s.centeredSlides&&s.centeredSlidesBounds){let e=0;f.forEach((t=>{e+=t+(b||0)})),e-=b;const t=e>a?e-a:0;u=u.map((e=>e<=0?-h:e>t?t+v:e))}if(s.centerInsufficientSlides){let e=0;f.forEach((t=>{e+=t+(b||0)})),e-=b;const t=(s.slidesOffsetBefore||0)+(s.slidesOffsetAfter||0);if(e+t{u[t]=e-s})),m.forEach(((e,t)=>{m[t]=e+s}))}}if(Object.assign(e,{slides:c,snapGrid:u,slidesGrid:m,slidesSizesGrid:f}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){S(i,"--swiper-centered-offset-before",-u[0]+"px"),S(i,"--swiper-centered-offset-after",e.size/2-f[f.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}if(p!==d&&e.emit("slidesLengthChange"),u.length!==g&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),m.length!==w&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(o||s.cssMode||"slide"!==s.effect&&"fade"!==s.effect)){const t=`${s.containerModifierClass}backface-hidden`,i=e.el.classList.contains(t);p<=s.maxBackfaceHiddenSlides?i||e.el.classList.add(t):i&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],i=t.virtual&&t.params.virtual.enabled;let r,a=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>i?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{s.push(e)}));else for(r=0;rt.slides.length&&!i)break;s.push(n(e))}else s.push(n(t.activeIndex));for(r=0;ra?e:a}(a||0===a)&&(t.wrapperEl.style.height=`${a}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let i=0;i=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let o=0;o=0&&u<=t.size-t.slidesSizesGrid[o],h=u>=0&&u1&&m<=t.size||u<=0&&m>=t.size;h&&(t.visibleSlides.push(e),t.visibleSlidesIndexes.push(o)),B(e,h,s.slideVisibleClass),B(e,f,s.slideFullyVisibleClass),e.progress=r?-c:c,e.originalProgress=r?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,i=t.maxTranslate()-t.minTranslate();let{progress:r,isBeginning:a,isEnd:n,progressLoop:l}=t;const o=a,d=n;if(0===i)r=0,a=!0,n=!0;else{r=(e-t.minTranslate())/i;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;a=s||r<=0,n=l||r>=1,s&&(r=0),l&&(r=1)}if(s.loop){const s=t.getSlideIndexByData(0),i=t.getSlideIndexByData(t.slides.length-1),r=t.slidesGrid[s],a=t.slidesGrid[i],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=r?(o-r)/n:(o+n-a)/n,l>1&&(l-=1)}Object.assign(t,{progress:r,progressLoop:l,isBeginning:a,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),a&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!a||d&&!n)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:i,activeIndex:r}=e,a=e.virtual&&s.virtual.enabled,n=e.grid&&s.grid&&s.grid.rows>1,l=e=>x(i,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let o,d,c;if(a)if(s.loop){let t=r-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),o=l(`[data-swiper-slide-index="${t}"]`)}else o=l(`[data-swiper-slide-index="${r}"]`);else n?(o=t.filter((e=>e.column===r))[0],c=t.filter((e=>e.column===r+1))[0],d=t.filter((e=>e.column===r-1))[0]):o=t[r];o&&(n||(c=function(e,t){const s=[];for(;e.nextElementSibling;){const i=e.nextElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!c&&(c=t[0]),d=function(e,t){const s=[];for(;e.previousElementSibling;){const i=e.previousElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&0===!d&&(d=t[t.length-1]))),t.forEach((e=>{F(e,e===o,s.slideActiveClass),F(e,e===c,s.slideNextClass),F(e,e===d,s.slidePrevClass)})),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:i,params:r,activeIndex:a,realIndex:n,snapIndex:l}=t;let o,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,i=e.rtlTranslate?e.translate:-e.translate;let r;for(let a=0;a=t[a]&&i=t[a]&&i=t[a]&&(r=a);return s.normalizeSlideIndex&&(r<0||void 0===r)&&(r=0),r}(t)),i.indexOf(s)>=0)o=i.indexOf(s);else{const e=Math.min(r.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/r.slidesPerGroup)}if(o>=i.length&&(o=i.length-1),d===a&&!t.params.loop)return void(o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")));if(d===a&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(d));const p=t.grid&&r.grid&&r.grid.rows>1;let u;if(t.virtual&&r.virtual.enabled&&r.loop)u=c(d);else if(p){const e=t.slides.filter((e=>e.column===d))[0];let s=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(s)&&(s=Math.max(t.slides.indexOf(e),0)),u=Math.floor(s/r.grid.rows)}else if(t.slides[d]){const e=t.slides[d].getAttribute("data-swiper-slide-index");u=e?parseInt(e,10):d}else u=d;Object.assign(t,{previousSnapIndex:l,snapIndex:o,previousRealIndex:n,realIndex:u,previousIndex:a,activeIndex:d}),t.initialized&&H(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(n!==u&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const s=this,i=s.params;let r=e.closest(`.${i.slideClass}, swiper-slide`);!r&&s.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach((e=>{!r&&e.matches&&e.matches(`.${i.slideClass}, swiper-slide`)&&(r=e)}));let a,n=!1;if(r)for(let l=0;lo?o:i&&e=o.length&&(v=o.length-1);const g=-o[v];if(l.normalizeSlideIndex)for(let y=0;y=t&&e=t&&e=t&&(n=y)}if(a.initialized&&n!==p){if(!a.allowSlideNext&&(u?g>a.translate&&g>a.minTranslate():ga.translate&&g>a.maxTranslate()&&(p||0)!==n)return!1}let w;n!==(c||0)&&s&&a.emit("beforeSlideChangeStart"),a.updateProgress(g),w=n>p?"next":n0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{m[e?"scrollLeft":"scrollTop"]=s}))):m[e?"scrollLeft":"scrollTop"]=s,b&&requestAnimationFrame((()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1}));else{if(!a.support.smoothScroll)return T({swiper:a,targetPosition:s,side:e?"left":"top"}),!0;m.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return a.setTransition(t),a.setTranslate(g),a.updateActiveIndex(n),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,i),a.transitionStart(s,w),0===t?a.transitionEnd(s,w):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(s,w))}),a.wrapperEl.addEventListener("transitionend",a.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,s,i){if(void 0===e&&(e=0),void 0===s&&(s=!0),"string"==typeof e){e=parseInt(e,10)}const r=this;if(r.destroyed)return;void 0===t&&(t=r.params.speed);const a=r.grid&&r.params.grid&&r.params.grid.rows>1;let n=e;if(r.params.loop)if(r.virtual&&r.params.virtual.enabled)n+=r.virtual.slidesBefore;else{let e;if(a){const t=n*r.params.grid.rows;e=r.slides.filter((e=>1*e.getAttribute("data-swiper-slide-index")===t))[0].column}else e=r.getSlideIndexByData(n);const t=a?Math.ceil(r.slides.length/r.params.grid.rows):r.slides.length,{centeredSlides:s}=r.params;let l=r.params.slidesPerView;"auto"===l?l=r.slidesPerViewDynamic():(l=Math.ceil(parseFloat(r.params.slidesPerView,10)),s&&l%2==0&&(l+=1));let o=t-e1*t.getAttribute("data-swiper-slide-index")===e))[0].column}else n=r.getSlideIndexByData(n)}return requestAnimationFrame((()=>{r.slideTo(n,t,s,i)})),r},slideNext:function(e,t,s){void 0===t&&(t=!0);const i=this,{enabled:r,params:a,animating:n}=i;if(!r||i.destroyed)return i;void 0===e&&(e=i.params.speed);let l=a.slidesPerGroup;"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(l=Math.max(i.slidesPerViewDynamic("current",!0),1));const o=i.activeIndex{i.slideTo(i.activeIndex+o,e,t,s)})),!0}return a.rewind&&i.isEnd?i.slideTo(0,e,t,s):i.slideTo(i.activeIndex+o,e,t,s)},slidePrev:function(e,t,s){void 0===t&&(t=!0);const i=this,{params:r,snapGrid:a,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=i;if(!o||i.destroyed)return i;void 0===e&&(e=i.params.speed);const c=i.virtual&&r.virtual.enabled;if(r.loop){if(d&&!c&&r.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(l?i.translate:-i.translate),m=a.map((e=>p(e)));let f=a[m.indexOf(u)-1];if(void 0===f&&r.cssMode){let e;a.forEach(((t,s)=>{u>=t&&(e=s)})),void 0!==e&&(f=a[e>0?e-1:e])}let h=0;if(void 0!==f&&(h=n.indexOf(f),h<0&&(h=i.activeIndex-1),"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(h=h-i.slidesPerViewDynamic("previous",!0)+1,h=Math.max(h,0))),r.rewind&&i.isBeginning){const r=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(r,e,t,s)}return r.loop&&0===i.activeIndex&&r.cssMode?(requestAnimationFrame((()=>{i.slideTo(h,e,t,s)})),!0):i.slideTo(h,e,t,s)},slideReset:function(e,t,s){void 0===t&&(t=!0);const i=this;if(!i.destroyed)return void 0===e&&(e=i.params.speed),i.slideTo(i.activeIndex,e,t,s)},slideToClosest:function(e,t,s,i){void 0===t&&(t=!0),void 0===i&&(i=.5);const r=this;if(r.destroyed)return;void 0===e&&(e=r.params.speed);let a=r.activeIndex;const n=Math.min(r.params.slidesPerGroupSkip,a),l=n+Math.floor((a-n)/r.params.slidesPerGroup),o=r.rtlTranslate?r.translate:-r.translate;if(o>=r.snapGrid[l]){const e=r.snapGrid[l];o-e>(r.snapGrid[l+1]-e)*i&&(a+=r.params.slidesPerGroup)}else{const e=r.snapGrid[l-1];o-e<=(r.snapGrid[l]-e)*i&&(a-=r.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,r.slidesGrid.length-1),r.slideTo(a,e,t,s)},slideToClickedSlide:function(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:s}=e,i="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let r,a=e.clickedIndex;const n=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;r=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?ae.slides.length-e.loopedSlides+i/2?(e.loopFix(),a=e.getSlideIndex(x(s,`${n}[data-swiper-slide-index="${r}"]`)[0]),v((()=>{e.slideTo(a)}))):e.slideTo(a):a>e.slides.length-i?(e.loopFix(),a=e.getSlideIndex(x(s,`${n}[data-swiper-slide-index="${r}"]`)[0]),v((()=>{e.slideTo(a)}))):e.slideTo(a)}else e.slideTo(a)}},loop:{loopCreate:function(e){const t=this,{params:s,slidesEl:i}=t;if(!s.loop||t.virtual&&t.params.virtual.enabled)return;const r=()=>{x(i,`.${s.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)}))},a=t.grid&&s.grid&&s.grid.rows>1,n=s.slidesPerGroup*(a?s.grid.rows:1),l=t.slides.length%n!=0,o=a&&t.slides.length%s.grid.rows!=0,d=e=>{for(let i=0;i1;d.lengthe.classList.contains(m.slideActiveClass)))[0]):S=a;const T="next"===i||!i,x="prev"===i||!i;let C=0,M=0;const P=w?Math.ceil(d.length/m.grid.rows):d.length,_=(w?d[a].column:a)+(f&&void 0===r?-h/2+.5:0);if(_=0;t-=1)d[t].column===e&&b.push(t)}else b.push(P-t-1)}}else if(_+h>P-g){M=Math.max(_-(P-2*g),v);for(let e=0;e{e.column===t&&y.push(s)})):y.push(t)}}if(o.__preventObserver__=!0,requestAnimationFrame((()=>{o.__preventObserver__=!1})),x&&b.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.prepend(d[e]),d[e].swiperLoopMoveDOM=!1})),T&&y.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.append(d[e]),d[e].swiperLoopMoveDOM=!1})),o.recalcSlides(),"auto"===m.slidesPerView?o.updateSlides():w&&(b.length>0&&x||y.length>0&&T)&&o.slides.forEach(((e,t)=>{o.grid.updateSlide(t,e,o.slides)})),m.watchSlidesProgress&&o.updateSlidesOffset(),s)if(b.length>0&&x){if(void 0===t){const e=o.slidesGrid[S],t=o.slidesGrid[S+C]-e;l?o.setTranslate(o.translate-t):(o.slideTo(S+Math.ceil(C),0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else if(r){const e=w?b.length/m.grid.rows:b.length;o.slideTo(o.activeIndex+e,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(y.length>0&&T)if(void 0===t){const e=o.slidesGrid[S],t=o.slidesGrid[S-M]-e;l?o.setTranslate(o.translate-t):(o.slideTo(S-M,0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else{const e=w?y.length/m.grid.rows:y.length;o.slideTo(o.activeIndex-e,0,!1,!0)}if(o.allowSlidePrev=c,o.allowSlideNext=p,o.controller&&o.controller.control&&!n){const e={slideRealIndex:t,direction:i,setTranslate:r,activeSlideIndex:a,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===m.slidesPerView&&s})})):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...e,slideTo:o.controller.control.params.slidesPerView===m.slidesPerView&&s})}o.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const i=[];e.slides.forEach((e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;i[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),i.forEach((e=>{s.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}},grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}},events:{attachEvents:function(){const e=this,{params:t}=e;e.onTouchStart=Y.bind(e),e.onTouchMove=X.bind(e),e.onTouchEnd=U.bind(e),e.onDocumentTouchStart=ee.bind(e),t.cssMode&&(e.onScroll=J.bind(e)),e.onClick=Z.bind(e),e.onLoad=Q.bind(e),te(e,"on")},detachEvents:function(){te(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{realIndex:t,initialized:s,params:i,el:r}=e,a=i.breakpoints;if(!a||a&&0===Object.keys(a).length)return;const n=e.getBreakpoint(a,e.params.breakpointsBase,e.el);if(!n||e.currentBreakpoint===n)return;const l=(n in a?a[n]:void 0)||e.originalParams,o=se(e,i),d=se(e,l),c=e.params.grabCursor,p=l.grabCursor,u=i.enabled;o&&!d?(r.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),e.emitContainerClasses()):!o&&d&&(r.classList.add(`${i.containerModifierClass}grid`),(l.grid.fill&&"column"===l.grid.fill||!l.grid.fill&&"column"===i.grid.fill)&&r.classList.add(`${i.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!p?e.unsetGrabCursor():!c&&p&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach((t=>{if(void 0===l[t])return;const s=i[t]&&i[t].enabled,r=l[t]&&l[t].enabled;s&&!r&&e[t].disable(),!s&&r&&e[t].enable()}));const m=l.direction&&l.direction!==i.direction,f=i.loop&&(l.slidesPerView!==i.slidesPerView||m),h=i.loop;m&&s&&e.changeDirection(),y(e.params,l);const v=e.params.enabled,g=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),u&&!v?e.disable():!u&&v&&e.enable(),e.currentBreakpoint=n,e.emit("_beforeBreakpoint",l),s&&(f?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!h&&g?(e.loopCreate(t),e.updateSlides()):h&&!g&&e.loopDestroy()),e.emit("breakpoint",l)},getBreakpoint:function(e,t,s){if(void 0===t&&(t="window"),!e||"container"===t&&!s)return;let i=!1;const r=h(),a="window"===t?r.innerHeight:s.clientHeight,n=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:a*t,point:e}}return{value:e,point:e}}));n.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let l=0;ls}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:i,el:r,device:a}=e,n=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((i=>{e[i]&&s.push(t+i)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:i},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:a.android},{ios:a.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...n),r.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e&&"string"!=typeof e&&(e.classList.remove(...t),this.emitContainerClasses())}}},ne={};let le=class e{constructor(){let t,s;for(var i=arguments.length,r=new Array(i),a=0;a1){const t=[];return n.querySelectorAll(s.el).forEach((i=>{const r=y({},s,{el:i});t.push(new e(r))})),t}const l=this;l.__swiper__=!0,l.support=D(),l.device=j({userAgent:s.userAgent}),l.browser=$(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],s.modules&&Array.isArray(s.modules)&&l.modules.push(...s.modules);const o={};l.modules.forEach((e=>{e({params:s,swiper:l,extendParams:re(s,o),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})}));const d=y({},ie,o);return l.params=y({},d,ne,s),l.originalParams=y({},l.params),l.passedParams=y({},s),l.params&&l.params.on&&Object.keys(l.params.on).forEach((e=>{l.on(e,l.params.on[e])})),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:s}=this,i=P(x(t,`.${s.slideClass}, swiper-slide`)[0]);return P(e)-i}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=x(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const i=s.minTranslate(),r=(s.maxTranslate()-i)*e+i;s.translateTo(r,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((s=>{const i=e.getSlideClasses(s);t.push({slideEl:s,classNames:i}),e.emit("_slideClass",s,i)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:s,slides:i,slidesGrid:r,slidesSizesGrid:a,size:n,activeIndex:l}=this;let o=1;if("number"==typeof s.slidesPerView)return s.slidesPerView;if(s.centeredSlides){let e,t=i[l]?Math.ceil(i[l].swiperSlideSize):0;for(let s=l+1;sn&&(e=!0));for(let s=l-1;s>=0;s-=1)i[s]&&!e&&(t+=i[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let d=l+1;d=0;d-=1){r[l]-r[d]{t.complete&&V(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),s.freeMode&&s.freeMode.enabled&&!s.cssMode)i(),s.autoHeight&&e.updateAutoHeight();else{if(("auto"===s.slidesPerView||s.slidesPerView>1)&&e.isEnd&&!s.centeredSlides){const t=e.virtual&&s.virtual.enabled?e.virtual.slides:e.slides;r=e.slideTo(t.length-1,0,!1,!0)}else r=e.slideTo(e.activeIndex,0,!1,!0);r||i()}s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const s=this,i=s.params.direction;return e||(e="horizontal"===i?"vertical":"horizontal"),e===i||"horizontal"!==e&&"vertical"!==e||(s.el.classList.remove(`${s.params.containerModifierClass}${i}`),s.el.classList.add(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let s=e||t.params.el;if("string"==typeof s&&(s=document.querySelector(s)),!s)return!1;s.swiper=t,s.parentNode&&s.parentNode.host&&s.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const i=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let r=(()=>{if(s&&s.shadowRoot&&s.shadowRoot.querySelector){return s.shadowRoot.querySelector(i())}return x(s,i())[0]})();return!r&&t.params.createElements&&(r=C("div",t.params.wrapperClass),s.append(r),x(s,`.${t.params.slideClass}`).forEach((e=>{r.append(e)}))),Object.assign(t,{el:s,wrapperEl:r,slidesEl:t.isElement&&!s.parentNode.host.slideSlots?s.parentNode.host:r,hostEl:t.isElement?s.parentNode.host:s,mounted:!0,rtl:"rtl"===s.dir.toLowerCase()||"rtl"===M(s,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===M(s,"direction")),wrongRTL:"-webkit-box"===M(r,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const s=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&s.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach((e=>{e.complete?V(t,e):e.addEventListener("load",(e=>{V(t,e.target)}))})),H(t),t.initialized=!0,H(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const s=this,{params:i,el:r,wrapperEl:a,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),i.loop&&s.loopDestroy(),t&&(s.removeClasses(),r&&"string"!=typeof r&&r.removeAttribute("style"),a&&a.removeAttribute("style"),n&&n.length&&n.forEach((e=>{e.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.el&&"string"!=typeof s.el&&(s.el.swiper=null),function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(s){}try{delete t[e]}catch(s){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){y(ne,e)}static get extendedDefaults(){return ne}static get defaults(){return ie}static installModule(t){e.prototype.__modules__||(e.prototype.__modules__=[]);const s=e.prototype.__modules__;"function"==typeof t&&s.indexOf(t)<0&&s.push(t)}static use(t){return Array.isArray(t)?(t.forEach((t=>e.installModule(t))),e):(e.installModule(t),e)}};Object.keys(ae).forEach((e=>{Object.keys(ae[e]).forEach((t=>{le.prototype[t]=ae[e][t]}))})),le.use([function(e){let{swiper:t,on:s,emit:i}=e;const r=h();let a=null,n=null;const l=()=>{t&&!t.destroyed&&t.initialized&&(i("beforeResize"),i("resize"))},o=()=>{t&&!t.destroyed&&t.initialized&&i("orientationchange")};s("init",(()=>{t.params.resizeObserver&&void 0!==r.ResizeObserver?t&&!t.destroyed&&t.initialized&&(a=new ResizeObserver((e=>{n=r.requestAnimationFrame((()=>{const{width:s,height:i}=t;let r=s,a=i;e.forEach((e=>{let{contentBoxSize:s,contentRect:i,target:n}=e;n&&n!==t.el||(r=i?i.width:(s[0]||s).inlineSize,a=i?i.height:(s[0]||s).blockSize)})),r===s&&a===i||l()}))})),a.observe(t.el)):(r.addEventListener("resize",l),r.addEventListener("orientationchange",o))})),s("destroy",(()=>{n&&r.cancelAnimationFrame(n),a&&a.unobserve&&t.el&&(a.unobserve(t.el),a=null),r.removeEventListener("resize",l),r.removeEventListener("orientationchange",o)}))},function(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const a=[],n=h(),l=function(e,s){void 0===s&&(s={});const i=new(n.MutationObserver||n.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void r("observerUpdate",e[0]);const s=function(){r("observerUpdate",e[0])};n.requestAnimationFrame?n.requestAnimationFrame(s):n.setTimeout(s,0)}));i.observe(e,{attributes:void 0===s.attributes||s.attributes,childList:t.isElement||(void 0===s.childList||s).childList,characterData:void 0===s.characterData||s.characterData}),a.push(i)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=_(t.hostEl);for(let t=0;t{a.forEach((e=>{e.disconnect()})),a.splice(0,a.length)}))}]);const oe=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function de(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!e.__swiper__}function ce(e,t){const s=["__proto__","constructor","prototype"];Object.keys(t).filter((e=>s.indexOf(e)<0)).forEach((s=>{void 0===e[s]?e[s]=t[s]:de(t[s])&&de(e[s])&&Object.keys(t[s]).length>0?t[s].__swiper__?e[s]=t[s]:ce(e[s],t[s]):e[s]=t[s]}))}function pe(e){return void 0===e&&(e={}),e.navigation&&void 0===e.navigation.nextEl&&void 0===e.navigation.prevEl}function ue(e){return void 0===e&&(e={}),e.pagination&&void 0===e.pagination.el}function me(e){return void 0===e&&(e={}),e.scrollbar&&void 0===e.scrollbar.el}function fe(e){void 0===e&&(e="");const t=e.split(" ").map((e=>e.trim())).filter((e=>!!e)),s=[];return t.forEach((e=>{s.indexOf(e)<0&&s.push(e)})),s.join(" ")}function he(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t{ge(e)?s.push(e):e.props&&e.props.children&&we(e.props.children).forEach((e=>s.push(e)))})),s}function be(e){const s=[],i={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return t.Children.toArray(e).forEach((e=>{if(ge(e))s.push(e);else if(e.props&&e.props.slot&&i[e.props.slot])i[e.props.slot].push(e);else if(e.props&&e.props.children){const t=we(e.props.children);t.length>0?t.forEach((e=>s.push(e))):i["container-end"].push(e)}else i["container-end"].push(e)})),{slides:s,slots:i}}function ye(t,s){return"undefined"==typeof window?e.useEffect(t,s):e.useLayoutEffect(t,s)}const Se=e.createContext(null),Te=e.createContext(null),xe=e.forwardRef((function(s,i){let{className:r,tag:a="div",wrapperTag:n="div",children:l,onSwiper:o,...d}=void 0===s?{}:s,c=!1;const[p,u]=e.useState("swiper"),[m,f]=e.useState(null),[h,v]=e.useState(!1),g=e.useRef(!1),w=e.useRef(null),b=e.useRef(null),y=e.useRef(null),S=e.useRef(null),T=e.useRef(null),x=e.useRef(null),E=e.useRef(null),C=e.useRef(null),{params:M,passedParams:P,rest:_,events:L}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const s={on:{}},i={},r={};ce(s,ie),s._emitClasses=!0,s.init=!1;const a={},n=oe.map((e=>e.replace(/_/,""))),l=Object.assign({},e);return Object.keys(l).forEach((l=>{void 0!==e[l]&&(n.indexOf(l)>=0?de(e[l])?(s[l]={},r[l]={},ce(s[l],e[l]),ce(r[l],e[l])):(s[l]=e[l],r[l]=e[l]):0===l.search(/on[A-Z]/)&&"function"==typeof e[l]?t?i[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:s.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:a[l]=e[l])})),["navigation","pagination","scrollbar"].forEach((e=>{!0===s[e]&&(s[e]={}),!1===s[e]&&delete s[e]})),{params:s,passedParams:r,rest:a,events:i}}(d),{slides:k,slots:O}=be(l),I=()=>{v(!h)};Object.assign(M.on,{_containerClasses(e,t){u(t)}});const A=()=>{Object.assign(M.on,L),c=!0;const e={...M};if(delete e.wrapperClass,b.current=new le(e),b.current.virtual&&b.current.params.virtual.enabled){b.current.virtual.slides=k;const e={cache:!1,slides:k,renderExternal:f,renderExternalUpdate:!1};ce(b.current.params.virtual,e),ce(b.current.originalParams.virtual,e)}};w.current||A(),b.current&&b.current.on("_beforeBreakpoint",I);return e.useEffect((()=>()=>{b.current&&b.current.off("_beforeBreakpoint",I)})),e.useEffect((()=>{!g.current&&b.current&&(b.current.emitSlidesClasses(),g.current=!0)})),ye((()=>{if(i&&(i.current=w.current),w.current)return b.current.destroyed&&A(),function(e,t){let{el:s,nextEl:i,prevEl:r,paginationEl:a,scrollbarEl:n,swiper:l}=e;pe(t)&&i&&r&&(l.params.navigation.nextEl=i,l.originalParams.navigation.nextEl=i,l.params.navigation.prevEl=r,l.originalParams.navigation.prevEl=r),ue(t)&&a&&(l.params.pagination.el=a,l.originalParams.pagination.el=a),me(t)&&n&&(l.params.scrollbar.el=n,l.originalParams.scrollbar.el=n),l.init(s)}({el:w.current,nextEl:T.current,prevEl:x.current,paginationEl:E.current,scrollbarEl:C.current,swiper:b.current},M),o&&!b.current.destroyed&&o(b.current),()=>{b.current&&!b.current.destroyed&&b.current.destroy(!0,!1)}}),[]),ye((()=>{!c&&L&&b.current&&Object.keys(L).forEach((e=>{b.current.on(e,L[e])}));const e=function(e,t,s,i,r){const a=[];if(!t)return a;const n=e=>{a.indexOf(e)<0&&a.push(e)};if(s&&i){const e=i.map(r),t=s.map(r);e.join("")!==t.join("")&&n("children"),i.length!==s.length&&n("children")}return oe.filter((e=>"_"===e[0])).map((e=>e.replace(/_/,""))).forEach((s=>{if(s in e&&s in t)if(de(e[s])&&de(t[s])){const i=Object.keys(e[s]),r=Object.keys(t[s]);i.length!==r.length?n(s):(i.forEach((i=>{e[s][i]!==t[s][i]&&n(s)})),r.forEach((i=>{e[s][i]!==t[s][i]&&n(s)})))}else e[s]!==t[s]&&n(s)})),a}(P,y.current,k,S.current,(e=>e.key));return y.current=P,S.current=k,e.length&&b.current&&!b.current.destroyed&&function(e){let{swiper:t,slides:s,passedParams:i,changedParams:r,nextEl:a,prevEl:n,scrollbarEl:l,paginationEl:o}=e;const d=r.filter((e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e)),{params:c,pagination:p,navigation:u,scrollbar:m,virtual:f,thumbs:h}=t;let v,g,w,b,y,S,T,x;r.includes("thumbs")&&i.thumbs&&i.thumbs.swiper&&!i.thumbs.swiper.destroyed&&c.thumbs&&(!c.thumbs.swiper||c.thumbs.swiper.destroyed)&&(v=!0),r.includes("controller")&&i.controller&&i.controller.control&&c.controller&&!c.controller.control&&(g=!0),r.includes("pagination")&&i.pagination&&(i.pagination.el||o)&&(c.pagination||!1===c.pagination)&&p&&!p.el&&(w=!0),r.includes("scrollbar")&&i.scrollbar&&(i.scrollbar.el||l)&&(c.scrollbar||!1===c.scrollbar)&&m&&!m.el&&(b=!0),r.includes("navigation")&&i.navigation&&(i.navigation.prevEl||n)&&(i.navigation.nextEl||a)&&(c.navigation||!1===c.navigation)&&u&&!u.prevEl&&!u.nextEl&&(y=!0);const E=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),c[e].prevEl=void 0,c[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),c[e].el=void 0,t[e].el=void 0))};r.includes("loop")&&t.isElement&&(c.loop&&!i.loop?S=!0:!c.loop&&i.loop?T=!0:x=!0),d.forEach((e=>{if(de(c[e])&&de(i[e]))Object.assign(c[e],i[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in i[e])||i[e].enabled||E(e);else{const t=i[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?c[e]=i[e]:!1===t&&E(e)}})),d.includes("controller")&&!g&&t.controller&&t.controller.control&&c.controller&&c.controller.control&&(t.controller.control=c.controller.control),r.includes("children")&&s&&f&&c.virtual.enabled?(f.slides=s,f.update(!0)):r.includes("virtual")&&f&&c.virtual.enabled&&(s&&(f.slides=s),f.update(!0)),r.includes("children")&&s&&c.loop&&(x=!0),v&&h.init()&&h.update(!0);g&&(t.controller.control=c.controller.control),w&&(!t.isElement||o&&"string"!=typeof o||(o=document.createElement("div"),o.classList.add("swiper-pagination"),o.part.add("pagination"),t.el.appendChild(o)),o&&(c.pagination.el=o),p.init(),p.render(),p.update()),b&&(!t.isElement||l&&"string"!=typeof l||(l=document.createElement("div"),l.classList.add("swiper-scrollbar"),l.part.add("scrollbar"),t.el.appendChild(l)),l&&(c.scrollbar.el=l),m.init(),m.updateSize(),m.setTranslate()),y&&(t.isElement&&(a&&"string"!=typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-next"),a.innerHTML=t.hostEl.constructor.nextButtonSvg,a.part.add("button-next"),t.el.appendChild(a)),n&&"string"!=typeof n||(n=document.createElement("div"),n.classList.add("swiper-button-prev"),n.innerHTML=t.hostEl.constructor.prevButtonSvg,n.part.add("button-prev"),t.el.appendChild(n))),a&&(c.navigation.nextEl=a),n&&(c.navigation.prevEl=n),u.init(),u.update()),r.includes("allowSlideNext")&&(t.allowSlideNext=i.allowSlideNext),r.includes("allowSlidePrev")&&(t.allowSlidePrev=i.allowSlidePrev),r.includes("direction")&&t.changeDirection(i.direction,!1),(S||x)&&t.loopDestroy(),(T||x)&&t.loopCreate(),t.update()}({swiper:b.current,slides:k,passedParams:P,changedParams:e,nextEl:T.current,prevEl:x.current,scrollbarEl:C.current,paginationEl:E.current}),()=>{L&&b.current&&Object.keys(L).forEach((e=>{b.current.off(e,L[e])}))}})),ye((()=>{var e;!(e=b.current)||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())}),[m]),t.createElement(a,ve({ref:w,className:fe(`${p}${r?` ${r}`:""}`)},_),t.createElement(Te.Provider,{value:b.current},O["container-start"],t.createElement(n,{className:he(M.wrapperClass)},O["wrapper-start"],M.virtual?function(e,s,i){if(!i)return null;const r=e=>{let t=e;return e<0?t=s.length+e:t>=s.length&&(t-=s.length),t},a=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${i.offset}px`}:{top:`${i.offset}px`},{from:n,to:l}=i,o=e.params.loop?-s.length:0,d=e.params.loop?2*s.length:s.length,c=[];for(let t=o;t=n&&t<=l&&c.push(s[r(t)]);return c.map(((s,i)=>t.cloneElement(s,{swiper:e,style:a,key:s.props.virtualIndex||s.key||`slide-${i}`})))}(b.current,k,m):k.map(((e,s)=>t.cloneElement(e,{swiper:b.current,swiperSlideIndex:s}))),O["wrapper-end"]),pe(M)&&t.createElement(t.Fragment,null,t.createElement("div",{ref:x,className:"swiper-button-prev"}),t.createElement("div",{ref:T,className:"swiper-button-next"})),me(M)&&t.createElement("div",{ref:C,className:"swiper-scrollbar"}),ue(M)&&t.createElement("div",{ref:E,className:"swiper-pagination"}),O["container-end"]))}));xe.displayName="Swiper";const Ee=e.forwardRef((function(s,i){let{tag:r="div",children:a,className:n="",swiper:l,zoom:o,lazy:d,virtualIndex:c,swiperSlideIndex:p,...u}=void 0===s?{}:s;const m=e.useRef(null),[f,h]=e.useState("swiper-slide"),[v,g]=e.useState(!1);function w(e,t,s){t===m.current&&h(s)}ye((()=>{if(void 0!==p&&(m.current.swiperSlideIndex=p),i&&(i.current=m.current),m.current&&l){if(!l.destroyed)return l.on("_slideClass",w),()=>{l&&l.off("_slideClass",w)};"swiper-slide"!==f&&h("swiper-slide")}})),ye((()=>{l&&m.current&&!l.destroyed&&h(l.getSlideClasses(m.current))}),[l]);const b={isActive:f.indexOf("swiper-slide-active")>=0,isVisible:f.indexOf("swiper-slide-visible")>=0,isPrev:f.indexOf("swiper-slide-prev")>=0,isNext:f.indexOf("swiper-slide-next")>=0},y=()=>"function"==typeof a?a(b):a;return t.createElement(r,ve({ref:m,className:fe(`${f}${n?` ${n}`:""}`),"data-swiper-slide-index":c,onLoad:()=>{g(!0)}},u),o&&t.createElement(Se.Provider,{value:b},t.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"==typeof o?o:void 0},y(),d&&!v&&t.createElement("div",{className:"swiper-lazy-preloader"}))),!o&&t.createElement(Se.Provider,{value:b},y(),d&&!v&&t.createElement("div",{className:"swiper-lazy-preloader"})))}));Ee.displayName="SwiperSlide";const Ce="_container_qyqa1_1",Me="_inner_container_qyqa1_8",Pe="_animationContainer_qyqa1_15",_e="_duck_airdrop_qyqa1_24",Le="_title_qyqa1_29",ke="_list_container_qyqa1_34",Oe="_message_container_qyqa1_42",Ie="_message_qyqa1_42",Ae="_button_qyqa1_54",ze=()=>{const e=s();return i.jsxs("div",{className:Ce,onClick:()=>e.openPointsModal(),children:[i.jsx("p",{className:Le,children:"Earn TON and farm points"}),i.jsxs("div",{className:Me,children:[i.jsxs("div",{className:ke,children:[i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"1"}),i.jsx("p",{className:Ae,children:"Copy link & invite frens"})]}),i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"2"}),i.jsx("p",{className:Ae,children:"Complete tasks"})]}),i.jsxs("div",{className:Oe,children:[i.jsx("p",{className:Ie,children:"3"}),i.jsx("p",{className:Ae,children:"Claim rewards"})]})]}),i.jsx("div",{className:Pe,children:i.jsx(r,{speed:.9,src:"animations/duck-money.lottie",className:_e})})]})]})},Ne="_container_ip37z_1",Ge="_header_container_ip37z_8",De="_inner_container_ip37z_14",je="_animationContainer_ip37z_21",$e="_duck_airdrop_ip37z_30",Be="_title_ip37z_35",Fe="_list_container_ip37z_40",Ve="_message_container_ip37z_48",Re="_message_ip37z_48",He="_button_ip37z_60",qe=()=>{const e=new Date(Date.UTC(2024,11,17,11,0,0)),t=new Date,s=e.getTime()-t.getTime();if(s<=0)return"";return`${Math.floor(s/864e5)+1} days left`},We=()=>{const{setInputAssetAddress:e,setOutputAssetAddress:t,setInputAssetAmount:s}=a(),o=()=>{e(n),t(l),s("20")};return i.jsxs("div",{className:Ne,children:[i.jsxs("div",{className:Ge,children:[i.jsx("p",{className:Be,children:"$1,500,000 Airdrop"}),i.jsx("p",{className:Be,children:qe()})]}),i.jsxs("div",{className:De,children:[i.jsxs("div",{className:Fe,children:[i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"1"}),i.jsx("p",{className:He,onClick:()=>window.Telegram.WebApp.openLink("https://society.ton.org/the-open-league-new-year-airdrop"),children:"Get free badge"})]}),i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"2"}),i.jsx("p",{className:He,onClick:o,children:"Swap any tokens"})]}),i.jsxs("div",{className:Ve,children:[i.jsx("p",{className:Re,children:"3"}),i.jsx("p",{className:He,onClick:o,children:"More you swap - more you get"})]})]}),i.jsx("div",{className:je,children:i.jsx(r,{speed:.8,src:"animations/duck-airdrop.lottie",className:$e})})]})]})},Ye=()=>i.jsxs(xe,{className:o.swiper,loop:!0,autoplay:{delay:1e4},speed:1400,effect:"fade",spaceBetween:16,pagination:{clickable:!0},modules:[I,A],children:[i.jsx(Ee,{className:d(o.swiperSlide,o.swiperSlideBlue),children:i.jsx(We,{})}),i.jsx(Ee,{className:d(o.swiperSlide,o.swiperSlideGreen),children:i.jsx(ze,{})})]});export{Ye as default}; diff --git a/assets/index-BLrQt2l-.js b/assets/index-Bq7ZhbaF.js similarity index 99% rename from assets/index-BLrQt2l-.js rename to assets/index-Bq7ZhbaF.js index ff4b62e..34f375c 100644 --- a/assets/index-BLrQt2l-.js +++ b/assets/index-Bq7ZhbaF.js @@ -1 +1 @@ -import{c as e,n as t}from"./index-CEKsu63Q.js";function r(e,t){for(var r=0;rn[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var n={},i={};var a=Symbol.for("nodejs.util.inspect.custom"),o={};Object.defineProperty(o,"__esModule",{value:!0}),o.crc16=void 0,o.crc16=function(e){let t=0;const r=Buffer.alloc(e.length+2);r.set(e);for(let n of r){let e=128;for(;e>0;)t<<=1,n&e&&(t+=1),e>>=1,t>65535&&(t&=65535,t^=4129)}return Buffer.from([Math.floor(t/256),t%256])};var s,l=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.address=i.Address=void 0;const u=l(a),d=o;function c(e){if("string"==typeof e&&!f.isFriendly(e))throw new Error("Unknown address type");const t=Buffer.isBuffer(e)?e:Buffer.from(e,"base64");if(36!==t.length)throw new Error("Unknown address type: byte length is not equal to 36");const r=t.subarray(0,34),n=t.subarray(34,36),i=(0,d.crc16)(r);if(i[0]!==n[0]||i[1]!==n[1])throw new Error("Invalid checksum: "+e);let a=r[0],o=!1,s=!1;if(128&a&&(o=!0,a^=128),17!==a&&81!==a)throw"Unknown address tag";s=17===a;let l=null;l=255===r[1]?-1:r[1];return{isTestOnly:o,isBounceable:s,workchain:l,hashPart:r.subarray(2,34)}}class f{static isAddress(e){return e instanceof f}static isFriendly(e){return 48===e.length&&!!/[A-Za-z0-9+/_-]+/.test(e)}static isRaw(e){if(-1===e.indexOf(":"))return!1;let[t,r]=e.split(":");return!!Number.isInteger(parseFloat(t))&&(!!/[a-f0-9]+/.test(r.toLowerCase())&&64===r.length)}static normalize(e){return"string"==typeof e?f.parse(e).toString():e.toString()}static parse(e){if(f.isFriendly(e))return this.parseFriendly(e).address;if(f.isRaw(e))return this.parseRaw(e);throw new Error("Unknown address type: "+e)}static parseRaw(e){let t=parseInt(e.split(":")[0]),r=Buffer.from(e.split(":")[1],"hex");return new f(t,r)}static parseFriendly(e){if(Buffer.isBuffer(e)){let t=c(e);return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new f(t.workchain,t.hashPart)}}{let t=c(e.replace(/\-/g,"+").replace(/_/g,"/"));return{isBounceable:t.isBounceable,isTestOnly:t.isTestOnly,address:new f(t.workchain,t.hashPart)}}}constructor(e,t){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const e=Buffer.alloc(36);return e.set(this.hash),e.set([this.workChain,this.workChain,this.workChain,this.workChain],32),e},this.toStringBuffer=e=>{let t=!(!e||void 0===e.testOnly)&&e.testOnly,r=!e||void 0===e.bounceable||e.bounceable?17:81;t&&(r|=128);const n=Buffer.alloc(34);n[0]=r,n[1]=this.workChain,n.set(this.hash,2);const i=Buffer.alloc(36);return i.set(n),i.set((0,d.crc16)(n),34),i},this.toString=e=>{let t=!e||void 0===e.urlSafe||e.urlSafe,r=this.toStringBuffer(e);return t?r.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):r.toString("base64")},this[s]=()=>this.toString(),32!==t.length)throw new Error("Invalid address hash length: "+t.length);this.workChain=e,this.hash=t,Object.freeze(this)}equals(e){return e.workChain===this.workChain&&e.hash.equals(this.hash)}}i.Address=f,s=u.default,i.address=function(e){return f.parse(e)};var h,p={},g=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.ExternalAddress=void 0;const m=g(a);class b{static isAddress(e){return e instanceof b}constructor(e,t){this[h]=()=>this.toString(),this.value=e,this.bits=t}toString(){return`External<${this.bits}:${this.value}>`}}p.ExternalAddress=b,h=m.default;var y={},v={};Object.defineProperty(v,"__esModule",{value:!0}),v.base32Decode=v.base32Encode=void 0;const w="abcdefghijklmnopqrstuvwxyz234567";function k(e,t){const r=e.indexOf(t);if(-1===r)throw new Error("Invalid character found: "+t);return r}v.base32Encode=function(e){const t=e.byteLength;let r=0,n=0,i="";for(let a=0;a=5;)i+=w[n>>>r-5&31],r-=5;return r>0&&(i+=w[n<<5-r&31]),i},v.base32Decode=function(e){let t;t=e.toLowerCase();const{length:r}=t;let n=0,i=0,a=0;const o=Buffer.alloc(5*r/8|0);for(let s=0;s=8&&(o[a++]=i>>>n-8&255,n-=8);return o};var B,_=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(y,"__esModule",{value:!0}),y.ADNLAddress=void 0;const S=_(a),P=v,U=o;class C{static parseFriendly(e){if(55!==e.length)throw Error("Invalid address");e="f"+e;let t=(0,P.base32Decode)(e);if(45!==t[0])throw Error("Invalid address");let r=t.slice(33);if(!(0,U.crc16)(t.slice(0,33)).equals(r))throw Error("Invalid address");return new C(t.slice(1,33))}static parseRaw(e){const t=Buffer.from(e,"base64");return new C(t)}constructor(e){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let e=Buffer.concat([Buffer.from([45]),this.address]),t=(0,U.crc16)(e);return e=Buffer.concat([e,t]),(0,P.base32Encode)(e).slice(1)},this[B]=()=>this.toString(),32!==e.length)throw Error("Invalid address");this.address=e}equals(e){return this.address.equals(e.address)}}y.ADNLAddress=C,B=S.default;var M,x,I,A={},j={},O={},E={},T={};function z(){if(M)return T;M=1,Object.defineProperty(T,"__esModule",{value:!0}),T.paddedBufferToBits=T.bitsToPaddedBuffer=void 0;const e=N(),t=R();return T.bitsToPaddedBuffer=function(t){let r=new e.BitBuilder(8*Math.ceil(t.length/8));r.writeBits(t);let n=8*Math.ceil(t.length/8)-t.length;for(let e=0;e=0;t--)if(0!==e[t]){const n=e[t];let i=n&-n;1&i||(i=Math.log2(i)+1),t>0&&(r=t<<3),r+=8-i;break}return new t.BitString(e,0,r)},T}function R(){if(x)return E;x=1;var t,r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.BitString=void 0;const n=z(),i=r(a);let o=class e{static isBitString(t){return t instanceof e}constructor(e,r,n){if(this[t]=()=>this.toString(),n<0)throw new Error(`Length ${n} is out of bounds`);this._length=n,this._data=e,this._offset=r}get length(){return this._length}at(e){if(e>=this._length)throw new Error(`Index ${e} > ${this._length} is out of bounds`);if(e<0)throw new Error(`Index ${e} < 0 is out of bounds`);let t=this._offset+e>>3,r=7-(this._offset+e)%8;return!!(this._data[t]&1<this._length)throw new Error(`Offset(${t}) > ${this._length} is out of bounds`);if(t<0)throw new Error(`Offset(${t}) < 0 is out of bounds`);if(0===r)return e.EMPTY;if(t+r>this._length)throw new Error(`Offset ${t} + Length ${r} > ${this._length} is out of bounds`);return new e(this._data,this._offset+t,r)}subbuffer(e,t){if(e>this._length)throw new Error(`Offset ${e} is out of bounds`);if(e<0)throw new Error(`Offset ${e} is out of bounds`);if(e+t>this._length)throw new Error(`Offset + Lenght = ${e+t} is out of bounds`);if(t%8!=0)return null;if((this._offset+e)%8!=0)return null;let r=this._offset+e>>3,n=r+(t>>3);return this._data.subarray(r,n)}equals(e){if(this._length!==e._length)return!1;for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");("boolean"==typeof e&&!0===e||"number"==typeof e&&e>0)&&(this._buffer[t/8|0]|=1<<7-t%8),this._length++}writeBits(e){for(let t=0;t8*this._buffer.length)throw new Error("BitBuilder overflow");e.copy(this._buffer,this._length/8),this._length+=8*e.length}else for(let t=0;t=n)throw Error(`bitLength is too small for a value ${e}. Got ${t}`);if(this._length+t>8*this._buffer.length)throw new Error("BitBuilder overflow");const i=8-this._length%8;if(i>0){const e=Math.floor(this._length/8);if(t>BigInt(t-i));this._buffer[e]|=n,this._length+=i}}for(t-=i;t>0;)t>=8?(this._buffer[this._length/8]=Number(r>>BigInt(t-8)&0xffn),this._length+=8,t-=8):(this._buffer[this._length/8]=Number(r<=n)throw Error(`value is out of range for ${t} bits. Got ${e}`);r<0?(this.writeBit(!0),r=n+r):this.writeBit(!1),this.writeUint(r,t-1)}writeVarUint(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(r<0)throw Error(`value is negative. Got ${e}`);if(0n===r)return void this.writeUint(0,t);const n=Math.ceil(r.toString(2).length/8),i=8*n;this.writeUint(n,t),this.writeUint(r,i)}writeVarInt(e,t){let r=BigInt(e);if(t<0||!Number.isSafeInteger(t))throw Error(`invalid bit length. Got ${t}`);if(0n===r)return void this.writeUint(0,t);let n=r>0?r:-r;const i=1+Math.ceil(n.toString(2).length/8),a=8*i;this.writeUint(i,t),this.writeInt(r,a)}writeCoins(e){this.writeVarUint(e,4)}writeAddress(r){if(null!=r){if(e.Address.isAddress(r))return this.writeUint(2,2),this.writeUint(0,1),this.writeInt(r.workChain,8),void this.writeBuffer(r.hash);if(t.ExternalAddress.isAddress(r))return this.writeUint(1,2),this.writeUint(r.bits,9),void this.writeUint(r.value,r.bits);throw Error(`Invalid address. Got ${r}`)}this.writeUint(0,2)}build(){return new r.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!=0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}},O}var L,D,K={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.CellType=void 0,(D=L||(H.CellType=L={}))[D.Ordinary=-1]="Ordinary",D[D.PrunedBranch=1]="PrunedBranch",D[D.Library=2]="Library",D[D.MerkleProof=3]="MerkleProof",D[D.MerkleUpdate=4]="MerkleUpdate";var F={},q={},V={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.readUnaryLength=void 0,$.readUnaryLength=function(e){let t=0;for(;e.loadBit();)t++;return t};var Y={},W={};Object.defineProperty(W,"__esModule",{value:!0}),W.BitReader=void 0;const G=i,X=p;class Z{constructor(e,t=0){this._checkpoints=[],this._bits=e,this._offset=t}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(e){if(e<0||this._offset+e>this._bits.length)throw new Error(`Index ${this._offset+e} is out of bounds`);this._offset+=e}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let e=this._bits.at(this._offset);return this._offset++,e}preloadBit(){return this._bits.at(this._offset)}loadBits(e){let t=this._bits.substring(this._offset,e);return this._offset+=e,t}preloadBits(e){return this._bits.substring(this._offset,e)}loadBuffer(e){let t=this._preloadBuffer(e,this._offset);return this._offset+=8*e,t}preloadBuffer(e){return this._preloadBuffer(e,this._offset)}loadUint(e){return this._toSafeInteger(this.loadUintBig(e),"loadUintBig")}loadUintBig(e){let t=this.preloadUintBig(e);return this._offset+=e,t}preloadUint(e){return this._toSafeInteger(this._preloadUint(e,this._offset),"preloadUintBig")}preloadUintBig(e){return this._preloadUint(e,this._offset)}loadInt(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,this._toSafeInteger(t,"loadUintBig")}loadIntBig(e){let t=this._preloadInt(e,this._offset);return this._offset+=e,t}preloadInt(e){return this._toSafeInteger(this._preloadInt(e,this._offset),"preloadIntBig")}preloadIntBig(e){return this._preloadInt(e,this._offset)}loadVarUint(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadUintBig(8*t),"loadVarUintBig")}loadVarUintBig(e){let t=Number(this.loadUint(e));return this.loadUintBig(8*t)}preloadVarUint(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadUint(8*t,this._offset+e),"preloadVarUintBig")}preloadVarUintBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadUint(8*t,this._offset+e)}loadVarInt(e){let t=Number(this.loadUint(e));return this._toSafeInteger(this.loadIntBig(8*t),"loadVarIntBig")}loadVarIntBig(e){let t=Number(this.loadUint(e));return this.loadIntBig(8*t)}preloadVarInt(e){let t=Number(this._preloadUint(e,this._offset));return this._toSafeInteger(this._preloadInt(8*t,this._offset+e),"preloadVarIntBig")}preloadVarIntBig(e){let t=Number(this._preloadUint(e,this._offset));return this._preloadInt(8*t,this._offset+e)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let e=Number(this._preloadUint(2,this._offset));if(2===e)return this._loadInternalAddress();throw new Error("Invalid address: "+e)}loadMaybeAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(1===Number(this._preloadUint(2,this._offset)))return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(1===e)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let e=Number(this._preloadUint(2,this._offset));if(0===e)return this._offset+=2,null;if(2===e)return this._loadInternalAddress();if(1===e)return this._loadExternalAddress();throw 3===e?Error("Unsupported"):Error("Unreachable")}loadPaddedBits(e){if(e%8!=0)throw new Error("Invalid number of bits");let t=e;for(;;){if(this._bits.at(this._offset+t-1)){t--;break}t--}let r=this._bits.substring(this._offset,t);return this._offset+=e,r}clone(){return new Z(this._bits,this._offset)}_preloadInt(e,t){if(0==e)return 0n;let r=this._bits.at(t),n=0n;for(let i=0;ic+"0"===e.slice(0,c.length+1)));r=n(c+"0",r.beginParse(),a-d-1,e)}if(!i.isExotic){const e=o.filter((e=>c+"1"===e.slice(0,c.length+1)));i=n(c+"1",i.beginParse(),a-d-1,e)}return(0,e.beginCell)().storeSlice(t).storeRef(r).storeRef(i).endCell()}}function i(t,r,i){r.forEach((e=>{if(!t.has(e))throw new Error(`Trying to generate merkle proof for a missing key "${e}"`)}));return n("",(0,e.beginCell)().storeDictDirect(t).asSlice(),i.bits,r.map((e=>i.serialize(e).toString(2).padStart(i.bits,"0"))))}return V.generateMerkleProofDirect=i,V.generateMerkleProof=function(e,t,n){return(0,r.convertToMerkleProof)(i(e,t,n))},V}W.BitReader=Z;var re,ne={};function ie(){if(re)return ne;re=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.generateMerkleUpdate=void 0;const e=br(),t=te();return ne.generateMerkleUpdate=function(r,n,i,a){const o=(0,t.generateMerkleProof)(r,[n],i).refs[0];r.set(n,a);const s=(0,t.generateMerkleProof)(r,[n],i).refs[0];return l=o,u=s,(0,e.beginCell)().storeUint(4,8).storeBuffer(l.hash(0)).storeBuffer(u.hash(0)).storeUint(l.depth(0),16).storeUint(u.depth(0),16).storeRef(l).storeRef(u).endCell({exotic:!0});var l,u},ne}var ae={};function oe(e,t,r,n,i){let a=0,o=e;if(0===(t.loadBit()?1:0)){a=function(e){let t=0;for(;e.loadBit();)t++;return t}(t);for(let e=0;e0&&t.storeUint(BigInt("0b"+e),e.length),t}function s(e,t,r){r.storeBit(1),r.storeBit(0);let n=Math.ceil(Math.log2(t+1));return r.storeUint(e.length,n),e.length>0&&r.storeUint(BigInt("0b"+e),e.length),r}function l(e,t,r,n){n.storeBit(1),n.storeBit(1),n.storeBit(e);let i=Math.ceil(Math.log2(r+1));n.storeUint(t,i)}function u(e,t){let r="short",n=function(e){return 1+e.length+1+e.length}(e),i=function(e,t){return 2+Math.ceil(Math.log2(t+1))+e.length}(e,t);if(i(0,u.deserializeInternalKey)(e)))}values(){return Array.from(this._map.values())}store(e,r,n){if(0===this._map.size)e.storeBit(0);else{let i=this._key;null!=r&&(i=r);let a=this._value;if(null!=n&&(a=n),!i)throw Error("Key serializer is not defined");if(!a)throw Error("Value serializer is not defined");let o=new Map;for(const[e,t]of this._map)o.set(i.serialize((0,u.deserializeInternalKey)(e)),t);e.storeBit(1);let s=(0,t.beginCell)();(0,l.serializeDict)(o,i.bits,a.serialize,s),e.storeRef(s.endCell())}}storeDirect(e,t,r){if(0===this._map.size)throw Error("Cannot store empty dictionary directly");let n=this._key;null!=t&&(n=t);let i=this._value;if(null!=r&&(i=r),!n)throw Error("Key serializer is not defined");if(!i)throw Error("Value serializer is not defined");let a=new Map;for(const[o,s]of this._map)a.set(n.serialize((0,u.deserializeInternalKey)(o)),s);(0,l.serializeDict)(a,n.bits,i.serialize,e)}generateMerkleProof(e){return(0,a.generateMerkleProof)(this,e,this._key)}generateMerkleProofDirect(e){return(0,a.generateMerkleProofDirect)(this,e,this._key)}generateMerkleUpdate(e,t){return(0,o.generateMerkleUpdate)(this,e,this._key,t)}};return q.Dictionary=d,d.Keys={Address:()=>({bits:267,serialize:r=>{if(!e.Address.isAddress(r))throw Error("Key is not an address");return(0,t.beginCell)().storeAddress(r).endCell().beginParse().preloadUintBig(267)},parse:e=>(0,t.beginCell)().storeUint(e,267).endCell().beginParse().loadAddress()}),BigInt:e=>function(e){return{bits:e,serialize:r=>{if("bigint"!=typeof r)throw Error("Key is not a bigint");return(0,t.beginCell)().storeInt(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadIntBig(e)}}(e),Int:e=>function(e){return{bits:e,serialize:r=>{if("number"!=typeof r)throw Error("Key is not a number");if(!Number.isSafeInteger(r))throw Error("Key is not a safe integer: "+r);return(0,t.beginCell)().storeInt(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadInt(e)}}(e),BigUint:e=>function(e){return{bits:e,serialize:r=>{if("bigint"!=typeof r)throw Error("Key is not a bigint");if(r<0)throw Error("Key is negative: "+r);return(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)}}(e),Uint:e=>function(e){return{bits:e,serialize:r=>{if("number"!=typeof r)throw Error("Key is not a number");if(!Number.isSafeInteger(r))throw Error("Key is not a safe integer: "+r);if(r<0)throw Error("Key is negative: "+r);return(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUintBig(e)},parse:r=>Number((0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadUint(e))}}(e),Buffer:e=>function(e){return{bits:8*e,serialize:r=>{if(!Buffer.isBuffer(r))throw Error("Key is not a buffer");return(0,t.beginCell)().storeBuffer(r).endCell().beginParse().loadUintBig(8*e)},parse:r=>(0,t.beginCell)().storeUint(r,8*e).endCell().beginParse().loadBuffer(e)}}(e),BitString:e=>function(e){return{bits:e,serialize:r=>{if(!n.BitString.isBitString(r))throw Error("Key is not a BitString");return(0,t.beginCell)().storeBits(r).endCell().beginParse().loadUintBig(e)},parse:r=>(0,t.beginCell)().storeUint(r,e).endCell().beginParse().loadBits(e)}}(e)},d.Values={BigInt:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadIntBig(e)}}(e),Int:e=>function(e){return{serialize:(t,r)=>{r.storeInt(t,e)},parse:t=>t.loadInt(e)}}(e),BigVarInt:e=>function(e){return{serialize:(t,r)=>{r.storeVarInt(t,e)},parse:t=>t.loadVarIntBig(e)}}(e),BigUint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUintBig(e)}}(e),Uint:e=>function(e){return{serialize:(t,r)=>{r.storeUint(t,e)},parse:t=>t.loadUint(e)}}(e),BigVarUint:e=>function(e){return{serialize:(t,r)=>{r.storeVarUint(t,e)},parse:t=>t.loadVarUintBig(e)}}(e),Bool:()=>({serialize:(e,t)=>{t.storeBit(e)},parse:e=>e.loadBit()}),Address:()=>({serialize:(e,t)=>{t.storeAddress(e)},parse:e=>e.loadAddress()}),Cell:()=>({serialize:(e,t)=>{t.storeRef(e)},parse:e=>e.loadRef()}),Buffer:e=>{return t=e,{serialize:(e,r)=>{if(e.length!==t)throw Error("Invalid buffer size");r.storeBuffer(e)},parse:e=>e.loadBuffer(t)};var t},BitString:e=>function(e){return{serialize:(t,r)=>{if(t.length!==e)throw Error("Invalid BitString size");r.storeBits(t)},parse:t=>t.loadBits(e)}}(e),Dictionary:(e,t)=>function(e,t){return{serialize:(e,t)=>{e.store(t)},parse:r=>d.load(e,t,r)}}(e,t)},q}ce.serializeInternalKey=function(e){if("number"==typeof e){if(!Number.isSafeInteger(e))throw Error("Invalid key type: not a safe integer: "+e);return"n:"+e.toString(10)}if("bigint"==typeof e)return"b:"+e.toString(10);if(fe.Address.isAddress(e))return"a:"+e.toString();if(Buffer.isBuffer(e))return"f:"+e.toString("hex");if(he.BitString.isBitString(e))return"B:"+e.toString();throw Error("Invalid key type")},ce.deserializeInternalKey=function(e){let t=e.slice(0,2),r=e.slice(2);if("n:"===t)return parseInt(r,10);if("b:"===t)return BigInt(r);if("a:"===t)return fe.Address.parse(r);if("f:"===t)return Buffer.from(r,"hex");if("B:"===t){const e="_"==r.slice(-1);if(e||r.length%2!=0){let t=e?r.length-1:r.length;const n=r.substr(0,t)+"0";return!e&&1&t?new he.BitString(Buffer.from(n,"hex"),0,t<<2):(0,pe.paddedBufferToBits)(Buffer.from(n,"hex"))}return new he.BitString(Buffer.from(r,"hex"),0,r.length<<2)}throw Error("Invalid key type: "+t)};var be,ye,ve={};function we(){if(be)return ve;be=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.writeString=ve.stringToCell=ve.readString=void 0;const e=br();function t(e){if(e.remainingBits%8!=0)throw new Error(`Invalid string length: ${e.remainingBits}`);if(0!==e.remainingRefs&&1!==e.remainingRefs)throw new Error(`invalid number of refs: ${e.remainingRefs}`);let r;return r=0===e.remainingBits?Buffer.alloc(0):e.loadBuffer(e.remainingBits/8),1===e.remainingRefs&&(r=Buffer.concat([r,t(e.loadRef().beginParse())])),r}function r(t,n){if(t.length>0){let i=Math.floor(n.availableBits/8);if(t.length>i){let a=t.subarray(0,i),o=t.subarray(i);n=n.storeBuffer(a);let s=(0,e.beginCell)();r(o,s),n=n.storeRef(s.endCell())}else n=n.storeBuffer(t)}}return ve.readString=function(e){return t(e).toString()},ve.stringToCell=function(t){let n=(0,e.beginCell)();return r(Buffer.from(t),n),n.endCell()},ve.writeString=function(e,t){r(Buffer.from(e),t)},ve}function ke(){if(ye)return F;ye=1;var t,r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(F,"__esModule",{value:!0}),F.Slice=void 0;const n=r(a),i=me(),o=br(),s=we();return F.Slice=class e{constructor(e,r){this[t]=()=>this.toString(),this._reader=e.clone(),this._refs=[...r],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(e){return this._reader.skip(e),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(e){return this._reader.loadBits(e)}preloadBits(e){return this._reader.preloadBits(e)}loadUint(e){return this._reader.loadUint(e)}loadUintBig(e){return this._reader.loadUintBig(e)}preloadUint(e){return this._reader.preloadUint(e)}preloadUintBig(e){return this._reader.preloadUintBig(e)}loadMaybeUint(e){return this.loadBit()?this.loadUint(e):null}loadMaybeUintBig(e){return this.loadBit()?this.loadUintBig(e):null}loadInt(e){return this._reader.loadInt(e)}loadIntBig(e){return this._reader.loadIntBig(e)}preloadInt(e){return this._reader.preloadInt(e)}preloadIntBig(e){return this._reader.preloadIntBig(e)}loadMaybeInt(e){return this.loadBit()?this.loadInt(e):null}loadMaybeIntBig(e){return this.loadBit()?this.loadIntBig(e):null}loadVarUint(e){return this._reader.loadVarUint(e)}loadVarUintBig(e){return this._reader.loadVarUintBig(e)}preloadVarUint(e){return this._reader.preloadVarUint(e)}preloadVarUintBig(e){return this._reader.preloadVarUintBig(e)}loadVarInt(e){return this._reader.loadVarInt(e)}loadVarIntBig(e){return this._reader.loadVarIntBig(e)}preloadVarInt(e){return this._reader.preloadVarInt(e)}preloadVarIntBig(e){return this._reader.preloadVarIntBig(e)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(e){return this._reader.loadBuffer(e)}preloadBuffer(e){return this._reader.preloadBuffer(e)}loadStringTail(){return(0,s.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,s.readString)(this):null}loadStringRefTail(){return(0,s.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const e=this.loadMaybeRef();return e?(0,s.readString)(e.beginParse()):null}loadDict(e,t){return i.Dictionary.load(e,t,this)}loadDictDirect(e,t){return i.Dictionary.loadDirect(e,t,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,o.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,o.beginCell)().storeSlice(this)}clone(t=!1){if(t){let t=this._reader.clone();return t.reset(),new e(t,this._refs)}{let t=new e(this._reader,this._refs);return t._refsOffset=this._refsOffset,t}}toString(){return this.asCell().toString()}},t=n.default,F}var Be={},_e={};Object.defineProperty(_e,"__esModule",{value:!0}),_e.exoticLibrary=void 0;const Se=W;_e.exoticLibrary=function(e,t){const r=new Se.BitReader(e);if(264!==e.length)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let n=r.loadUint(8);if(2!==n)throw new Error(`Library cell must have type 2, got "${n}"`);return{}};var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.exoticMerkleUpdate=void 0;const Ue=W;Pe.exoticMerkleUpdate=function(e,t){const r=new Ue.BitReader(e);if(552!==e.length)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(2!==t.length)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let n=r.loadUint(8);if(4!==n)throw new Error(`Merkle Update cell type must be exactly 4, got "${n}"`);const i=r.loadBuffer(32),a=r.loadBuffer(32),o=r.loadUint(16),s=r.loadUint(16);if(o!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${o}", got "${t[0].depth(0)}"`);if(!i.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${i.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(s!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${s}", got "${t[1].depth(0)}"`);if(!a.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${a.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:o,proofDepth2:s,proofHash1:i,proofHash2:a}};var Ce={},Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.LevelMask=void 0;class xe{constructor(e=0){var t;this._mask=0,this._mask=e,this._hashIndex=(t=this._mask,16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(e){return new xe(this._mask&(1<>e-1)%2!=0}}Me.LevelMask=xe,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.exoticPruned=void 0;const Ie=W,Ae=Me;var je;function Oe(){if(je)return Be;je=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.resolveExotic=void 0;const e=W,t=H,r=_e,n=ee(),i=Pe,a=Ce,o=Me;return Be.resolveExotic=function(s,l){let u=new e.BitReader(s).preloadUint(8);if(1===u)return function(e,r){let n=(0,a.exoticPruned)(e,r),i=[],s=[],l=new o.LevelMask(n.mask);for(let t=0;t>1);return{type:t.CellType.MerkleProof,depths:[],hashes:[],mask:i}}(s,l);if(4===u)return function(e,r){(0,i.exoticMerkleUpdate)(e,r);let n=new o.LevelMask((r[0].level()|r[1].level())>>1);return{type:t.CellType.MerkleUpdate,depths:[],hashes:[],mask:n}}(s,l);throw Error("Invalid exotic cell type: "+u)},Be}Ce.exoticPruned=function(e,t){let r,n=new Ie.BitReader(e),i=n.loadUint(8);if(1!==i)throw new Error(`Pruned branch cell must have type 1, got "${i}"`);if(0!==t.length)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);if(280===e.length)r=new Ae.LevelMask(1);else{if(r=new Ae.LevelMask(n.loadUint(8)),r.level<1||r.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let a=[],o=[],s=[];for(let l=0;l>>3,u=-1===n?3:0;for(i=0;i>>2,s.length<=a&&s.push(0),s[a]|=e[i]<<8*(u+n*(o%4));return{value:s,binLen:8*e.length+r}}function r(r,n,i){switch(n){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,r){return function(e,t,r,n){var i,a,o,s;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");var l=t||[0],u=(r=r||0)>>>3,d=-1===n?3:0;for(i=0;i>>1)+u)>>>2;l.length<=o;)l.push(0);l[o]|=a<<8*(d+n*(s%4))}return{value:l,binLen:4*e.length+r}}(e,t,r,i)};case"TEXT":return function(e,t,r){return function(e,t,r,n,i){var a,o,s,l,u,d,c,f,h=0,p=r||[0],g=(n=n||0)>>>3;if("UTF8"===t)for(c=-1===i?3:0,s=0;s(a=e.charCodeAt(s))?o.push(a):2048>a?(o.push(192|a>>>6),o.push(128|63&a)):55296>a||57344<=a?o.push(224|a>>>12,128|a>>>6&63,128|63&a):(s+=1,a=65536+((1023&a)<<10|1023&e.charCodeAt(s)),o.push(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|63&a)),l=0;l>>2;p.length<=u;)p.push(0);p[u]|=o[l]<<8*(c+i*(d%4)),h+=1}else for(c=-1===i?2:0,f="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,s=0;s>>8),u=(d=h+g)>>>2;p.length<=u;)p.push(0);p[u]|=a<<8*(c+i*(d%4)),h+=2}return{value:p,binLen:8*h+n}}(e,n,t,r,i)};case"B64":return function(t,r,n){return function(t,r,n,i){var a,o,s,l,u,d,c=0,f=r||[0],h=(n=n||0)>>>3,p=-1===i?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&g3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${r.level}/${r.value}"`);const t=16+272*r.apply(r.level-1).hashCount;if(e.length!==t)throw new Error(`Pruned branch cell must have exactly ${t} bits, got "${e.length}"`)}let a=[],o=[],s=[];for(let l=0;l>>3,u=-1===n?3:0;for(i=0;i>>2,s.length<=a&&s.push(0),s[a]|=e[i]<<8*(u+n*(o%4));return{value:s,binLen:8*e.length+r}}function r(r,n,i){switch(n){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,r){return function(e,t,r,n){var i,a,o,s;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");var l=t||[0],u=(r=r||0)>>>3,d=-1===n?3:0;for(i=0;i>>1)+u)>>>2;l.length<=o;)l.push(0);l[o]|=a<<8*(d+n*(s%4))}return{value:l,binLen:4*e.length+r}}(e,t,r,i)};case"TEXT":return function(e,t,r){return function(e,t,r,n,i){var a,o,s,l,u,d,c,f,h=0,p=r||[0],g=(n=n||0)>>>3;if("UTF8"===t)for(c=-1===i?3:0,s=0;s(a=e.charCodeAt(s))?o.push(a):2048>a?(o.push(192|a>>>6),o.push(128|63&a)):55296>a||57344<=a?o.push(224|a>>>12,128|a>>>6&63,128|63&a):(s+=1,a=65536+((1023&a)<<10|1023&e.charCodeAt(s)),o.push(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|63&a)),l=0;l>>2;p.length<=u;)p.push(0);p[u]|=o[l]<<8*(c+i*(d%4)),h+=1}else for(c=-1===i?2:0,f="UTF16LE"===t&&1!==i||"UTF16LE"!==t&&1===i,s=0;s>>8),u=(d=h+g)>>>2;p.length<=u;)p.push(0);p[u]|=a<<8*(c+i*(d%4)),h+=2}return{value:p,binLen:8*h+n}}(e,n,t,r,i)};case"B64":return function(t,r,n){return function(t,r,n,i){var a,o,s,l,u,d,c=0,f=r||[0],h=(n=n||0)>>>3,p=-1===i?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&g{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var l={exports:{}},c={},u={exports:{}},d={},f=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),C=Symbol.iterator;var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function _(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||S}function R(){}function T(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||S}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},R.prototype=_.prototype;var O=T.prototype=new R;O.constructor=T,k(O,_.prototype),O.isPureReactComponent=!0;var j=Array.isArray,P=Object.prototype.hasOwnProperty,L={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function I(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)P.call(t,r)&&!N.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1{setTimeout((()=>t()),e)}))}))}function ut(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",(()=>t.abort()),{once:!0}),t}function dt(e,t){var n,r;return Ue(this,0,void 0,(function*(){const o=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:10,i=null!==(r=null==t?void 0:t.delayMs)&&void 0!==r?r:200,a=ut(null==t?void 0:t.signal);if("function"!=typeof e)throw new Fe("Expected a function, got "+typeof e);let s,l=0;for(;lUe(this,0,void 0,(function*(){if(i=null!=s?s:null,null==a||a.abort(),a=ut(s),a.signal.aborted)throw new Fe("Resource creation was aborted");r=null!=l?l:null;const c=e(a.signal,...l);o=c;const u=yield c;if(o!==c&&u!==n)throw yield t(u),new Fe("Resource creation was aborted by a new resource creation");return n=u,n}));return{create:s,current:()=>null!=n?n:null,dispose:()=>Ue(this,0,void 0,(function*(){try{const r=n;n=null;const i=o;o=null;try{null==a||a.abort()}catch(e){}yield Promise.allSettled([r?t(r):Promise.resolve(),i?t(yield i):Promise.resolve()])}catch(e){}})),recreate:e=>Ue(this,0,void 0,(function*(){const t=n,a=o,l=r,c=i;if(yield ct(e),t===n&&a===o&&l===r&&c===i)return yield s(i,...null!=l?l:[]);throw new Fe("Resource recreation was aborted by a new resource creation")}))}}(((e,t)=>Ue(this,0,void 0,(function*(){const n={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t};return yield function(e){return Ue(this,0,void 0,(function*(){return yield function(e,t){const n=null==t?void 0:t.timeout,r=ut(null==t?void 0:t.signal);return new Promise(((t,o)=>Ue(this,0,void 0,(function*(){if(r.signal.aborted)return void o(new Fe("Operation aborted"));let i;void 0!==n&&(i=setTimeout((()=>{r.abort(),o(new Fe(`Timeout after ${n}ms`))}),n)),r.signal.addEventListener("abort",(()=>{clearTimeout(i),o(new Fe("Operation aborted"))}),{once:!0});const a={timeout:n,abort:r.signal};yield e(((...e)=>{clearTimeout(i),t(...e)}),(()=>{clearTimeout(i),o()}),a)}))))}(((t,n,r)=>Ue(this,0,void 0,(function*(){var o;const i=ut(r.signal).signal;if(i.aborted)return void n(new Fe("Bridge connection aborted"));const a=new URL(at(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const s=yield e.bridgeGatewayStorage.getLastEventId();if(s&&a.searchParams.append("last_event_id",s),i.aborted)return void n(new Fe("Bridge connection aborted"));const l=new EventSource(a.toString());l.onerror=r=>Ue(this,0,void 0,(function*(){if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));try{const n=yield e.errorHandler(l,r);n!==l&&l.close(),n&&n!==l&&t(n)}catch(o){l.close(),n(o)}})),l.onopen=()=>{if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));t(l)},l.onmessage=t=>{if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",(()=>{l.close(),n(new Fe("Bridge connection aborted"))}))}))),{timeout:e.openingDeadlineMS,signal:e.signal})}))}(n)}))),(e=>Ue(this,0,void 0,(function*(){e.close()})))),this.bridgeGatewayStorage=new it(e,t)}get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}registerSession(e){return Ue(this,0,void 0,(function*(){yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS)}))}send(e,t,n,r){var o;return Ue(this,0,void 0,(function*(){const i={};"number"==typeof r?i.ttl=r:(i.ttl=null==r?void 0:r.ttl,i.signal=null==r?void 0:r.signal,i.attempts=null==r?void 0:r.attempts);const a=new URL(at(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",t),a.searchParams.append("ttl",((null==i?void 0:i.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",n);const s=Ie.encode(e);yield dt((e=>Ue(this,0,void 0,(function*(){const t=yield this.post(a,s,e.signal);if(!t.ok)throw new Fe(`Bridge send failed, status ${t.status}`)}))),{attempts:null!==(o=null==i?void 0:i.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:null==i?void 0:i.signal})}))}pause(){this.eventSource.dispose().catch((e=>pt(`Bridge pause failed, ${e}`)))}unPause(){return Ue(this,0,void 0,(function*(){yield this.eventSource.recreate(0)}))}close(){return Ue(this,0,void 0,(function*(){yield this.eventSource.dispose().catch((e=>pt(`Bridge close failed, ${e}`)))}))}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return Ue(this,0,void 0,(function*(){const r=yield fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new Fe(`Bridge send failed, status ${r.status}`);return r}))}errorsHandler(e,t){return Ue(this,0,void 0,(function*(){if(this.isConnecting)throw e.close(),new Fe("Bridge error, failed to connect");if(!this.isReady){if(this.isClosed)return e.close(),ft(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Fe("Bridge error, unknown state")}try{this.errorsListener(t)}catch(n){}}))}messagesHandler(e){return Ue(this,0,void 0,(function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{t=JSON.parse(e.data)}catch(n){throw new Fe(`Bridge message parse failed, message ${n.data}`)}this.listener(t)}))}}function gt(e){return!("connectEvent"in e)}class mt{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return Ue(this,0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!gt(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return Ue(this,0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new Be(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new Be(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new Fe("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new Fe("Trying to read HTTP connection source while injected connection is stored");if(!gt(e))throw new Fe("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new Fe("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return Ue(this,0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type}))}storeLastWalletEventId(e){return Ue(this,0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!gt(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}class yt{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new mt(e)}static fromStorage(e){return Ue(this,0,void 0,(function*(){const t=new mt(e),n=yield t.getHttpConnection();return gt(n)?new yt(e,n.connectionSource):new yt(e,{bridgeUrl:n.session.bridgeUrl})}))}connect(e,t){var n;const r=ut(null==t?void 0:t.signal);null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=r,this.closeGateways();const o=new Be;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then((()=>Ue(this,0,void 0,(function*(){r.signal.aborted||(yield dt((e=>{var n;return this.openGateways(o,{openingDeadlineMS:null!==(n=null==t?void 0:t.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS,signal:null==e?void 0:e.signal})}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:r.signal}))}))));const i="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(i,e)}restoreConnection(e){var t,n;return Ue(this,0,void 0,(function*(){const r=ut(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o)return;if(r.signal.aborted)return;const i=null!==(n=null==e?void 0:e.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS;if(gt(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:i,signal:null==r?void 0:r.signal});if(Array.isArray(this.walletConnectionSource))throw new Fe("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ht(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!r.signal.aborted){this.listeners.forEach((e=>e(o.connectEvent)));try{yield dt((e=>this.gateway.registerSession({openingDeadlineMS:i,signal:e.signal})),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:r.signal})}catch(a){return void(yield this.disconnect({signal:r.signal}))}}}))}sendRequest(e,t){const n={};return"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal,n.attempts=null==t?void 0:t.attempts),new Promise(((t,r)=>Ue(this,0,void 0,(function*(){var o;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Fe("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),ft("Send http-bridge request:",Object.assign(Object.assign({},e),{id:i}));const a=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:i})),De(this.session.walletPublicKey));try{yield this.gateway.send(a,this.session.walletPublicKey,e.method,{attempts:null==n?void 0:n.attempts,signal:null==n?void 0:n.signal}),null===(o=null==n?void 0:n.onRequestSent)||void 0===o||o.call(n),this.pendingRequests.set(i.toString(),t)}catch(s){r(s)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return Ue(this,0,void 0,(function*(){return new Promise((t=>Ue(this,0,void 0,(function*(){let n=!1,r=null;const o=()=>{n||(n=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=ut(null==e?void 0:e.signal);r=setTimeout((()=>{t.abort()}),this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:t.signal,attempts:1})}catch(i){ft("Disconnect error:",i),n||this.removeBridgeAndSession().then(t)}finally{r&&clearTimeout(r),o()}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return Ue(this,0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,n){return Ue(this,0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);yield e.close()}))}gatewayListener(e){return Ue(this,0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(Ie.decode(e.message).toUint8Array(),De(e.from)));if(ft("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),n=this.pendingRequests.get(e);return n?(n(t),void this.pendingRequests.delete(e)):void ft(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void pt(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const n=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(ft("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return Ue(this,0,void 0,(function*(){throw new Fe(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return Ue(this,0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const n=e.payload.items.find((e=>"ton_addr"===e.name)),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})}))}removeBridgeAndSession(){return Ue(this,0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return st(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}generateRegularUniversalLink(e,t){const n=new URL(e);return n.searchParams.append("v",2..toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(t)),n.toString()}generateTGUniversalLink(e,t){const n="tonconnect-"+lt(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),r=this.convertToDirectLink(e),o=new URL(r);return o.searchParams.append("startapp",n),o.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return Ue(this,0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways.map((e=>e.close().catch())),this.pendingGateways=this.walletConnectionSource.map((t=>{const n=new ht(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(()=>{}));return n.setListener((e=>this.pendingGatewaysListener(n,t.bridgeUrl,e))),n})),void(yield Promise.allSettled(this.pendingGateways.map((e=>dt((n=>{var r;return this.pendingGateways.some((t=>t===e))?e.registerSession({openingDeadlineMS:null!==(r=null==t?void 0:t.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS,signal:n.signal}):e.close()}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:null==t?void 0:t.signal})))))):(this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ht(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal}))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function vt(e,t){return bt(e,[t])}function bt(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}let wt=class e{constructor(){this.storage={}}static getInstance(){return e.instance||(e.instance=new e),e.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!==(t=n[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function At(){if("undefined"!=typeof window)return window}function xt(){var e;const t=null===(e=At())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function Ct(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new Fe("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return wt.getInstance()}class St{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=St.window;if(!St.isWindowContainsWallet(n,t))throw new Ze;this.connectionStorage=new mt(e),this.injectedWallet=n[t].tonconnect}static fromStorage(e){return Ue(this,0,void 0,(function*(){const t=new mt(e),n=yield t.getInjectedConnection();return new St(e,n.jsBridgeKey)}))}static isWalletInjected(e){return St.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!St.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=At();if(!e)return[];try{return Object.keys(e)}catch(t){return[]}}().filter((([e,t])=>function(e){try{return!(!vt(e,"tonconnect")||!vt(e.tonconnect,"walletInfo"))&&bt(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(t){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms})))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return Ue(this,0,void 0,(function*(){try{ft("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();ft("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEach((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return Ue(this,0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(n){ft(n),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){var n;return Ue(this,0,void 0,(function*(){const r={};"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),ft("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:o}));const i=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:o}));return i.then((e=>ft("Wallet message received:",e))),null===(n=null==r?void 0:r.onRequestSent)||void 0===n||n.call(r),i}))}_connect(e,t){return Ue(this,0,void 0,(function*(){try{ft(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const n=yield this.injectedWallet.connect(e,t);ft("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(n)))}catch(n){ft("Injected Provider connect error:",n);const e={event:"connect_error",payload:{code:0,message:null==n?void 0:n.toString()}};this.listeners.forEach((t=>t(e)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{ft("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}St.window=At();class kt{constructor(){this.localStorage=Ct()}getItem(e){return Ue(this,0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return Ue(this,0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return Ue(this,0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function Et(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function _t(e){return Et(e)&&e.embedded}function Rt(e){return"bridgeUrl"in e}const Tt=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.ton.space/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.delab.team/bridge"}],platforms:["ios","android"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget_wallet_logo_0_gas_fee.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"okxTonWalletTr",name:"OKX TR Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/587A8296F0BB640F.png",about_url:"https://tr.okx.com/web3",universal_url:"https://tr.okx.com/download?appendQuery=true&deeplink=okxtr://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]}];class Ot{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return Ue(this,0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return Ue(this,0,void 0,(function*(){const e=(yield this.getWallets()).filter(_t);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return Ue(this,0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new Ge("Wrong wallets list format, wallets list must be an array.");const n=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));n.length&&(pt(`Wallet(s) ${n.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(n){pt(n),e=Tt}let t=[];try{t=St.getCurrentlyInjectedWallets()}catch(n){pt(n)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((n=>{if("sse"===n.type&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===n.type){const e=n.key;t.jsBridgeKey=e,t.injected=St.isWalletInjected(e),t.embedded=St.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((n=>{const r=e.find((e=>e.name===n)),o=t.find((e=>e.name===n));return Object.assign(Object.assign({},r&&Object.assign({},r)),o&&Object.assign({},o))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const n=t.find((e=>"sse"===e.type));if(n&&(!("url"in n)||!n.url||!e.universal_url))return!1;const r=t.find((e=>"js"===e.type));return!!(!r||"key"in r&&r.key)}}class jt extends Fe{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,jt.prototype)}}function Pt(e,t){const n=e.includes("SendTransaction"),r=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!n&&!r)throw new jt("Wallet doesn't support SendTransaction feature.");if(r&&void 0!==r.maxMessages){if(r.maxMessages{var t,n;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null}}))}}function Ht(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},It(e,t)),zt(t,n))}function Vt(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},It(e,t)),zt(t,n))}function qt(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:null!=o?o:null},It(e,t)),zt(t,n))}function Kt(e,t,n){return Object.assign({type:"disconnection",scope:n},It(e,t))}class Qt{constructor(){this.window=At()}dispatchEvent(e,t){var n;return Ue(this,0,void 0,(function*(){const r=new CustomEvent(e,{detail:t});null===(n=this.window)||void 0===n||n.dispatchEvent(r)}))}addEventListener(e,t,n){var r;return Ue(this,0,void 0,(function*(){return null===(r=this.window)||void 0===r||r.addEventListener(e,t,n),()=>{var n;return null===(n=this.window)||void 0===n?void 0:n.removeEventListener(e,t)}}))}}class $t{constructor(e){var t;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=null!==(t=null==e?void 0:e.eventDispatcher)&&void 0!==t?t:new Qt,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}get version(){return Nt({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Ue(this,0,void 0,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}}))}setRequestVersionHandler(){return Ue(this,0,void 0,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",(()=>Ue(this,0,void 0,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Lt(this.tonConnectSdkVersion))}))))}))}requestTonConnectUiVersion(){return Ue(this,0,void 0,(function*(){return new Promise(((e,t)=>Ue(this,0,void 0,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",{type:"request-version"})}catch(n){t(n)}}))))}))}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(t){}}trackConnectionStarted(...e){try{const t=Mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionCompleted(...e){try{const t=Dt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionError(...e){try{const t=Bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringStarted(...e){try{const t=Ut(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringCompleted(...e){try{const t=Ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringError(...e){try{const t=Wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDisconnection(...e){try{const t=Kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSentForSignature(...e){try{const t=Ht(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigned(...e){try{const t=Vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigningFailed(...e){try{const t=qt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}}class Zt{constructor(e){if(this.walletsList=new Ot,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||xt(),storage:(null==e?void 0:e.storage)||new kt},this.walletsList=new Ot({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs}),this.tracker=new $t({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectSdkVersion:"3.0.5"}),!this.dappSettings.manifestUrl)throw new We("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new mt(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var n,r;const o={};if("object"==typeof t&&"tonProof"in t&&(o.request=t),"object"==typeof t&&("openingDeadlineMS"in t||"signal"in t||"request"in t)&&(o.request=null==t?void 0:t.request,o.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,o.signal=null==t?void 0:t.signal),this.connected)throw new Ve;const i=ut(null==o?void 0:o.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)throw new Fe("Connection was aborted");return null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=this.createProvider(e),i.signal.addEventListener("abort",(()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null})),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(null==o?void 0:o.request),{openingDeadlineMS:null==o?void 0:o.openingDeadlineMS,signal:i.signal})}restoreConnection(e){var t,n;return Ue(this,0,void 0,(function*(){this.tracker.trackConnectionRestoringStarted();const r=ut(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");const[o,i]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(r.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");let a=null;try{switch(o){case"http":a=yield yt.fromStorage(this.dappSettings.storage);break;case"injected":a=yield St.fromStorage(this.dappSettings.storage);break;default:if(!i)return;a=this.createProvider(i)}}catch(u){return this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==a||a.closeConnection(),void(a=null)}if(r.signal.aborted)return null==a||a.closeConnection(),void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");if(!a)return pt("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored");null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=a,a.listen(this.walletEventsListener.bind(this));const s=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),null==a||a.closeConnection(),a=null};r.signal.addEventListener("abort",s);const l=dt((t=>Ue(this,0,void 0,(function*(){yield null==a?void 0:a.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal}),r.signal.removeEventListener("abort",s),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}))),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:null==e?void 0:e.signal}),c=new Promise((e=>setTimeout((()=>e()),12e3)));return Promise.race([l,c])}))}sendTransaction(e,t){return Ue(this,0,void 0,(function*(){const n={};"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal);const r=ut(null==n?void 0:n.signal);if(r.signal.aborted)throw new Fe("Transaction sending was aborted");this.checkConnection(),Pt(this.wallet.device.features,{requiredMessagesNumber:e.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,e);const{validUntil:o}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{e.hidden?this.pauseConnection():this.unPauseConnection().catch()}))}catch(t){pt("Cannot subscribe to the document.visibilitychange: ",t)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new St(this.dappSettings.storage,e.jsBridgeKey):new yt(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),n=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new Fe("ton_addr connection item was not found");const r={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};n&&(r.connectItems={tonProof:n}),this.wallet=r,this.tracker.trackConnectionCompleted(r)}onWalletConnectError(e){const t=tt.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),ft(t),this.tracker.trackConnectionError(e.message,e.code),t instanceof He||t instanceof ze)throw pt(t),t}onWalletDisconnected(e){this.tracker.trackDisconnection(this.wallet,e),this.wallet=null}checkConnection(){if(!this.connected)throw new qe}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}Zt.walletsList=new Ot,Zt.isWalletInjected=e=>St.isWalletInjected(e),Zt.isInsideWalletBrowser=e=>St.isInsideWalletBrowser(e);function Gt(e,t=!1){const{wc:n,hex:r}=function(e){if(!e.includes(":"))throw new Je(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new Je(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new Je(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if(64!==(null==r?void 0:r.length))throw new Je(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:Yt(r)}}(e);let o=81;t&&(o|=128);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const a=new Uint8Array(36);return a.set(i),a.set(function(e){const t=4129;let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let o of r){let e=128;for(;e>0;)n<<=1,o&e&&(n+=1),e>>=1,n>65535&&(n&=65535,n^=t)}return new Uint8Array([Math.floor(n/256),n%256])}(i),34),Ie.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}const Jt={};for(let QQ=0;QQ<=255;QQ++){let e=QQ.toString(16);e.length<2&&(e="0"+e),Jt[e]=QQ}function Yt(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new Ye("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):r:this[l[0]]=u?l[1].call(this,u,l[2]):r:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):r):this[l]=u||r;d+=2}},$=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o2&&(e[c]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[u]=r,e[p]=r,Q.call(e,v,w.engine),e},this.getOS=function(){var e={};return e[u]=r,e[p]=r,Q.call(e,v,w.os),A&&!e[u]&&b&&b.platform&&"Unknown"!=b.platform&&(e[u]=b.platform.replace(/chrome os/i,F).replace(/macos/i,W)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?K(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.39",J.BROWSER=H([u,p,l]),J.CPU=H([h]),J.DEVICE=H([c,f,d,g,m,v,y,b,w]),J.ENGINE=J.OS=H([u,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var X=new J;Y.ua=X.getResult(),Y.ua.get=function(){return X.getUA()},Y.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:i)}(Xt,Xt.exports);const en=a(Xt.exports);var tn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===nn}(e)}(e)};var nn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function rn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?cn((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function on(e,t,n){return e.concat(t).map((function(e){return rn(e,n)}))}function an(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function sn(e,t){try{return t in e}catch(n){return!1}}function ln(e,t,n){var r={};return n.isMergeableObject(e)&&an(e).forEach((function(t){r[t]=rn(e[t],n)})),an(t).forEach((function(o){(function(e,t){return sn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(sn(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return cn;var n=t.customMerge(e);return"function"==typeof n?n:cn}(o,n)(e[o],t[o],n):r[o]=rn(t[o],n))})),r}function cn(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||on,n.isMergeableObject=n.isMergeableObject||tn,n.cloneUnlessOtherwiseSpecified=rn;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):ln(e,t,n):rn(t,n)}cn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return cn(e,n,t)}),{})};const un=a(cn);var dn={exports:{}}; +***************************************************************************** */function Ue(e,t,n,r){return new(n||(n=Promise))((function(t,o){function i(e){try{s(r.next(e))}catch(t){o(t)}}function a(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(i,a)}s((r=r.apply(e,[])).next())}))}class Fe extends Error{constructor(e,t){super(e,t),this.message=`${Fe.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,Fe.prototype)}get info(){return""}}Fe.prefix="[TON_CONNECT_SDK_ERROR]";class We extends Fe{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,We.prototype)}}class ze extends Fe{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,ze.prototype)}}class He extends Fe{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,He.prototype)}}class Ve extends Fe{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,Ve.prototype)}}class qe extends Fe{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,qe.prototype)}}class Ke extends Fe{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,Ke.prototype)}}class Qe extends Fe{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,Qe.prototype)}}class $e extends Fe{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,$e.prototype)}}class Ze extends Fe{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,Ze.prototype)}}class Ge extends Fe{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,Ge.prototype)}}class Je extends Fe{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,Je.prototype)}}class Ye extends Fe{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,Ye.prototype)}}class Xe extends Fe{constructor(...e){super(...e),Object.setPrototypeOf(this,Xe.prototype)}}const et={[Ce.UNKNOWN_ERROR]:Xe,[Ce.USER_REJECTS_ERROR]:Ke,[Ce.BAD_REQUEST_ERROR]:Qe,[Ce.UNKNOWN_APP_ERROR]:$e,[Ce.MANIFEST_NOT_FOUND_ERROR]:He,[Ce.MANIFEST_CONTENT_ERROR]:ze};const tt=new class{parseError(e){let t=Xe;return e.code in et&&(t=et[e.code]||Xe),new t(e.message)}};class nt{isError(e){return"error"in e}}const rt={[_e.UNKNOWN_ERROR]:Xe,[_e.USER_REJECTS_ERROR]:Ke,[_e.BAD_REQUEST_ERROR]:Qe,[_e.UNKNOWN_APP_ERROR]:$e};const ot=new class extends nt{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=Xe;throw e.error.code in rt&&(t=rt[e.error.code]||Xe),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}};class it{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return Ue(this,0,void 0,(function*(){return this.storage.setItem(this.storeKey,e)}))}removeLastEventId(){return Ue(this,0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getLastEventId(){return Ue(this,0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);return e||null}))}}function at(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function st(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function lt(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function ct(e,t){return Ue(this,0,void 0,(function*(){return new Promise(((t,n)=>{setTimeout((()=>t()),e)}))}))}function ut(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",(()=>t.abort()),{once:!0}),t}function dt(e,t){var n,r;return Ue(this,0,void 0,(function*(){const o=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:10,i=null!==(r=null==t?void 0:t.delayMs)&&void 0!==r?r:200,a=ut(null==t?void 0:t.signal);if("function"!=typeof e)throw new Fe("Expected a function, got "+typeof e);let s,l=0;for(;lUe(this,0,void 0,(function*(){if(i=null!=s?s:null,null==a||a.abort(),a=ut(s),a.signal.aborted)throw new Fe("Resource creation was aborted");r=null!=l?l:null;const c=e(a.signal,...l);o=c;const u=yield c;if(o!==c&&u!==n)throw yield t(u),new Fe("Resource creation was aborted by a new resource creation");return n=u,n}));return{create:s,current:()=>null!=n?n:null,dispose:()=>Ue(this,0,void 0,(function*(){try{const r=n;n=null;const i=o;o=null;try{null==a||a.abort()}catch(e){}yield Promise.allSettled([r?t(r):Promise.resolve(),i?t(yield i):Promise.resolve()])}catch(e){}})),recreate:e=>Ue(this,0,void 0,(function*(){const t=n,a=o,l=r,c=i;if(yield ct(e),t===n&&a===o&&l===r&&c===i)return yield s(i,...null!=l?l:[]);throw new Fe("Resource recreation was aborted by a new resource creation")}))}}(((e,t)=>Ue(this,0,void 0,(function*(){const n={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t};return yield function(e){return Ue(this,0,void 0,(function*(){return yield function(e,t){const n=null==t?void 0:t.timeout,r=ut(null==t?void 0:t.signal);return new Promise(((t,o)=>Ue(this,0,void 0,(function*(){if(r.signal.aborted)return void o(new Fe("Operation aborted"));let i;void 0!==n&&(i=setTimeout((()=>{r.abort(),o(new Fe(`Timeout after ${n}ms`))}),n)),r.signal.addEventListener("abort",(()=>{clearTimeout(i),o(new Fe("Operation aborted"))}),{once:!0});const a={timeout:n,abort:r.signal};yield e(((...e)=>{clearTimeout(i),t(...e)}),(()=>{clearTimeout(i),o()}),a)}))))}(((t,n,r)=>Ue(this,0,void 0,(function*(){var o;const i=ut(r.signal).signal;if(i.aborted)return void n(new Fe("Bridge connection aborted"));const a=new URL(at(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const s=yield e.bridgeGatewayStorage.getLastEventId();if(s&&a.searchParams.append("last_event_id",s),i.aborted)return void n(new Fe("Bridge connection aborted"));const l=new EventSource(a.toString());l.onerror=r=>Ue(this,0,void 0,(function*(){if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));try{const n=yield e.errorHandler(l,r);n!==l&&l.close(),n&&n!==l&&t(n)}catch(o){l.close(),n(o)}})),l.onopen=()=>{if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));t(l)},l.onmessage=t=>{if(i.aborted)return l.close(),void n(new Fe("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",(()=>{l.close(),n(new Fe("Bridge connection aborted"))}))}))),{timeout:e.openingDeadlineMS,signal:e.signal})}))}(n)}))),(e=>Ue(this,0,void 0,(function*(){e.close()})))),this.bridgeGatewayStorage=new it(e,t)}get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}registerSession(e){return Ue(this,0,void 0,(function*(){yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS)}))}send(e,t,n,r){var o;return Ue(this,0,void 0,(function*(){const i={};"number"==typeof r?i.ttl=r:(i.ttl=null==r?void 0:r.ttl,i.signal=null==r?void 0:r.signal,i.attempts=null==r?void 0:r.attempts);const a=new URL(at(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",t),a.searchParams.append("ttl",((null==i?void 0:i.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",n);const s=Ie.encode(e);yield dt((e=>Ue(this,0,void 0,(function*(){const t=yield this.post(a,s,e.signal);if(!t.ok)throw new Fe(`Bridge send failed, status ${t.status}`)}))),{attempts:null!==(o=null==i?void 0:i.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:null==i?void 0:i.signal})}))}pause(){this.eventSource.dispose().catch((e=>pt(`Bridge pause failed, ${e}`)))}unPause(){return Ue(this,0,void 0,(function*(){yield this.eventSource.recreate(0)}))}close(){return Ue(this,0,void 0,(function*(){yield this.eventSource.dispose().catch((e=>pt(`Bridge close failed, ${e}`)))}))}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return Ue(this,0,void 0,(function*(){const r=yield fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new Fe(`Bridge send failed, status ${r.status}`);return r}))}errorsHandler(e,t){return Ue(this,0,void 0,(function*(){if(this.isConnecting)throw e.close(),new Fe("Bridge error, failed to connect");if(!this.isReady){if(this.isClosed)return e.close(),ft(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Fe("Bridge error, unknown state")}try{this.errorsListener(t)}catch(n){}}))}messagesHandler(e){return Ue(this,0,void 0,(function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{t=JSON.parse(e.data)}catch(n){throw new Fe(`Bridge message parse failed, message ${n.data}`)}this.listener(t)}))}}function gt(e){return!("connectEvent"in e)}class mt{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return Ue(this,0,void 0,(function*(){if("injected"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!gt(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(t))}))}removeConnection(){return Ue(this,0,void 0,(function*(){return this.storage.removeItem(this.storeKey)}))}getConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type)return t;if("connectEvent"in t){const e=new Be(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return{type:"http",sessionCrypto:new Be(t.sessionCrypto),connectionSource:t.connectionSource}}))}getHttpConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new Fe("Trying to read HTTP connection source while injected connection is stored");return e}))}getHttpPendingConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read HTTP connection source while nothing is stored");if("injected"===e.type)throw new Fe("Trying to read HTTP connection source while injected connection is stored");if(!gt(e))throw new Fe("Trying to read HTTP-pending connection while http connection is stored");return e}))}getInjectedConnection(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(!e)throw new Fe("Trying to read Injected bridge connection source while nothing is stored");if("http"===(null==e?void 0:e.type))throw new Fe("Trying to read Injected bridge connection source while HTTP connection is stored");return e}))}storedConnectionType(){return Ue(this,0,void 0,(function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type}))}storeLastWalletEventId(e){return Ue(this,0,void 0,(function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!gt(t))return t.lastWalletEventId=e,this.storeConnection(t)}))}getLastWalletEventId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId}))}increaseNextRpcRequestId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}}))}getNextRpcRequestId(){return Ue(this,0,void 0,(function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0}))}}class yt{constructor(e,t){this.storage=e,this.walletConnectionSource=t,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new mt(e)}static fromStorage(e){return Ue(this,0,void 0,(function*(){const t=new mt(e),n=yield t.getHttpConnection();return gt(n)?new yt(e,n.connectionSource):new yt(e,{bridgeUrl:n.session.bridgeUrl})}))}connect(e,t){var n;const r=ut(null==t?void 0:t.signal);null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=r,this.closeGateways();const o=new Be;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then((()=>Ue(this,0,void 0,(function*(){r.signal.aborted||(yield dt((e=>{var n;return this.openGateways(o,{openingDeadlineMS:null!==(n=null==t?void 0:t.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS,signal:null==e?void 0:e.signal})}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:r.signal}))}))));const i="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(i,e)}restoreConnection(e){var t,n;return Ue(this,0,void 0,(function*(){const r=ut(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o)return;if(r.signal.aborted)return;const i=null!==(n=null==e?void 0:e.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS;if(gt(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:i,signal:null==r?void 0:r.signal});if(Array.isArray(this.walletConnectionSource))throw new Fe("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ht(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!r.signal.aborted){this.listeners.forEach((e=>e(o.connectEvent)));try{yield dt((e=>this.gateway.registerSession({openingDeadlineMS:i,signal:e.signal})),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:r.signal})}catch(a){return void(yield this.disconnect({signal:r.signal}))}}}))}sendRequest(e,t){const n={};return"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal,n.attempts=null==t?void 0:t.attempts),new Promise(((t,r)=>Ue(this,0,void 0,(function*(){var o;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Fe("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),ft("Send http-bridge request:",Object.assign(Object.assign({},e),{id:i}));const a=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:i})),De(this.session.walletPublicKey));try{yield this.gateway.send(a,this.session.walletPublicKey,e.method,{attempts:null==n?void 0:n.attempts,signal:null==n?void 0:n.signal}),null===(o=null==n?void 0:n.onRequestSent)||void 0===o||o.call(n),this.pendingRequests.set(i.toString(),t)}catch(s){r(s)}}))))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return Ue(this,0,void 0,(function*(){return new Promise((t=>Ue(this,0,void 0,(function*(){let n=!1,r=null;const o=()=>{n||(n=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=ut(null==e?void 0:e.signal);r=setTimeout((()=>{t.abort()}),this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:t.signal,attempts:1})}catch(i){ft("Disconnect error:",i),n||this.removeBridgeAndSession().then(t)}finally{r&&clearTimeout(r),o()}}))))}))}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach((e=>e.pause()))}unPause(){return Ue(this,0,void 0,(function*(){const e=this.pendingGateways.map((e=>e.unPause()));this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)}))}pendingGatewaysListener(e,t,n){return Ue(this,0,void 0,(function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);yield e.close()}))}gatewayListener(e){return Ue(this,0,void 0,(function*(){const t=JSON.parse(this.session.sessionCrypto.decrypt(Ie.decode(e.message).toUint8Array(),De(e.from)));if(ft("Wallet message received:",t),!("event"in t)){const e=t.id.toString(),n=this.pendingRequests.get(e);return n?(n(t),void this.pendingRequests.delete(e)):void ft(`Response id ${e} doesn't match any request's id`)}if(void 0!==t.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&t.id<=e)return void pt(`Received event id (=${t.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==t.event&&(yield this.connectionStorage.storeLastWalletEventId(t.id))}const n=this.listeners;"connect"===t.event&&(yield this.updateSession(t,e.from)),"disconnect"===t.event&&(ft("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach((e=>e(t)))}))}gatewayErrorsListener(e){return Ue(this,0,void 0,(function*(){throw new Fe(`Bridge error ${JSON.stringify(e)}`)}))}updateSession(e,t){return Ue(this,0,void 0,(function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const n=e.payload.items.find((e=>"ton_addr"===e.name)),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})}))}removeBridgeAndSession(){return Ue(this,0,void 0,(function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()}))}generateUniversalLink(e,t){return st(e)?this.generateTGUniversalLink(e,t):this.generateRegularUniversalLink(e,t)}generateRegularUniversalLink(e,t){const n=new URL(e);return n.searchParams.append("v",2..toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(t)),n.toString()}generateTGUniversalLink(e,t){const n="tonconnect-"+lt(this.generateRegularUniversalLink("about:blank",t).split("?")[1]),r=this.convertToDirectLink(e),o=new URL(r);return o.searchParams.append("startapp",n),o.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return Ue(this,0,void 0,(function*(){return Array.isArray(this.walletConnectionSource)?(this.pendingGateways.map((e=>e.close().catch())),this.pendingGateways=this.walletConnectionSource.map((t=>{const n=new ht(this.storage,t.bridgeUrl,e.sessionId,(()=>{}),(()=>{}));return n.setListener((e=>this.pendingGatewaysListener(n,t.bridgeUrl,e))),n})),void(yield Promise.allSettled(this.pendingGateways.map((e=>dt((n=>{var r;return this.pendingGateways.some((t=>t===e))?e.registerSession({openingDeadlineMS:null!==(r=null==t?void 0:t.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS,signal:n.signal}):e.close()}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:null==t?void 0:t.signal})))))):(this.gateway&&(ft("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ht(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal}))}))}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter((t=>t!==(null==e?void 0:e.except))).forEach((e=>e.close())),this.pendingGateways=[]}}function vt(e,t){return bt(e,[t])}function bt(e,t){return!(!e||"object"!=typeof e)&&t.every((t=>t in e))}let wt=class e{constructor(){this.storage={}}static getInstance(){return e.instance||(e.instance=new e),e.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!==(t=n[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function At(){if("undefined"!=typeof window)return window}function xt(){var e;const t=null===(e=At())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function Ct(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new Fe("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return wt.getInstance()}class St{constructor(e,t){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=St.window;if(!St.isWindowContainsWallet(n,t))throw new Ze;this.connectionStorage=new mt(e),this.injectedWallet=n[t].tonconnect}static fromStorage(e){return Ue(this,0,void 0,(function*(){const t=new mt(e),n=yield t.getInjectedConnection();return new St(e,n.jsBridgeKey)}))}static isWalletInjected(e){return St.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!St.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=At();if(!e)return[];try{return Object.keys(e)}catch(t){return[]}}().filter((([e,t])=>function(e){try{return!(!vt(e,"tonconnect")||!vt(e.tonconnect,"walletInfo"))&&bt(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(t){return!1}}(t))).map((([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms})))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}connect(e){this._connect(2,e)}restoreConnection(){return Ue(this,0,void 0,(function*(){try{ft("Injected Provider restoring connection...");const e=yield this.injectedWallet.restoreConnection();ft("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions(),this.listeners.forEach((t=>t(e)))):yield this.connectionStorage.removeConnection()}catch(e){yield this.connectionStorage.removeConnection(),console.error(e)}}))}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return Ue(this,0,void 0,(function*(){return new Promise((e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(n){ft(n),this.sendRequest({method:"disconnect",params:[]},t)}}))}))}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter((t=>t!==e))}sendRequest(e,t){var n;return Ue(this,0,void 0,(function*(){const r={};"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),ft("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:o}));const i=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:o}));return i.then((e=>ft("Wallet message received:",e))),null===(n=null==r?void 0:r.onRequestSent)||void 0===n||n.call(r),i}))}_connect(e,t){return Ue(this,0,void 0,(function*(){try{ft(`Injected Provider connect request: protocolVersion: ${e}, message:`,t);const n=yield this.injectedWallet.connect(e,t);ft("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach((e=>e(n)))}catch(n){ft("Injected Provider connect error:",n);const e={event:"connect_error",payload:{code:0,message:null==n?void 0:n.toString()}};this.listeners.forEach((t=>t(e)))}}))}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen((e=>{ft("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach((t=>t(e))),"disconnect"===e.event&&this.disconnect()}))}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}St.window=At();class kt{constructor(){this.localStorage=Ct()}getItem(e){return Ue(this,0,void 0,(function*(){return this.localStorage.getItem(e)}))}removeItem(e){return Ue(this,0,void 0,(function*(){this.localStorage.removeItem(e)}))}setItem(e,t){return Ue(this,0,void 0,(function*(){this.localStorage.setItem(e,t)}))}}function Et(e){return function(e){return"jsBridgeKey"in e}(e)&&e.injected}function _t(e){return Et(e)&&e.embedded}function Rt(e){return"bridgeUrl"in e}const Tt=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.ton.space/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.delab.team/bridge"}],platforms:["ios","android"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget_wallet_logo_0_gas_fee.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"okxTonWalletTr",name:"OKX TR Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/587A8296F0BB640F.png",about_url:"https://tr.okx.com/web3",universal_url:"https://tr.okx.com/download?appendQuery=true&deeplink=okxtr://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]}];class Ot{constructor(e){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",(null==e?void 0:e.walletsListSource)&&(this.walletsListSource=e.walletsListSource),(null==e?void 0:e.cacheTTLMs)&&(this.cacheTTLMs=e.cacheTTLMs)}getWallets(){return Ue(this,0,void 0,(function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then((()=>{this.walletsListCacheCreationTimestamp=Date.now()})).catch((()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null}))),this.walletsListCache}))}getEmbeddedWallet(){return Ue(this,0,void 0,(function*(){const e=(yield this.getWallets()).filter(_t);return 1!==e.length?null:e[0]}))}fetchWalletsList(){return Ue(this,0,void 0,(function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new Ge("Wrong wallets list format, wallets list must be an array.");const n=e.filter((e=>!this.isCorrectWalletConfigDTO(e)));n.length&&(pt(`Wallet(s) ${n.map((e=>e.name)).join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter((e=>this.isCorrectWalletConfigDTO(e))))}catch(n){pt(n),e=Tt}let t=[];try{t=St.getCurrentlyInjectedWallets()}catch(n){pt(n)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)}))}walletConfigDTOListToWalletConfigList(e){return e.map((e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms};return e.bridge.forEach((n=>{if("sse"===n.type&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===n.type){const e=n.key;t.jsBridgeKey=e,t.injected=St.isWalletInjected(e),t.embedded=St.isInsideWalletBrowser(e)}})),t}))}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map((e=>e.name))).values()].map((n=>{const r=e.find((e=>e.name===n)),o=t.find((e=>e.name===n));return Object.assign(Object.assign({},r&&Object.assign({},r)),o&&Object.assign({},o))}))}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some((e=>!e||"object"!=typeof e||!("type"in e))))return!1;const n=t.find((e=>"sse"===e.type));if(n&&(!("url"in n)||!n.url||!e.universal_url))return!1;const r=t.find((e=>"js"===e.type));return!!(!r||"key"in r&&r.key)}}class jt extends Fe{get info(){return"Wallet doesn't support requested feature method."}constructor(...e){super(...e),Object.setPrototypeOf(this,jt.prototype)}}function Pt(e,t){const n=e.includes("SendTransaction"),r=e.find((e=>e&&"object"==typeof e&&"SendTransaction"===e.name));if(!n&&!r)throw new jt("Wallet doesn't support SendTransaction feature.");if(r&&void 0!==r.maxMessages){if(r.maxMessages{var t,n;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null}}))}}function Ht(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},It(e,t)),zt(t,n))}function Vt(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},It(e,t)),zt(t,n))}function qt(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:null!=o?o:null},It(e,t)),zt(t,n))}function Kt(e,t,n){return Object.assign({type:"disconnection",scope:n},It(e,t))}class Qt{constructor(){this.window=At()}dispatchEvent(e,t){var n;return Ue(this,0,void 0,(function*(){const r=new CustomEvent(e,{detail:t});null===(n=this.window)||void 0===n||n.dispatchEvent(r)}))}addEventListener(e,t,n){var r;return Ue(this,0,void 0,(function*(){return null===(r=this.window)||void 0===r||r.addEventListener(e,t,n),()=>{var n;return null===(n=this.window)||void 0===n?void 0:n.removeEventListener(e,t)}}))}}class $t{constructor(e){var t;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=null!==(t=null==e?void 0:e.eventDispatcher)&&void 0!==t?t:new Qt,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}get version(){return Nt({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Ue(this,0,void 0,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}}))}setRequestVersionHandler(){return Ue(this,0,void 0,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",(()=>Ue(this,0,void 0,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Lt(this.tonConnectSdkVersion))}))))}))}requestTonConnectUiVersion(){return Ue(this,0,void 0,(function*(){return new Promise(((e,t)=>Ue(this,0,void 0,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",{type:"request-version"})}catch(n){t(n)}}))))}))}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(t){}}trackConnectionStarted(...e){try{const t=Mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionCompleted(...e){try{const t=Dt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionError(...e){try{const t=Bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringStarted(...e){try{const t=Ut(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringCompleted(...e){try{const t=Ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringError(...e){try{const t=Wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDisconnection(...e){try{const t=Kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSentForSignature(...e){try{const t=Ht(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigned(...e){try{const t=Vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigningFailed(...e){try{const t=qt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}}class Zt{constructor(e){if(this.walletsList=new Ot,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(null==e?void 0:e.manifestUrl)||xt(),storage:(null==e?void 0:e.storage)||new kt},this.walletsList=new Ot({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs}),this.tracker=new $t({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectSdkVersion:"3.0.5"}),!this.dappSettings.manifestUrl)throw new We("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new mt(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach((e=>e(this._wallet)))}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter((t=>t!==e)),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter((e=>e!==t)))}}connect(e,t){var n,r;const o={};if("object"==typeof t&&"tonProof"in t&&(o.request=t),"object"==typeof t&&("openingDeadlineMS"in t||"signal"in t||"request"in t)&&(o.request=null==t?void 0:t.request,o.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,o.signal=null==t?void 0:t.signal),this.connected)throw new Ve;const i=ut(null==o?void 0:o.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)throw new Fe("Connection was aborted");return null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=this.createProvider(e),i.signal.addEventListener("abort",(()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null})),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(null==o?void 0:o.request),{openingDeadlineMS:null==o?void 0:o.openingDeadlineMS,signal:i.signal})}restoreConnection(e){var t,n;return Ue(this,0,void 0,(function*(){this.tracker.trackConnectionRestoringStarted();const r=ut(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,r.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");const[o,i]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(r.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");let a=null;try{switch(o){case"http":a=yield yt.fromStorage(this.dappSettings.storage);break;case"injected":a=yield St.fromStorage(this.dappSettings.storage);break;default:if(!i)return;a=this.createProvider(i)}}catch(u){return this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==a||a.closeConnection(),void(a=null)}if(r.signal.aborted)return null==a||a.closeConnection(),void this.tracker.trackConnectionRestoringError("Connection restoring was aborted");if(!a)return pt("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored");null===(n=this.provider)||void 0===n||n.closeConnection(),this.provider=a,a.listen(this.walletEventsListener.bind(this));const s=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),null==a||a.closeConnection(),a=null};r.signal.addEventListener("abort",s);const l=dt((t=>Ue(this,0,void 0,(function*(){yield null==a?void 0:a.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal}),r.signal.removeEventListener("abort",s),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}))),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:null==e?void 0:e.signal}),c=new Promise((e=>setTimeout((()=>e()),12e3)));return Promise.race([l,c])}))}sendTransaction(e,t){return Ue(this,0,void 0,(function*(){const n={};"function"==typeof t?n.onRequestSent=t:(n.onRequestSent=null==t?void 0:t.onRequestSent,n.signal=null==t?void 0:t.signal);const r=ut(null==n?void 0:n.signal);if(r.signal.aborted)throw new Fe("Transaction sending was aborted");this.checkConnection(),Pt(this.wallet.device.features,{requiredMessagesNumber:e.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,e);const{validUntil:o}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{e.hidden?this.pauseConnection():this.unPauseConnection().catch()}))}catch(t){pt("Cannot subscribe to the document.visibilitychange: ",t)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new St(this.dappSettings.storage,e.jsBridgeKey):new yt(this.dappSettings.storage,e),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(e){const t=e.items.find((e=>"ton_addr"===e.name)),n=e.items.find((e=>"ton_proof"===e.name));if(!t)throw new Fe("ton_addr connection item was not found");const r={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};n&&(r.connectItems={tonProof:n}),this.wallet=r,this.tracker.trackConnectionCompleted(r)}onWalletConnectError(e){const t=tt.parseError(e);if(this.statusChangeErrorSubscriptions.forEach((e=>e(t))),ft(t),this.tracker.trackConnectionError(e.message,e.code),t instanceof He||t instanceof ze)throw pt(t),t}onWalletDisconnected(e){this.tracker.trackDisconnection(this.wallet,e),this.wallet=null}checkConnection(){if(!this.connected)throw new qe}createConnectRequest(e){const t=[{name:"ton_addr"}];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}Zt.walletsList=new Ot,Zt.isWalletInjected=e=>St.isWalletInjected(e),Zt.isInsideWalletBrowser=e=>St.isInsideWalletBrowser(e);function Gt(e,t=!1){const{wc:n,hex:r}=function(e){if(!e.includes(":"))throw new Je(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new Je(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new Je(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if(64!==(null==r?void 0:r.length))throw new Je(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:Yt(r)}}(e);let o=81;t&&(o|=128);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const a=new Uint8Array(36);return a.set(i),a.set(function(e){const t=4129;let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let o of r){let e=128;for(;e>0;)n<<=1,o&e&&(n+=1),e>>=1,n>65535&&(n&=65535,n^=t)}return new Uint8Array([Math.floor(n/256),n%256])}(i),34),Ie.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}const Jt={};for(let $Q=0;$Q<=255;$Q++){let e=$Q.toString(16);e.length<2&&(e="0"+e),Jt[e]=$Q}function Yt(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new Ye("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):r:this[l[0]]=u?l[1].call(this,u,l[2]):r:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):r):this[l]=u||r;d+=2}},$=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o2&&(e[c]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[u]=r,e[p]=r,Q.call(e,v,w.engine),e},this.getOS=function(){var e={};return e[u]=r,e[p]=r,Q.call(e,v,w.os),A&&!e[u]&&b&&b.platform&&"Unknown"!=b.platform&&(e[u]=b.platform.replace(/chrome os/i,F).replace(/macos/i,W)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?K(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.39",J.BROWSER=H([u,p,l]),J.CPU=H([h]),J.DEVICE=H([c,f,d,g,m,v,y,b,w]),J.ENGINE=J.OS=H([u,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var X=new J;Y.ua=X.getResult(),Y.ua.get=function(){return X.getUA()},Y.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:i)}(Xt,Xt.exports);const en=a(Xt.exports);var tn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===nn}(e)}(e)};var nn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function rn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?cn((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function on(e,t,n){return e.concat(t).map((function(e){return rn(e,n)}))}function an(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function sn(e,t){try{return t in e}catch(n){return!1}}function ln(e,t,n){var r={};return n.isMergeableObject(e)&&an(e).forEach((function(t){r[t]=rn(e[t],n)})),an(t).forEach((function(o){(function(e,t){return sn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(sn(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return cn;var n=t.customMerge(e);return"function"==typeof n?n:cn}(o,n)(e[o],t[o],n):r[o]=rn(t[o],n))})),r}function cn(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||on,n.isMergeableObject=n.isMergeableObject||tn,n.cloneUnlessOtherwiseSpecified=rn;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):ln(e,t,n):rn(t,n)}cn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return cn(e,n,t)}),{})};const un=a(cn);var dn={exports:{}}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see @@ -85,7 +85,7 @@ PERFORMANCE OF THIS SOFTWARE. */ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ti(e){var t,n;return!1!==Ri(e)&&(void 0===(t=e.constructor)||!1!==Ri(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function Oi(e,t){if(!e)return t;return un(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:Ti})}const[ji,Pi]=Ei({theme:lo.LIGHT,colors:_i,borderRadius:"m"}),Li={[lo.LIGHT]:_i,[lo.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Ni={[lo.LIGHT]:void 0,[lo.DARK]:void 0};function Ii(e,t){t&&(Ni[lo.DARK]=Oi(t[lo.DARK],Ni[lo.DARK]),Ni[lo.LIGHT]=Oi(t[lo.LIGHT],Ni[lo.LIGHT])),Pi({theme:e,colors:Oi(Ni[e],Li[e])})}const Mi=Co.div` background-color: ${e=>e.theme.colors.background.secondary}; -`,Di=e=>{let t;const[n,r]=Zn(null);return Yn((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener("load",(()=>r(t))),()=>t.removeEventListener("load",(()=>r(t))))})),[_r(Nr,{get when(){return n()},get children(){return n()}}),_r(Nr,{get when(){return!n()},get children(){return _r(Mi,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let Bi={};try{Bi=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=$i(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=$i(r),e=e.substr(n+1)}let r=function(e){let t={};if(!e.length)return t;let n,r,o,i,a=e.split("&");for(n=0;ni?1:-1;return 0}(Fi,"6.1")>=0?Qi("web_app_open_tg_link",{path_full:r}):Mo("https://t.me"+r)}function Ki(){try{const e=Fo();return!!e&&(null!=e.parent&&e!==e.parent)}catch(KQ){return!1}}function Qi(e,t){try{const n=Fo();if(!n)throw new Lo("Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)No("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)No("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!Ki())throw new Lo("Can't post event to TMA");{const r="*",o=JSON.stringify({eventType:e,eventData:t});No("postEvent",e,t),n.parent.postMessage(o,r)}}}catch(KQ){!function(...t){try{console.error("[TON_CONNECT_UI]",...t)}catch(e){}}(`Can't post event to parent window: ${KQ}`)}}function $i(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(KQ){return e}}const Zi=440,Gi=1020;function Ji(e){const t=Fo();if(!t)return"desktop"===e;if(Wi("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>Gi;case"tablet":return n>Zi;default:return n<=Zi||Ho("ios","android","ipad")}}function Yi(e){switch(e){case"mobile":return`@media (max-width: ${Zi}px)`;case"tablet":return`@media (max-width: ${Gi}px) (min-width: ${Zi}px)`;default:return`@media (min-width: ${Gi}px)`}}const Xi="@media (hover: none)",ea="@media not all and (hover: none)",ta={m:"100vh",s:"8px",none:"0"},na={s:.02,m:.04},ra=Co.button` +`,Di=e=>{let t;const[n,r]=Zn(null);return Yn((()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener("load",(()=>r(t))),()=>t.removeEventListener("load",(()=>r(t))))})),[_r(Nr,{get when(){return n()},get children(){return n()}}),_r(Nr,{get when(){return!n()},get children(){return _r(Mi,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let Bi={};try{Bi=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=$i(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=$i(r),e=e.substr(n+1)}let r=function(e){let t={};if(!e.length)return t;let n,r,o,i,a=e.split("&");for(n=0;ni?1:-1;return 0}(Fi,"6.1")>=0?Qi("web_app_open_tg_link",{path_full:r}):Mo("https://t.me"+r)}function Ki(){try{const e=Fo();return!!e&&(null!=e.parent&&e!==e.parent)}catch(QQ){return!1}}function Qi(e,t){try{const n=Fo();if(!n)throw new Lo("Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)No("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)No("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!Ki())throw new Lo("Can't post event to TMA");{const r="*",o=JSON.stringify({eventType:e,eventData:t});No("postEvent",e,t),n.parent.postMessage(o,r)}}}catch(QQ){!function(...t){try{console.error("[TON_CONNECT_UI]",...t)}catch(e){}}(`Can't post event to parent window: ${QQ}`)}}function $i(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(QQ){return e}}const Zi=440,Gi=1020;function Ji(e){const t=Fo();if(!t)return"desktop"===e;if(Wi("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>Gi;case"tablet":return n>Zi;default:return n<=Zi||Ho("ios","android","ipad")}}function Yi(e){switch(e){case"mobile":return`@media (max-width: ${Zi}px)`;case"tablet":return`@media (max-width: ${Gi}px) (min-width: ${Zi}px)`;default:return`@media (min-width: ${Gi}px)`}}const Xi="@media (hover: none)",ea="@media not all and (hover: none)",ta={m:"100vh",s:"8px",none:"0"},na={s:.02,m:.04},ra=Co.button` display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; @@ -205,7 +205,7 @@ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}funct ${e=>ba[e.theme.borderRadius]}; `,ka=Co(va)` background-color: ${e=>To(e.theme.colors.icon.secondary,.12)}; -`;class Ea{constructor(){On(this,"currentTime",0)}}const _a=class{constructor(){On(this,"currentTime",0),On(this,"playbackRate",1),On(this,"startTime",null),On(this,"timeline",new Ea),On(this,"finished",Promise.resolve(this)),On(this,"effect",null),On(this,"id",""),On(this,"pending",!1),On(this,"playState","finished"),On(this,"replaceState","active"),On(this,"ready",Promise.resolve(this)),On(this,"oncancel",null),On(this,"onfinish",null),On(this,"onremove",null)}static create(){return _a._instance||(!function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(KQ){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),_a._instance=new _a),_a._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let Ra=_a;function Ta(e,t,n){return"animate"in e?e.animate(t,n):Ra.create()}On(Ra,"_instance",null);const Oa=qr("
"),ja=function(e,t){const n=n=>{var r;return!e.contains(n.target)&&(null==(r=t())?void 0:r())};document.body.addEventListener("click",n),or((()=>document.body.removeEventListener("click",n)))},Pa=function(e,t){const n=e=>{var n,r;"Escape"===e.key&&(null==(n=document.activeElement)||n.blur(),null==(r=t())||r())};document.body.addEventListener("keydown",n),or((()=>document.body.removeEventListener("keydown",n)))},La=function(e,t){const{isEnabled:n,onClose:r}=t();if(!n)return;if(!("android"===zo().os))return;window.history.pushState(da,"");const o=e=>{e.preventDefault(),r()};window.addEventListener("popstate",o,{once:!0}),or((()=>{window.removeEventListener("popstate",o),Bo((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[ua])&&window.history.back()}))}))},Na=e=>{const t=Ao(),n=oa(e);return Yn((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Oo(-document.documentElement.scrollTop),document.body.classList.add(Eo)):(document.body.classList.remove(Eo),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),_r(sa,{onBeforeEnter:e=>{const t=Ji("mobile")?200:100;Ta(e,[{opacity:0},{opacity:1}],{duration:t}),Ji("mobile")&&Ta(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const n=Ji("mobile")?200:100,r=Ta(e,[{opacity:1},{opacity:0}],{duration:n});if(Ji("mobile")){const o=Ta(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return _r(Nr,{get when(){return e.opened},get children(){return _r(wa,jr({"data-tc-modal":"true"},n,{get children(){const n=Oa.cloneNode(!0);return Zr(La,n,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),Zr(Pa,n,(()=>()=>e.onClose())),Zr(ja,n,(()=>()=>e.onClose())),Gr(n,_r(xa,{get class(){return e.class},get children(){return[_r(Ca,{icon:"close",onClick:()=>e.onClose()}),Xn((()=>e.children))]}}),null),Gr(n,_r(Nr,{get when(){return e.onClickQuestion},get children(){return _r(Sa,{get children(){return[_r(Ws,{}),_r(ka,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Jn((()=>Qr(n,fn(Aa,yo` +`;class Ea{constructor(){On(this,"currentTime",0)}}const _a=class{constructor(){On(this,"currentTime",0),On(this,"playbackRate",1),On(this,"startTime",null),On(this,"timeline",new Ea),On(this,"finished",Promise.resolve(this)),On(this,"effect",null),On(this,"id",""),On(this,"pending",!1),On(this,"playState","finished"),On(this,"replaceState","active"),On(this,"ready",Promise.resolve(this)),On(this,"oncancel",null),On(this,"onfinish",null),On(this,"onremove",null)}static create(){return _a._instance||(!function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(QQ){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),_a._instance=new _a),_a._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let Ra=_a;function Ta(e,t,n){return"animate"in e?e.animate(t,n):Ra.create()}On(Ra,"_instance",null);const Oa=qr("
"),ja=function(e,t){const n=n=>{var r;return!e.contains(n.target)&&(null==(r=t())?void 0:r())};document.body.addEventListener("click",n),or((()=>document.body.removeEventListener("click",n)))},Pa=function(e,t){const n=e=>{var n,r;"Escape"===e.key&&(null==(n=document.activeElement)||n.blur(),null==(r=t())||r())};document.body.addEventListener("keydown",n),or((()=>document.body.removeEventListener("keydown",n)))},La=function(e,t){const{isEnabled:n,onClose:r}=t();if(!n)return;if(!("android"===zo().os))return;window.history.pushState(da,"");const o=e=>{e.preventDefault(),r()};window.addEventListener("popstate",o,{once:!0}),or((()=>{window.removeEventListener("popstate",o),Bo((()=>{var e;!0===(null==(e=window.history.state)?void 0:e[ua])&&window.history.back()}))}))},Na=e=>{const t=Ao(),n=oa(e);return Yn((()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Oo(-document.documentElement.scrollTop),document.body.classList.add(Eo)):(document.body.classList.remove(Eo),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")})),_r(sa,{onBeforeEnter:e=>{const t=Ji("mobile")?200:100;Ta(e,[{opacity:0},{opacity:1}],{duration:t}),Ji("mobile")&&Ta(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const n=Ji("mobile")?200:100,r=Ta(e,[{opacity:1},{opacity:0}],{duration:n});if(Ji("mobile")){const o=Ta(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return _r(Nr,{get when(){return e.opened},get children(){return _r(wa,jr({"data-tc-modal":"true"},n,{get children(){const n=Oa.cloneNode(!0);return Zr(La,n,(()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()}))),Zr(Pa,n,(()=>()=>e.onClose())),Zr(ja,n,(()=>()=>e.onClose())),Gr(n,_r(xa,{get class(){return e.class},get children(){return[_r(Ca,{icon:"close",onClick:()=>e.onClose()}),Xn((()=>e.children))]}}),null),Gr(n,_r(Nr,{get when(){return e.onClickQuestion},get children(){return _r(Sa,{get children(){return[_r(Ws,{}),_r(ka,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Jn((()=>Qr(n,fn(Aa,yo` border-radius: ${ba[t.borderRadius]}; background-color: ${t.colors.background.tint}; @@ -351,7 +351,7 @@ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}funct filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); background-color: ${e=>e.theme.colors.background.segment}; -`;var Za={exports:{}};!function(e){var t=function(){var e=function(e,t){var n=e,r=u[t],o=null,i=0,a=null,s=[],l={},c=function(e,t){o=function(e){for(var t=new Array(e),n=0;n=7&&h(e),null==a&&(a=y(n,r,s)),m(a,t)},d=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||i<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(o[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},f=function(){for(var e=8;e>r&1);o[Math.floor(r/3)][r%3+i-8-3]=a}for(r=0;r<18;r+=1){a=!e&&1==(t>>r&1);o[r%3+i-8-3][Math.floor(r/3)]=a}},g=function(e,t){for(var n=r<<3|t,a=b.getBCHTypeInfo(n),s=0;s<15;s+=1){var l=!e&&1==(a>>s&1);s<6?o[s][8]=l:s<8?o[s+1][8]=l:o[i-15+s][8]=l}for(s=0;s<15;s+=1){l=!e&&1==(a>>s&1);s<8?o[8][i-s-1]=l:s<9?o[8][15-s-1+1]=l:o[8][15-s-1]=l}o[i-8][8]=!e},m=function(e,t){for(var n=-1,r=i-1,a=7,s=0,l=b.getMaskFunction(t),c=i-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var u=0;u<2;u+=1)if(null==o[r][c-u]){var d=!1;s>>a&1)),l(r,c-u)&&(d=!d),o[r][c-u]=d,-1==(a-=1)&&(s+=1,a=7)}if((r+=n)<0||i<=r){r-=n,n=-n;break}}},y=function(e,t,n){for(var r=x.getRSBlocks(e,t),o=C(),i=0;i8*s)throw"code length overflow. ("+o.getLengthInBits()+">"+8*s+")";for(o.getLengthInBits()+4<=8*s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*s||(o.put(236,8),o.getLengthInBits()>=8*s));)o.put(17,8);return function(e,t){for(var n=0,r=0,o=0,i=new Array(t.length),a=new Array(t.length),s=0;s=0?f.getAt(p):0}}var h=0;for(u=0;ur)&&(e=r,t=n)}return t}())},l.createTableTag=function(e,t){e=e||2;var n="";n+='',n+="";for(var r=0;r";for(var o=0;o';n+=""}return n+="",n+="
"},l.createSvgTag=function(e,t,n,r){var o={};"object"==typeof arguments[0]&&(e=(o=arguments[0]).cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var i,a,s,c,u=l.getModuleCount()*e+2*t,d="";for(c="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+=''+v(r.text)+"":"",d+=n.text?''+v(n.text)+"":"",d+='',d+='":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t};return l.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,o,i,a=1*l.getModuleCount()+2*e,s=e,c=a-e,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},f="";for(t=0;t=c?d[i]:u[i];f+="\n"}return a%2&&e>0?f.substring(0,f.length-a-1)+Array(a+1).join("▀"):f.substring(0,f.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,a=l.getModuleCount()*e+2*t,s=t,c=a-t,u=Array(e+1).join("██"),d=Array(e+1).join(" "),f="",p="";for(n=0;n>>8),t.push(255&a)):t.push(r)}}return t}};var t,n,r,o,i,a=1,s=2,l=4,c=8,u={L:1,M:0,Q:3,H:2},d=0,f=1,p=2,h=3,g=4,m=5,y=6,v=7,b=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,r=7973,i=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(o={}).getBCHTypeInfo=function(e){for(var t=e<<10;i(t)-i(n)>=0;)t^=n<=0;)t^=r<5&&(n+=3+i-5)}for(r=0;r=256;)t-=255;return e[t]}};return r}();function A(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},S=function(e){var t=a,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(var t=n,r=0;r+2>>8&255)+(255&r),e.put(r,13),n+=2}if(n>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o0&&(t+=","),t+=e[n];return t+="]"}};return t},T=function(e){var t=e,n=0,r=0,o=0,i={read:function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(n);if(n+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(r=r<<6|a(e.charCodeAt(0)),o+=6)}var i=r>>>o-8&255;return o-=8,i}},a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return i},O=function(e,t,n){for(var r=function(e,t){var n=e,r=t,o=new Array(e*t),i={setPixel:function(e,t,r){o[t*n+e]=r},write:function(e){e.writeString("GIF87a"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=a(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")}},a=function(e){for(var t=1<>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<>>=8-c,u=0,c=0;u|=e<0&&l.writeByte(u)}});f.write(t,r);var p=0,h=String.fromCharCode(o[p]);for(p+=1;p=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,a=0;a>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},e.exports=t}(Za);const Ga=Za.exports;function Ja(e){return jn(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Lo("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(KQ){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const Ya=qr("
"),Xa=e=>{let t,n,r;const[o,i]=Zn(!1),[a,s]=Zn(48);Yn((()=>{const o=Ga(0,"L");o.addData(e.sourceUrl),o.make(),t.innerHTML=o.createSvgTag(4,0);const i=t.firstElementChild.clientWidth,a=Math.round(256/i*1e5)/1e5;if(r){const e=4*Math.ceil(60/(4*a)),t=Oo(4*Math.ceil((i-e)/8));r.style.top=t,r.style.left=t,r.style.height=Oo(e),r.style.width=Oo(e),s(Math.round(48/a))}n.style.transform=`scale(${a})`}));let l=null;return _r(Va,{get class(){return e.class},onClick:()=>{i(!0),Ja(e.sourceUrl),null!=l&&clearTimeout(l),l=setTimeout((()=>i(!1)),1500)},get children(){return[_r(qa,{ref(e){"function"==typeof n?n(e):n=e},get children(){return[(()=>{const e=Ya.cloneNode(!0);return"function"==typeof t?Zr(t,e):t=e,e})(),_r(Nr,{get when(){return e.imageUrl},get children(){return _r(Ka,{ref(e){"function"==typeof r?r(e):r=e},get children(){return _r(Qa,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),_r(sa,{onBeforeEnter:e=>{Ta(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{Ta(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return _r(Nr,{get when(){return o()&&!e.disableCopy},get children(){return _r($a,{get children(){return[_r(js,{size:"xs"}),_r(is,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),_r(Nr,{get when(){return!e.disableCopy},get children(){return _r(Ha,{get children(){return _r(pl,{})}})}})]}})};var es=(e,t,n)=>{const r=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==r?r:n},ts=(e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[n,r]=Zn(t),[o,i]=Ei(e);return[(e,t,r)=>{const i=es(o[n()],e,r||"");return"function"==typeof i?i(t):"string"==typeof i?((e,t,n=/{{(.*?)}}/g)=>e.replace(n,((e,n)=>es(t,n,""))))(i,t||{}):i},{add(e,t){i(e,(e=>Object.assign(e||{},t)))},locale:e=>e?r(e):n(),dict:e=>es(o,e)}]},ns=ar({}),rs=()=>sr(ns);const os=Co.div` +`;var Za={exports:{}};!function(e){var t=function(){var e=function(e,t){var n=e,r=u[t],o=null,i=0,a=null,s=[],l={},c=function(e,t){o=function(e){for(var t=new Array(e),n=0;n=7&&h(e),null==a&&(a=y(n,r,s)),m(a,t)},d=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||i<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(o[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},f=function(){for(var e=8;e>r&1);o[Math.floor(r/3)][r%3+i-8-3]=a}for(r=0;r<18;r+=1){a=!e&&1==(t>>r&1);o[r%3+i-8-3][Math.floor(r/3)]=a}},g=function(e,t){for(var n=r<<3|t,a=b.getBCHTypeInfo(n),s=0;s<15;s+=1){var l=!e&&1==(a>>s&1);s<6?o[s][8]=l:s<8?o[s+1][8]=l:o[i-15+s][8]=l}for(s=0;s<15;s+=1){l=!e&&1==(a>>s&1);s<8?o[8][i-s-1]=l:s<9?o[8][15-s-1+1]=l:o[8][15-s-1]=l}o[i-8][8]=!e},m=function(e,t){for(var n=-1,r=i-1,a=7,s=0,l=b.getMaskFunction(t),c=i-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var u=0;u<2;u+=1)if(null==o[r][c-u]){var d=!1;s>>a&1)),l(r,c-u)&&(d=!d),o[r][c-u]=d,-1==(a-=1)&&(s+=1,a=7)}if((r+=n)<0||i<=r){r-=n,n=-n;break}}},y=function(e,t,n){for(var r=x.getRSBlocks(e,t),o=C(),i=0;i8*s)throw"code length overflow. ("+o.getLengthInBits()+">"+8*s+")";for(o.getLengthInBits()+4<=8*s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*s||(o.put(236,8),o.getLengthInBits()>=8*s));)o.put(17,8);return function(e,t){for(var n=0,r=0,o=0,i=new Array(t.length),a=new Array(t.length),s=0;s=0?f.getAt(p):0}}var h=0;for(u=0;ur)&&(e=r,t=n)}return t}())},l.createTableTag=function(e,t){e=e||2;var n="";n+='',n+="";for(var r=0;r";for(var o=0;o';n+=""}return n+="",n+="
"},l.createSvgTag=function(e,t,n,r){var o={};"object"==typeof arguments[0]&&(e=(o=arguments[0]).cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var i,a,s,c,u=l.getModuleCount()*e+2*t,d="";for(c="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+=''+v(r.text)+"":"",d+=n.text?''+v(n.text)+"":"",d+='',d+='":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t};return l.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,o,i,a=1*l.getModuleCount()+2*e,s=e,c=a-e,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},f="";for(t=0;t=c?d[i]:u[i];f+="\n"}return a%2&&e>0?f.substring(0,f.length-a-1)+Array(a+1).join("▀"):f.substring(0,f.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,a=l.getModuleCount()*e+2*t,s=t,c=a-t,u=Array(e+1).join("██"),d=Array(e+1).join(" "),f="",p="";for(n=0;n>>8),t.push(255&a)):t.push(r)}}return t}};var t,n,r,o,i,a=1,s=2,l=4,c=8,u={L:1,M:0,Q:3,H:2},d=0,f=1,p=2,h=3,g=4,m=5,y=6,v=7,b=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,r=7973,i=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(o={}).getBCHTypeInfo=function(e){for(var t=e<<10;i(t)-i(n)>=0;)t^=n<=0;)t^=r<5&&(n+=3+i-5)}for(r=0;r=256;)t-=255;return e[t]}};return r}();function A(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},S=function(e){var t=a,n=e,r={getMode:function(){return t},getLength:function(e){return n.length},write:function(e){for(var t=n,r=0;r+2>>8&255)+(255&r),e.put(r,13),n+=2}if(n>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o0&&(t+=","),t+=e[n];return t+="]"}};return t},T=function(e){var t=e,n=0,r=0,o=0,i={read:function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(n);if(n+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(r=r<<6|a(e.charCodeAt(0)),o+=6)}var i=r>>>o-8&255;return o-=8,i}},a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return i},O=function(e,t,n){for(var r=function(e,t){var n=e,r=t,o=new Array(e*t),i={setPixel:function(e,t,r){o[t*n+e]=r},write:function(e){e.writeString("GIF87a"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=a(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")}},a=function(e){for(var t=1<>>t!=0)throw"length over";for(;c+t>=8;)l.writeByte(255&(e<>>=8-c,u=0,c=0;u|=e<0&&l.writeByte(u)}});f.write(t,r);var p=0,h=String.fromCharCode(o[p]);for(p+=1;p=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,a=0;a>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},e.exports=t}(Za);const Ga=Za.exports;function Ja(e){return jn(this,null,(function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new Lo("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(QQ){}!function(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}(e)}))}const Ya=qr("
"),Xa=e=>{let t,n,r;const[o,i]=Zn(!1),[a,s]=Zn(48);Yn((()=>{const o=Ga(0,"L");o.addData(e.sourceUrl),o.make(),t.innerHTML=o.createSvgTag(4,0);const i=t.firstElementChild.clientWidth,a=Math.round(256/i*1e5)/1e5;if(r){const e=4*Math.ceil(60/(4*a)),t=Oo(4*Math.ceil((i-e)/8));r.style.top=t,r.style.left=t,r.style.height=Oo(e),r.style.width=Oo(e),s(Math.round(48/a))}n.style.transform=`scale(${a})`}));let l=null;return _r(Va,{get class(){return e.class},onClick:()=>{i(!0),Ja(e.sourceUrl),null!=l&&clearTimeout(l),l=setTimeout((()=>i(!1)),1500)},get children(){return[_r(qa,{ref(e){"function"==typeof n?n(e):n=e},get children(){return[(()=>{const e=Ya.cloneNode(!0);return"function"==typeof t?Zr(t,e):t=e,e})(),_r(Nr,{get when(){return e.imageUrl},get children(){return _r(Ka,{ref(e){"function"==typeof r?r(e):r=e},get children(){return _r(Qa,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),_r(sa,{onBeforeEnter:e=>{Ta(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{Ta(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then((()=>{t()}))},get children(){return _r(Nr,{get when(){return o()&&!e.disableCopy},get children(){return _r($a,{get children(){return[_r(js,{size:"xs"}),_r(is,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),_r(Nr,{get when(){return!e.disableCopy},get children(){return _r(Ha,{get children(){return _r(pl,{})}})}})]}})};var es=(e,t,n)=>{const r=t.trim().split(".").reduce(((e,t)=>e?e[t]:void 0),e);return void 0!==r?r:n},ts=(e={},t=(navigator.language in e?navigator.language:Object.keys(e)[0]))=>{const[n,r]=Zn(t),[o,i]=Ei(e);return[(e,t,r)=>{const i=es(o[n()],e,r||"");return"function"==typeof i?i(t):"string"==typeof i?((e,t,n=/{{(.*?)}}/g)=>e.replace(n,((e,n)=>es(t,n,""))))(i,t||{}):i},{add(e,t){i(e,(e=>Object.assign(e||{},t)))},locale:e=>e?r(e):n(),dict:e=>es(o,e)}]},ns=ar({}),rs=()=>sr(ns);const os=Co.div` font-style: normal; font-weight: ${e=>e.fontWeight}; font-size: ${e=>e.fontSize}; @@ -778,7 +778,7 @@ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}funct width: 32px; height: 32px; border-radius: ${e=>wu[e.theme.borderRadius]}; -`,Iu=e=>{const[t]=rs();return Xn((()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())}))};function Mu(e,t){let n;n="string"==typeof t?t:zi()?t.twaReturnUrl||t.returnStrategy:"none";const r=function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",n);if(!st(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+lt(o)}function Du(e,t){t=Rn({},t);const n=function(e){const t=new URL(e);t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start");return t.toString()}(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Hi()){t.returnStrategy="back";Mo(Mu(r.toString(),t.returnStrategy))}else if(zi())if(Wi("ios","android","macos","tdesktop","web")){t.returnStrategy="back";qi(Mu(r.toString(),t.returnStrategy))}else Wi("weba")?qi(Mu(r.toString(),t)):Mo(Mu(r.toString(),t));else if(Ho("ios")){"back"===t.returnStrategy&&(Vo("safari")?t.returnStrategy="back":Vo("chrome")?t.returnStrategy="googlechrome://":Vo("firefox")?t.returnStrategy="firefox://":Vo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Vo("chrome"),n=Vo("firefox");if((e||n)&&!t.forceRedirect){const e=Mu(r.toString(),t.returnStrategy);Do(Uu(e),(()=>Mo(e)))}else{Mo(Mu(r.toString(),t.returnStrategy))}}else if(Ho("android")){t.returnStrategy="back";const e=Vo("chrome"),n=Vo("firefox");if((e||n)&&!t.forceRedirect){const e=Mu(r.toString(),t.returnStrategy);Do(Uu(e),(()=>Mo(e)))}else{Mo(Mu(r.toString(),t.returnStrategy))}}else if(Ho("ipad")){"back"===t.returnStrategy&&(Vo("safari")?t.returnStrategy="back":Vo("chrome")?t.returnStrategy="googlechrome://":Vo("firefox")?t.returnStrategy="firefox://":Vo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Vo("chrome"),n=Vo("firefox"),o=(e||n)&&!t.forceRedirect,i=Mu(r.toString(),t.returnStrategy);if(o){Do(Uu(i),(()=>Mo(i)))}else Mo(i)}else if(Ho("macos","windows","linux")){t.returnStrategy="back",t.twaReturnUrl=void 0;const e=Mu(r.toString(),t.returnStrategy);if(t.forceRedirect)Mo(e);else{Do(Uu(e),(()=>Mo(e)))}}else Mo(Mu(r.toString(),t))}function Bu(e,t,n,r){if(n=Rn({},n),Hi())if(Ho("ios","android"))"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link"),Io(Mu(e,n.returnStrategy),"_self");else{r("universal-link");Mo(Mu(e,n.returnStrategy))}else if(zi())if(Wi("ios","android")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link");const t=Mu(e,n.returnStrategy);qi(t,(()=>{r("universal-link"),Mo(t)}))}else if(Wi("macos","tdesktop")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve");const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else if(Wi("weba")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy=location.href:Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else if(Wi("web")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy=location.href:Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else{r("universal-link");Mo(Mu(e,n.returnStrategy))}else if(Ho("ios"))"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Vo("chrome")?(r("universal-link"),Io(Mu(e,n.returnStrategy),"_self")):(r("universal-link"),Mo(Mu(e,n.returnStrategy)));else if(Ho("android"))"back"===n.returnStrategy&&(Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Mo(Mu(e,n.returnStrategy));else if(Ho("ipad"))"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Vo("chrome")?(r("universal-link"),Io(Mu(e,n.returnStrategy),"_self")):(r("universal-link"),Mo(Mu(e,n.returnStrategy)));else if(Ho("macos","windows","linux")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else r("universal-link"),Mo(Mu(e,n.returnStrategy))}function Uu(e){const t=new URL(e),[,n,r]=t.pathname.split("/");return`tg://resolve?domain=${n}&appname=${r}&startapp=${t.searchParams.get("startapp")}`}const Fu=e=>{const[t,n]=Zn("mobile"),[r,o]=Zn(!1),[i,a]=Zn(),[s,l]=Zn(!0),c=sr(di);or(c.onStatusChange((()=>{}),(()=>{e.wallet.appName!==Al&&o(!0)})));const u=()=>{try{const t=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);a(t)}catch(KQ){}};Yn((()=>{"extension"!==nr(t)&&(cu(e.wallet)||lu(e.wallet))&&u()}));const d=()=>{o(!1),"extension"===t()&&u(),n("mobile"),ii(Tn(Rn({},e.wallet),{openMethod:"qrcode"}))},f=()=>{if(o(!1),"extension"===t()&&u(),n("desktop"),st(i()))p();else{const t=!s();l(!1),Bu(i(),e.wallet.deepLink,{returnStrategy:ou.returnStrategy,forceRedirect:t},(t=>{ii(Tn(Rn({},e.wallet),{openMethod:t}))}))}},p=()=>{const t=!s();l(!1),ii(Tn(Rn({},e.wallet),{openMethod:"universal-link"})),Du(i(),{returnStrategy:ou.returnStrategy,twaReturnUrl:ou.twaReturnUrl,forceRedirect:t})},h=()=>{o(!1),n("extension"),Et(e.wallet)&&(ii(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return cu(e.wallet)?d():uu(e.wallet)?h():f(),_r(Au,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[_r(Nr,{get when(){return!e.backDisabled},get children(){return _r(Eu,{icon:"arrow",onClick:()=>e.onBackClick()})}}),_r(Su,{get children(){return e.wallet.name}}),_r(Nr,{get when(){return"mobile"===t()},get children(){return _r(ku,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Xn((()=>e.wallet.name)),"’s camera"]}})}}),_r(xu,{get qr(){return"mobile"===t()},get children(){return _r(Ir,{get children(){return[_r(Mr,{get when(){return"mobile"===t()},get children(){return _r(Cu,{disableCopy:!1,get sourceUrl(){return Mu(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),_r(Mr,{get when(){return r()},get children(){return[_r(ju,{size:"s"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),_r(_u,{get children(){return _r(ia,{get leftIcon(){return _r(Js,{})},get onClick(){return"extension"===t()?h:f},get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),_r(Mr,{get when(){return"extension"===t()},get children(){return[_r(Nr,{get when(){return Et(e.wallet)},get children(){return[_r(Ou,{size:"s"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Xn((()=>e.wallet.name))," browser extension…"]}}),_r(_u,{get children(){return _r(ia,{get leftIcon(){return _r(Js,{})},onClick:h,get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),_r(Nr,{get when(){return!Et(e.wallet)},get children(){return[_r(Pu,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Xn((()=>e.wallet.name))," browser extension"]}}),_r(_u,{get children(){return _r(Nl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return _r(ia,{get rightIcon(){return _r(Xs,{})},onClick:h,get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Xn((()=>e.wallet.name))]}})}})}})}})]}})]}}),_r(Mr,{get when(){return"desktop"===t()},get children(){return[_r(Us,{size:"m"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Xn((()=>e.wallet.name))," on desktop…"]}}),_r(_u,{get children(){return[_r(ia,{get leftIcon(){return _r(Js,{})},onClick:f,get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}}),_r(Nl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return _r(ia,{get rightIcon(){return _r(Xs,{})},get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Xn((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),_r(Nr,{get when(){return e.wallet.appName===Al},get children(){return _r(Lu,{get rightIcon(){return _r(Nu,{get src(){return Cl}})},scale:"s",onClick:p,get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),_r(Nr,{get when(){return e.wallet.appName!==Al},get children(){return _r(Ru,{get children(){return[_r(Nr,{get when(){return Xn((()=>"mobile"!==t()))()&&cu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(Qs,{})},onClick:d,get children(){return _r(Iu,{translationKey:"common.mobile",children:"Mobile"})}})}}),_r(Nr,{get when(){return Xn((()=>"extension"!==t()))()&&uu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(qs,{})},onClick:h,get children(){return _r(Iu,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),_r(Nr,{get when(){return Xn((()=>"desktop"!==t()))()&&lu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(Zs,{})},onClick:f,get children(){return _r(Iu,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Wu=Co.div``,zu=Co(va)` +`,Iu=e=>{const[t]=rs();return Xn((()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())}))};function Mu(e,t){let n;n="string"==typeof t?t:zi()?t.twaReturnUrl||t.returnStrategy:"none";const r=function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",n);if(!st(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+lt(o)}function Du(e,t){t=Rn({},t);const n=function(e){const t=new URL(e);t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start");return t.toString()}(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Hi()){t.returnStrategy="back";Mo(Mu(r.toString(),t.returnStrategy))}else if(zi())if(Wi("ios","android","macos","tdesktop","web")){t.returnStrategy="back";qi(Mu(r.toString(),t.returnStrategy))}else Wi("weba")?qi(Mu(r.toString(),t)):Mo(Mu(r.toString(),t));else if(Ho("ios")){"back"===t.returnStrategy&&(Vo("safari")?t.returnStrategy="back":Vo("chrome")?t.returnStrategy="googlechrome://":Vo("firefox")?t.returnStrategy="firefox://":Vo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Vo("chrome"),n=Vo("firefox");if((e||n)&&!t.forceRedirect){const e=Mu(r.toString(),t.returnStrategy);Do(Uu(e),(()=>Mo(e)))}else{Mo(Mu(r.toString(),t.returnStrategy))}}else if(Ho("android")){t.returnStrategy="back";const e=Vo("chrome"),n=Vo("firefox");if((e||n)&&!t.forceRedirect){const e=Mu(r.toString(),t.returnStrategy);Do(Uu(e),(()=>Mo(e)))}else{Mo(Mu(r.toString(),t.returnStrategy))}}else if(Ho("ipad")){"back"===t.returnStrategy&&(Vo("safari")?t.returnStrategy="back":Vo("chrome")?t.returnStrategy="googlechrome://":Vo("firefox")?t.returnStrategy="firefox://":Vo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Vo("chrome"),n=Vo("firefox"),o=(e||n)&&!t.forceRedirect,i=Mu(r.toString(),t.returnStrategy);if(o){Do(Uu(i),(()=>Mo(i)))}else Mo(i)}else if(Ho("macos","windows","linux")){t.returnStrategy="back",t.twaReturnUrl=void 0;const e=Mu(r.toString(),t.returnStrategy);if(t.forceRedirect)Mo(e);else{Do(Uu(e),(()=>Mo(e)))}}else Mo(Mu(r.toString(),t))}function Bu(e,t,n,r){if(n=Rn({},n),Hi())if(Ho("ios","android"))"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link"),Io(Mu(e,n.returnStrategy),"_self");else{r("universal-link");Mo(Mu(e,n.returnStrategy))}else if(zi())if(Wi("ios","android")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link");const t=Mu(e,n.returnStrategy);qi(t,(()=>{r("universal-link"),Mo(t)}))}else if(Wi("macos","tdesktop")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve");const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else if(Wi("weba")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy=location.href:Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else if(Wi("web")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy=location.href:Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else{r("universal-link");Mo(Mu(e,n.returnStrategy))}else if(Ho("ios"))"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Vo("chrome")?(r("universal-link"),Io(Mu(e,n.returnStrategy),"_self")):(r("universal-link"),Mo(Mu(e,n.returnStrategy)));else if(Ho("android"))"back"===n.returnStrategy&&(Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Mo(Mu(e,n.returnStrategy));else if(Ho("ipad"))"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Vo("chrome")?(r("universal-link"),Io(Mu(e,n.returnStrategy),"_self")):(r("universal-link"),Mo(Mu(e,n.returnStrategy)));else if(Ho("macos","windows","linux")){"back"===n.returnStrategy&&(Vo("safari")?n.returnStrategy="none":Vo("chrome")?n.returnStrategy="googlechrome://":Vo("firefox")?n.returnStrategy="firefox://":Vo("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=Mu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),Do(qo(o,t),(()=>{r("universal-link"),Mo(o)}))):(r("universal-link"),Mo(o))}else r("universal-link"),Mo(Mu(e,n.returnStrategy))}function Uu(e){const t=new URL(e),[,n,r]=t.pathname.split("/");return`tg://resolve?domain=${n}&appname=${r}&startapp=${t.searchParams.get("startapp")}`}const Fu=e=>{const[t,n]=Zn("mobile"),[r,o]=Zn(!1),[i,a]=Zn(),[s,l]=Zn(!0),c=sr(di);or(c.onStatusChange((()=>{}),(()=>{e.wallet.appName!==Al&&o(!0)})));const u=()=>{try{const t=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);a(t)}catch(QQ){}};Yn((()=>{"extension"!==nr(t)&&(cu(e.wallet)||lu(e.wallet))&&u()}));const d=()=>{o(!1),"extension"===t()&&u(),n("mobile"),ii(Tn(Rn({},e.wallet),{openMethod:"qrcode"}))},f=()=>{if(o(!1),"extension"===t()&&u(),n("desktop"),st(i()))p();else{const t=!s();l(!1),Bu(i(),e.wallet.deepLink,{returnStrategy:ou.returnStrategy,forceRedirect:t},(t=>{ii(Tn(Rn({},e.wallet),{openMethod:t}))}))}},p=()=>{const t=!s();l(!1),ii(Tn(Rn({},e.wallet),{openMethod:"universal-link"})),Du(i(),{returnStrategy:ou.returnStrategy,twaReturnUrl:ou.twaReturnUrl,forceRedirect:t})},h=()=>{o(!1),n("extension"),Et(e.wallet)&&(ii(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return cu(e.wallet)?d():uu(e.wallet)?h():f(),_r(Au,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[_r(Nr,{get when(){return!e.backDisabled},get children(){return _r(Eu,{icon:"arrow",onClick:()=>e.onBackClick()})}}),_r(Su,{get children(){return e.wallet.name}}),_r(Nr,{get when(){return"mobile"===t()},get children(){return _r(ku,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Xn((()=>e.wallet.name)),"’s camera"]}})}}),_r(xu,{get qr(){return"mobile"===t()},get children(){return _r(Ir,{get children(){return[_r(Mr,{get when(){return"mobile"===t()},get children(){return _r(Cu,{disableCopy:!1,get sourceUrl(){return Mu(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),_r(Mr,{get when(){return r()},get children(){return[_r(ju,{size:"s"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),_r(_u,{get children(){return _r(ia,{get leftIcon(){return _r(Js,{})},get onClick(){return"extension"===t()?h:f},get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),_r(Mr,{get when(){return"extension"===t()},get children(){return[_r(Nr,{get when(){return Et(e.wallet)},get children(){return[_r(Ou,{size:"s"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Xn((()=>e.wallet.name))," browser extension…"]}}),_r(_u,{get children(){return _r(ia,{get leftIcon(){return _r(Js,{})},onClick:h,get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),_r(Nr,{get when(){return!Et(e.wallet)},get children(){return[_r(Pu,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Xn((()=>e.wallet.name))," browser extension"]}}),_r(_u,{get children(){return _r(Nl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return _r(ia,{get rightIcon(){return _r(Xs,{})},onClick:h,get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Xn((()=>e.wallet.name))]}})}})}})}})]}})]}}),_r(Mr,{get when(){return"desktop"===t()},get children(){return[_r(Us,{size:"m"}),_r(Pu,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Xn((()=>e.wallet.name))," on desktop…"]}}),_r(_u,{get children(){return[_r(ia,{get leftIcon(){return _r(Js,{})},onClick:f,get children(){return _r(Iu,{translationKey:"common.retry",children:"Retry"})}}),_r(Nl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return _r(ia,{get rightIcon(){return _r(Xs,{})},get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Xn((()=>e.wallet.name))]}})}})}})]}})]}})]}})}}),_r(Nr,{get when(){return e.wallet.appName===Al},get children(){return _r(Lu,{get rightIcon(){return _r(Nu,{get src(){return Cl}})},scale:"s",onClick:p,get children(){return _r(Iu,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),_r(Nr,{get when(){return e.wallet.appName!==Al},get children(){return _r(Ru,{get children(){return[_r(Nr,{get when(){return Xn((()=>"mobile"!==t()))()&&cu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(Qs,{})},onClick:d,get children(){return _r(Iu,{translationKey:"common.mobile",children:"Mobile"})}})}}),_r(Nr,{get when(){return Xn((()=>"extension"!==t()))()&&uu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(qs,{})},onClick:h,get children(){return _r(Iu,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),_r(Nr,{get when(){return Xn((()=>"desktop"!==t()))()&&lu(e.wallet)},get children(){return _r(Tu,{appearance:"secondary",get leftIcon(){return _r(Zs,{})},onClick:f,get children(){return _r(Iu,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Wu=Co.div``,zu=Co(va)` position: absolute; top: 16px; left: 16px; @@ -1070,7 +1070,7 @@ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}funct width: 16px; `,$d=Co(ia)` margin-top: 32px; -`,Zd=e=>{const t=oa(e),n=sr(Il),[r,o]=Zn(!0),[i,a]=Zn(!1);let s,l;Yn((()=>{const e=ai();a(!!e&&"sent"in e&&e.sent)})),(null==n?void 0:n.wallet)&&"universalLink"in n.wallet&&("universal-link"===n.wallet.openMethod||st(n.wallet.universalLink)&&zi())&&(s=n.wallet.universalLink),(null==n?void 0:n.wallet)&&"deepLink"in n.wallet&&("custom-deeplink"===n.wallet.openMethod||st(n.wallet.deepLink)&&zi())&&(l=n.wallet.deepLink);const c=()=>{const e=ai(),t="returnStrategy"in e?e.returnStrategy:ou.returnStrategy,n=!r();o(!1),st(s)?Du(s,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:ou.twaReturnUrl,forceRedirect:n}):Bu(s,l,{returnStrategy:t,forceRedirect:n},(()=>{}))};return _r(Hd,jr(t,{get children(){return[Xn((()=>e.icon)),_r(Vd,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),_r(qd,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),_r(Nr,{get when(){return!i()&&("open-wallet"===e.showButton&&s||"open-wallet"!==e.showButton)},get children(){return _r(Kd,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return _r(Qd,{})}})}}),_r(Nr,{get when(){return i()},get children(){return[_r(Nr,{get when(){return"open-wallet"!==e.showButton},get children(){return _r($d,{onClick:()=>e.onClose(),get children(){return _r(Iu,{translationKey:"common.close",children:"Close"})}})}}),_r(Nr,{get when(){return"open-wallet"===e.showButton&&s},get children(){return _r($d,{onClick:c,get children(){return _r(Iu,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Gd=e=>{const t=sr(Il),[n]=rs();return _r(Zd,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return _r(Us,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Jd=e=>_r(Zd,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return _r(Is,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Yd=e=>_r(Zd,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return _r(js,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),Xd=()=>_r(Na,{get opened(){var e;return Xn((()=>null!==ai()))()&&!0===(null==(e=ai())?void 0:e.openModal)},get enableAndroidBackHandler(){return ou.enableAndroidBackHandler},onClose:()=>si(null),"data-tc-actions-modal-container":"true",get children(){return _r(Ir,{get children(){return[_r(Mr,{get when(){return"transaction-sent"===ai().name},get children(){return _r(Yd,{onClose:()=>si(null)})}}),_r(Mr,{get when(){return"transaction-canceled"===ai().name},get children(){return _r(Jd,{onClose:()=>si(null)})}}),_r(Mr,{get when(){return"confirm-transaction"===ai().name},get children(){return _r(Gd,{onClose:()=>si(null)})}})]}})}}),ef=()=>{const{locale:e}=rs()[1];Yn((()=>e(ou.language))),Yn((()=>{ei()&&jl()}));const t=sr(di),n=sr(Il),[r,o]=Zn(!1),i=()=>{var e;return"loading"===(null==(e=ou.connectRequestParameters)?void 0:e.state)},a=Xn((()=>{var e;if(!i())return null==(e=ou.connectRequestParameters)?void 0:e.value})),s=e=>{n.closeSingleWalletModal(e)};return or(t.onStatusChange((e=>{e&&s("wallet-selected")}))),or((()=>{o(!1)})),_r(tu,{get opened(){return ei()},get enableAndroidBackHandler(){return ou.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[_r(Nr,{get when(){return r()},get children(){return _r(Gu,{onBackClick:()=>o(!1)})}}),_r(Nr,{get when(){return!r()},get children(){return[_r(Nr,{get when(){return i()},get children(){return[_r(nu,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),_r(ru,{get children(){return _r(Us,{size:"m"})}})]}}),_r(Nr,{get when(){return!i()},get children(){return _r(so,{get component(){return Tl()?fd:Fu},get wallet(){return ti()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},tf=e=>{const t=ts(ci,ou.language);return customElements.define(ko,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),_r(ns.Provider,{value:t,get children(){return _r(Il.Provider,{get value(){return e.tonConnectUI},get children(){return _r(di.Provider,{get value(){return ou.connector},get children(){return[_r(Ro,{}),_r(wo,{theme:ji,get children(){return[_r(Nr,{get when(){return ou.buttonRootId},get children(){return _r(ao,{get mount(){return document.getElementById(ou.buttonRootId)},get children(){return _r(eu,{})}})}}),_r(so,{component:ko,get children(){return[_r(zd,{}),_r(ef,{}),_r(Xd,{})]}})]}})]}})}})}})},nf=()=>{setTimeout((()=>Go({status:"opened",closeReason:null})))},rf=e=>{setTimeout((()=>Go({status:"closed",closeReason:e})))},of=e=>{setTimeout((()=>Xo({status:"opened",closeReason:null,walletInfo:e})))},af=e=>{setTimeout((()=>Xo({status:"closed",closeReason:e})))},sf=e=>{setTimeout((()=>si(e)))},lf=()=>{setTimeout((()=>si(null)))},cf=()=>ri(),uf=()=>ii(null),df=(e,t)=>function(e,t,n,r={}){let o;return $n((r=>{o=r,t===document?e():Gr(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}((()=>_r(tf,{tonConnectUI:t})),document.getElementById(e));class ff{constructor(e){On(this,"connector"),On(this,"setConnectRequestParametersCallback"),On(this,"consumers",[]),On(this,"tracker"),On(this,"state",Zo()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Yn((()=>{const e=Zo();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return jn(this,null,(function*(){this.tracker.trackConnectionStarted();const e=(yield this.connector.getWallets()).find(_t);return e?this.connectEmbeddedWallet(e):this.openWalletsModal()}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),rf(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openWalletsModal(){return jn(this,null,(function*(){return zi()&&Vi(),nf(),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}class pf{constructor(e){On(this,"connector"),On(this,"consumers",[]),this.connector=e.connector,Yn((()=>{const e=ai();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}class hf{constructor(e){On(this,"connector"),On(this,"setConnectRequestParametersCallback"),On(this,"consumers",[]),On(this,"tracker"),On(this,"state",Yo()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Yn((()=>{const e=Yo();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(e){return jn(this,null,(function*(){this.tracker.trackConnectionStarted();const t=su(yield this.connector.getWallets(),ou.walletsListConfiguration),n=t.find(_t);if(!!n)return this.connectEmbeddedWallet(n);const r=t.filter(Rt).find((t=>du(t,e)));if(!!r)return this.openSingleWalletModal(r);const o=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(o),new Lo(o)}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),af("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openSingleWalletModal(e){return jn(this,null,(function*(){return zi()&&Vi(),of(e),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}class gf{constructor(e){var t;On(this,"eventPrefix","ton-connect-ui-"),On(this,"tonConnectUiVersion"),On(this,"tonConnectSdkVersion",null),On(this,"eventDispatcher"),this.eventDispatcher=null!=(t=null==e?void 0:e.eventDispatcher)?t:new Qt,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return Nt({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return jn(this,null,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(KQ){}}))}setRequestVersionHandler(){return jn(this,null,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",(()=>jn(this,null,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Lt(this.tonConnectUiVersion))}))))}))}requestTonConnectSdkVersion(){return jn(this,null,(function*(){return new Promise(((e,t)=>jn(this,null,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",{type:"request-version"})}catch(KQ){t(KQ)}}))))}))}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(KQ){}}trackConnectionStarted(...e){try{const t=Mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackConnectionCompleted(...e){try{const t=Dt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackConnectionError(...e){try{const t=Bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackConnectionRestoringStarted(...e){try{const t=Ut(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackConnectionRestoringCompleted(...e){try{const t=Ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackConnectionRestoringError(...e){try{const t=Wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackDisconnection(...e){try{const t=Kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackTransactionSentForSignature(...e){try{const t=Ht(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackTransactionSigned(...e){try{const t=Vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}trackTransactionSigningFailed(...e){try{const t=qt(this.version,...e);this.dispatchUserActionEvent(t)}catch(KQ){}}}class mf{constructor(e){if(On(this,"walletInfoStorage",new Ko),On(this,"preferredWalletStorage",new Qo),On(this,"tracker"),On(this,"walletInfo",null),On(this,"systemThemeChangeUnsubscribe",null),On(this,"actionsConfiguration"),On(this,"walletsList"),On(this,"connectRequestParametersCallback"),On(this,"connector"),On(this,"modal"),On(this,"singleWalletModal"),On(this,"transactionModal"),On(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Lo("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new Zt({manifestUrl:e.manifestUrl,eventDispatcher:null==e?void 0:e.eventDispatcher})}this.tracker=new gf({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectUiVersion:"2.0.9"}),this.modal=new ff({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new hf({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new pf({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return Uo((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=function(e){return jn(this,null,(function*(){return yield new Promise((e=>requestAnimationFrame(e))),e()}))}((()=>jn(this,null,(function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))))),this.uiOptions=Oi(e,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();iu({connector:this.connector,preferredWalletAppName:n}),df(t,this)}static getWallets(){return Zt.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Rn(Rn({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,n,r,o,i,a,s;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(n=e.uiPreferences)?void 0:n.theme)?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),Ii(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Ii(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?lo.LIGHT:lo.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?lo.DARK:lo.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Ii))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(a=e.uiPreferences.colorsSet,Ni[lo.DARK]=Oi(a[lo.DARK],Ni[lo.DARK]),Ni[lo.LIGHT]=Oi(a[lo.LIGHT],Ni[lo.LIGHT]),Pi((e=>({colors:Oi(Ni[e.theme],Li[e.theme])})))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(s=e.uiPreferences.borderRadius,Pi({borderRadius:s})),iu((t=>{var n,r;const o=Oi(Rn(Rn(Rn(Rn({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(r=e.actionsConfiguration)?void 0:r.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),yi(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o}))}setConnectRequestParameters(e){var t;iu({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return jn(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>jn(this,null,(function*(){if(t){const n=yield this.getSelectedWalletInfo(t);e(Rn(Rn({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return jn(this,null,(function*(){return this.modal.open()}))}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return jn(this,null,(function*(){return this.singleWalletModal.open(e)}))}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return jn(this,null,(function*(){const e=(yield this.getWallets()).find(_t);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),lf(),uf(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return jn(this,null,(function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new Lo("Connect wallet to send a transaction.");zi()&&Vi();const{notifications:n,modals:r,returnStrategy:o,twaReturnUrl:i,skipRedirectToWallet:a}=this.getModalsAndNotificationsConfiguration(t);sf({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!1});const s=()=>{l.signal.aborted||(sf({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)&&(st(this.walletInfo.universalLink)?Du(this.walletInfo.universalLink,{returnStrategy:o,twaReturnUrl:i||ou.twaReturnUrl,forceRedirect:!1}):Bu(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:o,forceRedirect:!1},(()=>{}))))},l=new AbortController,c=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(c(),e||l.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,signal:l.signal},s);return this.tracker.trackTransactionSigned(this.wallet,e,t),sf({name:"transaction-sent",showNotification:n.includes("success"),openModal:r.includes("success")}),t}catch(KQ){throw sf({name:"transaction-canceled",showNotification:n.includes("error"),openModal:r.includes("error")}),KQ instanceof Fe?KQ:(console.error(KQ),new Lo("Unhandled error:"+KQ))}finally{c()}}))}connectEmbeddedWallet(e){return jn(this,null,(function*(){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;return"loading"===(null==n?void 0:n.state)?this.connectRequestParametersCallback=t:t(null==n?void 0:n.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return jn(this,null,(function*(){const e=new AbortController;nf();const t=this.onModalStateChange((n=>{const{status:r,closeReason:o}=n;"opened"!==r&&(t(),"action-cancelled"===o&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,signal:e.signal})}))}waitForWalletConnection(e){return jn(this,null,(function*(){return new Promise(((t,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:r=!1,signal:o=null}=e;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new Lo("Wallet was not connected"));const i=e=>jn(this,null,(function*(){if(e)this.tracker.trackConnectionCompleted(e),s(),t(e);else{if(this.tracker.trackConnectionError("Connection was cancelled"),r)return;s(),n(new Lo("Wallet was not connected"))}})),a=e=>{this.tracker.trackConnectionError(e.message),r||(s(),n(e))},s=this.onStatusChange((e=>i(e)),(e=>a(e)));o&&o.addEventListener("abort",(()=>{s(),n(new Lo("Wallet was not connected"))}),{once:!0})}))}))}waitForSendTransaction(e,t){return jn(this,null,(function*(){return new Promise(((n,r)=>{const{transaction:o,signal:i}=e;if(i.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new Lo("Transaction was not sent"));const a=e=>jn(this,null,(function*(){n(e)})),s=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new Lo("Transaction was not sent"))};i.addEventListener("abort",s,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:t,signal:i}).then((e=>(i.removeEventListener("abort",s),a(e)))).catch((e=>(i.removeEventListener("abort",s),(e=>{r(e)})(e))))}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>jn(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),iu({preferredWalletAppName:e})}getSelectedWalletInfo(e){return jn(this,null,(function*(){let t,n=cf();if(!n)return null;if("name"in n)t=n;else{const r=su(yield this.walletsList,ou.walletsListConfiguration).find((t=>du(t,e.device.appName)));if(!r)throw new Lo(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=Rn(Rn({},r),n)}return t}))}updateWalletInfo(e){return jn(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const n=this.walletInfoStorage.getWalletInfo();this.walletInfo=n||((yield this.walletsList).find((t=>du(t,e.device.appName)))||null)}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Lo(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r,o,i,a;const s=["before","success","error"];let l=s;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?s:e.notifications);let c=["before"];(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(c="all"===this.actionsConfiguration.modals?s:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?s:e.modals);const u=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",d=(null==e?void 0:e.twaReturnUrl)||(null==(i=this.actionsConfiguration)?void 0:i.twaReturnUrl);let f=(null==e?void 0:e.skipRedirectToWallet)||(null==(a=this.actionsConfiguration)?void 0:a.skipRedirectToWallet)||"ios";return zi()&&(f="never"),{notifications:l,modals:c,returnStrategy:u,twaReturnUrl:d,skipRedirectToWallet:f}}}var yf,vf=Object.defineProperty,bf=Object.getOwnPropertySymbols,wf=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable,xf=(e,t,n)=>t in e?vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cf=(e,t)=>{for(var n in t||(t={}))wf.call(t,n)&&xf(e,n,t[n]);if(bf)for(var n of bf(t))Af.call(t,n)&&xf(e,n,t[n]);return e},Sf={exports:{}},kf={};Sf.exports=function(){if(yf)return kf;yf=1;var e=Q,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:o.current}}return kf.Fragment=n,kf.jsx=a,kf.jsxs=a,kf}();const Ef=Sf.exports.jsx;function _f(){return"undefined"!=typeof window}const Rf=K.createContext(null);let Tf=null;const Of=K.memo((e=>{var t=e,{children:n}=t,r=((e,t)=>{var n={};for(var r in e)wf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&bf)for(var r of bf(e))t.indexOf(r)<0&&Af.call(e,r)&&(n[r]=e[r]);return n})(t,["children"]);return _f()&&!Tf&&(Tf=new mf(r)),Ef(Rf.Provider,{value:Tf,children:n})}));class jf extends Lo{constructor(...e){super(...e),Object.setPrototypeOf(this,jf.prototype)}}class Pf extends jf{constructor(...e){super(...e),Object.setPrototypeOf(this,Pf.prototype)}}function Lf(){const e=K.useContext(Rf),t=K.useCallback((t=>{e&&(e.uiOptions=t)}),[e]);return _f()?(function(e){if(!e)throw new Pf("You should add on the top of the app to use TonConnect")}(e),[e,t]):[null,()=>{}]}const Nf="ton-connect-button";function If(e=!0){const t=function(){const[e]=Lf(),[t,n]=K.useState((null==e?void 0:e.wallet)||null);return K.useEffect((()=>{if(e)return n(e.wallet),e.onStatusChange((e=>{n(e)}))}),[e]),t}();return K.useMemo((()=>t?e?Gt(t.account.address,t.account.chain===Le.TESTNET):t.account.address:""),[t,e,null==t?void 0:t.account.address,null==t?void 0:t.account.chain])}K.memo((({className:e,style:t})=>{const[n,r]=Lf();return K.useEffect((()=>(r({buttonRootId:Nf}),()=>r({buttonRootId:null}))),[r]),Ef("div",{id:Nf,className:e,style:Cf({width:"fit-content"},t)})}));var Mf={},Df={exports:{}},Bf={},Uf={exports:{}},Ff={}; +`,Zd=e=>{const t=oa(e),n=sr(Il),[r,o]=Zn(!0),[i,a]=Zn(!1);let s,l;Yn((()=>{const e=ai();a(!!e&&"sent"in e&&e.sent)})),(null==n?void 0:n.wallet)&&"universalLink"in n.wallet&&("universal-link"===n.wallet.openMethod||st(n.wallet.universalLink)&&zi())&&(s=n.wallet.universalLink),(null==n?void 0:n.wallet)&&"deepLink"in n.wallet&&("custom-deeplink"===n.wallet.openMethod||st(n.wallet.deepLink)&&zi())&&(l=n.wallet.deepLink);const c=()=>{const e=ai(),t="returnStrategy"in e?e.returnStrategy:ou.returnStrategy,n=!r();o(!1),st(s)?Du(s,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:ou.twaReturnUrl,forceRedirect:n}):Bu(s,l,{returnStrategy:t,forceRedirect:n},(()=>{}))};return _r(Hd,jr(t,{get children(){return[Xn((()=>e.icon)),_r(Vd,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),_r(qd,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),_r(Nr,{get when(){return!i()&&("open-wallet"===e.showButton&&s||"open-wallet"!==e.showButton)},get children(){return _r(Kd,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return _r(Qd,{})}})}}),_r(Nr,{get when(){return i()},get children(){return[_r(Nr,{get when(){return"open-wallet"!==e.showButton},get children(){return _r($d,{onClick:()=>e.onClose(),get children(){return _r(Iu,{translationKey:"common.close",children:"Close"})}})}}),_r(Nr,{get when(){return"open-wallet"===e.showButton&&s},get children(){return _r($d,{onClick:c,get children(){return _r(Iu,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Gd=e=>{const t=sr(Il),[n]=rs();return _r(Zd,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return _r(Us,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Jd=e=>_r(Zd,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return _r(Is,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Yd=e=>_r(Zd,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return _r(js,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),Xd=()=>_r(Na,{get opened(){var e;return Xn((()=>null!==ai()))()&&!0===(null==(e=ai())?void 0:e.openModal)},get enableAndroidBackHandler(){return ou.enableAndroidBackHandler},onClose:()=>si(null),"data-tc-actions-modal-container":"true",get children(){return _r(Ir,{get children(){return[_r(Mr,{get when(){return"transaction-sent"===ai().name},get children(){return _r(Yd,{onClose:()=>si(null)})}}),_r(Mr,{get when(){return"transaction-canceled"===ai().name},get children(){return _r(Jd,{onClose:()=>si(null)})}}),_r(Mr,{get when(){return"confirm-transaction"===ai().name},get children(){return _r(Gd,{onClose:()=>si(null)})}})]}})}}),ef=()=>{const{locale:e}=rs()[1];Yn((()=>e(ou.language))),Yn((()=>{ei()&&jl()}));const t=sr(di),n=sr(Il),[r,o]=Zn(!1),i=()=>{var e;return"loading"===(null==(e=ou.connectRequestParameters)?void 0:e.state)},a=Xn((()=>{var e;if(!i())return null==(e=ou.connectRequestParameters)?void 0:e.value})),s=e=>{n.closeSingleWalletModal(e)};return or(t.onStatusChange((e=>{e&&s("wallet-selected")}))),or((()=>{o(!1)})),_r(tu,{get opened(){return ei()},get enableAndroidBackHandler(){return ou.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o((e=>!e)),"data-tc-wallets-modal-container":"true",get children(){return[_r(Nr,{get when(){return r()},get children(){return _r(Gu,{onBackClick:()=>o(!1)})}}),_r(Nr,{get when(){return!r()},get children(){return[_r(Nr,{get when(){return i()},get children(){return[_r(nu,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),_r(ru,{get children(){return _r(Us,{size:"m"})}})]}}),_r(Nr,{get when(){return!i()},get children(){return _r(so,{get component(){return Tl()?fd:Fu},get wallet(){return ti()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},tf=e=>{const t=ts(ci,ou.language);return customElements.define(ko,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),_r(ns.Provider,{value:t,get children(){return _r(Il.Provider,{get value(){return e.tonConnectUI},get children(){return _r(di.Provider,{get value(){return ou.connector},get children(){return[_r(Ro,{}),_r(wo,{theme:ji,get children(){return[_r(Nr,{get when(){return ou.buttonRootId},get children(){return _r(ao,{get mount(){return document.getElementById(ou.buttonRootId)},get children(){return _r(eu,{})}})}}),_r(so,{component:ko,get children(){return[_r(zd,{}),_r(ef,{}),_r(Xd,{})]}})]}})]}})}})}})},nf=()=>{setTimeout((()=>Go({status:"opened",closeReason:null})))},rf=e=>{setTimeout((()=>Go({status:"closed",closeReason:e})))},of=e=>{setTimeout((()=>Xo({status:"opened",closeReason:null,walletInfo:e})))},af=e=>{setTimeout((()=>Xo({status:"closed",closeReason:e})))},sf=e=>{setTimeout((()=>si(e)))},lf=()=>{setTimeout((()=>si(null)))},cf=()=>ri(),uf=()=>ii(null),df=(e,t)=>function(e,t,n,r={}){let o;return $n((r=>{o=r,t===document?e():Gr(t,e(),t.firstChild?null:void 0,n)}),r.owner),()=>{o(),t.textContent=""}}((()=>_r(tf,{tonConnectUI:t})),document.getElementById(e));class ff{constructor(e){On(this,"connector"),On(this,"setConnectRequestParametersCallback"),On(this,"consumers",[]),On(this,"tracker"),On(this,"state",Zo()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Yn((()=>{const e=Zo();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(){return jn(this,null,(function*(){this.tracker.trackConnectionStarted();const e=(yield this.connector.getWallets()).find(_t);return e?this.connectEmbeddedWallet(e):this.openWalletsModal()}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),rf(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openWalletsModal(){return jn(this,null,(function*(){return zi()&&Vi(),nf(),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}class pf{constructor(e){On(this,"connector"),On(this,"consumers",[]),this.connector=e.connector,Yn((()=>{const e=ai();this.consumers.forEach((t=>t(e)))}))}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}}class hf{constructor(e){On(this,"connector"),On(this,"setConnectRequestParametersCallback"),On(this,"consumers",[]),On(this,"tracker"),On(this,"state",Yo()),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,Yn((()=>{const e=Yo();this.state=e,this.consumers.forEach((t=>t(e)))}))}open(e){return jn(this,null,(function*(){this.tracker.trackConnectionStarted();const t=su(yield this.connector.getWallets(),ou.walletsListConfiguration),n=t.find(_t);if(!!n)return this.connectEmbeddedWallet(n);const r=t.filter(Rt).find((t=>du(t,e)));if(!!r)return this.openSingleWalletModal(r);const o=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(o),new Lo(o)}))}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),af("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter((t=>t!==e))}}connectEmbeddedWallet(e){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openSingleWalletModal(e){return jn(this,null,(function*(){return zi()&&Vi(),of(e),new Promise((e=>{const t=this.onStateChange((n=>{const{status:r}=n;"opened"===r&&(t(),e())}))}))}))}}class gf{constructor(e){var t;On(this,"eventPrefix","ton-connect-ui-"),On(this,"tonConnectUiVersion"),On(this,"tonConnectSdkVersion",null),On(this,"eventDispatcher"),this.eventDispatcher=null!=(t=null==e?void 0:e.eventDispatcher)?t:new Qt,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return Nt({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return jn(this,null,(function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(QQ){}}))}setRequestVersionHandler(){return jn(this,null,(function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",(()=>jn(this,null,(function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Lt(this.tonConnectUiVersion))}))))}))}requestTonConnectSdkVersion(){return jn(this,null,(function*(){return new Promise(((e,t)=>jn(this,null,(function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",(t=>{e(t.detail.version)}),{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",{type:"request-version"})}catch(QQ){t(QQ)}}))))}))}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(QQ){}}trackConnectionStarted(...e){try{const t=Mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackConnectionCompleted(...e){try{const t=Dt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackConnectionError(...e){try{const t=Bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackConnectionRestoringStarted(...e){try{const t=Ut(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackConnectionRestoringCompleted(...e){try{const t=Ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackConnectionRestoringError(...e){try{const t=Wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackDisconnection(...e){try{const t=Kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackTransactionSentForSignature(...e){try{const t=Ht(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackTransactionSigned(...e){try{const t=Vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}trackTransactionSigningFailed(...e){try{const t=qt(this.version,...e);this.dispatchUserActionEvent(t)}catch(QQ){}}}class mf{constructor(e){if(On(this,"walletInfoStorage",new Ko),On(this,"preferredWalletStorage",new Qo),On(this,"tracker"),On(this,"walletInfo",null),On(this,"systemThemeChangeUnsubscribe",null),On(this,"actionsConfiguration"),On(this,"walletsList"),On(this,"connectRequestParametersCallback"),On(this,"connector"),On(this,"modal"),On(this,"singleWalletModal"),On(this,"transactionModal"),On(this,"connectionRestored",Promise.resolve(!1)),e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new Lo("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new Zt({manifestUrl:e.manifestUrl,eventDispatcher:null==e?void 0:e.eventDispatcher})}this.tracker=new gf({eventDispatcher:null==e?void 0:e.eventDispatcher,tonConnectUiVersion:"2.0.9"}),this.modal=new ff({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new hf({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new pf({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then((e=>{return Uo((t=e.map((e=>e.imageUrl)),[...new Set(t)]));var t}));const t=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=function(e){return jn(this,null,(function*(){return yield new Promise((e=>requestAnimationFrame(e))),e()}))}((()=>jn(this,null,(function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))))),this.uiOptions=Oi(e,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();iu({connector:this.connector,preferredWalletAppName:n}),df(t,this)}static getWallets(){return Zt.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Rn(Rn({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,n,r,o,i,a,s;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(n=e.uiPreferences)?void 0:n.theme)?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),Ii(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Ii(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?lo.LIGHT:lo.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?lo.DARK:lo.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Ii))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(a=e.uiPreferences.colorsSet,Ni[lo.DARK]=Oi(a[lo.DARK],Ni[lo.DARK]),Ni[lo.LIGHT]=Oi(a[lo.LIGHT],Ni[lo.LIGHT]),Pi((e=>({colors:Oi(Ni[e.theme],Li[e.theme])})))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(s=e.uiPreferences.borderRadius,Pi({borderRadius:s})),iu((t=>{var n,r;const o=Oi(Rn(Rn(Rn(Rn({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(r=e.actionsConfiguration)?void 0:r.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),yi(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o}))}setConnectRequestParameters(e){var t;iu({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}getWallets(){return jn(this,null,(function*(){return this.connector.getWallets()}))}onStatusChange(e,t){return this.connector.onStatusChange((t=>jn(this,null,(function*(){if(t){const n=yield this.getSelectedWalletInfo(t);e(Rn(Rn({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}))),t)}openModal(){return jn(this,null,(function*(){return this.modal.open()}))}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return jn(this,null,(function*(){return this.singleWalletModal.open(e)}))}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return jn(this,null,(function*(){const e=(yield this.getWallets()).find(_t);return e?yield this.connectEmbeddedWallet(e):yield this.connectExternalWallet()}))}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),lf(),uf(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return jn(this,null,(function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new Lo("Connect wallet to send a transaction.");zi()&&Vi();const{notifications:n,modals:r,returnStrategy:o,twaReturnUrl:i,skipRedirectToWallet:a}=this.getModalsAndNotificationsConfiguration(t);sf({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!1});const s=()=>{l.signal.aborted||(sf({name:"confirm-transaction",showNotification:n.includes("before"),openModal:r.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)&&(st(this.walletInfo.universalLink)?Du(this.walletInfo.universalLink,{returnStrategy:o,twaReturnUrl:i||ou.twaReturnUrl,forceRedirect:!1}):Bu(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:o,forceRedirect:!1},(()=>{}))))},l=new AbortController,c=this.onTransactionModalStateChange((e=>{(null==e?void 0:e.openModal)||(c(),e||l.abort())}));try{const t=yield this.waitForSendTransaction({transaction:e,signal:l.signal},s);return this.tracker.trackTransactionSigned(this.wallet,e,t),sf({name:"transaction-sent",showNotification:n.includes("success"),openModal:r.includes("success")}),t}catch(QQ){throw sf({name:"transaction-canceled",showNotification:n.includes("error"),openModal:r.includes("error")}),QQ instanceof Fe?QQ:(console.error(QQ),new Lo("Unhandled error:"+QQ))}finally{c()}}))}connectEmbeddedWallet(e){return jn(this,null,(function*(){const t=t=>{ii(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=ou.connectRequestParameters;return"loading"===(null==n?void 0:n.state)?this.connectRequestParametersCallback=t:t(null==n?void 0:n.value),yield this.waitForWalletConnection({ignoreErrors:!1})}))}connectExternalWallet(){return jn(this,null,(function*(){const e=new AbortController;nf();const t=this.onModalStateChange((n=>{const{status:r,closeReason:o}=n;"opened"!==r&&(t(),"action-cancelled"===o&&e.abort())}));return yield this.waitForWalletConnection({ignoreErrors:!0,signal:e.signal})}))}waitForWalletConnection(e){return jn(this,null,(function*(){return new Promise(((t,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:r=!1,signal:o=null}=e;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new Lo("Wallet was not connected"));const i=e=>jn(this,null,(function*(){if(e)this.tracker.trackConnectionCompleted(e),s(),t(e);else{if(this.tracker.trackConnectionError("Connection was cancelled"),r)return;s(),n(new Lo("Wallet was not connected"))}})),a=e=>{this.tracker.trackConnectionError(e.message),r||(s(),n(e))},s=this.onStatusChange((e=>i(e)),(e=>a(e)));o&&o.addEventListener("abort",(()=>{s(),n(new Lo("Wallet was not connected"))}),{once:!0})}))}))}waitForSendTransaction(e,t){return jn(this,null,(function*(){return new Promise(((n,r)=>{const{transaction:o,signal:i}=e;if(i.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new Lo("Transaction was not sent"));const a=e=>jn(this,null,(function*(){n(e)})),s=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new Lo("Transaction was not sent"))};i.addEventListener("abort",s,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:t,signal:i}).then((e=>(i.removeEventListener("abort",s),a(e)))).catch((e=>(i.removeEventListener("abort",s),(e=>{r(e)})(e))))}))}))}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange((e=>jn(this,null,(function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),iu({preferredWalletAppName:e})}getSelectedWalletInfo(e){return jn(this,null,(function*(){let t,n=cf();if(!n)return null;if("name"in n)t=n;else{const r=su(yield this.walletsList,ou.walletsListConfiguration).find((t=>du(t,e.device.appName)));if(!r)throw new Lo(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=Rn(Rn({},r),n)}return t}))}updateWalletInfo(e){return jn(this,null,(function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const n=this.walletInfoStorage.getWalletInfo();this.walletInfo=n||((yield this.walletsList).find((t=>du(t,e.device.appName)))||null)}))}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new Lo(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r,o,i,a;const s=["before","success","error"];let l=s;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?s:e.notifications);let c=["before"];(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(c="all"===this.actionsConfiguration.modals?s:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?s:e.modals);const u=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",d=(null==e?void 0:e.twaReturnUrl)||(null==(i=this.actionsConfiguration)?void 0:i.twaReturnUrl);let f=(null==e?void 0:e.skipRedirectToWallet)||(null==(a=this.actionsConfiguration)?void 0:a.skipRedirectToWallet)||"ios";return zi()&&(f="never"),{notifications:l,modals:c,returnStrategy:u,twaReturnUrl:d,skipRedirectToWallet:f}}}var yf,vf=Object.defineProperty,bf=Object.getOwnPropertySymbols,wf=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable,xf=(e,t,n)=>t in e?vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cf=(e,t)=>{for(var n in t||(t={}))wf.call(t,n)&&xf(e,n,t[n]);if(bf)for(var n of bf(t))Af.call(t,n)&&xf(e,n,t[n]);return e},Sf={exports:{}},kf={};Sf.exports=function(){if(yf)return kf;yf=1;var e=Q,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:o.current}}return kf.Fragment=n,kf.jsx=a,kf.jsxs=a,kf}();const Ef=Sf.exports.jsx;function _f(){return"undefined"!=typeof window}const Rf=K.createContext(null);let Tf=null;const Of=K.memo((e=>{var t=e,{children:n}=t,r=((e,t)=>{var n={};for(var r in e)wf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&bf)for(var r of bf(e))t.indexOf(r)<0&&Af.call(e,r)&&(n[r]=e[r]);return n})(t,["children"]);return _f()&&!Tf&&(Tf=new mf(r)),Ef(Rf.Provider,{value:Tf,children:n})}));class jf extends Lo{constructor(...e){super(...e),Object.setPrototypeOf(this,jf.prototype)}}class Pf extends jf{constructor(...e){super(...e),Object.setPrototypeOf(this,Pf.prototype)}}function Lf(){const e=K.useContext(Rf),t=K.useCallback((t=>{e&&(e.uiOptions=t)}),[e]);return _f()?(function(e){if(!e)throw new Pf("You should add on the top of the app to use TonConnect")}(e),[e,t]):[null,()=>{}]}const Nf="ton-connect-button";function If(e=!0){const t=function(){const[e]=Lf(),[t,n]=K.useState((null==e?void 0:e.wallet)||null);return K.useEffect((()=>{if(e)return n(e.wallet),e.onStatusChange((e=>{n(e)}))}),[e]),t}();return K.useMemo((()=>t?e?Gt(t.account.address,t.account.chain===Le.TESTNET):t.account.address:""),[t,e,null==t?void 0:t.account.address,null==t?void 0:t.account.chain])}K.memo((({className:e,style:t})=>{const[n,r]=Lf();return K.useEffect((()=>(r({buttonRootId:Nf}),()=>r({buttonRootId:null}))),[r]),Ef("div",{id:Nf,className:e,style:Cf({width:"fit-content"},t)})}));var Mf={},Df={exports:{}},Bf={},Uf={exports:{}},Ff={}; /** * @license React * scheduler.production.min.js @@ -1089,7 +1089,7 @@ function Ri(e){return"[object Object]"===Object.prototype.toString.call(e)}funct * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function Vf(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n