1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4711],{37458:(e,t,r)=>{r.d(t,{Mt:()=>p,OL:()=>f,PL:()=>u,QS:()=>g,UK:()=>m,ri:()=>h,wG:()=>l,zJ:()=>y});var o=r(36746),n=r(65375);let a="ls_ebay_connect_surface",s="ls_ebay_connect_fail_pending",c="ls_ebay_oauth_pending";function i(e){return"onboarding"===e||"connect_modal"===e||"settings"===e||"oauth_callback"===e}function l(){try{let e=localStorage.getItem(a);if(i(e))return e}catch{}return"oauth_callback"}function u(){try{let e=localStorage.getItem(a);if(localStorage.removeItem(a),i(e))return e}catch{}return"oauth_callback"}function d(e){if(null!=e)return("string"==typeof e?e:e instanceof Error?e.message:String(e)).replace(/https?:\/\/\S+/gi,"[url]").replace(/\b(code|state|token|access_token)=[^&\s]+/gi,"$1=[redacted]").slice(0,200)}function f(){if(!(0,o.xU)())return;let e=[];try{let t=sessionStorage.getItem(s);if(sessionStorage.removeItem(s),t){let r=JSON.parse(t);Array.isArray(r)&&(e=r)}}catch{}for(let t of e)try{(0,n.Dt)("ebay_connect_failed",{surface:t.surface,stage:t.stage,...t.error?{error:t.error}:{},flushed_from_buffer:!0})}catch{}let t=[];try{let e=sessionStorage.getItem(c);if(sessionStorage.removeItem(c),e){let r=JSON.parse(e);Array.isArray(r)&&(t=r)}}catch{return}for(let e of t)try{(0,n.Dt)(e.event,{surface:e.surface,outcome:e.outcome,...e.error?{error:e.error}:{},flushed_from_buffer:!0})}catch{}}function m(e){var t=e.surface;try{localStorage.setItem(a,t)}catch{}try{(0,n.Dt)("ebay_connect_clicked",{surface:e.surface,...e.storeId?{store_id:e.storeId}:{},..."boolean"==typeof e.hadStoreAlready?{had_store_already:e.hadStoreAlready}:{}})}catch{}}function y(e){let t=e?.surface??l();try{(0,n.Dt)("ebay_oauth_started",{surface:t,...e?.storeId?{store_id:e.storeId}:{}})}catch{}}function h(e){let t=e.surface??l(),r=d(e.error),o="denied"===e.outcome?"ebay_oauth_denied":"ebay_oauth_returned",a={surface:t,outcome:e.outcome,...r?{error:r}:{}};try{(0,n.Dt)(o,a)||function(e){try{let t=sessionStorage.getItem(c),r=t?JSON.parse(t):[];if(!Array.isArray(r))return void sessionStorage.setItem(c,JSON.stringify([e]));r.push(e),sessionStorage.setItem(c,JSON.stringify(r.slice(-10)))}catch{}}({event:o,surface:t,outcome:e.outcome,...r?{error:r}:{}})}catch{}}function p(e){let t=e.surface??u(),r=d(e.error),o={surface:t,stage:e.stage,...r?{error:r}:{}};try{(0,n.Dt)("ebay_connect_failed",o)||function(e){try{let t=sessionStorage.getItem(s),r=t?JSON.parse(t):[];if(!Array.isArray(r))return void sessionStorage.setItem(s,JSON.stringify([e]));r.push(e),sessionStorage.setItem(s,JSON.stringify(r.slice(-10)))}catch{}}({surface:t,stage:e.stage,...r?{error:r}:{}})}catch{}}function g(e){let t=l();try{(0,n.Dt)("ebay_connect_tab_fallback",{surface:t,reason:e.reason})}catch{}}},48127:(e,t,r)=>{r.d(t,{WW:()=>s,ig:()=>a,pY:()=>n});let o=null;function n(){a();try{o=window.open("about:blank","_blank")}catch{o=null}if(!o||o.closed)return o=null,!1;var e,t=o;try{let r;t.document.open(),t.document.write((e=function(){try{return document.documentElement.classList.contains("dark")?"dark":"light"}catch{return"light"}}(),r="dark"===e,`<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <meta charset="utf-8" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1" /> 6 <meta name="color-scheme" content="${e}" /> 7 <title>Connecting to eBayâ¦</title> 8 <style> 9 :root { color-scheme: ${e}; } 10 body { 11 margin: 0; 12 min-height: 100vh; 13 display: grid; 14 place-items: center; 15 font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; 16 background: ${r?"#1c1c1f":"#fafbfc"}; 17 color: ${r?"#f4f4f5":"#18181b"}; 18 } 19 .card { text-align: center; padding: 2rem; max-width: 22rem; } 20 .spinner { 21 width: 2rem; height: 2rem; margin: 0 auto 1rem; 22 border: 2px solid ${r?"rgba(255,255,255,0.2)":"rgba(24,24,27,0.12)"}; 23 border-top-color: ${r?"#a78bfa":"#7c3aed"}; 24 border-radius: 9999px; 25 animation: spin 0.8s linear infinite; 26 } 27 @keyframes spin { to { transform: rotate(360deg); } } 28 @media (prefers-reduced-motion: reduce) { .spinner { animation: none; } } 29 h1 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.5rem; } 30 p { margin: 0; font-size: 0.875rem; line-height: 1.5; color: ${r?"#a1a1aa":"#71717a"}; } 31 </style> 32</head> 33<body> 34 <div class="card"> 35 <div class="spinner" aria-hidden="true"></div> 36 <h1>Connecting to eBay</h1> 37 <p>Hang tight â we are preparing a secure sign-in. This tab will open eBay in a moment.</p> 38 </div> 39</body> 40</html>`)),t.document.close()}catch{}return!0}function a(){let e=o;if(o=null,e)try{e.closed||e.close()}catch{}}function s(e){let t=o;if(o=null,!t)return"popup_blocked";if(t.closed)return"tab_closed";
40try{return t.location.href=e,t.focus(),"sent"}catch{return"tab_closed"}}},64711:(e,t,r)=>{r.d(t,{Pp:()=>g,RI:()=>b,eK:()=>p,oP:()=>_});var o=r(21620),n=r(18249),a=r(10800),s=r(74664),c=r(7276),i=r(8631),l=r(83340),u=r(37458),d=r(65304),f=r(48127),m=r(38389);let y=r(52092).r.getMarketplaceRepository(),h={ebay:["auth.ebay.com","auth.sandbox.ebay.com"]};function p(e){let{data:t}=(0,l.R)(),r=(0,c.useMemo)(()=>e?m.l.platformConnections.list(e):["platform-connections","disabled"],[e]),n=t?.permissions.email_verified??!1,a=!!e&&n;return(0,o.I)({queryKey:r,queryFn:async()=>{if(!e)return[];let t=await y.getPlatformConnections(e);return Array.isArray(t)?t:[]},enabled:a,staleTime:3e4})}function g(e){let t=(0,n.jE)(),r=(0,s.c)("dashboard.stores");return(0,a.n)({mutationFn:async({storeId:t,...r})=>y.connectPlatform(t??e,r),onSuccess:(o,n)=>{let a=n.storeId??e;if("object"==typeof o&&null!==o&&"data"in o&&"object"==typeof o.data&&null!==o.data&&"authorization_url"in o.data){let e=o.data.authorization_url;if(!function(e,t){let r;try{r=new URL(e)}catch{return!1}return"https:"===r.protocol&&(h[t.toLowerCase()]??[]).includes(r.hostname)}(e,n.platform)){(0,f.ig)(),"ebay"===n.platform&&(0,u.Mt)({stage:"api_error",error:"untrusted_auth_url"}),i.oR.error(r("platform.connectionFailed")||"Connection Failed",{description:r("platform.untrustedAuthUrl")});return}"ebay"===n.platform&&(0,u.zJ)({storeId:a});let t=(0,f.WW)(e);"sent"!==t&&("ebay"===n.platform&&(0,u.QS)({reason:t}),window.location.href=e);return}(0,f.ig)(),t.invalidateQueries({queryKey:m.l.platformConnections.list(a)}),t.invalidateQueries({queryKey:m.l.stores.marketplaceConfigurations(a)}),i.oR.success(r("platform.connected")||"Platform Connected",{description:r("platform.connectedSuccess")||"Platform connected successfully"})},onError:(e,t)=>{(0,f.ig)(),"ebay"===t.platform&&(0,u.Mt)({stage:"api_error",error:e}),(0,d.JA)(e,{title:r("platform.connectionFailed")||"Connection Failed"})}})}function b(e){let t=(0,n.jE)(),r=(0,s.c)("dashboard.stores");return(0,a.n)({mutationFn:async t=>y.disconnectPlatform(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:m.l.platformConnections.list(e)}),t.invalidateQueries({queryKey:m.l.stores.marketplaceConfigurations(e)}),i.oR.success(r("platform.disconnected")||"Platform Disconnected",{description:r("platform.disconnectedSuccess")||"Platform disconnected successfully"})},onError:e=>{(0,d.JA)(e,{title:r("platform.disconnectionFailed")||"Disconnection Failed"})}})}function _(e){let t=(0,n.jE)(),r=(0,s.c)("dashboard.stores");return(0,a.n)({mutationFn:async t=>y.refreshSellerInfo(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:m.l.platformConnections.list(e)}),i.oR.success(r("platform.sellerInfoRefreshed")||"Seller Info Refreshed",{description:r("platform.sellerInfoRefreshedSuccess")||"Seller information updated successfully"})},onError:e=>{(0,d.JA)(e,{title:r("platform.sellerInfoRefreshFailed")||"Refresh Failed"})}})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.