PageSourceSearch

https://hugshop.dk/cdn/shopifycloud/checkout-web/assets/c1/4a3d8599.3ZyIIYd8.js

js hugshop.dk collected 2026-10-03 02:50:11 UTC 8,517 bytes, 1 lines download raw bytes

1import{u as e,l as n,s as t,U as a,V as o,x as i,q as c,m as r,T as s,S as l}from"./2c1ab0fe.GMbxnz74.js";import{b as d,a as m}from"./efa0389a.ZcaEqvMP.js";import{J as p,o as u,B as b,c8 as f,b8 as k,W as y,F as h,c as _,l as g,S as v,I as j}from"./164ad2e3.B4L1MRYB.js";import{S as C,aZ as S,W as B,cl as T,bp as A,bi as I}from"./4c290a1e.DMQ9xOwP.js";import{P as N}from"./86720dbb.DHZl5FAg.js";import{P as w}from"./598fef4e.Blg5kMTg.js";import{g as x,F as P,D as F,M as E}from"./e77f7fe0.BZPIxVUE.js";import{u as L,W as D}from"./8536083a.mfSjjx3G.js";import{u as q,a as O,S as M}from"./3a819064.DvJdzPv7.js";import"./app.DGSHpWaV.js";import"./9f047e05.DwjCPgK0.js";import"./0a7dffce.BcNpdEJk.js";import"./5fda1420.BLaDhoyL.js";import"./60a453ce.Cg9T1Gj2.js";import"./21cc90a2.Ccyorzx_.js";import"./bb728e1c.CHt2JlPY.js";import"./bff2ff9b.Cy_si-5k.js";import"./dfca5da5.BJQx_CCE.js";import"./55098bf1.SNyaSeYe.js";import"./0e67bd3b.DUa61rto.js";import"./74835653.DeaMa2xw.js";import"./31cc568e.CVMsqQ1x.js";import"./29034f35.DARWjbfB.js";import"./ac5a19ff.BchXgW63.js";import"./47b970b2.C6dKnXeF.js";import"./0727407f.DihGPUji.js";import"./064f6ac1.DPGuEQ9h.js";import"./53bbdad9.oGVvLPt2.js";import"./f3fe2775.Cg8b5yuM.js";import"./a422df8c.B9fLTQ4u.js";import"./cc6ff67d.D2x8Yxrg.js";import"./08a3b809.DDk5v8y8.js";import"./87bfafec.4CtkSIvo.js";import"./e39bc11c.D2a9UHbt.js";import"./cf29e63b.BYllFEI4.js";import"./7a8217fd.C-KSXAi3.js";import"./e477f96c.DJuIaq7S.js";import"./7114e006.DxMyqTAB.js";import"./f692f62f.DHgy7Fzw.js";import"./b684bff6.FsqZYmPf.js";import"./6720fa5f.B84Z8I3K.js";import"./58314944.D85q6ENI.js";function W({accountType:n,bankName:t,lastDigits:a,id:o}){const{i18n:i}=C();return e(d,{id:o,value:o,children:[e(p,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",padding:"none",alignItems:"center",alignContent:"center",children:[e(w,{type:x(t)}),e(u,{type:"strong",children:[t," ",e("span",{className:"vr1Ob",children:i.translate("payment.masked_digits_label",{last_digits:a})})]})]}),n&&e(b,{padding:"small-400 none none none",children:e(u,{children:(()=>{const e=n?.toLowerCase();return"checking"===e?i.translate("payment.bank_account_type.checking"):"savings"===e?i.translate("payment.bank_account_type.savings"):""})()})})]},o)}const z={id:"137c4da513561030856913c790967e4e298bea45ad3d6adfc786bc844ca55be2",type:"query",name:"StripeFinancialConnectionsClientSecret",source:""};class G extends Error{constructor(){super(...arguments),this.name="BankPaymentTokenInterceptError"}}function H(e){return{bankName:e.bankName??"",lastDigits:e.lastDigits??"",id:e.shopifyPublicToken??"",accountType:e.accountType??"savings",type:"SHOPIFY_PUBLIC_TOKEN"}}function K({method:d,setSelected:p,id:b,setIcon:I}){const{paymentProviderClientCredentials:N,availableInstruments:w}=d,{i18n:x,shop:P,observability:F}=C(),[E,K]=i(),{connectedBankAccount:R,handleBankConnectionClick:$,isLoading:Q,Sandbox:U}=function({clientCredentials:s,observability:l,onBankAccountCollected:d}){const m=q(),p=L(),u=(()=>{const{observability:e,graphql:{coreGraphql:i}}=C(),c=n(null);return t(async()=>c.current?c.current:c.current=(async({graphql:e,observability:n})=>{const t=async n=>{const{data:t,error:a}=await e.staticQuery(z,{cache:!1,variables:{input:n?{pendingTask:{taskId:n}}:{}}});return null!=a?(r(a.message),null):null==t?(r("NO_DATA"),null):t};let i=0,c="";for(;;){const e=await t(c);if(null===e)return null;const{stripeFinancialConnectionsClientSecret:n}=e;switch(n.__typename){case"StripeFinancialConnectionsClientSecretCreationFailed":return r(n.errorCode),null;case"StripeFinancialConnectionsClientSecretCreationSuccess":return n.clientSecret;case"PendingTask":if(c=n.taskId,i+=1,i>=5)return r("REACHED_MAX_POLLING"),null;await o(n.pollDelay);break;default:a(n)}}function r(e){return n.counter({name:"stripe_financial_connections_client_secret_error",value:1,attributes:{code:e}}),n.log("use_get_client_secret_stripe_client_secret_creation_failed","createStripeFinancialConnectionsClientSecret failed",{attributes:{code:e}}),null}})({graphql:i,observability:e}).finally(()=>{c.current=null}),[i,e])})(),[b,y]=i(!0),h=f(),{i18n:_}=C(),g=c(null),[v,j]=i(!1),[S,B]=i(null),[T,A]=i(null);r(()=>{(async()=>{A(await u())})()},[u]);const I=()=>{y(!1),j(!1)},N=e=>{l.leaveErrorBreadcrumb("Bank account token collection failed",{error:e}),h(_.translate("payment.bank_account_generic_error")),I()},w=O({breadcrumb:m,onBankAccountCollected:e=>{l.leaveErrorBreadcrumb("bank_account_collected",{bankAccountId:e.id,bankName:e.bankName??"",type:e.type}),B(e),d(e),I()},onModalClosed:I,onError:N,telemetry:p}),x=()=>{g.value=null};return{connectedBankAccount:S,handleBankConnectionClick:async()=>
1{if(g.value){y(!T);const e=T||await u();j(!0),e?(g.value.call.collectBankAccount(e),T&&A(null)):(y(!1),j(!1),N("No client secret")),y(!1)}},terminateSandbox:x,isLoading:b,Sandbox:e(k,{children:e(D,{wallet:"STRIPE_BANK",onConnect:async e=>{g.value=e;const n=await e.call.configure(s?.apiClientKey??"",s?.merchantAccountId??"");n?.status!==M.Success&&(l.leaveErrorBreadcrumb("Stripe Bank sandbox configuration failed",{status:n.status}),h(_.translate("payment.bank_account_generic_error"))),y(!1)},hostMethods:w,isSdkOnly:!v,isFullScreen:v,onTerminate:x})})}}({clientCredentials:N,observability:F,onBankAccountCollected:e=>{V(e??null),K(void 0)}});T(async({parts:e,reason:n})=>{const t=e.paymentLines.value.find(e=>"bank"===e.method.type);if(("completion"===n||"progression"===n)&&t){if(!J)return{behavior:"block",reason:A.MissingBankAccount,perform(){K(x.translate("payment.bank_account_missing"))}};if(!t.method.selectedToken)return F.error(new G("Bank payment blocked at completion: selectedBankAccount is set but selectedToken is missing from payment line")),{behavior:"block",reason:A.MissingBankAccount,perform(){K(x.translate("payment.bank_account_missing"))}}}return{behavior:"allow"}});const X=s(()=>[...w.map(H),...R?[R]:[]],[w,R]),{selectedBankAccount:J,setSelectedBankAccount:V}=function(e,n,a,o){const{bankPaymentTokenSignal:c}=S(),[s,l]=i(e[0]??null),d=t(e=>{e?(n(a,{type:"bank",selectedToken:e.id,selectedType:e.type}),o(e.bankName??"")):n(a,{type:"bank",selectedToken:void 0,selectedType:void 0})},[a,n,o]),m=t(e=>{l(e),c.value=e?{selectedToken:e.id,selectedType:e.type}:void 0,d(e),e&&o(e.bankName??"")},[l,d,o]),p=B().paymentLines.value;return r(()=>{const n=p.find(e=>"bank"===e.method.type)?.method;if(n)if(n.selectedToken&&n.selectedType){const t=e.find(e=>e.id===n.selectedToken);t?(l(t),o(t.bankName??"")):(c.value=void 0,d(null))}else if(s){if(!e.some(e=>e.id===s.id))return;c.value={selectedToken:s.id,selectedType:s.type},d(s)}},[e,d,p,s,o]),{selectedBankAccount:s,setSelectedBankAccount:m}}(X,p,b,I),Y=t(([e])=>{const n=X.find(n=>n.id===e);V(n??null)},[X,V]),Z=s(()=>[J?.id??""],[J?.id]),ee=Boolean(R);return e(_,{gap:"base",children:[U,E&&e(y,{tone:"critical",errorType:h.PaymentError,children:E}),X.length>0?e(l,{children:[e(_,{gap:"small-100",padding:"none none small-100 none",children:[ee?e(u,{color:"subdued",children:x.translate("payment.new_bank_account_disclaimer",{shop_name:P?.name||""})}):null,e(u,{color:"subdued",children:x.translate("payment.bank_account_disclaimer")})]}),e(m,{values:Z,onChange:Y,variant:"grid",children:X.map(n=>e(W,{...n},n.id))})]}):e(u,{children:x.translate("payment.bank_account_choose")}),e(g,{variant:"plain",textDecoration:"none",disabled:Q,onClick:$,tone:Q?"monochrome":"auto",children:e(_,{direction:"inline",alignItems:"center",gap:"small-100",minBlockSize:"10px",minInlineSize:"10px",children:[Q?e(v,{size:"base"}):e(j,{type:"plus"}),e(u,{color:"subdued",children:X.length>0?x.translate("payment.bank_account_connect_another"):x.translate("payment.bank_account_connect")})]})})]})}function R({method:n,setSelected:a,id:o,showSelectedContent:c=!0,bare:r=!1}){const{i18n:s}=C(),l=n.availableInstruments[0]?.bankName,m=l?[x(l)]:F,[p,b]=i(m),[f,k]=i(l?void 0:E),y=n.displayName??s.translate("payment.bank_payment_method_label"),h=t(e=>{b([e?x(e):P]),k(void 0)},[]);if(r)return e(K,{id:o,method:n,setIcon:h,setSelected:a});const _=I(s,p,f),g=_?`${y}, ${_}`:y;return e(d,{renderSelectedContentWhenCollapsed:!0,secondaryContent:e(N,{paymentBrands:p,brandCountOverride:f}),value:o,accessibilityLabel:g,selectedContent:c?e(K,{id:o,method:n,setIcon:h,setSelected:a}):void 0,children:e(u,{type:"strong",children:y})})}export{R as BankPaymentMethod,K as BankPaymentMethodDetails};

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.