@apps-in-toss/web-framework 1.9.3 → 1.9.4

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.
@@ -153360,7 +153360,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
153360
153360
  var _default = exports.default = _framework.AppsInToss.registerApp(AppContainer, {
153361
153361
  context: _context.context
153362
153362
  });
153363
- },1255,[1256,2630,9],"react-native/src/_app.tsx");
153363
+ },1255,[1256,2631,9],"react-native/src/_app.tsx");
153364
153364
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
153365
153365
  "use strict";
153366
153366
 
@@ -153472,6 +153472,12 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
153472
153472
  getDeploymentId: function getDeploymentId() {
153473
153473
  var _global$__appsInToss;
153474
153474
  return __DEV__ ? "local" : (_global$__appsInToss = global.__appsInToss) == null ? void 0 : _global$__appsInToss.deploymentId;
153475
+ },
153476
+ getWebViewType: function getWebViewType() {
153477
+ return global.__appsInToss.webViewType;
153478
+ },
153479
+ getAppName: function getAppName() {
153480
+ return global.__granite.app.name;
153475
153481
  }
153476
153482
  };
153477
153483
  var import_native_modules = _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules");
@@ -154883,6 +154889,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154883
154889
  var appsInTossAsyncBridges = __toESM(_$$_REQUIRE(_dependencyMap[17], "@apps-in-toss/native-modules/async-bridges"), 1);
154884
154890
  var appsInTossConstantBridges = __toESM(_$$_REQUIRE(_dependencyMap[18], "@apps-in-toss/native-modules/constant-bridges"), 1);
154885
154891
  var appsInTossEventBridges = __toESM(_$$_REQUIRE(_dependencyMap[19], "@apps-in-toss/native-modules/event-bridges"), 1);
154892
+ var import_user_scripts = _$$_REQUIRE(_dependencyMap[20], "@apps-in-toss/user-scripts");
154886
154893
  var import_react_native_safe_area_context4 = _$$_REQUIRE(_dependencyMap[16], "@granite-js/native/react-native-safe-area-context");
154887
154894
  var import_react_native39 = _$$_REQUIRE(_dependencyMap[9], "@granite-js/react-native");
154888
154895
  var import_tds_react_native15 = _$$_REQUIRE(_dependencyMap[10], "@toss/tds-react-native");
@@ -154890,7 +154897,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154890
154897
  var import_react28 = _$$_REQUIRE(_dependencyMap[12], "react");
154891
154898
  var import_react_native40 = _$$_REQUIRE(_dependencyMap[11], "react-native");
154892
154899
  var import_native_modules15 = _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules");
154893
- var import_react_native_webview = _$$_REQUIRE(_dependencyMap[20], "@granite-js/native/react-native-webview");
154900
+ var import_react_native_webview = _$$_REQUIRE(_dependencyMap[21], "@granite-js/native/react-native-webview");
154894
154901
  var import_react19 = _$$_REQUIRE(_dependencyMap[12], "react");
154895
154902
  var import_react_native28 = _$$_REQUIRE(_dependencyMap[11], "react-native");
154896
154903
  var import_react_native_safe_area_context2 = _$$_REQUIRE(_dependencyMap[16], "@granite-js/native/react-native-safe-area-context");
@@ -154984,7 +154991,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154984
154991
  }, props))]
154985
154992
  });
154986
154993
  });
154987
- var import_react_native_webview2 = _$$_REQUIRE(_dependencyMap[20], "@granite-js/native/react-native-webview");
154994
+ var import_react_native_webview2 = _$$_REQUIRE(_dependencyMap[21], "@granite-js/native/react-native-webview");
154988
154995
  var import_react21 = _$$_REQUIRE(_dependencyMap[12], "react");
154989
154996
  var import_react_native29 = _$$_REQUIRE(_dependencyMap[9], "@granite-js/react-native");
154990
154997
  var import_tds_react_native12 = _$$_REQUIRE(_dependencyMap[10], "@toss/tds-react-native");
@@ -156232,7 +156239,9 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156232
156239
  loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
156233
156240
  showFullScreenAd_isSupported: _showFullScreenAd.isSupported,
156234
156241
  fetchTossAd_isSupported: fetchTossAd.isSupported,
156235
- getDeploymentId: _env.getDeploymentId
156242
+ getDeploymentId: _env.getDeploymentId,
156243
+ getWebViewType: _env.getWebViewType,
156244
+ getAppName: _env.getAppName
156236
156245
  }),
156237
156246
  asyncHandlerMap: Object.assign({}, appsInTossAsyncBridges, {
156238
156247
  getServerTime: import_native_modules24.getServerTime,
@@ -156279,7 +156288,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156279
156288
  completeProductGrant: import_native_modules24.IAP.completeProductGrant,
156280
156289
  isAppsInTossAdMobLoaded: import_native_modules24.GoogleAdMob.isAppsInTossAdMobLoaded,
156281
156290
  tossAdEventLog: tossAdEventLog,
156282
- memoryDebugLog: webViewMemoryDebugLog
156291
+ memoryDebugLog: webViewMemoryDebugLog,
156292
+ debugLog: function () {
156293
+ var _debugLog = _asyncToGenerator(function* (event) {
156294
+ var _import_react_native, _import_react_native2;
156295
+ (_import_react_native = import_react_native40.NativeModules.AppsInTossModule) == null ? void 0 : _import_react_native.eventLog(event);
156296
+ (_import_react_native2 = import_react_native40.NativeModules.TossCoreModule) == null ? void 0 : _import_react_native2.eventLog(event);
156297
+ });
156298
+ function debugLog(_x8) {
156299
+ return _debugLog.apply(this, arguments);
156300
+ }
156301
+ return debugLog;
156302
+ }()
156283
156303
  })
156284
156304
  });
156285
156305
  var headerPropForExternalWebView = (0, import_react28.useMemo)(function () {
@@ -156314,7 +156334,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156314
156334
  return import_react_native40.BackHandler.removeEventListener("hardwareBackPress", callback);
156315
156335
  };
156316
156336
  }, [webBackHandler]);
156317
- var globalScripts = useGlobalScripts();
156318
156337
  var handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
