1import{P as M,Q as _,r,x as J,v as V}from"./entry.Qot5eQPL.js";const Q=M("order",()=>{const{userApiV2BaseUrl:o,userApiV3BaseUrl:U}=_(),k=r({reason_id:null,subscription_number:null}),f=r({}),C=r([]),p=r(!1),u=r(),h=r(!1),i=r(!1),m=r(!1),R=r(!1),b=r([{id:5,title:"Jeg har fundet et bedre alternativ til Bold+"},{id:11,title:"Brugeroplevelsen på Bold+ er forvirrende og ikke intuitiv."},{id:24,title:"Jeg synes at Bold+ er for dyrt"},{id:26,title:"Der er for lidt interessant indhold på Bold+"},{id:30,title:"Teknikken driller på Bold (app og web)"},{id:35,title:"Jeg skulle kun have adgang til én bestemt kamp/artikel på Bold+"}]);(e=>{for(let t=e.length-1;t>0;t--){const s=Math.floor(Math.random()*(t+1));[e[t],e[s]]=[e[s],e[t]]}})(b.value),b.value.push({id:19,title:"Anden årsag"});const c=r(!1),g=r({}),B=r({}),d=r(!1),$=r(!1),S=r(null),A=r(!0),y=J(),{tokens:l,isAuthenticated:v}=V(y),a=y.$fetchAuth,n=()=>"Bearer "+l.value.boldUserAccessToken,O=e=>c.value=e,E=async e=>a(`${o.value}/payment/mobilepay_v2/step1`,{method:"post",body:e.value,onResponse:({response:t})=>{t.status===200&&(g.value=t._data)},onResponseError:async({response:t})=>{}}),T=async e=>a(`${o.value}/payment/creditcard/${e.step}`,{method:"post",body:e,onResponse:({response:t})=>{t.status===200&&(g.value=t._data,c.value=!1)},onResponseError:({response:t})=>{c.value=!0,console.error("Error response received:",t)}}),L=e=>{if(d.value=!0,v){let t=o.value+`/payment/status/${e}`;if(l.value.boldUserAccessToken&&e)return a(t,{server:!1,immediate:!1,headers:{authorization:n()}}).then(s=>{B.value=s,d.value=!1}).catch(s=>{u.value=null,d.value=!1})}},P=()=>{if(v.value){p.value=!0;let e=U.value+"/auth/subscriptions";if(l.value.boldUserAccessToken)return a(e,{server:!1,immediate:!1,headers:{authorization:n()}}).then(t=>{if(f.value=t,C.value=Array.isArray(t)?t:[t],p.value=!1,t.subscriptionNumber)return z(t.subscriptionNumber)}).catch(t=>{t?.response?.status===401&&y.logout(!0),f.value={}})}},z=e=>{if(v){h.value=!0;let t=o.value+"/boldplus/subscription/task/status/";if(l.value.boldUserAccessToken&&e)return a(t+e,{server:!1,immediate:!1,headers:{authorization:n()}}).then(s=>{u.value=s,h.value=!1}).catch(s=>{u.value=null})}};return{orderProcessingError:c,setOrderProcessingError:O,placeMobilepayOrderV2:E,placeCreditCardOrder:T,getUserSubscriptions:P,getSubscriptionStatus:z,cancelSubscription:()=>(i.value=!0,a(`${o.value}/boldplus/subscription/cancellation`,{method:"post",server:!1,immediate:!1,headers:{authorization:n()},body:k.value}).then(e=>(i.value=!1,e==null?(m.value=!0,console.log("cancel",e)):R.value=!0,e)).catch(e=>{i.value=!1,m.value=!0})),checkOrderStatus:L,getRSASignature:e=>{if(v){A.value=!0;let t=o.value+"/payment/RSASignature";if(l.value.boldUserAccessToken)return a(t,{method:"post",server:!1,immediate:!1,headers:{authorization:n()},body:e}).then(s=>{S.value=s,A.value=!1}).catch(s=>{S.value=null})}},commitCreditCardChange:async e=>($.value=!0,a(`${o.value}/payment/customer`,{method:"patch",server:!1,immediate:!1,headers:{authorization:n()},body:e}).then(t=>($.value=!1,t))),cancelSubscriptonByProductCode:e=>a(`${o.value}/subscription/cancel/${e}`,{method:"post",server:!1,immediate:!1,headers:{authorization:n()}}),subscription:f,subscriptions:C,subscriptionStatus:u,subscriptionLoading:p,subscriptionStatusLoading:h,cancelSubscriptionLoading:i,cancellationOfSubscriptionError:m,showConfirmationCancelMessage:R,cancelSubscriptionForm:k,cancelSubscriptionReasons:b,orderResponse:g,orderStatusResponse:B,loadingOrderStatus:d,RSASignature:S,RSASignatureLoading:A}});export{Q as u};
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.