PageSourceSearch

https://hatjecantz.com/cdn/shopifycloud/checkout-web/assets/c1/d8ca7400.BX2tnq7s.js

js hatjecantz.com collected 2026-10-02 05:56:22 UTC 7,038 bytes, 1 lines download raw bytes

1import{u as e,T as X,q as g,g as j,P as K,l as Q,N as tt,h as Y,S as D,O as nt}from"./2c1ab0fe.BqEHHmaW.js";import{a4 as w,B as C,P,n as Z,h as et,bW as ot,H as it,b as at,_ as rt,bX as st,c as ut,R as ct,bu as lt,A as pt,bY as mt,l as dt}from"./164ad2e3.BA-GikTU.js";import{b as E,a as V,C as Tt}from"./efa0389a.CmzfQUTJ.js";import{N as gt}from"./33d2e4fc.CyCci7cQ.js";import{O as f,P as H,ca as ft,Q as yt}from"./4c290a1e.FJVsH4yi.js";import{r as ht}from"./dfca5da5.BUxySJFd.js";import"./app.D2gvVyTR.js";import"./65f3d4da.BdKZt11Z.js";import"./60a453ce.BClq-svk.js";import"./0a7dffce.BHf0S_6c.js";import"./bb728e1c.uhKc-SJ5.js";const I="0",M="tipping_list_options";function It({label:t}){const n=w(),o=f().checkout.configuration.layout.isOnePage.value;return e(E,{id:I,value:I,ref:n("tipping_none"),children:e(C,{inlineAlignment:"center",blockAlignment:"center",minBlockSize:"100%",children:e(P,{children:o?t:e(Z,{type:"strong",children:t})})})})}function Nt({tipOption:t}){const{amount:n,percentage:o}=t,{i18n:r}=f(),i=r.numberFormatter({style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),l=w();return e(E,{id:n.amount.toString(),value:n.amount.toString(),ref:l(`tipping_percent_${o}`),children:e(C,{inlineAlignment:"center",blockAlignment:"center",minBlockSize:"100%",children:[e(P,{children:i.format(o)}),e(P,{type:"small",color:"subdued",children:r.formatCurrency(n.amount,{currency:n.currencyCode,form:"short"})})]})})}function bt({tipOptions:t,onChange:n,proposedTip:o}){const{i18n:r}=f(),i=X(()=>[o?.amount?.amount?.toString()??I],[o?.amount?.amount]),l=g(([a])=>{n(a)},[n]);return e(Tt,{padding:"small200",children:e(V,{name:"tipping_options",values:i,onChange:l,variant:"inline",children:t.map(a=>a.amount.amount>0?e(Nt,{tipOption:a},a.amount.amount.toString()):e(It,{label:r.translate("tips.no_tip_label")},"zero-amount"))})})}function _t(){const{shop:t}=f(),n=H().buyerIdentity,o=ft();return j(()=>n.value?.presentmentCurrency??o.value?.currencyCode??t.currencyCode)}function vt(t,n){switch(n.type){case"NEGOTIATION_START":return{...t,loading:!0};case"INPUT":return{...t,customTip:n.payload,dirty:Ct(n.payload,t.negotiatedTip),error:void 0};case"NEGOTIATION_ERROR":return{...t,loading:!1,dirty:!1,...n.payload};case"NEGOTIATION_FINISH":return{...t,customTip:n.payload.customTip,loading:!1,dirty:!1,negotiatedTip:n.payload.negotiatedTip};case"CLEAR":return{...t,customTip:n.payload};default:return t}}function St(t,n){K({currencyCode:t,tipOptions:n},At);const{value:o}=H().tipLines,r=o?.[0],{i18n:i}=f(),l=$(n,r,i),{tipLines:a}=yt(),F=a.value[0],[N,L]=Q(""),{negotiate:m}=et(),y=ot(),[d,p]=tt(vt,{loading:!1,dirty:!1,negotiatedTip:r,customTip:{amount:l,currencyCode:t}}),_=g(()=>{p({type:"CLEAR",payload:{amount:"",currencyCode:t}})},[t]),x=g(async s=>{if(!s)return;const c=n?.find(({amount:u})=>u.amount===Number(s));if(!c)return;const T=U(c.amount.amount,c.amount.currencyCode),S={amount:s,currencyCode:c.amount.currencyCode};a.value=T,await m({onComplete:u=>{const b=O(u);p({type:"NEGOTIATION_FINISH",payload:{customTip:S,negotiatedTip:b}}),_()}})},[n,a,m,_]),h=g(async()=>{p({type:"NEGOTIATION_START"});const s=U(d.customTip.amount,t);a.value=s,await m({onComplete:c=>{const T=Ot(c),u={amount:$(n,O(c),i),currencyCode:t},b=O(c),k=i.formatCurrency(Number(d.customTip.amount),{currency:u.currencyCode,form:"short"}),B=T?{type:"NEGOTIATION_ERROR",payload:{customTip:u,error:T}}:{type:"NEGOTIATION_FINISH",payload:{customTip:u,negotiatedTip:b}};T&&(L(k),y()),p(B)}})},[d.customTip.amount,t,a,m,n,i,y]),R=g(s=>{p({type:"INPUT",payload:{amount:s==="undefined"?I:s,currencyCode:t}})},[t]),v=g(async()=>{a.value=[],await m({onComplete:s=>{p({type:"NEGOTIATION_FINISH",payload:{customTip:{amount:"",currencyCode:t},negotiatedTip:O(s)}})}})},[t,m,a]);return Y(()=>{l===""&&p({type:"CLEAR",payload:{amount:"",currencyCode:t}})},[l,t]),{state:d,negotiatedTip:r,invalidTipValue:N,proposedTip:F,onChange:x,onInput:R,onSubmit:h,clear:v}}function Ot(t){return t.status==="success"||t.status==="error"?t.violations.find(n=>n.__typename==="ConfirmChangeViolation")?.localizedMessage??null:null}function O(t){if(t.status==="success"||t.status==="error")return t.negotiated.tipLines?.[0]}function $(t,n,o){return!(n&&t?t.some(i=>i.amount.amount===n.amount.amount):!1)&&n?o.formatCurrency(n.amount.amount,{currency:n.amount.currencyCode,form:"plain"}):""}function U(t,n){return String(t)===I?[]:[{amount:{amount:Number(t),currencyCode:n}}]}function At({currencyCode:t,tipOptions:n}){return`currency: ${t}, tipOptions: ${JSON.stringify(n)}`}function Ct(t,n){return!n&&t.amount===I?!1:parseFloat(t.amount)!==n?.amount.amount}const Pt="QEtOP",Et="_0ZWye",Ft="RdIOQ",A={Tips:Pt,Field:Et,Error:"_7Twg0",Button:Ft},Lt=[];function Yt({renderInSection:t,hideHeading:n,headingLevel:o=2}){const{i18n:r}=f(),i=e(D,{children:[!n&&e(D,{children:[e(it,{level:o,children:r.translate("tips.title")}),e(at,{blockSize:"base"})]}),e(xt,{})]});return ht(t)?e(rt,{accessibilityLabel:r.translate("tips.title"),children:e(C,{paddingBlockEnd:"base",children:i})}):e(C,{paddingBlockEnd:"base",children:i})}
1function xt(){return e(st,{children:e(Bt,{})})}function Rt({amount:{amount:t}}){return t>0}function kt(t){return!!t?.some(Rt)}function Bt(){const{i18n:t,shop:{name:n,showTipPayments:o},shopPay:r}=f(),i=r.session.paymentMethodOption.value?.name==="SHOPIFY_INSTALLMENTS",l=_t(),{symbol:a,prefixed:F}=nt(l.value,t),{value:N=Lt}=H().tipOptions,{state:L,invalidTipValue:m,negotiatedTip:y,proposedTip:d,onChange:p,onInput:_,onSubmit:x,clear:h}=St(l.value,N),R=w(),v=y??d,s=v&&v.amount.amount>0,{loading:c,dirty:T,customTip:S,error:u}=L,[b,k]=Q(o||s?[M]:[]),B=F?{prefix:a}:{suffix:a},W="TipsInput",J=g(z=>{k(z),z.length===0&&h()},[h]);if(Y(()=>{i&&s&&h()},[i,s,h]),i)return e(V,{name:"tipping_list",values:[],variant:"block",children:e(E,{value:M,disabled:!0,tertiaryContent:e(Z,{color:"subdued",type:"small",children:t.translate("tips.not_available_with_spi")}),children:t.translate("tips.description",{shop_name:n})})});const G=parseFloat(S.amount),q=isNaN(G)||G===0?void 0:G.toString();return e(V,{name:"tipping_list",values:b,multiple:!0,onChange:J,variant:"block",children:e(E,{value:M,selectedContent:e(ut,{gap:"small-100",children:[kt(N)&&e(bt,{tipOptions:N,onChange:p,proposedTip:d}),e(ct,{onSubmit:x,children:e("div",{className:A.Tips,children:[e("div",{className:A.Field,children:e(gt,{controls:"stepper",error:!!u,id:W,name:"tipping_custom",label:t.translate("tips.custom_label"),value:q,onInput:_,...B})}),u&&e("div",{className:A.Error,children:e(lt,{errorType:pt.InputInvalid,message:u,errorValue:m,children:e(mt,{controlID:W,children:u})})}),e("div",{className:A.Button,children:e(dt,{variant:"primary",type:"submit",inlineSize:"fill",loading:c,disabled:!T,ref:R("tipping_custom_submit"),children:y&&y.amount.amount>0?t.translate("tips.update_tip"):t.translate("tips.add_tip")})})]})}),e(P,{children:t.translate("tips.message")})]}),children:t.translate("tips.description",{shop_name:n})})})}export{Lt as EMPTY_TIP_OPTIONS,Yt 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.