156319
156338
  return (0, import_jsx_runtime19.jsx)(BaseWebView, Object.assign({
156320
156339
  ref: refs
@@ -156339,8 +156358,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156339
156358
  webviewDebuggingEnabled: webViewDebuggingEnabled,
156340
156359
  thirdPartyCookiesEnabled: true,
156341
156360
  onMessage: handler.onMessage,
156342
- injectedJavaScript: globalScripts.afterLoad,
156343
- injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
156361
+ injectedJavaScript: import_user_scripts.afterDocumentLoad,
156362
+ injectedJavaScriptBeforeContentLoaded: [handler.injectedJavaScript, import_user_scripts.beforeDocumentLoad].join("\n"),
156344
156363
  decelerationRate: import_react_native40.Platform.OS === "ios" ? 1 : void 0,
156345
156364
  allowsBackForwardNavigationGestures: allowsBackForwardNavigationGestures,
156346
156365
  onShouldStartLoadWithRequest: function onShouldStartLoadWithRequest(event) {
@@ -156363,76 +156382,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156363
156382
  onRenderProcessGone: handleWebViewProcessDidTerminate
156364
156383
  }));
156365
156384
  }
156366
- function useGlobalScripts() {
156367
- var global2 = getAppsInTossGlobals();
156368
- var disableTextSelectionCSS = `
156369
- const style = document.createElement('style');
156370
- style.textContent = '*:not(input):not(textarea) { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }';
156371
- document.head.appendChild(style);
156372
- `;
156373
- var applyGameResourcesCache = `
156374
- (function () {
156375
- if (typeof caches === 'undefined') {
156376
- return;
156377
- }
156378
- const cacheKeyPrefix = '@apps-in-toss/caches/';
156379
- const cacheKey = \`\${cacheKeyPrefix}${global2.deploymentId}\`;
156380
- window.addEventListener('load', async () => {
156381
- const keys = await caches.keys();
156382
- for (const key of keys) {
156383
- if (key.startsWith(cacheKeyPrefix) && key !== cacheKey) {
156384
- await caches.delete(key);
156385
- }
156386
- }
156387
- });
156388
- window.fetch = new Proxy(window.fetch, {
156389
- async apply(originalFetch, thisArg, args) {
156390
- const request = new Request(args[0], args[1]);
156391
- if (!/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/.test(request.url)) {
156392
- return await originalFetch.call(thisArg, request);
156393
- }
156394
- const cache = await caches.open(cacheKey);
156395
- const cached = await cache.match(request);
156396
- if (cached) {
156397
- const eTag = cached.headers.get('ETag');
156398
- const lastModified = cached.headers.get('Last-Modified');
156399
- if (eTag) {
156400
- request.headers.set('If-None-Match', eTag);
156401
- }
156402
- if (lastModified) {
156403
- request.headers.set('If-Modified-Since', lastModified);
156404
- }
156405
- const revalidated = await originalFetch.call(thisArg, request);
156406
- if (revalidated.status === 304) {
156407
- return cached;
156408
- }
156409
- cache.put(request, revalidated.clone());
156410
- return revalidated;
156411
- }
156412
- const response = await originalFetch.call(thisArg, request);
156413
- cache.put(request, response.clone());
156414
- return response;
156415
- },
156416
- });
156417
- })();
156418
- `;
156419
- return {
156420
- beforeLoad: mergeScripts(global2.webViewType === "game" && applyGameResourcesCache),
156421
- afterLoad: mergeScripts(disableTextSelectionCSS)
156422
- };
156423
- }
156424
- function mergeScripts() {
156425
- for (var _len3 = arguments.length, scripts = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
156426
- scripts[_key3] = arguments[_key3];
156427
- }
156428
- return scripts.filter(function (script) {
156429
- return typeof script === "string";
156430
- }).join("\n");
156431
- }
156432
156385
  __reExport(src_exports, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), module.exports);
156433
156386
  var import_private10 = _$$_REQUIRE(_dependencyMap[15], "@toss/tds-react-native/private");
156434
156387
  __reExport(src_exports, _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), module.exports);
156435
- __reExport(src_exports, _$$_REQUIRE(_dependencyMap[21], "@apps-in-toss/types"), module.exports);
156388
+ __reExport(src_exports, _$$_REQUIRE(_dependencyMap[22], "@apps-in-toss/types"), module.exports);
156436
156389
  var Analytics2 = {
156437
156390
  init: import_analytics2.Analytics.init,
156438
156391
  Impression: import_analytics2.Analytics.Impression,
@@ -156453,8 +156406,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156453
156406
  useOverlay: useOverlay,
156454
156407
  useTopNavigation: _useTopNavigation,
156455
156408
  useWaitForReturnNavigator: _useWaitForReturnNavigator
156456
- }, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), _$$_REQUIRE(_dependencyMap[21], "@apps-in-toss/types")));
156457
- },1256,[24,25,32,207,16,61,1257,1258,1259,2,1446,18,6,9,2468,2568,534,2569,2607,2614,2477,1260],"../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.cjs");
156409
+ }, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), _$$_REQUIRE(_dependencyMap[22], "@apps-in-toss/types")));
156410
+ },1256,[24,25,32,207,16,61,1257,1258,1259,2,1446,18,6,9,2468,2568,534,2569,2607,2614,2630,2477,1260],"../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.cjs");
156458
156411
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
156459
156412
  function _objectDestructuringEmpty(obj) {
156460
156413
  if (obj == null) throw new TypeError("Cannot destructure undefined");
@@ -234674,6 +234627,66 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234674
234627
  return _appsInTossEvent.appsInTossEvent.addEventListener('onVisibilityChangedByTransparentServiceWeb', eventParams);
234675
234628
  }
234676
234629
  },2629,[2616],"../../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-e56741e8de/1/packages/apps-in-toss/native-modules/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts");
