@xsolla/backpack-js 1.6.1-rc.1 → 1.6.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76014,7 +76014,7 @@ class Ctt extends HTMLElement {
76014
76014
  this._root.render(I.createElement(ytt, i));
76015
76015
  }
76016
76016
  }
76017
- const Stt = "1.6.1-rc.1", Itt = {
76017
+ const Stt = "1.6.1-rc.3", Itt = {
76018
76018
  version: Stt
76019
76019
  }, Mtt = Itt.version;
76020
76020
  oIe("backpack-js", Mtt);
@@ -7121,7 +7121,7 @@ Code: ${c}`)}return o.result}const hWe=new WeakMap,AWe=new WeakMap;async functio
7121
7121
  overflow: hidden;
7122
7122
  overflow: clip;
7123
7123
  }
7124
- `,I_e=["display:block","height:100%","width:0","margin:0","padding:0","border:0","min-height:0","max-height:none","flex:none","align-self:start","justify-self:start","overflow:hidden","visibility:hidden","pointer-events:none"].join(";");function M_e(t){const e=t.parentElement;if(!e)return!1;const n=document.createElement("div");n.setAttribute("aria-hidden","true"),n.style.cssText=I_e,e.appendChild(n);try{return n.getBoundingClientRect().height>0}finally{n.remove()}}function B_e(t,e){for(const n of t){if(n.target!==e)continue;const{width:r,height:i}=n.contentRect;return{width:r,height:i}}return null}function yie(t,e){const n=M_e(t)?"fill":"viewport";return n===e||(t.style.display="block",t.style.position="relative",t.style.width="100%",t.style.height=n==="fill"?"100%":"100dvh",t.style.maxHeight="100dvh",t.style.minHeight="0",t.style.overflow="hidden",t.style.overflow="clip",t.style.contain="layout style"),n}class bie extends HTMLElement{constructor(){super(...arguments),this._root=null,this._container=null,this._config={},this._renderScheduled=!1,this._frameObserver=null,this._frameMode=null,this._frameSize=null}static get observedAttributes(){return C_e}get accessToken(){return this._config.accessToken}set accessToken(e){this._config.accessToken=e,this._scheduleRender()}get environment(){return this._config.environment??"Prod"}set environment(e){this._config.environment=e,this._scheduleRender()}get locale(){return this._config.locale}set locale(e){this._config.locale=e,this._scheduleRender()}get theme(){return this._config.theme??"dark"}set theme(e){this._config.theme=e,this._scheduleRender()}get topInset(){return this._config.topInset??0}set topInset(e){this._config.topInset=e,this._scheduleRender()}get descriptionBySku(){return this._config.descriptionBySku}set descriptionBySku(e){this._config.descriptionBySku=e,this._scheduleRender()}get enableFilter(){return this._config.enableFilter??!0}set enableFilter(e){this._config.enableFilter=e,this._scheduleRender()}get showFilterChips(){return this._config.showFilterChips??!1}set showFilterChips(e){this._config.showFilterChips=e,this._scheduleRender()}get isGuest(){return this._config.isGuest??!1}set isGuest(e){this._config.isGuest=e,this._scheduleRender()}get configurationId(){return this._config.configurationId}set configurationId(e){this._config.configurationId=e,this._scheduleRender()}get apiBaseUrl(){return this._config.apiBaseUrl}set apiBaseUrl(e){this._config.apiBaseUrl=e,this._scheduleRender()}get enableRealtime(){return this._config.enableRealtime??!0}set enableRealtime(e){this._config.enableRealtime=e,this._scheduleRender()}get enablePurchase(){return this._config.enablePurchase??!1}set enablePurchase(e){this._config.enablePurchase=e,this._scheduleRender()}get enableTransfer(){return this._config.enableTransfer??!1}set enableTransfer(e){this._config.enableTransfer=e,this._scheduleRender()}get enableTransfuse(){return this._config.enableTransfuse??!1}set enableTransfuse(e){this._config.enableTransfuse=e,this._scheduleRender()}get enableSalvage(){return this._config.enableSalvage??!0}set enableSalvage(e){this._config.enableSalvage=e,this._scheduleRender()}get enableWheel3dModel(){return this._config.enableWheel3dModel??!1}set enableWheel3dModel(e){this._config.enableWheel3dModel=e,this._scheduleRender()}get pageBackground(){return this._config.pageBackground}set pageBackground(e){this._config.pageBackground=e,this._scheduleRender()}get enableAnalytics(){return this._config.enableAnalytics??!1}set enableAnalytics(e){this._config.enableAnalytics=e,this._scheduleRender()}get externalId(){return this._config.externalId}set externalId(e){this._config.externalId=e,this._scheduleRender()}get openItem(){return this._config.openItem}set openItem(e){this._config.openItem=(e==null?void 0:e.trim())||void 0,this._scheduleRender()}connectedCallback(){this._frameMode=yie(this,null);const e=this.parentElement;e&&typeof ResizeObserver<"u"&&(this._frameObserver=new ResizeObserver(r=>{const i=this.parentElement;if(!i)return;const s=B_e(r,i);if(!s)return;const a=this._frameSize;a&&a.width===s.width&&a.height===s.height||(this._frameSize=s,this._frameMode=yie(this,this._frameMode))}),this._frameObserver.observe(e));const n=document.createElement("style");n.textContent=S_e,this.appendChild(n),this._container=document.createElement("div"),this._container.className="backpack-js-root",this.appendChild(this._container),this._root=SG.createRoot(this._container),this._render()}disconnectedCallback(){var e,n;(e=this._frameObserver)==null||e.disconnect(),this._frameObserver=null,this._frameMode=null,this._frameSize=null,(n=this._root)==null||n.unmount(),this._root=null,this._container=null,this.innerHTML=""}attributeChangedCallback(e,n,r){switch(e){case"access-token":this._config.accessToken=r??void 0;break;case"environment":this._config.environment=r??"Prod";break;case"locale":this._config.locale=r??void 0;break;case"theme":this._config.theme=r??"dark";break;case"top-inset":this._config.topInset=r?Number(r):0;break;case"enable-filter":this._config.enableFilter=Wu(r,!0);break;case"show-filter-chips":this._config.showFilterChips=Wu(r,!1);break;case"is-guest":this._config.isGuest=Wu(r,!1);break;case"configuration-id":this._config.configurationId=r??void 0;break;case"api-base-url":this._config.apiBaseUrl=r??void 0;break;case"enable-realtime":this._config.enableRealtime=Wu(r,!0);break;case"enable-transfer":this._config.enableTransfer=Wu(r,!1);break;case"enable-transfuse":this._config.enableTransfuse=Wu(r,!1);break;case"enable-salvage":this._config.enableSalvage=Wu(r,!0);break;case"enable-wheel-3d-model":this._config.enableWheel3dModel=Wu(r,!1);break;case"page-background":this._config.pageBackground=(r==null?void 0:r.trim())||void 0;break;case"enable-analytics":this._config.enableAnalytics=Wu(r,!1);break;case"external-id":this._config.externalId=(r==null?void 0:r.trim())||void 0;break;case"open-item":this._config.openItem=(r==null?void 0:r.trim())||void 0;break}this._scheduleRender()}_scheduleRender(){this._renderScheduled||!this._root||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this._render()}))}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:n}))}_render(){if(!this._root)return;const{enablePurchase:e,...n}=this._config,i={...n,onSignIn:s=>{this._dispatch("backpack-sign-in",s)},onLogout:()=>{this._dispatch("backpack-logout")},onClickPurchase:e?s=>{this._dispatch("backpack-purchase",{item:s})}:void 0,onUnauthorized:s=>new Promise(a=>{this._dispatch("backpack-unauthorized",{context:s,resolve:a})}),onCurrenciesFetched:s=>{this._dispatch("backpack-currencies",{snapshot:s})}};this._root.render(I.createElement(E_e,i))}}const P_e={version:"1.6.1-rc.1"}.version;N5e("backpack-js",P_e);const vie="xsolla-backpack";typeof customElements<"u"&&!customElements.get(vie)&&customElements.define(vie,bie);const xie=2592e5,wie="thumbmark",Eie="https://api.thumbmarkjs.com",N4={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,collect_beacon:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,simple_request:!1,property_name_factory:t=>`${wie}_${t}`},T_e={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}],always:[{exclude:["speech"],browsers:["brave","firefox"]}]},Cie=typeof window<"u"?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function k_e(t){let e=0;for(let n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}function Sie(t,e,n){if(t.length===1)return t[0];if(t.length===3){const s=t[0].data,a=t[1].data,o=t[2].data,l=new Uint8ClampedArray(s.length);for(let c=0;c<s.length;c++){const u=s[c],f=a[c],h=o[c];l[c]=u===f||u===h?u:f===h?f:u}return new ImageData(l,e,n)}let r=[];for(let s=0;s<t[0].data.length;s++){let a=[];for(let o=0;o<t.length;o++)a.push(t[o].data[s]);r.push(D_e(a))}const i=new Uint8ClampedArray(r);return new ImageData(i,e,n)}function D_e(t){if(t.length===0)return 0;const e={};for(const r of t)e[r]=(e[r]||0)+1;let n=t[0];for(const r in e)e[r]>e[n]&&(n=parseInt(r,10));return n}function wS(t){return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),(t^=t>>>16)>>>0}const Ws=new Uint32Array([597399067,2869860233,951274213,2716044179]);function tl(t,e){return t<<e|t>>>32-e}function kc(t,e=0){if(e=e?0|e:0,typeof t=="string"&&(t=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).buffer;const s=[];for(let a=0;a<i.length;a++){let o=i.charCodeAt(a);o<128?s.push(o):o<2048?s.push(192|o>>6,128|63&o):o<55296||o>=57344?s.push(224|o>>12,128|o>>6&63,128|63&o):(a++,o=65536+((1023&o)<<10|1023&i.charCodeAt(a)),s.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return new Uint8Array(s).buffer}(t)),!(t instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");const n=new Uint32Array([e,e,e,e]);(function(i,s){const a=i.byteLength/16|0,o=new Uint32Array(i,0,4*a);for(let l=0;l<a;l++){const c=o.subarray(4*l,4*(l+1));c[0]=Math.imul(c[0],Ws[0]),c[0]=tl(c[0],15),c[0]=Math.imul(c[0],Ws[1]),s[0]=s[0]^c[0],s[0]=tl(s[0],19),s[0]=s[0]+s[1],s[0]=Math.imul(s[0],5)+1444728091,c[1]=Math.imul(c[1],Ws[1]),c[1]=tl(c[1],16),c[1]=Math.imul(c[1],Ws[2]),s[1]=s[1]^c[1],s[1]=tl(s[1],17),s[1]=s[1]+s[2],s[1]=Math.imul(s[1],5)+197830471,c[2]=Math.imul(c[2],Ws[2]),c[2]=tl(c[2],17),c[2]=Math.imul(c[2],Ws[3]),s[2]=s[2]^c[2],s[2]=tl(s[2],15),s[2]=s[2]+s[3],s[2]=Math.imul(s[2],5)+2530024501,c[3]=Math.imul(c[3],Ws[3]),c[3]=tl(c[3],18),c[3]=Math.imul(c[3],Ws[0]),s[3]=s[3]^c[3],s[3]=tl(s[3],13),s[3]=s[3]+s[0],s[3]=Math.imul(s[3],5)+850148119}})(t,n),function(i,s){const a=i.byteLength/16|0,o=i.byteLength%16,l=new Uint32Array(4),c=new Uint8Array(i,16*a,o);switch(o){case 15:l[3]=l[3]^c[14]<<16;case 14:l[3]=l[3]^c[13]<<8;case 13:l[3]=l[3]^c[12],l[3]=Math.imul(l[3],Ws[3]),l[3]=tl(l[3],18),l[3]=Math.imul(l[3],Ws[0]),s[3]=s[3]^l[3];case 12:l[2]=l[2]^c[11]<<24;case 11:l[2]=l[2]^c[10]<<16;case 10:l[2]=l[2]^c[9]<<8;case 9:l[2]=l[2]^c[8],l[2]=Math.imul(l[2],Ws[2]),l[2]=tl(l[2],17),l[2]=Math.imul(l[2],Ws[3]),s[2]=s[2]^l[2];case 8:l[1]=l[1]^c[7]<<24;case 7:l[1]=l[1]^c[6]<<16;case 6:l[1]=l[1]^c[5]<<8;case 5:l[1]=l[1]^c[4],l[1]=Math.imul(l[1],Ws[1]),l[1]=tl(l[1],16),l[1]=Math.imul(l[1],Ws[2]),s[1]=s[1]^l[1];case 4:l[0]=l[0]^c[3]<<24;case 3:l[0]=l[0]^c[2]<<16;case 2:l[0]=l[0]^c[1]<<8;case 1:l[0]=l[0]^c[0],l[0]=Math.imul(l[0],Ws[0]),l[0]=tl(l[0],15),l[0]=Math.imul(l[0],Ws[1]),s[0]=s[0]^l[0]}}(t,n),function(i,s){s[0]=s[0]^i.byteLength,s[1]=s[1]^i.byteLength,s[2]=s[2]^i.byteLength,s[3]=s[3]^i.byteLength,s[0]=s[0]+s[1]|0,s[0]=s[0]+s[2]|0,s[0]=s[0]+s[3]|0,s[1]=s[1]+s[0]|0,s[2]=s[2]+s[0]|0,s[3]=s[3]+s[0]|0,s[0]=wS(s[0]),s[1]=wS(s[1]),s[2]=wS(s[2]),s[3]=wS(s[3]),s[0]=s[0]+s[1]|0,s[0]=s[0]+s[2]|0,s[0]=s[0]+s[3]|0,s[1]=s[1]+s[0]|0,s[2]=s[2]+s[0]|0,s[3]=s[3]+s[0]|0}(t,n);const r=new Uint8Array(n.buffer);return Array.from(r).map(i=>i.toString(16).padStart(2,"0")).join("")}const Iie=280;function R_e(t,e){return new Promise(n=>setTimeout(n,t,e))}const z_e=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],L_e=["monospace","sans-serif","serif"];function Mie(t,e){return t.font=`72px ${e}`,t.measureText("WwMmLli0Oo").width}function O_e(){var t;const e=document.createElement("canvas"),n=(t=e.getContext("webgl"))!==null&&t!==void 0?t:e.getContext("experimental-webgl");if(n&&"getParameter"in n)try{const r=(n.getParameter(n.VENDOR)||"").toString(),i=(n.getParameter(n.RENDERER)||"").toString();let s={vendor:r,renderer:i,version:(n.getParameter(n.VERSION)||"").toString(),shadingLanguageVersion:(n.getParameter(n.SHADING_LANGUAGE_VERSION)||"").toString()};if(!i.length||!r.length){const a=n.getExtension("WEBGL_debug_renderer_info");if(a){const o=(n.getParameter(a.UNMASKED_VENDOR_WEBGL)||"").toString(),l=(n.getParameter(a.UNMASKED_RENDERER_WEBGL)||"").toString();o&&(s.vendorUnmasked=o),l&&(s.rendererUnmasked=l)}}return s}catch{}return"undefined"}function H_e(){const t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}const ES=(t,e,n,r)=>{const i=(n-e)/r;let s=0;for(let a=0;a<r;a++)s+=t(e+(a+.5)*i);return s*i};function N_e(t,e){const n={};return e.forEach(r=>{const i=function(s){if(s.length===0)return null;const a={};s.forEach(c=>{const u=String(c);a[u]=(a[u]||0)+1});let o=s[0],l=1;return Object.keys(a).forEach(c=>{a[c]>l&&(o=c,l=a[c])}),o}(t.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0));i&&(n[r]=i)}),n}const F_e=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],F4=new Map;function CS(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};const t=!!navigator.brave,e=(t?"B|":"N|")+navigator.userAgent,n=F4.get(e);if(n)return n;const r=[{name:"Brave",detect:()=>t}];let i;for(const s of r)if(s.detect()){const a=Bie(navigator.userAgent);return i={name:s.name,version:a.version},F4.set(e,i),i}return i=Bie(navigator.userAgent),F4.set(e,i),i}function Bie(t){var e,n,r,i,s,a;const o=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],l={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi"};for(const c of o){const u=t.match(c);if(u){let f=(e=u.groups)===null||e===void 0?void 0:e.name,h=((n=u.groups)===null||n===void 0?void 0:n.version)||((r=u.groups)===null||r===void 0?void 0:r.version1)||((i=u.groups)===null||i===void 0?void 0:i.version2);if(f||!(!((s=u.groups)===null||s===void 0)&&s.version1)&&!(!((a=u.groups)===null||a===void 0)&&a.version2)||(f="Safari"),!f&&c.source.includes("Opera Mini")&&(f="Opera Mini"),!f&&c.source.includes("Opera Mobi")&&(f="Opera Mobi"),!f&&c.source.includes("Opera")&&(f="Opera"),!f&&u[1]&&(f=u[1]),!h&&u[2]&&(h=u[2]),f)return{name:l[f.toLowerCase()]||f,version:h||"unknown"}}}return{name:"unknown",version:"unknown"}}function Pie(){if(typeof navigator>"u"||!navigator.userAgent)return!1;const t=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(t)&&!/iPad/i.test(t)}function Q_e(){let t=[];const e={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(e).forEach(n=>{e[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&t.push(`${n}: ${r}`)})}),t}function U_e(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{const t=window.ApplePaySession.supportsVersion;for(let e=15;e>0;e--)if(t(e))return e}catch{return 0}return 0}const G_e=CS().name!=="SamsungBrowser"?1:3,j_e=CS().name!=="Brave",Tie=137,Z_e=(()=>{const t=new Float32Array(548),e=2*Math.PI/Tie;for(let n=0;n<Tie;n++){const r=n*e;t[4*n]=0,t[4*n+1]=0,t[4*n+2]=100*Math.cos(r),t[4*n+3]=50*Math.sin(r)}return t})();let mx=null;function kie(){try{if(typeof document>"u")return null;const t=document.createElement("canvas");t.width=200,t.height=100;const e=t.getContext("webgl");if(!e)return null;t.addEventListener("webglcontextlost",a=>{a.preventDefault(),mx=null},{once:!0});const n=e.createShader(e.VERTEX_SHADER),r=e.createShader(e.FRAGMENT_SHADER);if(!n||!r||(e.shaderSource(n,`
7124
+ `,I_e=["display:block","height:100%","width:0","margin:0","padding:0","border:0","min-height:0","max-height:none","flex:none","align-self:start","justify-self:start","overflow:hidden","visibility:hidden","pointer-events:none"].join(";");function M_e(t){const e=t.parentElement;if(!e)return!1;const n=document.createElement("div");n.setAttribute("aria-hidden","true"),n.style.cssText=I_e,e.appendChild(n);try{return n.getBoundingClientRect().height>0}finally{n.remove()}}function B_e(t,e){for(const n of t){if(n.target!==e)continue;const{width:r,height:i}=n.contentRect;return{width:r,height:i}}return null}function yie(t,e){const n=M_e(t)?"fill":"viewport";return n===e||(t.style.display="block",t.style.position="relative",t.style.width="100%",t.style.height=n==="fill"?"100%":"100dvh",t.style.maxHeight="100dvh",t.style.minHeight="0",t.style.overflow="hidden",t.style.overflow="clip",t.style.contain="layout style"),n}class bie extends HTMLElement{constructor(){super(...arguments),this._root=null,this._container=null,this._config={},this._renderScheduled=!1,this._frameObserver=null,this._frameMode=null,this._frameSize=null}static get observedAttributes(){return C_e}get accessToken(){return this._config.accessToken}set accessToken(e){this._config.accessToken=e,this._scheduleRender()}get environment(){return this._config.environment??"Prod"}set environment(e){this._config.environment=e,this._scheduleRender()}get locale(){return this._config.locale}set locale(e){this._config.locale=e,this._scheduleRender()}get theme(){return this._config.theme??"dark"}set theme(e){this._config.theme=e,this._scheduleRender()}get topInset(){return this._config.topInset??0}set topInset(e){this._config.topInset=e,this._scheduleRender()}get descriptionBySku(){return this._config.descriptionBySku}set descriptionBySku(e){this._config.descriptionBySku=e,this._scheduleRender()}get enableFilter(){return this._config.enableFilter??!0}set enableFilter(e){this._config.enableFilter=e,this._scheduleRender()}get showFilterChips(){return this._config.showFilterChips??!1}set showFilterChips(e){this._config.showFilterChips=e,this._scheduleRender()}get isGuest(){return this._config.isGuest??!1}set isGuest(e){this._config.isGuest=e,this._scheduleRender()}get configurationId(){return this._config.configurationId}set configurationId(e){this._config.configurationId=e,this._scheduleRender()}get apiBaseUrl(){return this._config.apiBaseUrl}set apiBaseUrl(e){this._config.apiBaseUrl=e,this._scheduleRender()}get enableRealtime(){return this._config.enableRealtime??!0}set enableRealtime(e){this._config.enableRealtime=e,this._scheduleRender()}get enablePurchase(){return this._config.enablePurchase??!1}set enablePurchase(e){this._config.enablePurchase=e,this._scheduleRender()}get enableTransfer(){return this._config.enableTransfer??!1}set enableTransfer(e){this._config.enableTransfer=e,this._scheduleRender()}get enableTransfuse(){return this._config.enableTransfuse??!1}set enableTransfuse(e){this._config.enableTransfuse=e,this._scheduleRender()}get enableSalvage(){return this._config.enableSalvage??!0}set enableSalvage(e){this._config.enableSalvage=e,this._scheduleRender()}get enableWheel3dModel(){return this._config.enableWheel3dModel??!1}set enableWheel3dModel(e){this._config.enableWheel3dModel=e,this._scheduleRender()}get pageBackground(){return this._config.pageBackground}set pageBackground(e){this._config.pageBackground=e,this._scheduleRender()}get enableAnalytics(){return this._config.enableAnalytics??!1}set enableAnalytics(e){this._config.enableAnalytics=e,this._scheduleRender()}get externalId(){return this._config.externalId}set externalId(e){this._config.externalId=e,this._scheduleRender()}get openItem(){return this._config.openItem}set openItem(e){this._config.openItem=(e==null?void 0:e.trim())||void 0,this._scheduleRender()}connectedCallback(){this._frameMode=yie(this,null);const e=this.parentElement;e&&typeof ResizeObserver<"u"&&(this._frameObserver=new ResizeObserver(r=>{const i=this.parentElement;if(!i)return;const s=B_e(r,i);if(!s)return;const a=this._frameSize;a&&a.width===s.width&&a.height===s.height||(this._frameSize=s,this._frameMode=yie(this,this._frameMode))}),this._frameObserver.observe(e));const n=document.createElement("style");n.textContent=S_e,this.appendChild(n),this._container=document.createElement("div"),this._container.className="backpack-js-root",this.appendChild(this._container),this._root=SG.createRoot(this._container),this._render()}disconnectedCallback(){var e,n;(e=this._frameObserver)==null||e.disconnect(),this._frameObserver=null,this._frameMode=null,this._frameSize=null,(n=this._root)==null||n.unmount(),this._root=null,this._container=null,this.innerHTML=""}attributeChangedCallback(e,n,r){switch(e){case"access-token":this._config.accessToken=r??void 0;break;case"environment":this._config.environment=r??"Prod";break;case"locale":this._config.locale=r??void 0;break;case"theme":this._config.theme=r??"dark";break;case"top-inset":this._config.topInset=r?Number(r):0;break;case"enable-filter":this._config.enableFilter=Wu(r,!0);break;case"show-filter-chips":this._config.showFilterChips=Wu(r,!1);break;case"is-guest":this._config.isGuest=Wu(r,!1);break;case"configuration-id":this._config.configurationId=r??void 0;break;case"api-base-url":this._config.apiBaseUrl=r??void 0;break;case"enable-realtime":this._config.enableRealtime=Wu(r,!0);break;case"enable-transfer":this._config.enableTransfer=Wu(r,!1);break;case"enable-transfuse":this._config.enableTransfuse=Wu(r,!1);break;case"enable-salvage":this._config.enableSalvage=Wu(r,!0);break;case"enable-wheel-3d-model":this._config.enableWheel3dModel=Wu(r,!1);break;case"page-background":this._config.pageBackground=(r==null?void 0:r.trim())||void 0;break;case"enable-analytics":this._config.enableAnalytics=Wu(r,!1);break;case"external-id":this._config.externalId=(r==null?void 0:r.trim())||void 0;break;case"open-item":this._config.openItem=(r==null?void 0:r.trim())||void 0;break}this._scheduleRender()}_scheduleRender(){this._renderScheduled||!this._root||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this._render()}))}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:n}))}_render(){if(!this._root)return;const{enablePurchase:e,...n}=this._config,i={...n,onSignIn:s=>{this._dispatch("backpack-sign-in",s)},onLogout:()=>{this._dispatch("backpack-logout")},onClickPurchase:e?s=>{this._dispatch("backpack-purchase",{item:s})}:void 0,onUnauthorized:s=>new Promise(a=>{this._dispatch("backpack-unauthorized",{context:s,resolve:a})}),onCurrenciesFetched:s=>{this._dispatch("backpack-currencies",{snapshot:s})}};this._root.render(I.createElement(E_e,i))}}const P_e={version:"1.6.1-rc.3"}.version;N5e("backpack-js",P_e);const vie="xsolla-backpack";typeof customElements<"u"&&!customElements.get(vie)&&customElements.define(vie,bie);const xie=2592e5,wie="thumbmark",Eie="https://api.thumbmarkjs.com",N4={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,collect_beacon:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,simple_request:!1,property_name_factory:t=>`${wie}_${t}`},T_e={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}],always:[{exclude:["speech"],browsers:["brave","firefox"]}]},Cie=typeof window<"u"?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function k_e(t){let e=0;for(let n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}function Sie(t,e,n){if(t.length===1)return t[0];if(t.length===3){const s=t[0].data,a=t[1].data,o=t[2].data,l=new Uint8ClampedArray(s.length);for(let c=0;c<s.length;c++){const u=s[c],f=a[c],h=o[c];l[c]=u===f||u===h?u:f===h?f:u}return new ImageData(l,e,n)}let r=[];for(let s=0;s<t[0].data.length;s++){let a=[];for(let o=0;o<t.length;o++)a.push(t[o].data[s]);r.push(D_e(a))}const i=new Uint8ClampedArray(r);return new ImageData(i,e,n)}function D_e(t){if(t.length===0)return 0;const e={};for(const r of t)e[r]=(e[r]||0)+1;let n=t[0];for(const r in e)e[r]>e[n]&&(n=parseInt(r,10));return n}function wS(t){return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),(t^=t>>>16)>>>0}const Ws=new Uint32Array([597399067,2869860233,951274213,2716044179]);function tl(t,e){return t<<e|t>>>32-e}function kc(t,e=0){if(e=e?0|e:0,typeof t=="string"&&(t=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).buffer;const s=[];for(let a=0;a<i.length;a++){let o=i.charCodeAt(a);o<128?s.push(o):o<2048?s.push(192|o>>6,128|63&o):o<55296||o>=57344?s.push(224|o>>12,128|o>>6&63,128|63&o):(a++,o=65536+((1023&o)<<10|1023&i.charCodeAt(a)),s.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return new Uint8Array(s).buffer}(t)),!(t instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");const n=new Uint32Array([e,e,e,e]);(function(i,s){const a=i.byteLength/16|0,o=new Uint32Array(i,0,4*a);for(let l=0;l<a;l++){const c=o.subarray(4*l,4*(l+1));c[0]=Math.imul(c[0],Ws[0]),c[0]=tl(c[0],15),c[0]=Math.imul(c[0],Ws[1]),s[0]=s[0]^c[0],s[0]=tl(s[0],19),s[0]=s[0]+s[1],s[0]=Math.imul(s[0],5)+1444728091,c[1]=Math.imul(c[1],Ws[1]),c[1]=tl(c[1],16),c[1]=Math.imul(c[1],Ws[2]),s[1]=s[1]^c[1],s[1]=tl(s[1],17),s[1]=s[1]+s[2],s[1]=Math.imul(s[1],5)+197830471,c[2]=Math.imul(c[2],Ws[2]),c[2]=tl(c[2],17),c[2]=Math.imul(c[2],Ws[3]),s[2]=s[2]^c[2],s[2]=tl(s[2],15),s[2]=s[2]+s[3],s[2]=Math.imul(s[2],5)+2530024501,c[3]=Math.imul(c[3],Ws[3]),c[3]=tl(c[3],18),c[3]=Math.imul(c[3],Ws[0]),s[3]=s[3]^c[3],s[3]=tl(s[3],13),s[3]=s[3]+s[0],s[3]=Math.imul(s[3],5)+850148119}})(t,n),function(i,s){const a=i.byteLength/16|0,o=i.byteLength%16,l=new Uint32Array(4),c=new Uint8Array(i,16*a,o);switch(o){case 15:l[3]=l[3]^c[14]<<16;case 14:l[3]=l[3]^c[13]<<8;case 13:l[3]=l[3]^c[12],l[3]=Math.imul(l[3],Ws[3]),l[3]=tl(l[3],18),l[3]=Math.imul(l[3],Ws[0]),s[3]=s[3]^l[3];case 12:l[2]=l[2]^c[11]<<24;case 11:l[2]=l[2]^c[10]<<16;case 10:l[2]=l[2]^c[9]<<8;case 9:l[2]=l[2]^c[8],l[2]=Math.imul(l[2],Ws[2]),l[2]=tl(l[2],17),l[2]=Math.imul(l[2],Ws[3]),s[2]=s[2]^l[2];case 8:l[1]=l[1]^c[7]<<24;case 7:l[1]=l[1]^c[6]<<16;case 6:l[1]=l[1]^c[5]<<8;case 5:l[1]=l[1]^c[4],l[1]=Math.imul(l[1],Ws[1]),l[1]=tl(l[1],16),l[1]=Math.imul(l[1],Ws[2]),s[1]=s[1]^l[1];case 4:l[0]=l[0]^c[3]<<24;case 3:l[0]=l[0]^c[2]<<16;case 2:l[0]=l[0]^c[1]<<8;case 1:l[0]=l[0]^c[0],l[0]=Math.imul(l[0],Ws[0]),l[0]=tl(l[0],15),l[0]=Math.imul(l[0],Ws[1]),s[0]=s[0]^l[0]}}(t,n),function(i,s){s[0]=s[0]^i.byteLength,s[1]=s[1]^i.byteLength,s[2]=s[2]^i.byteLength,s[3]=s[3]^i.byteLength,s[0]=s[0]+s[1]|0,s[0]=s[0]+s[2]|0,s[0]=s[0]+s[3]|0,s[1]=s[1]+s[0]|0,s[2]=s[2]+s[0]|0,s[3]=s[3]+s[0]|0,s[0]=wS(s[0]),s[1]=wS(s[1]),s[2]=wS(s[2]),s[3]=wS(s[3]),s[0]=s[0]+s[1]|0,s[0]=s[0]+s[2]|0,s[0]=s[0]+s[3]|0,s[1]=s[1]+s[0]|0,s[2]=s[2]+s[0]|0,s[3]=s[3]+s[0]|0}(t,n);const r=new Uint8Array(n.buffer);return Array.from(r).map(i=>i.toString(16).padStart(2,"0")).join("")}const Iie=280;function R_e(t,e){return new Promise(n=>setTimeout(n,t,e))}const z_e=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],L_e=["monospace","sans-serif","serif"];function Mie(t,e){return t.font=`72px ${e}`,t.measureText("WwMmLli0Oo").width}function O_e(){var t;const e=document.createElement("canvas"),n=(t=e.getContext("webgl"))!==null&&t!==void 0?t:e.getContext("experimental-webgl");if(n&&"getParameter"in n)try{const r=(n.getParameter(n.VENDOR)||"").toString(),i=(n.getParameter(n.RENDERER)||"").toString();let s={vendor:r,renderer:i,version:(n.getParameter(n.VERSION)||"").toString(),shadingLanguageVersion:(n.getParameter(n.SHADING_LANGUAGE_VERSION)||"").toString()};if(!i.length||!r.length){const a=n.getExtension("WEBGL_debug_renderer_info");if(a){const o=(n.getParameter(a.UNMASKED_VENDOR_WEBGL)||"").toString(),l=(n.getParameter(a.UNMASKED_RENDERER_WEBGL)||"").toString();o&&(s.vendorUnmasked=o),l&&(s.rendererUnmasked=l)}}return s}catch{}return"undefined"}function H_e(){const t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}const ES=(t,e,n,r)=>{const i=(n-e)/r;let s=0;for(let a=0;a<r;a++)s+=t(e+(a+.5)*i);return s*i};function N_e(t,e){const n={};return e.forEach(r=>{const i=function(s){if(s.length===0)return null;const a={};s.forEach(c=>{const u=String(c);a[u]=(a[u]||0)+1});let o=s[0],l=1;return Object.keys(a).forEach(c=>{a[c]>l&&(o=c,l=a[c])}),o}(t.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0));i&&(n[r]=i)}),n}const F_e=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],F4=new Map;function CS(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};const t=!!navigator.brave,e=(t?"B|":"N|")+navigator.userAgent,n=F4.get(e);if(n)return n;const r=[{name:"Brave",detect:()=>t}];let i;for(const s of r)if(s.detect()){const a=Bie(navigator.userAgent);return i={name:s.name,version:a.version},F4.set(e,i),i}return i=Bie(navigator.userAgent),F4.set(e,i),i}function Bie(t){var e,n,r,i,s,a;const o=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],l={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi"};for(const c of o){const u=t.match(c);if(u){let f=(e=u.groups)===null||e===void 0?void 0:e.name,h=((n=u.groups)===null||n===void 0?void 0:n.version)||((r=u.groups)===null||r===void 0?void 0:r.version1)||((i=u.groups)===null||i===void 0?void 0:i.version2);if(f||!(!((s=u.groups)===null||s===void 0)&&s.version1)&&!(!((a=u.groups)===null||a===void 0)&&a.version2)||(f="Safari"),!f&&c.source.includes("Opera Mini")&&(f="Opera Mini"),!f&&c.source.includes("Opera Mobi")&&(f="Opera Mobi"),!f&&c.source.includes("Opera")&&(f="Opera"),!f&&u[1]&&(f=u[1]),!h&&u[2]&&(h=u[2]),f)return{name:l[f.toLowerCase()]||f,version:h||"unknown"}}}return{name:"unknown",version:"unknown"}}function Pie(){if(typeof navigator>"u"||!navigator.userAgent)return!1;const t=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(t)&&!/iPad/i.test(t)}function Q_e(){let t=[];const e={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(e).forEach(n=>{e[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&t.push(`${n}: ${r}`)})}),t}function U_e(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{const t=window.ApplePaySession.supportsVersion;for(let e=15;e>0;e--)if(t(e))return e}catch{return 0}return 0}const G_e=CS().name!=="SamsungBrowser"?1:3,j_e=CS().name!=="Brave",Tie=137,Z_e=(()=>{const t=new Float32Array(548),e=2*Math.PI/Tie;for(let n=0;n<Tie;n++){const r=n*e;t[4*n]=0,t[4*n+1]=0,t[4*n+2]=100*Math.cos(r),t[4*n+3]=50*Math.sin(r)}return t})();let mx=null;function kie(){try{if(typeof document>"u")return null;const t=document.createElement("canvas");t.width=200,t.height=100;const e=t.getContext("webgl");if(!e)return null;t.addEventListener("webglcontextlost",a=>{a.preventDefault(),mx=null},{once:!0});const n=e.createShader(e.VERTEX_SHADER),r=e.createShader(e.FRAGMENT_SHADER);if(!n||!r||(e.shaderSource(n,`
7125
7125
  attribute vec2 position;
7126
7126
  void main() {
7127
7127
  gl_Position = vec4(position, 0.0, 1.0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/backpack-js",
3
- "version": "1.6.1-rc.1",
3
+ "version": "1.6.1-rc.3",
4
4
  "description": "Framework-agnostic Xsolla Backpack Web Component — drop-in custom element for Angular, Vue, or vanilla HTML",
5
5
  "type": "module",
6
6
  "sideEffects": [