1import{m as c,n as l,d as m,ar as p,au as u,j as h,av as f,a as v,l as y}from"./app-6d16514d.js";import{C as b}from"./CreditCardForm-a10ed2f2.js";import{m as g,c as w}from"./dateUtils-9576e410.js";/* empty css */const C={emits:["selectCard"],props:{card:Object},computed:{...c("window",["pageWidth","pageHeight"])}};var x=function(){var e=this,s=e._self._c;return s("label",{staticClass:"credit-card-detail-group address-detail-group flex justify-between items-center rounded-lg px-4 text-black"},[s("div",{staticClass:"flex w-full"},[s("div",{staticClass:"flex-none m-auto"},[s("input",{staticClass:"mr-4",attrs:{type:"radio",name:"credit_card"},on:{click:function(a){return e.$emit("selectCard",e.card.arb_id)}}})]),e._v(" "),s("div",{staticClass:"grow flex-col w-full"},[s("div",{},[e._v(e._s(e.card.card_type==="MasterCard"&&this.pageWidth<501?"MC":e.card.card_type)+" **** **** **** "+e._s(e.card.pan_last_four))]),e._v(" "),s("div",{staticClass:"credit-card-billing-address"},[e._v("\n\n "+e._s(e.card.address.address_1)+"\n "),e.card.address.address_2?s("span",[e._v(e._s(e.card.address.address_2))]):e._e(),e._v("\n "+e._s(e.card.address.city)+", "+e._s(e.card.address.state)+" "+e._s(e.card.address.zip)+"\n "+e._s(e.card.address.country)+"\n ")])]),e._v(" "),s("div",{staticClass:"flex-none m-auto"},[e._v("Exp: "+e._s(e.card.exp_month)+"/"+e._s(e.card.exp_year.slice(-2)))])])])},S=[],k=l(C,x,S,!1,null,"1cc2daa1",null,null);const $=k.exports;const E={unsubscribe:null,mixins:[m,p],components:{CreditCardDetails:$,AddressSelectForm:u,CreditCardForm:b},props:{modalProps:{}},watch:{address_form_type(t,e){this.$emit("content-changed")},ask_to_use_same_address(t,e){this.$emit("content-changed")},show_card_select(t,e){this.$emit("content-changed")},show_card_form(t,e){this.$emit("content-changed")},show_address_select(t,e){this.$emit("content-changed")}},data(){return{post_submit_rehydration_in_progress:!1,current_form:"credit-card-select",baseUrl:"/ajax/user/sale_registration",add_credit_url:"/account/add-credit-card",update_credit_url:"/account/update-credit-card",deferFormInit:!0,inputs:{},query_params:{timestamp:""},monthOptions:g,yearOptions:w}},computed:{...c("auction",["auction_room_url"]),...c("user",{user_fd_key:t=>{var e;return(e=t.record)!=null&&e.LOGGED_IN?t.record.fd_key:null}}),...c("card_and_address",{ADDRESS_FORM_TYPES:"ADDRESS_FORM_TYPES",address_form_type:"address_form_type",ask_to_use_same_address:"ask_to_use_same_address",show_card_select:"show_card_select",show_card_form:"show_card_form",show_address_select:"show_address_select"}),...h("auction",["selectedSession"]),address_form_title(){var t,e,s;return f((s=(e=(t=this.address_form_type)==null?void 0:t.split("_address"))==null?void 0:e[0])!=null?s:"")+" Address"},isLive(){var e;return(parseInt((e=this.selectedSession)==null?void 0:e.start_date)*1e3-Date.now()||0)/1e3/60<=10}},methods:{...v("user",["initUser"]),...y({hideModal:"modals/hideModal",set_property:"card_and_address/set_property",set_form_type:"card_and_address/set_form_type"}),selectCard(t){this.form.selected_card=t.arb_id,this.form.billing_selected_address=t.address_id},passesValidation(){return this.validate_card_form()},async preProcess(){this.map_form_fields(!0),this.query_params.timestamp=new Date().getTime(),this.query_string=this.parameterize_object(this.query_params);const t=this.form.selected_card?this.update_credit_url:this.add_credit_url;await d.refreshTokenHeader(),this.form._token=this.$page.props.CSRF_TOKEN,await this.form.post(t).then(e=>{this.form.payment_method=e.arb_id,this.form.selected_card=e.arb_id,this.post_submit_rehydration_in_progress=!0}).catch(e=>{var s,a,o,i,_;this.error=e==null?void 0:e.response,(a=(s=this.error)==null?void 0:s.data)!=null&&a.errors?this.form.withErrors(this.error.errors):this.form.withErrors({general:[(_=(i=(o=this.error)==null?void 0:o.data)==null?void 0:i.message)!=null?_:"Server Error"]}),this.map_form_fields(),this.post_submit_rehydration_in_progress=!1,this.prevent_submit=!0,this.set_card_and_address_state(),setTimeout(()=>{const n=d.CreditCardSelectModal.$el.querySelector(".parsley-error:first-of-type");n&&n.scrollIntoView({behavior:"smooth",block:"center"})}
1,1)})},async onSuccess(){this.post_submit_rehydration_in_progress=!0,this.$store.state.modals.skip_recompute=!0,this.initUser(),this.hideModal()},async finally(){this.map_form_fields()},async onError(t){this.post_submit_rehydration_in_progress=!1,this.set_card_and_address_state(),setTimeout(()=>{const e=d.CreditCardSelectModal.$el.querySelector(".parsley-error:first-of-type");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},1)},toggle_cc_form(){this.set_property({key:"show_card_select",value:!this.show_card_select}),this.set_property({key:"show_card_form",value:!this.show_card_select}),this.set_form_type(this.ADDRESS_FORM_TYPES.billing),this.asked_to_use_same_address=!1,this.form.selected_card=""}},mounted(){var t,e;this.unsubscribe=this.$store.subscribe(s=>{switch(s.type){case"user/updateUserSaleRegistrationInStore":this.hideModal();break}}),this.set_card_and_address_state(),this.inputs={...this.gather_credit_card_form_data(),registration_cc:!0,user_fd_key:this.user_fd_key,auction_fd_key:(t=this.modalProps)==null?void 0:t.auction_fd_key,session_fd_key:(e=this.modalProps)==null?void 0:e.session_fd_key},this.setForm()},beforeDestroy(){this.reset_address_form(),this.unsubscribe()}};var M=function(){var a,o,i,_,n;var e=this,s=e._self._c;return s("div",{staticClass:"payment-select"},[e.post_submit_rehydration_in_progress||e.form.processing?s("spinner",{attrs:{dark:"true"}}):e._e(),e._v(" "),s("form",{directives:[{name:"show",rawName:"v-show",value:!e.form.processing&&!e.post_submit_rehydration_in_progress,expression:" !form.processing && !post_submit_rehydration_in_progress "}],staticClass:"flex flex-col",on:{submit:function(r){return r.preventDefault(),e.submitForm.apply(null,arguments)}}},[e.formOtherSubmitError?s("div",{staticClass:"mb-8 error note-box danger text-center",domProps:{innerHTML:e._s(e.formOtherSubmitError)}}):e._e(),e._v(" "),e.form.errors.has("expires_soon")?s("div",{staticClass:"mb-8 error note-box danger text-center",domProps:{innerHTML:e._s((i=(o=(a=e.form)==null?void 0:a.errors)==null?void 0:o.get("expires_soon"))==null?void 0:i.join(" "))}}):e._e(),e._v(" "),e.ask_to_use_same_address?s("div",[s("h2",{staticClass:"flex items-center"},[e._v("Shipping Address")]),e._v(" "),s("p",[e._v("Would you like to use this address as your shipping address?")]),e._v(" "),e.card_billing_address_full?s("p",{staticClass:"italic"},[e._v(e._s(e.card_billing_address_full))]):e._e(),e._v(" "),s("div",{staticClass:"flex justify-center mt-10 mx-20"},[s("button",{staticClass:"w-btn w-btn-grey-outline mr-4 btn-bsas-no",on:{click:function(r){return e.dontUseSameAddress(!1)}}},[e._v("no")]),e._v(" "),s("busy-button",{attrs:{button_classes:"w-btn w-btn-grey-solid btn-bsas-yes",button_type:"button",busy:e.form.processing},on:{click:e.useSameAddress}},[e._v("\n yes\n ")])],1)]):s("div",[s("div",{directives:[{name:"show",rawName:"v-show",value:e.show_card_select||e.show_card_form,expression:" show_card_select || show_card_form "}],staticClass:"mb-8"},[s("h2",{staticClass:"flex items-center mb-4"},[e._v("Credit Card Details")]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.show_card_select,expression:" show_card_select "}],staticClass:"payment-list flex flex-col"},[s("div",{staticClass:"mb-4",class:{"error note-box danger":e.form.errors.has("selected_card")}},[e._v("Please select a\n credit card below.\n ")]),e._v(" "),s("div",{staticClass:"inner"},e._l(e.creditCards,function(r){return s("credit-card-details",{key:"credit-card-".concat(r.arb_id),class:{active:e.form.selected_card===r.arb_id},attrs:{card:r},on:{selectCard:function(P){return e.selectCard(r)}}})}),1),e._v(" "),s("span",{staticClass:"add-card ml-auto"},[e._v("\n\n + "),s("a",{staticClass:"cursor-pointer",on:{click:e.toggle_cc_form}},[e._v("add a new credit card")])])]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.show_card_select&&e.show_card_form,expression:" !show_card_select && show_card_form "}],staticClass:"new-card flex flex-col"},[s("div",{staticClass:"mb-4",class:{"error note-box danger":e.form.errors.has("selected_card")}},[e._v("Please add a new\n credit card.\n ")]),e._v(" "),s("credit-card-form",{attrs:{form:e.form,"month-options":e.monthOptions,"year-options":e.yearOptions}}),e._v(" "),(_=e.creditCards)!=null&&_.length?s("span",{staticClass:"add-card ml-auto mt-4"},[e._v("\n\n + "),s("a",{staticClass:"cursor-pointer",on:{click:e.toggle_cc_form}}
1,[e._v("use an existing credit card")])]):e._e()],1)]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.show_card_select,expression:" !show_card_select "}]},[s("h2",{staticClass:"flex items-center"},[e._v(e._s(e.address_form_title))]),e._v(" "),e.address_form_type==e.ADDRESS_FORM_TYPES.shipping?s("div",{staticClass:"flex w-full m-auto mb-10"},[e.form.shipping_selected_address?s("p",[e._v("\n\n Updating your default shipping address will apply to all upcoming invoices. Your shipping address dictates\n your sales tax on your final invoice. If you have any questions please contact "),s("a",{attrs:{href:"mailto:".concat(e.$page.props.contact_payments_email)}},[e._v(e._s(e.$page.props.contact_payments_email))]),e._v(".\n ")]):s("p",[e._v("\n\n Your default shipping address dictates your sales tax on your final invoice. If you have any questions\n please contact "),s("a",{attrs:{href:"mailto:".concat(e.$page.props.contact_payments_email)}},[e._v(e._s(e.$page.props.contact_payments_email))]),e._v(".\n ")])]):e._e(),e._v(" "),s("address-select-form",{attrs:{form:e.form},scopedSlots:e._u([{key:"address-select-form-header",fn:function(){return[s("div",{staticClass:"mb-4"},[e._v("Please enter address below")])]},proxy:!0},{key:"address-view-form-title",fn:function(){return[e._v("add a new address")]},proxy:!0},{key:"address-view-select-title",fn:function(){return[e._v("view address book")]},proxy:!0}])})],1),e._v(" "),s("div",{staticClass:"flex justify-center mt-10 mx-20"},[e.address_form_type==e.ADDRESS_FORM_TYPES.shipping&&e.asked_to_use_same_address?s("a",{staticClass:"w-btn w-btn-grey-outline mr-4",on:{click:e.set_card_and_address_state}},[e._v("go back")]):e._e(),e._v(" "),s("busy-button",{attrs:{button_type:"button",button_classes:"w-btn w-btn-grey-solid btn-continue",busy:e.form.processing},on:{click:e.submitForm}},[e._v("\n continue\n ")])],1),e._v(" "),!e.selectedSession.is_timed&&e.isLive?s("div",{staticClass:"just-watch align-middle flex w-full mt-6"},[s("a",{staticClass:"mx-auto",attrs:{href:e.auction_room_url}},[e._v("Watch live without registering to bid")])]):e._e()]),e._v(" "),e.hasFormValidationErrors||((n=e.error)==null?void 0:n.status)==500?s("div",{staticClass:"flex flex-col note-box danger"},[s("div",{staticClass:"text-center"},[e._v("Error saving. Please try again or contact "),s("a",{attrs:{href:"mailto:".concat(e.$page.props.email_webmaster)}},[e._v(e._s(e.$page.props.email_webmaster))])])]):e._e()])],1)},D=[],F=l(E,M,D,!1,null,"0dbd9166",null,null);const j=F.exports;export{j 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.