234630
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234631
+ "use strict";
234632
+
234633
+ var a = Object.defineProperty;
234634
+ var i = Object.getOwnPropertyDescriptor;
234635
+ var s = Object.getOwnPropertyNames;
234636
+ var c = Object.prototype.hasOwnProperty;
234637
+ var d = function d(t, e) {
234638
+ for (var o in e) a(t, o, {
234639
+ get: e[o],
234640
+ enumerable: !0
234641
+ });
234642
+ },
234643
+ u = function u(t, e, o, r) {
234644
+ if (e && typeof e == "object" || typeof e == "function") {
234645
+ var _loop = function _loop(n) {
234646
+ !c.call(t, n) && n !== o && a(t, n, {
234647
+ get: function get() {
234648
+ return e[n];
234649
+ },
234650
+ enumerable: !(r = i(e, n)) || r.enumerable
234651
+ });
234652
+ };
234653
+ for (var n of s(e)) {
234654
+ _loop(n);
234655
+ }
234656
+ }
234657
+ return t;
234658
+ };
234659
+ var l = function l(t) {
234660
+ return u(a({}, "__esModule", {
234661
+ value: !0
234662
+ }), t);
234663
+ };
234664
+ var m = {};
234665
+ d(m, {
234666
+ afterDocumentLoad: function afterDocumentLoad() {
234667
+ return p;
234668
+ },
234669
+ beforeDocumentLoad: function beforeDocumentLoad() {
234670
+ return g;
234671
+ }
234672
+ });
234673
+ module.exports = l(m);
234674
+ var p = `"use strict";(()=>{var e=document.createElement("style");e.textContent=\`
234675
+ *:not(input):not(textarea) {
234676
+ -webkit-user-select: none;
234677
+ -moz-user-select: none;
234678
+ -ms-user-select: none;
234679
+ user-select: none;
234680
+ -webkit-touch-callout: none;
234681
+ }
234682
+ \`;document.head.appendChild(e);})();
234683
+ `,
234684
+ g = '"use strict";(()=>{var b=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let n=this._window.__GRANITE_NATIVE_EMITTER;if(!n)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return n.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},u=new b,y=()=>Math.random().toString(36).substring(2,15),R=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[n,r]of Object.entries(e))t[n]=r;return t}return e};function h(e){return(...t)=>{let n=y(),r=[],a=()=>{for(let o of r)o()};return new Promise((o,i)=>{r.push(u.on(`${e}/resolve/${n}`,s=>{a(),o(s)})),r.push(u.on(`${e}/reject/${n}`,s=>{a(),i(R(s))})),u.postMessage({type:"method",functionName:e,eventId:n,args:t})})}}function g(e){return()=>u.getConstant(e)}var m=class{_log=h("debugLog");log(t,n){try{this._log({log_name:`apps_in_toss_webview_${t}`,log_type:"debug",params:{...n,...this.getCommonParams()}})}catch{}}getCommonParams(){return{...this.getLocationInfo(),...this.getNavigatorInfo(),...this.getScreenInfo(),appName:window.__appsInToss.appName,deploymentId:window.__appsInToss.deploymentId,sessionId:window.__appsInToss.sessionId,isGame:window.__appsInToss.webViewType==="game",timestampMs:Date.now()}}getLocationInfo(){return{url:window.location.href,urlOrigin:window.location.origin,urlHost:window.location.hostname,urlPath:window.location.pathname,urlSearch:window.location.search}}getNavigatorInfo(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory?navigator.deviceMemory*1024*1024:void 0,maxTouchPoints:navigator.maxTouchPoints}}getScreenInfo(){return{screenWidth:screen.width,screenHeight:screen.height,availableScreenWidth:screen.availWidth,availableScreenHeight:screen.availHeight,devicePixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}};var l=class{callbacks={};on(t,n){typeof this.callbacks[t]>"u"&&(this.callbacks[t]=[]),this.callbacks[t].push(n)}emit(t,n){this.callbacks[t]?.forEach(r=>r(n))}};window.__appsInToss={appName:g("getAppName")(),deploymentId:g("getDeploymentId")(),webViewType:g("getWebViewType")(),sessionId:Math.random().toString(36).substring(2),eventEmitter:new l,debugLogger:new m};var d=/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/;function f(e){window.fetch=new Proxy(window.fetch,{apply:e})}(()=>{if(window.__appsInToss.webViewType!=="game"||typeof caches>"u")return;let e="@apps-in-toss/caches/",t=`${e}${window.__appsInToss.deploymentId}`;window.addEventListener("load",async()=>{let n=await caches.keys();for(let r of n)r.startsWith(e)&&r!==t&&await caches.delete(r)}),f(async(n,r,a)=>{let o=new Request(a[0],a[1]);if(!d.test(o.url))return await n.call(r,o);let i=await caches.open(t),s=await i.match(o);if(s){let v=s.headers.get("ETag"),_=s.headers.get("Last-Modified");v&&o.headers.set("If-None-Match",v),_&&o.headers.set("If-Modified-Since",_);let p=await n.call(r,o);return p.status===304?(s.__revalidateResponse=p,s):(i.put(o,p.clone()),p)}let w=await n.call(r,o);return i.put(o,w.clone()),w})})();f(async(e,t,n)=>{let r=new Request(n[0],n[1]),a=Date.now();window.__appsInToss.eventEmitter.emit("fetchRequest",{request:r});let o=await e.call(t,r);return window.__appsInToss.eventEmitter.emit("fetchResponse",{request:r,response:o,requestAt:a}),o});var E=window.__appsInToss.debugLogger;E.log("load_start",{});window.addEventListener("load",()=>{let e=performance.timeOrigin,t=performance.getEntriesByType?.("navigation")[0]??null,n=typeof e<"u"&&t!==null,r=n?{navigationStartAtMs:e+t.startTime,navigationRedirectStartAtMs:e+t.redirectStart,navigationRedirectEndAtMs:e+t.redirectEnd,navigationRedirectCount:t.redirectCount,navigationServiceWorkerStartAtMs:e+t.workerStart,navigationFetchStartAtMs:e+t.fetchStart,navigationDomainLookupStartAtMs:e+t.domainLookupStart,navigationDomainLookupEndAtMs:e+t.domainLookupEnd,navigationConnectStartAtMs:e+t.connectStart,navigationSecureConnectStartAtMs:e+t.secureConnectionStart,navigationConnectEndAtMs:e+t.connectEnd,navigationRequestStartAtMs:e+t.requestStart,navigationResponseStartAtMs:e+t.responseStart,navigationResponseEndAtMs:e+t.responseEnd,navigationDomInteractiveAtMs:e+t.domInteractive,navigationDomContentLoadedEventStartAtMs:e+t.domContentLoadedEventStart,navigationDomContentLoadedEventEndAtMs:e+t.domContentLoadedEventEnd,navigationDomCompleteAtMs:e+t.domComplete}:{};E.log("load_complete",{isNavigationDebugSupported:n,...r})});function c(e,t){return parseFloat(e.toFixed(t))}(()=>{if(typeof performance.memory>"u"||typeof performance.memory.usedJSHeapSize>"u"||typeof performance.memory.totalJSHeapSize>"u"||typeof performance.memory.jsHeapSizeLimit>"u")return;function e(t){window.__appsInToss.debugLogger.log(t,{usedJSHeapSize:c(performance.memory.usedJSHeapSize/1024,2),totalJSHeapSize:c(performance.memory.totalJSHeapSize/1024,2),jsHeapSizeLimit:c(performance.memory.jsHeapSizeLimit/1024,2)})}e("memory_usage_first_0s"),setTimeout(()=>e("memory_usage_first_1s"),1e3),setTimeout(()=>e("memory_usage_first_10s"),1e4),setTimeout(()=>e("memory_usage_first_30s"),3e4),setTimeout(()=>e("memory_usage_first_60s"),6e4),setInterval(()=>e("memory_usage_every_180s"),18e4)})();(()=>{let e=window.__appsInToss.debugLogger,t=performance.timeOrigin;if(typeof t>"u"||typeof PerformanceObserver>"u")return;new PerformanceObserver(a=>{a.getEntries().forEach(i=>{i.name==="first-paint"?e.log("first_paint",{fpStartAtMs:t+i.startTime}):i.name==="first-contentful-paint"&&e.log("first_contentful_paint",{fcpStartAtMs:t+i.startTime})})}).observe({type:"paint"}),new PerformanceObserver(a=>{a.getEntries().forEach(i=>{e.log("largest_contentful_paint",{lcpStartAtMs:t+i.startTime,lcpRenderSize:i.size})})}).observe({type:"largest-contentful-paint"})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;function e(t){let n=t.getContext("webgl2")??t.getContext("webgl");if(n==null)return;let r=n.getExtension("WEBGL_debug_renderer_info"),a=n.getParameter(n.MAX_VIEWPORT_DIMS),o={webGLRenderer:n.getParameter(n.RENDERER),webGLVendor:n.getParameter(n.VENDOR),webGLVersion:n.getParameter(n.VERSION),webGLShadingLanguageVersion:n.getParameter(n.SHADING_LANGUAGE_VERSION),webGLMaxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),webGLMaxViewportWidth:a[0],webGLMaxViewportHeight:a[1],webGLMaxRenderbufferSize:n.getParameter(n.MAX_RENDERBUFFER_SIZE)},i=r?{webGLUnmaskedVendor:n.getParameter(r.UNMASKED_VENDOR_WEBGL),webGLUnmaskedRenderer:n.getParameter(r.UNMASKED_RENDERER_WEBGL)}:{};window.__appsInToss.debugLogger.log("unity_webgl_info",{...o,...i})}window.addEventListener("load",()=>{let t=document.querySelector("#unity-canvas");if(t!=null){e(t);return}new MutationObserver((r,a)=>{for(let o of r)o.type==="childList"&&o.addedNodes.forEach(i=>{if(i instanceof HTMLCanvasElement&&i.getAttribute("id")==="unity-canvas"&&(e(i),a.disconnect()),i instanceof HTMLElement){let s=i.querySelector("#unity-canvas");s!=null&&(e(s),a.disconnect())}})}).observe(document.body,{childList:!0,subtree:!0})})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.debugLogger,t=window.__appsInToss.eventEmitter;t.on("fetchRequest",({request:n})=>{d.test(n.url)&&e.log("game_resource_download_start",{gameResourceRequestURL:n.url})}),t.on("fetchResponse",async({request:n,requestAt:r,response:a})=>{if(!d.test(n.url))return;let o=c((await a.clone().blob()).size/1024,2),i=Date.now();e.log("game_resource_download_end",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:r,gameResourceResponseAtMs:i,gameResourceResponseSize:o,gameResourceResponseStatus:a.__revalidateResponse?.status??a.status,gameResourceDownloadDurationMs:i-r})})})();})();\n';
234685
+ 0 && (module.exports = {
234686
+ afterDocumentLoad: afterDocumentLoad,
234687
+ beforeDocumentLoad: beforeDocumentLoad
234688
+ });
234689
+ },2630,[],"../user-scripts/dist/index.js");
234677
234690
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234678
234691
  Object.defineProperty(exports, "__esModule", {
234679
234692
  value: true
@@ -234688,7 +234701,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234688
234701
  context.keys = function () {
234689
234702
  return Array.from(files.keys());
234690
234703
  };
234691
- },2630,[2631,2632],"react-native/context.ts");
234704
+ },2631,[2632,2633],"react-native/context.ts");
234692
234705
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234693
234706
  Object.defineProperty(exports, "__esModule", {
234694
234707
  value: true
@@ -234721,7 +234734,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234721
234734
  })
