PageSourceSearch

https://www.linksys.com/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblemsModal.BEqxmZGR.js

js linksys.com collected 2026-09-24 08:40:12 UTC 5,128 bytes, 1 lines download raw bytes

1import{u as n,T as A,k as q,q as g,h as k,f as W,i as $}from"./esnext-vendor.D7ldIee_.js";import{bo as K,B,G as Q,k as N,l as R,i as D,bp as Y,bq as V,br as X,D as Z,bs as ee,O as te,bt as ne}from"./hydrate.ByRIsqvd.js";import{N as h,bx as L,$ as ae,bb as re,a0 as F,O as oe,aa as ie,ad as se,by as le,an as ce}from"./addresses-is-address-empty.-MuOhIyI.js";import{u as de}from"./stock-problems-useStockProblemsState.CP-sNfHY.js";import{U as ue}from"./embed-deferred.9gwgYB2W.js";import{u as me,S as T}from"./components-RedirectionNotice.module.CqgkZHXB.js";import{S as pe}from"./StockProblems-StockProblemsLineItemList.Di56mnXD.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.js";function z({progressing:e,onClick:t,cartEmpty:r,inlineSize:a}){const{i18n:o,embed:d}=h(),s=r&&!L(d?.embedder);return n(D,{variant:"primary",disabled:e,loading:e,onClick:t,inlineSize:a,children:s?o.translate("stock.return_to_store_label"):o.translate("stock.continue_cta_label")})}function be({progressing:e,onSecondaryClick:t}){const{i18n:r,url:a,observability:o}=h();return n(D,{onClick:async()=>{try{await t()}catch(s){o.leaveErrorBreadcrumb("Error negotiating before returning to cart",{error:s})}finally{window.location.replace(a.cart())}},variant:"plain",disabled:e,children:n(N,{direction:"inline",gap:"small-200",alignItems:"center",children:n(R,{children:r.translate("general.back_to_cart")})})})}function ge(e){const{shop:t,embed:r}=h(),{isAppLayout:a}=K(),o=L(r?.embedder);if(!t.hasStorefront&&e.cartEmpty&&!o)return null;const{primary:d,secondary:s}=he(t.hasStorefront,e,a,o);return n(Q,{alignItems:"center",alignContent:"center",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",gap:"large-300",...o?{gridTemplateColumns:"1fr",inlineSize:"100%"}:{gridTemplateColumns:"@media (inline-size >= extraSmall) 'minmax(auto, max-content) minmax(auto, max-content)', none",justifyContent:"@media (inline-size >= extraSmall) end, ''",justifyItems:"@media (inline-size >= extraSmall) end, ''"},children:[n(B,{display:"@media (inline-size >= extraSmall) auto, none",children:s}),d,n(B,{display:"@media (inline-size >= extraSmall) none, auto",inlineAlignment:"center",children:s})]})}function he(e,t,r,a){return e?{primary:t.cartEmpty&&r&&!a?null:n(z,{...t,inlineSize:a?"fill":void 0}),secondary:t.cartEmpty||a||r&&!t.cartEmpty?null:n(be,{...t})}:!e&&!t.cartEmpty?{primary:n(z,{...t,inlineSize:a?"fill":void 0})}:{}}function ye({lineItems:e,showLineItems:t=!0,cartEmpty:r,type:a,subtitle:o}){const d=ae(),{value:s}=d.merchandiseLines,p=re("merchandiseLines").value,{progress:b,progressing:P}=F(),u=oe().merchandiseLines,f=Y(),{observability:x,router:_,embed:v}=h(),{currentDetour:O}=ie().value,M=A(()=>s?.lines??[],[s]),[C,G]=q(p);se("stock_problems"),me({stage:C?T.Loading:T.Complete,id:"StockProblems"});const U=r&&L(v?.embedder),E=g(l=>{const i=u.value;u.value=i.filter(({stableId:y})=>!l.includes(y))},[u]),J=g(()=>{le(v,ue)},[v]),I=A(()=>M.reduce((l,i)=>({...l,[i.stableId]:i}),{}),[M]),S=g(({removeUnavailableMerchandise:l=!1}={})=>{const i=u.value,y=i.flatMap(m=>{const c=I[m.stableId];return l&&(!c||c.quantity===0)?[]:!c||c.quantity===0?[m]:m.quantity===c.quantity&&m.totalPrice===c.totalPrice?[m]:[{...m,quantity:c.quantity,totalPrice:c.totalPrice}]});y.length===i.length&&y.every((m,c)=>m===i[c])||(u.value=y)},[I,u]),j=g(async()=>{const l=e.filter(({problem:i})=>V(i.type)).map(({line:i})=>i.stableId);l.length&&E(l),S({removeUnavailableMerchandise:!0}),x.log("stock_problems_actions_submitted","Stock problems actions submitted",{unshippableMerchandiseIds:JSON.stringify(l),currentDetour:JSON.stringify(O),routerCurrentUrl:_.currentUrl.value.normalizedPath}),await b("checkout-stock-problems-submit")},[O,e,x,b,E,_,S]),w=X(),H=g(async()=>{await w(e)},[w,e]);return k(function(){S()},[M,S]),k(()=>{p||(G(!1),f.notify({checkout_in_progress:!1}))},[p,C,f]),n(ee,{message:o,errorType:Z.InventoryError,children:n(N,{gap:"large-200",children:[n(R,{children:o}),t&&e.length>0?n(pe,{lineItems:e,loading:C,type:a}):null,n(ge,{cartEmpty:r,progressing:P.value,onClick:U?J:j,onSecondaryClick:H})]})})}function Ee(){const{observability:e,checkout:{wallets:t}}=h(),{canBeDismissed:r,...a}=de(),{progress:o}=F(),[d,s]=q(!0),p=W(()=>t.activeSession.value?.wallet!=="GOOGLE_PAY"),{checkoutProtocolModalEventSignal:b}=ce(),P=g(()=>{o("stock-problems-modal-close",()=>{s(!1)})},[o]),u=r?{blocking:!1,onHide:P}:{blocking:!0};k(()=>()=>{b.value="none"},[b]);const f=()=>{e.leaveErrorBreadcrumb("Stock problems modal opened",{type:a.type}),b.value="stockProblems"};return n($,{when:p,children:[n(fe,{state:a}),n(te,{section:"stock-problems",children:n(ne,{id:"stock-problems-modal",open:d,heading:a.title,size:"large",onShow:f,...u,children:n(ye,{...a}
1)})})]})}function fe({state:e}){const{observability:t}=h();return k(()=>{e.lineItems.length!==0&&t.leaveErrorBreadcrumb("Displaying stock problems modal",{type:e.type,lineItems:e.lineItems.map(r=>({stableId:r.line.stableId,problem:r.problem.type}))})},[t,e.lineItems,e.type]),null}export{Ee as default};

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.