PageSourceSearch

https://studycafe.se/_next/static/chunks/pages/profile/subscription-d70fd6961c33d688.js

js studycafe.se collected 2026-10-08 03:20:57 UTC 7,782 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2552],{62023:function(e,r,t){"use strict";t.d(r,{Z:function(){return v}});var n=t(63366),a=t(87462),i=t(67294),o=t(86010),l=t(94780),s=t(90948),c=t(71657),u=t(1588),d=t(34867);function p(e){return(0,d.Z)("MuiCardActions",e)}(0,u.Z)("MuiCardActions",["root","spacing"]);var m=t(85893);let x=["disableSpacing","className"],g=e=>{let{classes:r,disableSpacing:t}=e;return(0,l.Z)({root:["root",!t&&"spacing"]},p,r)},f=(0,s.ZP)("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,r)=>{let{ownerState:t}=e;return[r.root,!t.disableSpacing&&r.spacing]}})(({ownerState:e})=>(0,a.Z)({display:"flex",alignItems:"center",padding:8},!e.disableSpacing&&{"& > :not(:first-of-type)":{marginLeft:8}})),b=i.forwardRef(function(e,r){let t=(0,c.Z)({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:l}=t,s=(0,n.Z)(t,x),u=(0,a.Z)({},t,{disableSpacing:i}),d=g(u);return(0,m.jsx)(f,(0,a.Z)({className:(0,o.Z)(d.root,l),ownerState:u,ref:r},s))});var v=b},18987:function(e,r,t){"use strict";t.d(r,{Z:function(){return h}});var n=t(63366),a=t(87462),i=t(67294),o=t(86010),l=t(94780),s=t(59773),c=t(90948),u=t(71657),d=t(1588),p=t(34867);function m(e){return(0,p.Z)("MuiListItemAvatar",e)}
1(0,d.Z)("MuiListItemAvatar",["root","alignItemsFlexStart"]);var x=t(85893);let g=["className"],f=e=>{let{alignItems:r,classes:t}=e;return(0,l.Z)({root:["root","flex-start"===r&&"alignItemsFlexStart"]},m,t)},b=(0,c.ZP)("div",{name:"MuiListItemAvatar",slot:"Root",overridesResolver:(e,r)=>{let{ownerState:t}=e;return[r.root,"flex-start"===t.alignItems&&r.alignItemsFlexStart]}})(({ownerState:e})=>(0,a.Z)({minWidth:56,flexShrink:0},"flex-start"===e.alignItems&&{marginTop:8})),v=i.forwardRef(function(e,r){let t=(0,u.Z)({props:e,name:"MuiListItemAvatar"}),{className:l}=t,c=(0,n.Z)(t,g),d=i.useContext(s.Z),p=(0,a.Z)({},t,{alignItems:d.alignItems}),m=f(p);return(0,x.jsx)(b,(0,a.Z)({className:(0,o.Z)(m.root,l),ownerState:p,ref:r},c))});var h=v},2209:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/subscription",function(){return t(580)}])},50591:function(e,r,t){"use strict";var n=t(2734),a=t(25812);let i=()=>{let e=(0,n.Z)();return{primaryFilled:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main},primaryLight:{color:e.palette.primary.main,backgroundColor:(0,a.E)(e.palette.primary.main,.12)},secondaryFilled:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main},secondaryLight:{color:e.palette.secondary.main,backgroundColor:(0,a.E)(e.palette.secondary.main,.12)},successFilled:{color:e.palette.success.contrastText,backgroundColor:e.palette.success.main},successLight:{color:e.palette.success.main,backgroundColor:(0,a.E)(e.palette.success.main,.12)},errorFilled:{color:e.palette.error.contrastText,backgroundColor:e.palette.error.main},errorLight:{color:e.palette.error.main,backgroundColor:(0,a.E)(e.palette.error.main,.12)},warningFilled:{color:e.palette.warning.contrastText,backgroundColor:e.palette.warning.main},warningLight:{color:e.palette.warning.main,backgroundColor:(0,a.E)(e.palette.warning.main,.12)},infoFilled:{color:e.palette.info.contrastText,backgroundColor:e.palette.info.main},infoLight:{color:e.palette.info.main,backgroundColor:(0,a.E)(e.palette.info.main,.12)}}};r.Z=i},580:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return S}});var n=t(85893),a=t(66242),i=t(90948),o=t(44267),l=t(99226),s=t(28615),c=t(81134),u=t(7631),d=t(67218),p=t(45013),m=t(11163),x=t(87952),g=t(15861);t(67294);var f=t(50591);let b=e=>{let{title:r,price:t}=e,a=(0,f.Z)();return(0,n.jsx)(l.Z,{sx:{marginTop:2,borderRadius:"4px",color:"text.primary",p:e=>e.spacing(2.25,2.75),backgroundColor:a.primaryLight.backgroundColor},children:(0,n.jsxs)(l.Z,{sx:{width:"100%",display:"flex",alignItems:"center"},children:[(0,n.jsx)(x.Z,{variant:"rounded",sx:{mr:3,width:"2.625rem",height:"2.625rem",backgroundColor:"transparent",border:e=>"1px solid ".concat(e.palette.primary.main)},children:(0,n.jsx)("img",{width:23,height:20,alt:"briefcase",src:"/images/cards/briefcase.png"})}),(0,n.jsxs)(l.Z,{sx:{width:"100%",display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column","& a":{fontWeight:500,fontSize:"0.75rem",color:"primary.main",textDecoration:"none"}},children:[(0,n.jsx)(g.Z,{sx:{fontWeight:500,fontSize:"0.875rem"},children:r}),(0,n.jsx)(g.Z,{variant:"caption",sx:{color:"primary.main"},children:"Vald plan"})]}),(0,n.jsx)(l.Z,{sx:{display:"flex"},children:(0,n.jsx)(g.Z,{variant:"h5",sx:{fontWeight:600},children:t})})]})]})})};var v=t(22120);let h=Number("3"),Z=Number("4"),w=Number("2"),k=Number("1"),y=(0,i.ZP)(o.Z)(e=>{let{theme:r}=e;return{padding:"".concat(r.spacing(20,36)," !important"),[r.breakpoints.down("xl")]:{padding:"".concat(r.spacing(20)," !important")},[r.breakpoints.down("sm")]:{padding:"".concat(r.spacing(10,5)," !important")}}}),C=e=>{switch(e){case Number("3"):return"\xc4r du s\xe4ker p\xe5 att du vill avsluta prenumerationen?";case Number("4"):return"\xc4r du s\xe4ker p\xe5 att du vill byta till standardplanen?";case Number("2"):return"\xc4r du s\xe4ker p\xe5 att du vill byta till plusplanen?";case Number("1"):return"\xc4r du s\xe4ker p\xe5 att du vill byta till basplanen?";default:return"\xc4r du s\xe4ker p\xe5 att du vill byta prenumeration?"}},I=e=>{switch(e){case Number("3"):return(0,n.jsx)(l.Z,{sx:{marginTop:2},children:"Du kan sj\xe4lvklart kunna anv\xe4nda betalfunktioner till slutet av din p\xe5g\xe5ende prenumeration"});case Number("4"):return(0,n.jsx)(b,{title:"Standard",price:"2299 kr/m\xe5n"});case Number("2"):return(0,n.jsx)(b,{title:"Premium",price:"2999 kr/m\xe5n"});case Number("1"):return(0,n.jsx)(b,{title:"Basic",price:"1499 kr/m\xe5n"});default:return}},N=e=>e===h?0:e===k?1:e===Z?2:e===w?3:-1,j=(e,r)=>{if(e===r)return!1;let t=N(e),n=N(r);return n<t||n>t},P=()=>{let{showConfirmation:e}=(0,c.p)(),r=(0,u.m)(),t=(0,m.useRouter)(),{user:i,subscription:o,refreshSubscription:l}=(0,d.a)(),{t:p}=(0,v.$G)(),x=async n=>{let a=await e({title:"\xc4ndra prenumeration",message:C(n),subContent:I(n)});if(!a)return;let s=(null==o?void 0:o.productId)&&(null==o?void 0:o.productId)!==Number("3");try{var c,u,d,p;if(s){let e;if(e=n===Number("3")?await r.stripe.cancelSubscription():await r.stripe.changeSubscription({productId:n}),await l(),!(null==e?void 0:e.ok))throw null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.detail;let a=j(o.productId,n);a?t.push("/profile/subscription/success?productId=".concat(n)):t.push("/profile/subscription/success?productId=".concat(n,"&currentPeriodEnd=").concat(e.data.currentPeriodEnd))}else{let e=await r.stripe.createSession({productId:n,organizationId:null==i?void 0:null===(u=i.activeOrganization)||void 0===u?void 0:u.id,userId:null==i?void 0:i.id,promotekitReferral:window.promotekit_referral});if(!(null==e?void 0:e.ok))throw null==e?void 0:null===(d=e.error)||void 0===d?void 0:d.detail;if(await l(),null==e?void 0:null===(p=e.data)||void 0===p?void 0:p.url){await t.replace(e.data.url);return}}}catch(e){console.error(e)}},g=(()=>{let e=!!(null==o?void 0:o.cancelAt)||!!(null==o?void 0:o.currentPeriodEnd),r=e&&(null==o?void 0:o.productId)!==(null==o?void 0:o.nextPeriodProductId),t=!!(null==o?void 0:o.cancelAt);return r||t})();return(0,n.jsx)(a.Z,{children:(0,n.jsx)(y,{children:(0,n.jsx)(s.ZP,{headerText:p("pricingPage.title"),subheaderText:p("pricingPage.subtitle"),onSelect:x,enableOwnedProduct:g,ownedProductButtonLabel:p(g?"pricingPage.pendingChangesLabel":"pricingPage.currentPlanLabel")})})})};P.acl={action:p.H.Read,subject:p.D.GeneralPage};var S=P}},function(e){e.O(0,[6886,8615,9774,2888,179],function(){return e(e.s=2209)}),_N_E=e.O()}]);

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.