234722
234735
  });
234723
234736
  }
234724
- },2631,[1256,18,9],"react-native/pages/index.tsx");
234737
+ },2632,[1256,18,9],"react-native/pages/index.tsx");
234725
234738
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234726
234739
  var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault");
234727
234740
  Object.defineProperty(exports, "__esModule", {
@@ -234734,6 +234747,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234734
234747
  }
234735
234748
  });
234736
234749
  var _index = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./index"));
234737
- },2632,[1,2631],"react-native/pages/_404.tsx");
234750
+ },2633,[1,2632],"react-native/pages/_404.tsx");
234738
234751
  __r(133);
234739
234752
  __r(0);
@@ -153181,7 +153181,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
153181
153181
  var _default = exports.default = _framework.AppsInToss.registerApp(AppContainer, {
153182
153182
  context: _context.context
153183
153183
  });
153184
- },1255,[1256,2629,9],"react-native/src/_app.tsx");
153184
+ },1255,[1256,2630,9],"react-native/src/_app.tsx");
153185
153185
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
153186
153186
  "use strict";
153187
153187
 
@@ -153293,6 +153293,12 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
153293
153293
  getDeploymentId: function getDeploymentId() {
153294
153294
  var _global$__appsInToss;
153295
153295
  return __DEV__ ? "local" : (_global$__appsInToss = global.__appsInToss) == null ? void 0 : _global$__appsInToss.deploymentId;
153296
+ },
153297
+ getWebViewType: function getWebViewType() {
153298
+ return global.__appsInToss.webViewType;
153299
+ },
153300
+ getAppName: function getAppName() {
153301
+ return global.__granite.app.name;
153296
153302
  }
153297
153303
  };
153298
153304
  var import_native_modules = _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules");
@@ -154704,6 +154710,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154704
154710
  var appsInTossAsyncBridges = __toESM(_$$_REQUIRE(_dependencyMap[17], "@apps-in-toss/native-modules/async-bridges"), 1);
154705
154711
  var appsInTossConstantBridges = __toESM(_$$_REQUIRE(_dependencyMap[18], "@apps-in-toss/native-modules/constant-bridges"), 1);
154706
154712
  var appsInTossEventBridges = __toESM(_$$_REQUIRE(_dependencyMap[19], "@apps-in-toss/native-modules/event-bridges"), 1);
154713
+ var import_user_scripts = _$$_REQUIRE(_dependencyMap[20], "@apps-in-toss/user-scripts");
154707
154714
  var import_react_native_safe_area_context4 = _$$_REQUIRE(_dependencyMap[16], "@granite-js/native/react-native-safe-area-context");
154708
154715
  var import_react_native39 = _$$_REQUIRE(_dependencyMap[9], "@granite-js/react-native");
154709
154716
  var import_tds_react_native15 = _$$_REQUIRE(_dependencyMap[10], "@toss/tds-react-native");
@@ -154711,7 +154718,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154711
154718
  var import_react28 = _$$_REQUIRE(_dependencyMap[12], "react");
154712
154719
  var import_react_native40 = _$$_REQUIRE(_dependencyMap[11], "react-native");
154713
154720
  var import_native_modules15 = _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules");
154714
- var import_react_native_webview = _$$_REQUIRE(_dependencyMap[20], "@granite-js/native/react-native-webview");
154721
+ var import_react_native_webview = _$$_REQUIRE(_dependencyMap[21], "@granite-js/native/react-native-webview");
154715
154722
  var import_react19 = _$$_REQUIRE(_dependencyMap[12], "react");
154716
154723
  var import_react_native28 = _$$_REQUIRE(_dependencyMap[11], "react-native");
154717
154724
  var import_react_native_safe_area_context2 = _$$_REQUIRE(_dependencyMap[16], "@granite-js/native/react-native-safe-area-context");
@@ -154805,7 +154812,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
154805
154812
  }, props))]
154806
154813
  });
154807
154814
  });
154808
- var import_react_native_webview2 = _$$_REQUIRE(_dependencyMap[20], "@granite-js/native/react-native-webview");
154815
+ var import_react_native_webview2 = _$$_REQUIRE(_dependencyMap[21], "@granite-js/native/react-native-webview");
154809
154816
  var import_react21 = _$$_REQUIRE(_dependencyMap[12], "react");
154810
154817
  var import_react_native29 = _$$_REQUIRE(_dependencyMap[9], "@granite-js/react-native");
154811
154818
  var import_tds_react_native12 = _$$_REQUIRE(_dependencyMap[10], "@toss/tds-react-native");
@@ -156053,7 +156060,9 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156053
156060
  loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
156054
156061
  showFullScreenAd_isSupported: _showFullScreenAd.isSupported,
156055
156062
  fetchTossAd_isSupported: fetchTossAd.isSupported,
156056
- getDeploymentId: _env.getDeploymentId
156063
+ getDeploymentId: _env.getDeploymentId,
156064
+ getWebViewType: _env.getWebViewType,
156065
+ getAppName: _env.getAppName
156057
156066
  }),
156058
156067
  asyncHandlerMap: Object.assign({}, appsInTossAsyncBridges, {
156059
156068
  getServerTime: import_native_modules24.getServerTime,
@@ -156100,7 +156109,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156100
156109
  completeProductGrant: import_native_modules24.IAP.completeProductGrant,
156101
156110
  isAppsInTossAdMobLoaded: import_native_modules24.GoogleAdMob.isAppsInTossAdMobLoaded,
156102
156111
  tossAdEventLog: tossAdEventLog,
156103
- memoryDebugLog: webViewMemoryDebugLog
156112
+ memoryDebugLog: webViewMemoryDebugLog,
156113
+ debugLog: function () {
156114
+ var _debugLog = _asyncToGenerator(function* (event) {
156115
+ var _import_react_native, _import_react_native2;
156116
+ (_import_react_native = import_react_native40.NativeModules.AppsInTossModule) == null ? void 0 : _import_react_native.eventLog(event);
156117
+ (_import_react_native2 = import_react_native40.NativeModules.TossCoreModule) == null ? void 0 : _import_react_native2.eventLog(event);
156118
+ });
156119
+ function debugLog(_x8) {
156120
+ return _debugLog.apply(this, arguments);
156121
+ }
156122
+ return debugLog;
156123
+ }()
156104
156124
  })
156105
156125
  });
156106
156126
  var headerPropForExternalWebView = (0, import_react28.useMemo)(function () {
@@ -156135,7 +156155,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156135
156155
  return import_react_native40.BackHandler.removeEventListener("hardwareBackPress", callback);
156136
156156
  };
156137
156157
  }, [webBackHandler]);
156138
- var globalScripts = useGlobalScripts();
156139
156158
  var handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
156140
156159
  return (0, import_jsx_runtime19.jsx)(BaseWebView, Object.assign({
156141
156160
  ref: refs
@@ -156160,8 +156179,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156160
156179
  webviewDebuggingEnabled: webViewDebuggingEnabled,
156161
156180
  thirdPartyCookiesEnabled: true,
156162
156181
  onMessage: handler.onMessage,
156163
- injectedJavaScript: globalScripts.afterLoad,
156164
- injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
156182
+ injectedJavaScript: import_user_scripts.afterDocumentLoad,
156183
+ injectedJavaScriptBeforeContentLoaded: [handler.injectedJavaScript, import_user_scripts.beforeDocumentLoad].join("\n"),
156165
156184
  decelerationRate: import_react_native40.Platform.OS === "ios" ? 1 : void 0,
156166
156185
  allowsBackForwardNavigationGestures: allowsBackForwardNavigationGestures,
156167
156186
  onShouldStartLoadWithRequest: function onShouldStartLoadWithRequest(event) {
@@ -156184,76 +156203,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156184
156203
  onRenderProcessGone: handleWebViewProcessDidTerminate
156185
156204
  }));
156186
156205
  }
156187
- function useGlobalScripts() {
156188
- var global2 = getAppsInTossGlobals();
156189
- var disableTextSelectionCSS = `
156190
- const style = document.createElement('style');
156191
- style.textContent = '*:not(input):not(textarea) { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }';
156192
- document.head.appendChild(style);
156193
- `;
156194
- var applyGameResourcesCache = `
156195
- (function () {
156196
- if (typeof caches === 'undefined') {
156197
- return;
156198
- }
156199
- const cacheKeyPrefix = '@apps-in-toss/caches/';
156200
- const cacheKey = \`\${cacheKeyPrefix}${global2.deploymentId}\`;
156201
- window.addEventListener('load', async () => {
156202
- const keys = await caches.keys();
156203
- for (const key of keys) {
156204
- if (key.startsWith(cacheKeyPrefix) && key !== cacheKey) {
156205
- await caches.delete(key);
156206
- }
156207
- }
156208
- });
156209
- window.fetch = new Proxy(window.fetch, {
156210
- async apply(originalFetch, thisArg, args) {
156211
- const request = new Request(args[0], args[1]);
156212
- if (!/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/.test(request.url)) {
156213
- return await originalFetch.call(thisArg, request);
156214
- }
156215
- const cache = await caches.open(cacheKey);
156216
- const cached = await cache.match(request);
156217
- if (cached) {
156218
- const eTag = cached.headers.get('ETag');
156219
- const lastModified = cached.headers.get('Last-Modified');
156220
- if (eTag) {
156221
- request.headers.set('If-None-Match', eTag);
156222
- }
156223
- if (lastModified) {
156224
- request.headers.set('If-Modified-Since', lastModified);
156225
- }
156226
- const revalidated = await originalFetch.call(thisArg, request);
156227
- if (revalidated.status === 304) {
156228
- return cached;
156229
- }
156230
- cache.put(request, revalidated.clone());
156231
- return revalidated;
156232
- }
156233
- const response = await originalFetch.call(thisArg, request);
156234
- cache.put(request, response.clone());
156235
- return response;
156236
- },
156237
- });
156238
- })();
156239
- `;
156240
- return {
156241
- beforeLoad: mergeScripts(global2.webViewType === "game" && applyGameResourcesCache),
156242
- afterLoad: mergeScripts(disableTextSelectionCSS)
156243
- };
156244
- }
156245
- function mergeScripts() {
156246
- for (var _len3 = arguments.length, scripts = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
156247
- scripts[_key3] = arguments[_key3];
156248
- }
156249
- return scripts.filter(function (script) {
156250
- return typeof script === "string";
156251
- }).join("\n");
156252
- }
156253
156206
  __reExport(src_exports, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), module.exports);
156254
156207
  var import_private10 = _$$_REQUIRE(_dependencyMap[15], "@toss/tds-react-native/private");
156255
156208
  __reExport(src_exports, _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), module.exports);
156256
- __reExport(src_exports, _$$_REQUIRE(_dependencyMap[21], "@apps-in-toss/types"), module.exports);
156209
+ __reExport(src_exports, _$$_REQUIRE(_dependencyMap[22], "@apps-in-toss/types"), module.exports);
156257
156210
  var Analytics2 = {
156258
156211
  init: import_analytics2.Analytics.init,
156259
156212
  Impression: import_analytics2.Analytics.Impression,
@@ -156274,8 +156227,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156274
156227
  useOverlay: useOverlay,
156275
156228
  useTopNavigation: _useTopNavigation,
156276
156229
  useWaitForReturnNavigator: _useWaitForReturnNavigator
156277
- }, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), _$$_REQUIRE(_dependencyMap[21], "@apps-in-toss/types")));
156278
- },1256,[24,25,32,207,16,61,1257,1258,1259,2,1446,18,6,9,2467,2567,532,2568,2606,2613,2476,1260],"../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.cjs");
156230
+ }, _$$_REQUIRE(_dependencyMap[7], "@apps-in-toss/analytics"), _$$_REQUIRE(_dependencyMap[8], "@apps-in-toss/native-modules"), _$$_REQUIRE(_dependencyMap[22], "@apps-in-toss/types")));
156231
+ },1256,[24,25,32,207,16,61,1257,1258,1259,2,1446,18,6,9,2467,2567,532,2568,2606,2613,2629,2476,1260],"../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.cjs");
156279
156232
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
156280
156233
  function _objectDestructuringEmpty(obj) {
156281
156234
  if (obj == null) throw new TypeError("Cannot destructure undefined");
@@ -234514,6 +234467,66 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234514
234467
  return _appsInTossEvent.appsInTossEvent.addEventListener('onVisibilityChangedByTransparentServiceWeb', eventParams);
234515
234468
  }
234516
234469
  },2628,[2615],"../../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-e56741e8de/1/packages/apps-in-toss/native-modules/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts");
234470
+ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234471
+ "use strict";
234472
+
234473
+ var a = Object.defineProperty;
234474
+ var i = Object.getOwnPropertyDescriptor;
234475
+ var s = Object.getOwnPropertyNames;
234476
+ var c = Object.prototype.hasOwnProperty;
234477
+ var d = function d(t, e) {
234478
+ for (var o in e) a(t, o, {
234479
+ get: e[o],
234480
+ enumerable: !0
234481
+ });
234482
+ },
234483
+ u = function u(t, e, o, r) {
234484
+ if (e && typeof e == "object" || typeof e == "function") {
234485
+ var _loop = function _loop(n) {
234486
+ !c.call(t, n) && n !== o && a(t, n, {
234487
+ get: function get() {
234488
+ return e[n];
234489
+ },
234490
+ enumerable: !(r = i(e, n)) || r.enumerable
234491
+ });
234492
+ };
234493
+ for (var n of s(e)) {
234494
+ _loop(n);
234495
+ }
234496
+ }
234497
+ return t;
234498
+ };
234499
+ var l = function l(t) {
234500
+ return u(a({}, "__esModule", {
234501
+ value: !0
234502
+ }), t);
234503
+ };
234504
+ var m = {};
234505
+ d(m, {
234506
+ afterDocumentLoad: function afterDocumentLoad() {
234507
+ return p;
234508
+ },
234509
+ beforeDocumentLoad: function beforeDocumentLoad() {
234510
+ return g;
234511
+ }
234512
+ });
234513
+ module.exports = l(m);
234514
+ var p = `"use strict";(()=>{var e=document.createElement("style");e.textContent=\`
234515
+ *:not(input):not(textarea) {
234516
+ -webkit-user-select: none;
234517
+ -moz-user-select: none;
234518
+ -ms-user-select: none;
234519
+ user-select: none;
234520
+ -webkit-touch-callout: none;
234521
+ }
234522
+ \`;document.head.appendChild(e);})();
234523
+ `,
234524
+ g = '"use strict";(()=>{var b=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let n=this._window.__GRANITE_NATIVE_EMITTER;if(!n)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return n.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},u=new b,y=()=>Math.random().toString(36).substring(2,15),R=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[n,r]of Object.entries(e))t[n]=r;return t}return e};function h(e){return(...t)=>{let n=y(),r=[],a=()=>{for(let o of r)o()};return new Promise((o,i)=>{r.push(u.on(`${e}/resolve/${n}`,s=>{a(),o(s)})),r.push(u.on(`${e}/reject/${n}`,s=>{a(),i(R(s))})),u.postMessage({type:"method",functionName:e,eventId:n,args:t})})}}function g(e){return()=>u.getConstant(e)}var m=class{_log=h("debugLog");log(t,n){try{this._log({log_name:`apps_in_toss_webview_${t}`,log_type:"debug",params:{...n,...this.getCommonParams()}})}catch{}}getCommonParams(){return{...this.getLocationInfo(),...this.getNavigatorInfo(),...this.getScreenInfo(),appName:window.__appsInToss.appName,deploymentId:window.__appsInToss.deploymentId,sessionId:window.__appsInToss.sessionId,isGame:window.__appsInToss.webViewType==="game",timestampMs:Date.now()}}getLocationInfo(){return{url:window.location.href,urlOrigin:window.location.origin,urlHost:window.location.hostname,urlPath:window.location.pathname,urlSearch:window.location.search}}getNavigatorInfo(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory?navigator.deviceMemory*1024*1024:void 0,maxTouchPoints:navigator.maxTouchPoints}}getScreenInfo(){return{screenWidth:screen.width,screenHeight:screen.height,availableScreenWidth:screen.availWidth,availableScreenHeight:screen.availHeight,devicePixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}};var l=class{callbacks={};on(t,n){typeof this.callbacks[t]>"u"&&(this.callbacks[t]=[]),this.callbacks[t].push(n)}emit(t,n){this.callbacks[t]?.forEach(r=>r(n))}};window.__appsInToss={appName:g("getAppName")(),deploymentId:g("getDeploymentId")(),webViewType:g("getWebViewType")(),sessionId:Math.random().toString(36).substring(2),eventEmitter:new l,debugLogger:new m};var d=/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/;function f(e){window.fetch=new Proxy(window.fetch,{apply:e})}(()=>{if(window.__appsInToss.webViewType!=="game"||typeof caches>"u")return;let e="@apps-in-toss/caches/",t=`${e}${window.__appsInToss.deploymentId}`;window.addEventListener("load",async()=>{let n=await caches.keys();for(let r of n)r.startsWith(e)&&r!==t&&await caches.delete(r)}),f(async(n,r,a)=>{let o=new Request(a[0],a[1]);if(!d.test(o.url))return await n.call(r,o);let i=await caches.open(t),s=await i.match(o);if(s){let v=s.headers.get("ETag"),_=s.headers.get("Last-Modified");v&&o.headers.set("If-None-Match",v),_&&o.headers.set("If-Modified-Since",_);let p=await n.call(r,o);return p.status===304?(s.__revalidateResponse=p,s):(i.put(o,p.clone()),p)}let w=await n.call(r,o);return i.put(o,w.clone()),w})})();f(async(e,t,n)=>{let r=new Request(n[0],n[1]),a=Date.now();window.__appsInToss.eventEmitter.emit("fetchRequest",{request:r});let o=await e.call(t,r);return window.__appsInToss.eventEmitter.emit("fetchResponse",{request:r,response:o,requestAt:a}),o});var E=window.__appsInToss.debugLogger;E.log("load_start",{});window.addEventListener("load",()=>{let e=performance.timeOrigin,t=performance.getEntriesByType?.("navigation")[0]??null,n=typeof e<"u"&&t!==null,r=n?{navigationStartAtMs:e+t.startTime,navigationRedirectStartAtMs:e+t.redirectStart,navigationRedirectEndAtMs:e+t.redirectEnd,navigationRedirectCount:t.redirectCount,navigationServiceWorkerStartAtMs:e+t.workerStart,navigationFetchStartAtMs:e+t.fetchStart,navigationDomainLookupStartAtMs:e+t.domainLookupStart,navigationDomainLookupEndAtMs:e+t.domainLookupEnd,navigationConnectStartAtMs:e+t.connectStart,navigationSecureConnectStartAtMs:e+t.secureConnectionStart,navigationConnectEndAtMs:e+t.connectEnd,navigationRequestStartAtMs:e+t.requestStart,navigationResponseStartAtMs:e+t.responseStart,navigationResponseEndAtMs:e+t.responseEnd,navigationDomInteractiveAtMs:e+t.domInteractive,navigationDomContentLoadedEventStartAtMs:e+t.domContentLoadedEventStart,navigationDomContentLoadedEventEndAtMs:e+t.domContentLoadedEventEnd,navigationDomCompleteAtMs:e+t.domComplete}:{};E.log("load_complete",{isNavigationDebugSupported:n,...r})});function c(e,t){return parseFloat(e.toFixed(t))}(()=>{if(typeof performance.memory>"u"||typeof performance.memory.usedJSHeapSize>"u"||typeof performance.memory.totalJSHeapSize>"u"||typeof performance.memory.jsHeapSizeLimit>"u")return;function e(t){window.__appsInToss.debugLogger.log(t,{usedJSHeapSize:c(performance.memory.usedJSHeapSize/1024,2),totalJSHeapSize:c(performance.memory.totalJSHeapSize/1024,2),jsHeapSizeLimit:c(performance.memory.jsHeapSizeLimit/1024,2)})}e("memory_usage_first_0s"),setTimeout(()=>e("memory_usage_first_1s"),1e3),setTimeout(()=>e("memory_usage_first_10s"),1e4),setTimeout(()=>e("memory_usage_first_30s"),3e4),setTimeout(()=>e("memory_usage_first_60s"),6e4),setInterval(()=>e("memory_usage_every_180s"),18e4)})();(()=>{let e=window.__appsInToss.debugLogger,t=performance.timeOrigin;if(typeof t>"u"||typeof PerformanceObserver>"u")return;new PerformanceObserver(a=>{a.getEntries().forEach(i=>{i.name==="first-paint"?e.log("first_paint",{fpStartAtMs:t+i.startTime}):i.name==="first-contentful-paint"&&e.log("first_contentful_paint",{fcpStartAtMs:t+i.startTime})})}).observe({type:"paint"}),new PerformanceObserver(a=>{a.getEntries().forEach(i=>{e.log("largest_contentful_paint",{lcpStartAtMs:t+i.startTime,lcpRenderSize:i.size})})}).observe({type:"largest-contentful-paint"})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;function e(t){let n=t.getContext("webgl2")??t.getContext("webgl");if(n==null)return;let r=n.getExtension("WEBGL_debug_renderer_info"),a=n.getParameter(n.MAX_VIEWPORT_DIMS),o={webGLRenderer:n.getParameter(n.RENDERER),webGLVendor:n.getParameter(n.VENDOR),webGLVersion:n.getParameter(n.VERSION),webGLShadingLanguageVersion:n.getParameter(n.SHADING_LANGUAGE_VERSION),webGLMaxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),webGLMaxViewportWidth:a[0],webGLMaxViewportHeight:a[1],webGLMaxRenderbufferSize:n.getParameter(n.MAX_RENDERBUFFER_SIZE)},i=r?{webGLUnmaskedVendor:n.getParameter(r.UNMASKED_VENDOR_WEBGL),webGLUnmaskedRenderer:n.getParameter(r.UNMASKED_RENDERER_WEBGL)}:{};window.__appsInToss.debugLogger.log("unity_webgl_info",{...o,...i})}window.addEventListener("load",()=>{let t=document.querySelector("#unity-canvas");if(t!=null){e(t);return}new MutationObserver((r,a)=>{for(let o of r)o.type==="childList"&&o.addedNodes.forEach(i=>{if(i instanceof HTMLCanvasElement&&i.getAttribute("id")==="unity-canvas"&&(e(i),a.disconnect()),i instanceof HTMLElement){let s=i.querySelector("#unity-canvas");s!=null&&(e(s),a.disconnect())}})}).observe(document.body,{childList:!0,subtree:!0})})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.debugLogger,t=window.__appsInToss.eventEmitter;t.on("fetchRequest",({request:n})=>{d.test(n.url)&&e.log("game_resource_download_start",{gameResourceRequestURL:n.url})}),t.on("fetchResponse",async({request:n,requestAt:r,response:a})=>{if(!d.test(n.url))return;let o=c((await a.clone().blob()).size/1024,2),i=Date.now();e.log("game_resource_download_end",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:r,gameResourceResponseAtMs:i,gameResourceResponseSize:o,gameResourceResponseStatus:a.__revalidateResponse?.status??a.status,gameResourceDownloadDurationMs:i-r})})})();})();\n';
234525
+ 0 && (module.exports = {
234526
+ afterDocumentLoad: afterDocumentLoad,
234527
+ beforeDocumentLoad: beforeDocumentLoad
234528
+ });
234529
+ },2629,[],"../user-scripts/dist/index.js");
234517
234530
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234518
234531
  Object.defineProperty(exports, "__esModule", {
234519
234532
  value: true
@@ -234528,7 +234541,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234528
234541
  context.keys = function () {
234529
234542
  return Array.from(files.keys());
234530
234543
  };
234531
- },2629,[2630,2631],"react-native/context.ts");
234544
+ },2630,[2631,2632],"react-native/context.ts");
234532
234545
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234533
234546
  Object.defineProperty(exports, "__esModule", {
234534
234547
  value: true
@@ -234561,7 +234574,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234561
234574
  })
234562
234575
  });
234563
234576
  }
234564
- },2630,[1256,18,9],"react-native/pages/index.tsx");
234577
+ },2631,[1256,18,9],"react-native/pages/index.tsx");
234565
234578
  __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
234566
234579
  var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault");
234567
234580
  Object.defineProperty(exports, "__esModule", {
@@ -234574,6 +234587,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
234574
234587
  }
234575
234588
  });
234576
234589
  var _index = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "./index"));
234577
- },2631,[1,2630],"react-native/pages/_404.tsx");
234590
+ },2632,[1,2631],"react-native/pages/_404.tsx");
234578
234591
  __r(134);
234579
234592
  __r(0);