1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];if(null!=t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:eden":!0});var a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="1e6766a0-09f5-4455-9908-ee7fbacb9149",e._sentryDebugIdIdentifier="sentry-dbid-1e6766a0-09f5-4455-9908-ee7fbacb9149")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14],{1496:(e,a,t)=>{"use strict";t.d(a,{O:()=>N});var r=t(27707),n=t(53972),s=t(60441),i=t(82590),l=t(6603),c=t(45768),o=t(3379),d=t(84961),u=t(20382),p=t(78057),f=t(15134),m=t(96255),h=t(51054),x=t(23245),y=t(16410),g=t(21647),b=t(62877),v=t(81573),j=t(33954),C=t(92027);let E=(0,m.LB)(3),N=({open:e,onClose:a,initialView:t="verify-email",oauthClientName:m})=>{let{t:N}=(0,d.B)(),{showErrorToast:w,showSuccessToast:k}=(0,v.d)(),{mutateAsync:A}=j.i.auth.resendVerificationLink.useMutation(),S=(0,l.useRouter)().asPath,{update:_,data:I}=(0,c.useSession)({required:!0}),M=(0,b.A)(),R=I?.user?.originalEmail??I?.user?.email,{mutateAsync:P,isPending:L}=j.i.user.changeUnverifiedEmail.useMutation(),[T,D]=(0,o.useState)("change-email"===t),[O,U]=(0,o.useState)(""),[F,B]=(0,o.useState)(""),[$,q]=(0,o.useState)(""),[V,G]=(0,o.useState)(0),H=(0,o.useRef)(null);(0,o.useEffect)(()=>{T&&R&&U(R)},[T,R]),(0,o.useEffect)(()=>{e&&(0,C.bq)({event_name:p.ay.OPENED_VERIFY_EMAIL_DIALOG})},[e]),(0,o.useEffect)(()=>{e&&"change-email"===t&&(0,C.bq)({event_name:p.ay.START_CHANGE_EMAIL})},[e,t]);let K=async()=>{if(!(0,f.x)(O))return void B(N("email-form-error"));if(O===R)return void B(N("verify-email-dialog-same-email-error"));(0,C.bq)({event_name:p.ay.COMPLETED_CHANGE_EMAIL});try{await P({newEmail:O,captchaToken:$}),await _(),a(),k(N("verify-email-dialog-email-changed-success"))}catch(e){G(e=>e+1),e.message===u.iR.USER_NOT_ALLOWED?w(N("auth-user-not-allowed")):w(N("verify-email-dialog-email-change-error"),e)}};(0,o.useEffect)(()=>{_()},[]),(0,o.useEffect)(()=>(m&&(H.current=setInterval(()=>{_()},E)),()=>{H.current&&clearInterval(H.current)}),[m,_]),(0,o.useEffect)(()=>{M&&(H.current&&clearInterval(H.current),a())},[M,a]);let z=async()=>{if(R){(0,C.bq)({event_name:p.ay.RESUBMIT_EMAIL_DIALOG});try{await A({email:R,originUrl:S,oauthClientName:m||void 0,captchaToken:$}),a(),k(N("verify-email-dialog-resent-success"))}catch(e){G(e=>e+1),w(N("verify-email-page-resent-error-message"),e)}}};return(0,r.jsx)(x.N,{onClose:a,open:e,"data-sentry-element":"FVDialog","data-sentry-component":"VerifyEmailDialog","data-sentry-source-file":"VerifyEmailDialog.tsx",children:(0,r.jsxs)(y.g,{"data-sentry-element":"FVDialogContent","data-sentry-source-file":"VerifyEmailDialog.tsx",children:[(0,r.jsx)(g.P,{"data-sentry-element":"FVDialogTitle","data-sentry-source-file":"VerifyEmailDialog.tsx"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 pt-3",children:[T&&(0,r.jsxs)(n.$,{onClick:()=>{G(e=>e+1),D(!1)},size:"24",variant:"text",className:"self-start -translate-x-2",children:[(0,r.jsx)(s.Y,{}),N("back")]}),(0,r.jsx)("div",{className:"flex gap-4 justify-between",children:(0,r.jsx)("p",{className:"typography-header-heading-sm",children:T?N("verify-email-dialog-change-email-title"):N("verify-email-dialog-check-email-title")})}),(0,r.jsxs)("p",{className:"typography-body-default-16px-regular text-left",children:[N("verify-email-dialog-sent-link"),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"break-words",children:R})]}),(0,r.jsx)("p",{className:"typography-body-default-16px-regular text-left -mt-1",children:N("verify-email-dialog-check-inbox")}),T?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{fullWidth:!0,placeholder:R,value:O,onChange:e=>{U(e.target.value),B("")},error:!!F,helperText:F}),(0,r.jsx)(n.$,{variant:"primary",className:"w-full",onClick:K,disabled:L||!$,children:N("verify-email-dialog-submit-new-email")}),(0,r.jsx)(n.$,{variant:"secondary",className:"w-full",onClick:()=>{G(e=>e+1),D(!1)},children:N("verify-email-dialog-go-back")})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"typography-body-default-16px-regular text-left",children:N("verify-email-dialog-havent-found")}),(0,r.jsx)(n.$,{variant:"primary",className:"w-full",onClick:z,disabled:!$,children:N("resend-email-send-again")}),(0,r.jsx)(n.$,{onClick:()=>{(0,C.bq)({event_name:p.ay.START_CHANGE_EMAIL}),G(e=>e+1),D(!0)},variant:"tertiary",disabled:!$,children:N("verify-email-dialog-change-email")})]}),(0,r.jsx)(h.B,{onVerify:e=>{q(e)},onExpire:()=>{q("")},action:T?"changeUnverifiedEmail":"resendVerificationLink",styles:{paddingTop:0},"data-sentry-element":"Captcha","data-sentry-source-file":"VerifyEmailDialog.tsx"},V)]})]})})}},3732:(e,a,t)=>{"use strict";t.d(a,{N:()=>h});var r=t(27707),n=t(65108),s=t(23354),i=t(97592),l=t(91934),c=t(54389),o=t(27549),d=t(84961);let u={"read:fan":"read_account","read:insights":"read_account","read:creator":"read_account","read:self":"read_account","read:agency":"read_account","read:chat":"messages","write:chat":"messages","read:media":"content","write:media":"content","read:post":"content","write:post":"content","read:experience":"content","write:experience":"content","read:tracking_links":"content","write:tracking_links":"content","write:creator":"settings","write:agency":"settings"},p=Object.keys(u),f=["read_account","messages","content","settings"],m={read_account:(0,r.jsx)(n.b,{}),messages:(0,r.jsx)(s.b,{}),content:(0,r.jsx)(i.x,{}),settings:(0,r.jsx)(l.D,{})},h=({clientName:e,clientLogoUrl:a,grantableScopes:t,unavailableScopes:n=[],incompatibleAccount:s=!1,isLoading:i,onAllow:h,onDeny:x})=>{let{t:y}=(0,d.B)(),g={"read:chat":y("oauth.scopes.read-chat"),"read:creator":y("oauth.scopes.read-creator"),"read:experience":y("oauth.scopes.read-experience"),"read:fan":y("oauth.scopes.read-fan"),"read:insights":y("oauth.scopes.read-insights"),"read:media":y("oauth.scopes.read-media"),"read:post":y("oauth.scopes.read-post"),"read:self":y("oauth.scopes.read-self"),"read:tracking_links":y("oauth.scopes.read-tracking-links"),"write:chat":y("oauth.scopes.write-chat"),"write:creator":y("oauth.scopes.write-creator"),"write:experience":y("oauth.scopes.write-experience"),"write:media":y("oauth.scopes.write-media"),"write:post":y("oauth.scopes.write-post"),"write:tracking_links":y("oauth.scopes.write-tracking-links"),"read:agency":y("oauth.scopes.read-agency"),"write:agency":y("oauth.scopes.write-agency")},b=e=>{let a=(e=>{let a=new Set(e);return f.map(e=>({id:e,scopes:p.filter(t=>u[t]===e&&a.has(t))})).filter(e=>e.scopes.length>0)})(e).flatMap(e=>e.scopes.map(a=>({id:a,icon:m[e.id],label:g[a]}))),t=new Set(a.map(e=>e.id));return[...a,...(0,o.CSV)(e).filter(e=>!t.has(e)).map(e=>({id:e,icon:(0,r.jsx)(l.D,{}),label:e}))]},v=0===t.length&&n.length>0,j=s?{variant:"warning",content:y("oauth.consent.creator-only")}:v?{variant:"warning",content:y("oauth.consent.not-compatible")}:{variant:"info",content:y("oauth.consent.revoke-info")};return(0,r.jsx)(c.G,{translations:{headline:y("oauth.consent.headline",{clientName:e}),scopesIntro:y("oauth.consent.app-will-be-able"),unavailableScopesIntro:y("oauth.consent.unavailable-heading"),allow:y("oauth.consent.allow-access"),deny:y("oauth.consent.deny")},clientName:e,clientLogoUrl:a,permissions:b(t),unavailablePermissions:b(n),notice:j,loading:i,allowDisabled:s||v,onAllow:h,onDeny:x,"data-sentry-element":"OAuthConsentScreen","data-sentry-component":"OAuthConsentView","data-sentry-source-file":"OAuthConsentView.tsx"})}},15134:(e,a,t)=>{"use strict";t.d(a,{x:()=>n});var r=t(32051);let n=e=>!!e&&e.length<=r.Bb&&/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i.test(e)},15417:(e,a,t)=>{"use strict";t.d(a,{A:()=>u});var r=t(27707),n=t(92782),s=t(53972),i=t(3379),l=t(84961),c=t(33623),o=t(37495),d=t(90884);let u=({description:e,isConsistent:a,isOffered:t,isRetired:u,isSaving:p,onSave:f,priceCents:m,title:h})=>{let{t:x}=(0,l.B)(),[y,g]=(0,i.useState)(t),[b,v]=(0,i.useState)(m??c.YE),[j,C]=(0,i.useState)({isOffered:t,priceCents:m,isConsistent:a});(j.isOffered!==t||j.priceCents!==m||j.isConsistent!==a)&&(C({isOffered:t,priceCents:m,isConsistent:a}),g(t),v(m??c.YE));let E=void 0!==b&&Number.isInteger(b)&&b>=c.YE&&b<=c.yk,N=y?E&&!u&&(b!==m||!a):t,w=y&&!E?x("experience-action-pricing.price-error",{min:(0,o.$g)(c.YE),max:(0,o.$g)(c.yk)}):void 0;return(0,r.jsxs)("div",{className:"space-y-3 rounded-md border border-border-primary bg-surface-primary p-3","data-sentry-component":"ExperienceA
1ctionPriceRow","data-sentry-source-file":"ExperienceActionPriceRow.tsx",children:[(0,r.jsx)(n.S,{checked:y,disabled:p||u&&!y,onCheckedChange:e=>g(!0===e),label:h,"data-sentry-element":"Checkbox","data-sentry-source-file":"ExperienceActionPriceRow.tsx"}),u?(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-tertiary",children:x("experience-action-pricing.retired-note")}):null,a?null:(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-warning-content",children:x(u?"experience-action-pricing.inconsistent-retired-note":"experience-action-pricing.inconsistent-note")}),e?(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:e}):null,y&&!u?(0,r.jsx)(d.O,{"aria-label":x("experience-action-pricing.price-label",{action:h}),disabled:p,error:w,fullWidth:!0,helperText:w??x("experience-action-pricing.price-limits",{min:(0,o.$g)(c.YE),max:(0,o.$g)(c.yk)}),onPriceChange:v,value:b}):null,y?null:(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-tertiary",children:x("experience-action-pricing.not-offered-note")}),(0,r.jsx)(s.$,{variant:"primary",className:"w-full",disabled:!N||p,onClick:()=>f(y?b??null:null),"data-sentry-element":"Button","data-sentry-source-file":"ExperienceActionPriceRow.tsx",children:x("experience-action-pricing.save-button")})]})}},46248:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/apps/[appUuid]/open",function(){return t(52600)}])},51054:(e,a,t)=>{"use strict";t.d(a,{B:()=>o});var r=t(27707),n=t(3379),s=t(17546),i=t.n(s),l=t(23488),c=t(43418);let o=({onVerify:e,onExpire:a,onError:t,action:s,forceDisplayCaptcha:o=!1,invisible:d=!1,styles:u})=>{let[p,f]=(0,n.useState)(!1),m=(0,c.h)(),h=(0,n.useRef)(a);h.current=a,(0,n.useEffect)(()=>(f(!0),()=>h.current()),[]);let x=l._.NEXT_PUBLIC_CAPTCHA_TURNSTILE_SITE_KEY;if(!p||!x)return null;let y=d&&!o;return(0,r.jsx)("div",{className:y?"absolute h-0 w-0 overflow-hidden opacity-0":"flex items-center justify-center pt-4",style:u,"data-sentry-component":"Captcha","data-sentry-source-file":"Captcha.tsx",children:(0,r.jsx)(i(),{sitekey:x,onVerify:e,onExpire:a,onError:t,action:s,theme:m?"dark":"light",appearance:y?"execute":o?"always":"interaction-only",refreshExpired:"auto","data-sentry-element":"Turnstile","data-sentry-source-file":"Captcha.tsx"})})}},52600:(e,a,t)=>{"use strict";t.r(a),t.d(a,{__N_SSP:()=>eE,default:()=>eN});var r=t(27707),n=t(6603),s=t(3379),i=t(68192),l=t(72294),c=t(42408),o=t(80272),d=t(97870),u=t(60441),p=t(2838),f=t(84961),m=t(27100),h=t(15744),x=t(91826),y=t(60506),g=t(5532),b=t(22254),v=t(81573),j=t(15397),C=t(74871),E=t(76981);let N=(0,t(32009).v)((e,a)=>({selectedAppSlug:null,embeddingConfigs:{},installedApps:new Set,selectApp:a=>e({selectedAppSlug:a}),installApp:a=>e(e=>({installedApps:new Set(e.installedApps).add(a)})),isAppInstalled:e=>a().installedApps.has(e),isDeveloperEnrolled:()=>!1}));var w=t(76651),k=t(39256),A=t(53972),S=t(93849),_=t(41267),I=t(94216),M=t(65728),R=t(43418),P=t(33954),L=t(3842),T=t(23245),D=t(16410),O=t(15417);let U=({appUuid:e,externalActionId:a,onResolve:t})=>{let{t:n}=(0,f.B)(),i=P.i.useUtils(),{showErrorToast:l,showSuccessToast:c}=(0,v.d)(),{data:o,isError:d,isFetching:u,isPending:p}=P.i.appIntegration.listMyExperienceActionPricing.useQuery(void 0,{staleTime:0,retry:!1}),{mutateAsync:m}=P.i.appIntegration.setMyExperienceActionPrice.useMutation(),[h,x]=(0,s.useState)(null),[y,g]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),C=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(C.current||p||u)return;if(C.current=!0,d||!o){l(n("fan-app-surfaces.price-dialog.unreadable")),t("failed");return}if(!o.isEnabled){l(n("experience-action-pricing.unavailable")),t("failed");return}let r=o.apps.find(a=>a.appUuid===e),s=r?.actions.find(e=>e.externalActionId===a);if(!s||!r){l(o.hasUnreadableApps?n("fan-app-surfaces.price-dialog.unreadable"):n("fan-app-surfaces.price-dialog.unknown-action")),t("failed");return}x({action:s,experienceCount:r.experienceCount})},[e,o,a,d,u,p,t,l,n]);let E=async r=>{g(!0);try{let s=await m({appUuid:e,externalActionId:a,priceCents:r});
1c(null===r?n("experience-action-pricing.withdraw-success"):n("experience-action-pricing.save-success")),i.appIntegration.listMyExperienceActionPricing.invalidate(),t("saved",{amountMinorUnits:s.priceCents??void 0})}catch(e){l(n("experience-action-pricing.save-error"),e),i.appIntegration.listMyExperienceActionPricing.invalidate(),j(!0),g(!1)}};return h?(0,r.jsx)(T.N,{className:"sm:max-w-2xl",open:!0,disableEasyClose:y,hideCloseButton:y,onClose:()=>{y||t(b?"failed":"cancelled")},title:n("fan-app-surfaces.price-dialog.title"),"data-sentry-element":"FVDialog","data-sentry-component":"ExperienceActionPriceDialog","data-sentry-source-file":"ExperienceActionPriceDialog.tsx",children:(0,r.jsx)(D.g,{className:"mt-4","data-sentry-element":"FVDialogContent","data-sentry-source-file":"ExperienceActionPriceDialog.tsx",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:n("fan-app-surfaces.price-dialog.intro")}),0===h.experienceCount?(0,r.jsx)(L.F,{variant:"warning",children:n("experience-action-pricing.no-experiences")}):null,(0,r.jsx)(O.A,{description:h.action.description,externalActionId:h.action.externalActionId,isConsistent:h.action.isConsistent,isOffered:h.action.isOffered,isRetired:h.action.isRetired,isSaving:y||0===h.experienceCount,onSave:e=>void E(e),priceCents:h.action.priceCents,title:h.action.title,"data-sentry-element":"ExperienceActionPriceRow","data-sentry-source-file":"ExperienceActionPriceDialog.tsx"})]})})}):null};var F=t(65108),B=t(33383),$=t(64494),q=t(84860),V=t(63950);let G={16:{outlined:[{d:"M6.313 10.187a.5.5 0 0 1-.353-.147A2.87 2.87 0 0 1 5.113 8 2.89 2.89 0 0 1 8 5.113c.767 0 1.493.3 2.04.847a.5.5 0 0 1 0 .707L6.667 10.04c-.1.1-.227.147-.354.147M8 6.113a1.89 1.89 0 0 0-1.64 2.82L8.933 6.36c-.28-.16-.6-.247-.933-.247"},{d:"M3.733 12.34a.5.5 0 0 1-.326-.12 9.7 9.7 0 0 1-1.9-2.22C.8 8.9.8 7.107 1.507 6 3.133 3.454 5.5 1.987 8 1.987c1.467 0 2.914.507 4.18 1.46a.5.5 0 0 1-.6.8C10.487 3.42 9.247 2.987 8 2.987c-2.153 0-4.213 1.293-5.653 3.553-.5.78-.5 2.14 0 2.92s1.073 1.454 1.706 2c.207.18.234.494.054.707a.48.48 0 0 1-.374.173M8 14.013c-.886 0-1.753-.18-2.586-.533a.5.5 0 0 1 .386-.92c.707.3 1.447.453 2.194.453 2.153 0 4.213-1.293 5.653-3.553.5-.78.5-2.14 0-2.92a10 10 0 0 0-.673-.934.506.506 0 0 1 .073-.706.5.5 0 0 1 .707.073c.26.32.513.667.74 1.027.706 1.1.706 2.893 0 4C12.867 12.546 10.5 14.013 8 14.013"},{d:"M8.46 10.847a.505.505 0 0 1-.493-.407.49.49 0 0 1 .4-.58 1.88 1.88 0 0 0 1.48-1.48.506.506 0 0 1 .587-.4.5.5 0 0 1 .4.587 2.86 2.86 0 0 1-2.28 2.28c-.034-.007-.06 0-.094 0m-7.127 4.32a.5.5 0 0 1-.353-.146.503.503 0 0 1 0-.707l4.98-4.98a.503.503 0 0 1 .707 0 .503.503 0 0 1 0 .707l-4.98 4.98c-.1.1-.227.146-.354.146m8.354-8.354a.5.5 0 0 1-.354-.147.503.503 0 0 1 0-.706l4.98-4.98a.503.503 0 0 1 .707 0 .503.503 0 0 1 0 .706l-4.98 4.98c-.1.1-.227.147-.353.147"}],filled:[{d:"M14.18 6.12a9 9 0 0 0-.614-.86.667.667 0 0 0-.993-.06l-2 2c.147.44.173.947.04 1.474a2.68 2.68 0 0 1-1.933 1.933 2.6 2.6 0 0 1-1.473-.04l-1.64 1.64c-.334.333-.227.92.22 1.093A6.2 6.2 0 0 0 8 13.713c1.187 0 2.34-.346 3.393-.993 1.073-.667 2.04-1.647 2.82-2.893.634-1.007.6-2.7-.033-3.707m-4.833.534L6.653 9.347A1.93 1.93 0 0 1 6.093 8 1.91 1.91 0 0 1 8 6.094c.52 0 1 .22 1.347.56"},{d:"m12.167 3.833-2.26 2.26A2.66 2.66 0 0 0 8 5.306 2.69 2.69 0 0 0 5.307 8c0 .747.3 1.42.786 1.907l-2.253 2.26h-.007a9.5 9.5 0 0 1-2-2.274c-.666-1.046-.666-2.746 0-3.793.774-1.213 1.72-2.167 2.774-2.82C5.66 2.64 6.813 2.287 8 2.287c1.487 0 2.927.546 4.167 1.546M9.907 8A1.91 1.91 0 0 1 8 9.907c-.04 0-.073 0-.113-.014l2.006-2.006A.3.3 0 0 1 9.907 8"},{d:"M14.513 1.487c-.2-.2-.527-.2-.727 0l-12.3 12.307c-.2.2-.2.527 0 .727a.505.505 0 0 0 .72-.007L14.513 2.207a.496.496 0 0 0 0-.72"}]},24:{outlined:[{d:"M9.47 15.28c-.19 0-.38-.07-.53-.22A4.3 4.3 0 0 1 7.67 12c0-2.39 1.94-4.33 4.33-4.33 1.15 0 2.24.45 3.06 1.27a.75.75 0 0 1 0 1.06L10 15.06c-.15.15-.34.22-.53.22M12 9.17a2.834 2.834 0 0 0-2.46 4.23l3.86-3.86c-.42-.24-.9-.37-1.4-.37"},{d:"M5.6 18.51c-.17 0-.35-.06-.49-.18-1.07-.91-2.03-2.03-2.85-3.33-1.06-1.
165-1.06-4.34 0-6C4.7 5.18 8.25 2.98 12 2.98c2.2 0 4.37.76 6.27 2.19a.75.75 0 0 1-.9 1.2c-1.64-1.24-3.5-1.89-5.37-1.89-3.23 0-6.32 1.94-8.48 5.33-.75 1.17-.75 3.21 0 4.38s1.61 2.18 2.56 3c.31.27.35.74.08 1.06-.14.17-.35.26-.56.26m6.4 2.51c-1.33 0-2.63-.27-3.88-.8a.75.75 0 0 1-.4-.98c.16-.38.6-.56.98-.4 1.06.45 2.17.68 3.29.68 3.23 0 6.32-1.94 8.48-5.33.75-1.17.75-3.21 0-4.38-.31-.49-.65-.96-1.01-1.4a.76.76 0 0 1 .11-1.06.75.75 0 0 1 1.06.11c.39.48.77 1 1.11 1.54 1.06 1.65 1.06 4.34 0 6-2.44 3.82-5.99 6.02-9.74 6.02"},{d:"M12.69 16.27c-.35 0-.67-.25-.74-.61-.08-.41.19-.8.6-.87 1.1-.2 2.02-1.12 2.22-2.22.08-.41.47-.67.88-.6.41.08.68.47.6.88-.32 1.73-1.7 3.1-3.42 3.42-.05-.01-.09 0-.14 0M2 22.75c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06L8.94 14c.29-.29.77-.29 1.06 0s.29.77 0 1.06l-7.47 7.47c-.15.15-.34.22-.53.22m12.53-12.53c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06l7.47-7.47c.29-.29.77-.29 1.06 0s.29.77 0 1.06L15.06 10c-.15.15-.34.22-.53.22"}],filled:[{d:"M21.27 9.18c-.29-.46-.6-.89-.92-1.29a1 1 0 0 0-1.49-.09l-3 3c.22.66.26 1.42.06 2.21a4.02 4.02 0 0 1-2.9 2.9c-.79.2-1.55.16-2.21-.06l-2.46 2.46c-.5.5-.34 1.38.33 1.64 1.07.41 2.18.62 3.32.62 1.78 0 3.51-.52 5.09-1.49 1.61-1 3.06-2.47 4.23-4.34.95-1.51.9-4.05-.05-5.56m-7.25.8-4.04 4.04c-.51-.52-.84-1.24-.84-2.02 0-1.57 1.28-2.86 2.86-2.86.78 0 1.5.33 2.02.84"},{d:"m18.25 5.75-3.39 3.39A4 4 0 0 0 12 7.96c-2.24 0-4.04 1.81-4.04 4.04 0 1.12.45 2.13 1.18 2.86l-3.38 3.39h-.01c-1.11-.9-2.13-2.05-3-3.41-1-1.57-1-4.12 0-5.69C3.91 7.33 5.33 5.9 6.91 4.92c1.58-.96 3.31-1.49 5.09-1.49 2.23 0 4.39.82 6.25 2.32M14.86 12c0 1.57-1.28 2.86-2.86 2.86-.06 0-.11 0-.17-.02l3.01-3.01c.02.06.02.11.02.17"},{d:"M21.77 2.23c-.3-.3-.79-.3-1.09 0L2.23 20.69c-.3.3-.3.79 0 1.09a.76.76 0 0 0 1.08-.01L21.77 3.31c.31-.3.31-.78 0-1.08"}]},32:{outlined:[{d:"M12.627 20.373a1 1 0 0 1-.707-.293A5.74 5.74 0 0 1 10.227 16 5.776 5.776 0 0 1 16 10.227c1.533 0 2.986.6 4.08 1.693a1 1 0 0 1 0 1.413l-6.747 6.747c-.2.2-.453.293-.706.293M16 12.227A3.78 3.78 0 0 0 12.227 16c0 .666.173 1.306.493 1.866l5.146-5.146c-.56-.32-1.2-.493-1.866-.493"},{d:"M7.467 24.68c-.227 0-.467-.08-.654-.24-1.426-1.213-2.706-2.706-3.8-4.44-1.413-2.2-1.413-5.786 0-8C6.267 6.908 11 3.975 16 3.975c2.933 0 5.827 1.013 8.36 2.92a1 1 0 0 1-1.2 1.6c-2.187-1.653-4.667-2.52-7.16-2.52-4.307 0-8.427 2.587-11.307 7.107-1 1.56-1 4.28 0 5.84s2.147 2.906 3.414 4c.413.36.466.986.106 1.413a.97.97 0 0 1-.746.347M16 28.026c-1.773 0-3.507-.36-5.173-1.067a1 1 0 0 1-.534-1.306 1 1 0 0 1 1.307-.534c1.414.6 2.894.907 4.387.907 4.307 0 8.427-2.587 11.307-7.107 1-1.56 1-4.28 0-5.84a19 19 0 0 0-1.347-1.866 1.013 1.013 0 0 1 .147-1.414 1 1 0 0 1 1.413.147 21 21 0 0 1 1.48 2.053c1.413 2.2 1.413 5.787 0 8C25.734 25.093 21 28.026 16 28.026"},{d:"M16.92 21.694a1.01 1.01 0 0 1-.987-.813.98.98 0 0 1 .8-1.16c1.467-.267 2.694-1.494 2.96-2.96a1.01 1.01 0 0 1 1.174-.8c.546.106.906.626.8 1.173a5.73 5.73 0 0 1-4.56 4.56c-.067-.014-.12 0-.187 0m-14.253 8.64a1 1 0 0 1-.707-.293 1.006 1.006 0 0 1 0-1.413l9.96-9.96a1.006 1.006 0 0 1 1.413 0 1.006 1.006 0 0 1 0 1.413l-9.96 9.96c-.2.2-.453.293-.706.293m16.706-16.708a1 1 0 0 1-.706-.293 1.006 1.006 0 0 1 0-1.414l9.96-9.96a1.006 1.006 0 0 1 1.413 0 1.006 1.006 0 0 1 0 1.414l-9.96 9.96c-.2.2-.453.293-.707.293"}],filled:[{d:"M28.36 12.24a19 19 0 0 0-1.227-1.72 1.334 1.334 0 0 0-1.986-.12l-4 4c.293.88.346 1.894.08 2.947a5.36 5.36 0 0 1-3.867 3.867c-1.053.266-2.067.213-2.947-.08l-3.28 3.28c-.666.666-.453 1.84.44 2.186a12.3 12.3 0 0 0 4.427.827c2.373 0 4.68-.693 6.787-1.987 2.146-1.333 4.08-3.293 5.64-5.786 1.266-2.014 1.2-5.4-.067-7.414m-9.667 1.068-5.387 5.386a3.87 3.87 0 0 1-1.12-2.693A3.82 3.82 0 0 1 16 12.187c1.04 0 2 .44 2.693 1.12"},{d:"m24.333 7.666-4.52 4.52A5.32 5.32 0 0 0 16 10.613 5.38 5.38 0 0 0 10.613 16c0 1.493.6 2.84 1.574 3.813l-4.507 4.52h-.013c-1.48-1.2-2.84-2.733-4-4.547-1.334-2.093-1.334-5.493 0-7.587 1.546-2.426 3.44-4.333 5.546-5.64C11.32 5.28 13.627 4.574 16 4.574c2.973 0 5.853 1.093 8.333 3.093M19.813 16A3.82 3.82 0 0 1 16 19.813c-.08 0-.147 0-.227-.026l4.014-4.014c.026.08.026.147.026.227"},{d:"M29.027 2.974c-.4-.4-1.054-.4-1.454 0l-24.6 24.614c-.4.4-.4 1.053 0 1.453a1.01 1.01 0 0 0 1.44-.013
1L29.027 4.414a.99.99 0 0 0 0-1.44"}]}},H=s.forwardRef((e,a)=>(0,r.jsx)(V.h,{ref:a,variants:G,...e}));H.displayName="EyeOffIcon";var K=t(97592),z=t(82590),Y=t(48800),W=t(22921),X=t(92782),Z=t(27549),Q=t(83093),J=t(54352),ee=t(85591),ea=t(33623),et=t(78057),er=t(37495);let en=[{key:"FREE",icon:F.b,titleKey:"fan-app-surfaces.publish-modal.access-free-title",subtitleKey:"fan-app-surfaces.publish-modal.access-free-subtitle"},{key:"SUBSCRIPTION",icon:B.c,titleKey:"fan-app-surfaces.publish-modal.access-subscription-title",subtitleKey:"fan-app-surfaces.publish-modal.access-subscription-subtitle"},{key:"PAID",icon:$.L,titleKey:"fan-app-surfaces.publish-modal.access-paid-title",subtitleKey:"fan-app-surfaces.publish-modal.access-paid-subtitle"},{key:"APP_SUBSCRIPTION",icon:q.H,titleKey:"fan-app-surfaces.publish-modal.access-app-subscription-title",subtitleKey:"fan-app-surfaces.publish-modal.access-app-subscription-subtitle"},{key:"HIDDEN",icon:H,titleKey:"fan-app-surfaces.publish-modal.access-hidden-title",subtitleKey:"fan-app-surfaces.publish-modal.access-hidden-subtitle"}],es=e=>"APP_SUBSCRIPTION"===e?"PAID":e,ei=e=>{let a=Number(e);if(""===e.trim()||Number.isNaN(a))return{problem:"empty_or_not_a_number"};let t=(0,er.Mx)(e);return Number(a.toFixed(2))!==a?{problem:"sub_cent"}:(0,Z._KT)(t,ea.YE,ea.yk)?{problem:"out_of_bounds"}:{cents:t}},el=e=>{let a=ei(e);return"cents"in a?a.cents:null},ec=(e,a)=>{let t=ei(e);if(!("cents"in t))return"sub_cent"===t.problem?a("fan-app-surfaces.publish-modal.price-precision-error"):a("fan-app-surfaces.publish-modal.price-error",{min:(0,er.$g)(ea.YE),max:(0,er.$g)(ea.yk)})},eo=({request:e,appUuid:a,appName:t,requestToken:n,onResolve:i})=>{let{t:l}=(0,f.B)(),c=P.i.appIntegration.publishExperience.useMutation(),o=(0,ee.E)({surface:et.UA.HIDE_EXPERIENCE,appUuid:a,appName:t}),[d,u]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[h,x]=(0,s.useState)("FREE"),[y,g]=(0,s.useState)("5"),[b,v]=(0,s.useState)({}),[j,C]=(0,s.useState)(null),[E,N]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!1),[S,_]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{e&&(u(e.title.slice(0,100)),m(e.description.slice(0,500)),x(e.proposedAccessMode),g("5"),v(Object.fromEntries((e.proposedActions??[]).map(e=>[e.externalActionId,{isOffered:!0,price:String((e.suggestedPriceCents??ea.YE)/100)}]))),C(null),N(!1),k(!1),_(!1))},[e]),!e)return null;if(S)return(0,r.jsxs)(T.N,{className:"sm:max-w-2xl",open:!0,onClose:()=>i("cancelled"),title:l("fan-app-surfaces.publish-modal.expired-title"),children:[(0,r.jsx)(D.g,{className:"mt-4",children:(0,r.jsx)(L.F,{variant:"error",children:l("fan-app-surfaces.publish-modal.expired-body")})}),(0,r.jsx)(A.$,{className:"w-full",onClick:()=>i("cancelled"),children:l("close")})]});let I=es(h),M="PAID"===I,{allowedAccessModes:R}=e,O=R?en.filter(e=>R.includes(es(e.key))):en,U=el(y),F=ec(y,l),B=M&&null===U,q=e.proposedActions??[],V=q.filter(e=>b[e.externalActionId]?.isOffered),G=V.some(e=>null===el(b[e.externalActionId]?.price??"")),H=d.trim()||e.title,Z=""===H,er=j?.impact,ei=j?.type==="blocked_active_subscriptions",eo=j?.type==="requires_acknowledgement",ed=er?.affectedFanCount??0,eu=er?.pendingSubscriptionInvoiceCount??0,ep=(er?.activeSubscriptionCount??0)===0&&eu>0,ef=async()=>{let t;k(!1);let r=p.trim(),s=M&&null!==U?{priceCents:U,priceRecurring:"APP_SUBSCRIPTION"===h}:{},l=V.flatMap(e=>{let a=el(b[e.externalActionId]?.price??"");return null===a?[]:[{externalActionId:e.externalActionId,priceCents:a}]}),d=q.length>0?{actions:l}:{};try{t=await c.mutateAsync({appUuid:a,externalExperienceId:e.externalExperienceId,token:n,title:H,description:r,accessMode:I,deliveryMode:e.deliveryMode,externalUrl:e.externalUrl,imageBucketKey:e.imageBucketKey,hidden:"HIDDEN"===I,...s,...d,...(0,J.sS)({acknowledged:E,impact:er})})}catch{k(!0);return}if("request_token_expired"===t.type)return void _(!0);if("blocked_active_subscriptions"===t.type||"requires_acknowledgement"===t.type){C(t),N(!1),o.trackRejection(t);return}"success"===t.type?i("published",{uuid:t.experience.uuid,title:H,description:r,accessMode:I,...s,...d}):i("cancelled")};return(0,r.jsxs)(T.N,{className:"sm:max-w-2xl",open:!0,onClose:()=>i("cancelled"),title:l("fan-app-surfaces.publish-modal.title"),"data-sentry-element":"FVDialog","data-sentry-component":"PublishExperienceModal","data-sentry-source-file":"PublishExperienceModal.tsx",children:[(0,r.jsx)(D.g,{className:"mt-4","data-sentry-element":"FVDialogContent","data-sentry-source-file":"PublishExperienceModal.tsx",children:(0,r.jsxs)("div",{className:"space-y-5",children:[ei?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(L.F,{variant:"error",children:ep?l("fan-app-surfaces.publish-modal.blocked-title"):l("fan-app-surfaces.publish-modal.blocked-body",{title:H})}),(0,r.jsx)(Q.ud,{tier:"blocked",count:eu}),(0,r.jsx)(Q.rb,{subscribers:er?.subscribers??[],totalCount:er?.subscriberTotalCount??0}),(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:l("apps.sunset-guard.blocked-guidance")})]}):null,eo?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(L.F,{variant:"warning",children:0===ed&&(0,J.$j)(er)>0?l("apps.sunset-guard.warn-pending",{count:(0,J.$j)(er)}
1):l("fan-app-surfaces.publish-modal.warn-body",{count:ed,title:H})}),(0,r.jsx)(Q.Sz,{}),(0,r.jsx)(Q.Er,{checked:E,onCheckedChange:e=>{N(e),e&&o.trackAcknowledged(ed)}})]}):null,(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"typography-description-12px-semibold px-1 pt-1 pb-2 text-content-primary",children:l("fan-app-surfaces.publish-modal.app-logo")}),e.imageUrl?(0,r.jsx)("img",{className:"size-16 rounded-sm bg-neutral-alphas-50 object-cover",src:e.imageUrl,alt:""}):(0,r.jsx)("div",{className:"flex size-16 items-center justify-center rounded-sm bg-neutral-alphas-50 text-content-tertiary",children:(0,r.jsx)(K.x,{className:"size-3"})})]}),(0,r.jsx)(z.A,{label:l("fan-app-surfaces.publish-modal.name-label"),value:d,onChange:e=>u(e.target.value),placeholder:l("fan-app-surfaces.publish-modal.name-placeholder"),maxLength:100,helperText:`${d.length}/100`,"data-sentry-element":"TextField","data-sentry-source-file":"PublishExperienceModal.tsx"}),(0,r.jsx)(Y.f,{label:l("fan-app-surfaces.publish-modal.description-label"),value:p,onChange:e=>m(e.target.value),placeholder:l("fan-app-surfaces.publish-modal.description-placeholder"),maxLength:500,helperText:`${p.length}/500`,"data-sentry-element":"TextArea","data-sentry-source-file":"PublishExperienceModal.tsx"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("span",{className:"typography-description-12px-semibold px-1 pt-1 pb-2 text-content-primary",children:l("fan-app-surfaces.publish-modal.access-label")}),O.map(e=>{let a=e.icon,t=h===e.key;return(0,r.jsxs)("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>(e=>{e!==h&&(x(e),C(null),N(!1))})(e.key),className:(0,W.cn)("flex w-full items-center gap-3 rounded-md border p-3 text-left transition-colors cursor-pointer",t?"border-brand-primary-default bg-surface-green-gray":"border-border-primary bg-surface-primary"),children:[(0,r.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-content-primary text-content-primary-inverted",children:(0,r.jsx)(a,{className:"text-base size-4"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"typography-body-default-16px-semibold text-content-primary leading-tight",children:l(e.titleKey)}),(0,r.jsx)("div",{className:"typography-body-default-14px-regular text-content-secondary leading-tight",children:l(e.subtitleKey)})]})]},e.key)})]}),M&&(0,r.jsx)(z.A,{label:"APP_SUBSCRIPTION"===h?l("fan-app-surfaces.publish-modal.price-monthly-label"):l("fan-app-surfaces.publish-modal.price-label"),type:"number",value:y,onChange:e=>g(e.target.value),leftIcon:(0,r.jsx)($.L,{}),error:!!F,helperText:F}),q.length>0?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"typography-description-12px-semibold px-1 pt-1 pb-2 text-content-primary",children:l("fan-app-surfaces.publish-modal.actions-label")}),(0,r.jsx)("p",{className:"typography-body-small-14px-regular px-1 text-content-secondary",children:l("fan-app-surfaces.publish-modal.actions-subtitle")})]}),q.map(e=>{let a=b[e.externalActionId],t=a?.isOffered??!1,n=a?.price??"",s=ec(n,l);return(0,r.jsxs)("div",{className:"space-y-3 rounded-md border border-border-primary bg-surface-primary p-3",children:[(0,r.jsx)(X.S,{checked:t,onCheckedChange:a=>v(t=>({...t,[e.externalActionId]:{price:t[e.externalActionId]?.price??"",isOffered:!0===a}})),label:e.title}),e.description?(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:e.description}):null,t?(0,r.jsx)(z.A,{label:l("fan-app-surfaces.publish-modal.action-price-label"),type:"number",value:n,onChange:a=>v(t=>({...t,[e.externalActionId]:{isOffered:!0,price:a.target.value}})),leftIcon:(0,r.jsx)($.L,{}),error:!!s,helperText:s}):(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-tertiary",children:l("fan-app-surfaces.publish-modal.action-disabled-note")})]},e.externalActionId)})]}):null]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[w?(0,r.jsx)(L.F,{variant:"error",children:l("apps.sunset-guard.mutation-error")}):null,(0,r.jsx)(A.$,{className:"w-full",disabled:c.isPending||B||G||Z||ei||eo&&!E,onClick:()=>void ef(),"data-sentry-element":"Button","data-sentry-source-file":"PublishExperienceModal.tsx",children:l("fan-app-surfaces.publish-modal.submit")})]})]})};var ed=t(53561),eu=t(58846);let ep=({request:e,appUuid:a,appName:t,onResolve:n})=>{let{t:s}=(0,f.B)(),i=P.i.appIntegration.unpublishExperience.useMutation(),l=P.i.appIntegration.getExperienceSunsetImpact.useQuery({uuid:e?.experienceUuid??"",appUuid:a},{enabled:!!e,staleTime:0,retry:!1}),c=(0,eu.h)({isOpen:!!e,impact:l.data,isLoading:l.isLoading,isError:l.isError,analytics:{surface:et.UA.UNPUBLISH_EXPERIENCE,appUuid:a,appName:t}});if(!e)return null;let o=c.displayedFanCount,d=(0,J.$j)(c.impact),u=0===o&&d>
10,p={cleanTitle:s("fan-app-surfaces.unpublish-modal.title"),cleanBody:s("fan-app-surfaces.unpublish-modal.body",{title:e.title}),cleanConfirm:s("fan-app-surfaces.unpublish-modal.confirm"),cancel:s("fan-app-surfaces.unpublish-modal.cancel"),warnTitle:s("fan-app-surfaces.unpublish-modal.warn-title"),warnBody:u?s("apps.sunset-guard.warn-pending",{count:d}):s("fan-app-surfaces.unpublish-modal.warn-body",{count:o,title:e.title}),warnConfirm:u?s("fan-app-surfaces.unpublish-modal.confirm"):s("fan-app-surfaces.unpublish-modal.warn-confirm",{count:o}),blockedTitle:s("fan-app-surfaces.unpublish-modal.blocked-title"),blockedBody:s("fan-app-surfaces.unpublish-modal.blocked-body",{title:e.title}),blockedGuidance:s("apps.sunset-guard.blocked-guidance")},m=async()=>{c.startConfirm();try{let t=await i.mutateAsync({uuid:e.experienceUuid,appUuid:a,...c.confirmInput});if("blocked_active_subscriptions"===t.type||"requires_acknowledgement"===t.type)return void c.applyGuardRejection(t);if("success"===t.type)return void n("unpublished");n("cancelled","upstream_refused")}catch{c.applyMutationError()}};return(0,r.jsx)(ed.k,{open:!0,state:c.state,impact:c.impact,copy:p,isPending:i.isPending,showConflictAlert:c.hasConflict,showMutationError:c.hasMutationError,acknowledged:c.acknowledged,onAcknowledgedChange:c.acknowledge,onConfirm:()=>void m(),onDismiss:()=>n("cancelled",(e=>"blocked"===e?"blocked_active_subscriptions":"warn"===e?"acknowledgement_declined":void 0)(c.state)),onRetry:()=>void l.refetch(),"data-sentry-element":"SunsetGuardDialog","data-sentry-component":"UnpublishExperienceModal","data-sentry-source-file":"UnpublishExperienceModal.tsx"})};var ef=t(16366),em=t(99234),eh=t(3732);let ex={ERROR_TOKEN_EXPIRED:"request_expired",ERROR_INVALID_TOKEN:"request_invalid",ERROR_NOT_CONFIGURED:"verification_failed"},ey=({appUuid:e})=>{let a=(0,n.useRouter)(),{t}=(0,f.B)(),{showErrorToast:i,showSimpleInfoToast:l}=(0,v.d)(),[x,b]=(0,s.useState)("probing"),[j,C]=(0,s.useState)(!1),{data:N,refetch:L}=P.i.appIntegration.getCreatorSurfaceLaunch.useQuery({appUuid:e}),T=N?.status==="ready"?N:null,D=(0,R.h)(),O=(0,s.useRef)(D);O.current=D;let F=(0,s.useMemo)(()=>T?((e,a)=>{let t=new URL(e);return t.searchParams.set("theme",a?"dark":"light"),t.toString()})(T.iframeSrc,O.current):void 0,[T]),B=(0,s.useRef)(null),{openHostDialog:$,dismissHostDialog:q,appDialogElement:V}=(0,_.aq)({appName:T?.appName??""}),{isBridgeFlagSettled:G}=(0,g.M)({iframeRef:B,expectedOrigin:(0,g.F)(T?.iframeSrc),granted:T?.bridgeCapabilities??[],context:{appUuid:e,appName:T?.appName??"",surface:"creator"},openHostDialog:$,dismissHostDialog:q}),{isEmbeddedSurfaceEnabled:H,isEmbeddedSurfaceFlagLoading:K}=(0,I.P)(),z=!K&&!H,{isEnabled:Y,isLoading:W}=(0,M.h)(),{pending:X,resolve:Z}=(({appOrigin:e,isEnabled:a,isLoading:t})=>{let[r,n]=(0,s.useState)(null),i=(0,s.useRef)(null),l=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!a&&!t)return;let e=e=>{let a=e.data;if("string"!=typeof a?.token)return;let r=a.type===ef.E2?"publish":a.type===ef.pL?"unpublish":null;if(null!==r){if(t){l.current={pending:{token:a.token,messageAction:r},source:e.source};return}i.current=e.source,n({token:a.token,messageAction:r})}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[a,t]),(0,s.useEffect)(()=>{if(t)return;let e=l.current;l.current=null,e&&a&&(i.current=e.source,n(e.pending))},[a,t]),{pending:r,resolve:(0,s.useCallback)((a,t,r)=>{let{experience:s,reason:l}=r??{},c=i.current;if(i.current=null,n(null),c&&e)if("unpublish"===a){let a="unpublished"===t,r={type:ef.Xu,status:a?"unpublished":"cancelled",...!a&&l?{reason:l}:{}};c.postMessage(r,e)}else{let a="published"===t,r={type:ef.c5,status:a?"published":"cancelled",experienceId:s?.uuid};a&&s&&(r.experience={title:s.title,description:s.description,accessMode:s.accessMode,...void 0!==s.priceCents?{priceCents:s.priceCents}:{},...void 0!==s.priceRecurring?{priceRecurring:s.priceRecurring}:{}}),c.postMessage(r,e)}},[e])}})({appOrigin:(0,g.F)(T?.iframeSrc),isEnabled:Y,isLoading:W}),{pending:Q,resolve:J}=(({appOrigin:e,iframeRef:a,isEnabled:t,isLoading:r})=>
1{let[n,i]=(0,s.useState)(null),l=(0,s.useRef)(null),c=(0,s.useRef)(1),o=(0,s.useRef)(null),d=(0,s.useRef)((0,em.i)(3,10)).current,u=(0,s.useCallback)((a,t,r,n)=>{if(!a||!e)return;let s="saved"===r&&void 0!==n,i={type:ef.Uu,status:r,externalActionId:t.externalActionId,...s?{amountMinorUnits:n,currency:ef.Su}:{}};a.postMessage(i,e)},[e]);return(0,s.useEffect)(()=>{if(!e)return;let n=n=>{let s=a.current?.contentWindow;if(!s||n.source!==s||n.origin!==e)return;let p=n.data;if(p?.type!==ef.Wo)return;let f=n.source;if("string"!=typeof p.externalActionId||0===p.externalActionId.length)return;let m={id:c.current,externalActionId:p.externalActionId};if(c.current+=1,l.current||o.current||!d())return void u(f,m,"failed");if(r){o.current={request:m,source:f};return}if(!t)return void u(f,m,"failed");l.current={request:m,source:f},i(m)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[e,a,t,r,u,d]),(0,s.useEffect)(()=>{if(r)return;let e=o.current;if(e){if(o.current=null,t){l.current=e,i(e.request);return}u(e.source,e.request,"failed")}},[t,r,u]),{pending:n,resolve:(0,s.useCallback)((e,a,t)=>{let r=l.current;r&&r.request.id===e&&(l.current=null,i(null),u(r.source,r.request,a,t?.amountMinorUnits))},[u])}})({appOrigin:(0,g.F)(T?.iframeSrc),iframeRef:B,isEnabled:Y,isLoading:W}),[ee,ea]=(0,s.useState)(null),et=P.i.appIntegration.verifyExperienceActionRequestToken.useMutation(),er=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!X){er.current=null;return}if(er.current===X.token)return;er.current=X.token;let{token:e,messageAction:a}=X;et.mutate({token:e},{onSuccess:t=>{"success"===t.type?ea({...t.request,token:e}):Z(a,"cancelled",{reason:ex[t.type]})},onError:()=>{Z(a,"cancelled",{reason:"verification_failed"})}})},[X,et,Z]);let en=(0,c.ZR5)(e),es=P.i.appIntegration.acceptCreatorSurfaceConsent.useMutation({onSuccess:()=>{L()},onError:()=>{i(t("apps.app-store.toasts.install-error"))}});(0,s.useEffect)(()=>{if(z){l(t("apps.app-store.toasts.no-launch-target")),a.replace((0,c.ZR5)(e));return}if(N)switch(N.status){case"not_found":i(t("apps.not-found")),a.replace(c.wTe);return;case"not_installed":case"no_surface":l(t("apps.app-store.toasts.no-launch-target")),a.replace((0,c.ZR5)(e));return;case"needs_consent":case"ready":return}},[N,z,e,a,i,l,t]),(0,s.useEffect)(()=>{if(!T)return;b("probing"),C(!1);let e=!1,a=new URL(T.iframeSrc);a.searchParams.delete("token"),fetch(a,{mode:"no-cors",cache:"no-store"}).then(()=>{e||b(e=>"probing"===e?"loading":e)}).catch(()=>{e||b("failed")});let t=setTimeout(()=>C(!0),3e4),r=setTimeout(()=>b(e=>"ready"===e?e:"failed"),6e4);return()=>{e=!0,clearTimeout(t),clearTimeout(r)}},[T]);let ei=(0,s.useMemo)(()=>T?(0,m._)((0,h.gk)(T.sandbox),T.iframeSrc):void 0,[T]);return z?null:N?.status==="needs_consent"?(0,r.jsx)(E.L,{children:(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center p-4",children:(0,r.jsx)(eh.N,{clientName:N.clientName,clientLogoUrl:N.clientLogoUrl,grantableScopes:N.scopes,isLoading:es.isPending,onAllow:()=>es.mutate({appUuid:e}),onDeny:()=>void a.replace((0,c.ZR5)(e))})})}):T&&!K&&G?(0,r.jsxs)(E.L,{"data-sentry-element":"PageContainer","data-sentry-component":"CreatorSurfaceLauncher","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:[(0,r.jsxs)(w.H,{className:"flex h-full flex-col","data-sentry-element":"AppStoreContentBox","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:[(0,r.jsxs)(p.G.ContentHeader,{className:"relative","data-sentry-element":"AppShell.ContentHeader","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:[(0,r.jsx)(p.G.ContentHeader.Leading,{"data-sentry-element":"AppShell.ContentHeader.Leading","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:(0,r.jsx)(y.N,{to:en,"aria-label":t("back"),className:"inline-flex","data-sentry-element":"Link","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:(0,r.jsx)(d.K,{variant:"tertiary",size:"32",icon:(0,r.jsx)(u.Y,{}),"aria-label":t("back"),tabIndex:-1,"data-sentry-element":"IconButton","data-sentry-source-file":"CreatorSurfaceLauncher.tsx"})})}),(0,r.jsx)(p.G.ContentHeader.Title,{"data-sentry-element":"AppShell.ContentHeader.Title","data-sentry-source-file":"CreatorSurfaceLauncher.tsx",children:`${t("apps.title")} / ${T.appName}`})]}),(0,r.jsxs)("div",{className:"relative w-full min-h-0 flex-1 overflow-hidden rounded-[16px]",children:[("probing"===x||"loading"===x)&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[(0,r.jsx)(o.N,{className:"animate-spin"}),j&&(0,r.jsx)("p",{className:"typography-body-default-16px-regular text-content-secondary",children:t("apps.app-store.surface-error.slow-loading")})]}),"failed"===x&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)(k.p,{className:"mx-auto",variant:"centered",media:S.A.src,title:(0,r.jsx)("h1",{className:"m-0 whitespace-pre-line typography-header-heading-lg text-content-primary",children:t("apps.app-store.surface-error.title")}),description:t("apps.app-store.surface-error.description"),primaryAction:(0,r.jsx)(A.$,{variant:"primary",asChild:!0,children:(0,r.jsx)(y.N,{to:en,children:t("apps.app-store.surface-error.back-cta")})})})}),("loading"===x||"ready"===x)&&(0,r.jsx)("iframe",{ref:B,src:F,className:`w-full h-full border-0 ${"ready"===x?"":"invisible"}`,sandbox:ei,allow:"clipboard-write",title:T.appName,onLoad:()=>{b(e=>"failed"===e?e:"ready")},onError:()=>{b("failed")}})]})]}),ee?.action==="publish"&&(0,r.jsx)(eo,{request:ee.payload,appUuid:e,appName:T.appName,requestToken:ee.token,onRes
1olve:(e,a)=>{Z("publish",e,{experience:a}),ea(null)}}),ee?.action==="unpublish"&&(0,r.jsx)(ep,{request:ee.payload,appUuid:e,appName:T.appName,onResolve:(e,a)=>{Z("unpublish",e,{reason:a}),ea(null)}}),Q&&(0,r.jsx)(U,{appUuid:e,externalActionId:Q.externalActionId,onResolve:(e,a)=>J(Q.id,e,a)},Q.id),V]}):(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)(o.N,{className:"animate-spin"})})},eg=[],eb=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ev=({appSlug:e})=>!e.startsWith("dev:")&&eb.test(e)?(0,r.jsx)(ey,{appUuid:e}):(0,r.jsx)(ej,{appSlug:e,"data-sentry-element":"MockOrDevAppIframe","data-sentry-component":"AppIframePage","data-sentry-source-file":"AppIframePage.tsx"}),ej=({appSlug:e})=>{let a=(0,n.useRouter)(),t=N(e=>e.installApp),i=N(e=>e.isAppInstalled),l=N(e=>e.embeddingConfigs),k=e.startsWith("dev:"),A=k?e.slice(4):null,S=A?l[A]:null,_=(0,g.F)(S?.landingUrl??null),I=k?null:eg.find(a=>a.slug===e),M=k?S?.appMeta?.name??"Developer App":I?.name,R="install"===a.query.mode,P=i(e),{t:L}=(0,f.B)(),T=(0,b.l)(),{showErrorToast:D}=(0,v.d)(),[O,U]=(0,s.useState)(null),[F,B]=(0,s.useState)(!0),[$,q]=(0,s.useState)(!1),V=(0,s.useMemo)(()=>{if(k&&S){if(!_)return;let e=Object.entries(S.permissions).filter(([,e])=>e).map(([e])=>e);return(0,m._)(e.join(" "),S.landingUrl)}return`${h.NV} allow-same-origin`},[k,S,_]),G=(0,s.useCallback)(()=>{if(k){if(!S?.landingUrl)return;R&&!P&&t(e),U(S.landingUrl);return}if(I){if(R&&!P){U(I.consentUrl);let e=setTimeout(()=>{t(I.slug),U(I.homeUrl)},2e3);return()=>clearTimeout(e)}U(I.homeUrl)}},[k,S,I,R,P,t,e]);(0,s.useEffect)(()=>G(),[G]);let H=(0,s.useRef)(null),{isBridgeFlagSettled:K}=(0,g.M)({iframeRef:H,expectedOrigin:(0,g.F)(O),granted:k?["analytics"]:[],context:{appUuid:e,appName:M??"",surface:"preview"}}),z=!k&&!I||k&&!_;if((0,s.useEffect)(()=>{z&&(D(L("apps.not-found")),a.push(c.wTe))},[z,D,L,a]),z)return null;let Y=(0,r.jsxs)("div",{className:"relative w-full min-h-0 flex-1",children:[O&&F&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)(o.N,{className:"animate-spin"})}),$&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("p",{className:"typography-body-default-16px-regular text-content-secondary",children:L("apps.iframe-error")})}),O&&K&&(0,r.jsx)("iframe",{ref:H,src:O,className:"w-full h-full border-0",sandbox:V,allow:"clipboard-write",title:M,onLoad:()=>B(!1),onError:()=>{B(!1),q(!0)}})]});return T?(0,r.jsx)(E.L,{children:(0,r.jsxs)(w.H,{className:"flex h-full flex-col",children:[(0,r.jsxs)(p.G.ContentHeader,{className:"static",children:[(0,r.jsx)(p.G.ContentHeader.Leading,{children:(0,r.jsx)(y.N,{to:c.wTe,"aria-label":L("back"),className:"inline-flex",children:(0,r.jsx)(d.K,{variant:"tertiary",size:"32",icon:(0,r.jsx)(u.Y,{}),"aria-label":L("back"),tabIndex:-1})})}),(0,r.jsx)(p.G.ContentHeader.Title,{children:M})]}),Y]})}):(0,r.jsx)(E.L,{"data-sentry-element":"PageContainer","data-sentry-component":"MockOrDevAppIframe","data-sentry-source-file":"AppIframePage.tsx",children:(0,r.jsxs)(j.x,{"data-sentry-element":"ContentContainer","data-sentry-source-file":"AppIframePage.tsx",children:[(0,r.jsxs)(C.$,{"data-sentry-element":"FlexHeader","data-sentry-source-file":"AppIframePage.tsx",children:[(0,r.jsx)(x.OR,{to:c.wTe,showDesktop:!0,ariaLabel:L("back"),"data-sentry-element":"FVSectionHeaderBack","data-sentry-source-file":"AppIframePage.tsx"}),(0,r.jsx)("h4",{className:"typography-header-heading-xs",children:M})]}),Y]})})},eC=({consent:e,appUuid:a})=>{let t=(0,n.useRouter)(),o=t.query.appUuid??a??void 0,{isListingsEnabled:d,isLoading:u,isAppStoreFlagsClientReady:p}=(0,i.v)();return((0,s.useEffect)(()=>{p&&!u&&(d||t.push(c.Kof))},[p,u,d,t]),d)?e?(0,r.jsx)(l.V,{...e}):o?(0,r.jsx)(ev,{appSlug:o,"data-sentry-element":"AppIframePage","data-sentry-component":"AppOpenPage","data-sentry-source-file":"open.tsx"}):null:null};eC.appShell={preset:"wide",gridMaxWidth:1280};var eE=!0;let eN=eC},53561:(e,a,t)=>{"use strict";t.d(a,{k:()=>d});var r=t(27707),n=t(54448),s=t(3842),i=t(53972),l=t(3379),c=t(84961),o=t(83093);let d=({open:e,state:a,impact:t,copy:d,isPending:u,showConflictAlert:p,showMutationError:f,acknowledged:m=!1,onAcknowledgedChange:h,onConfirm:x,onDismiss:y,onRetry:g,requireAcknowledgement:b=!0,impactRows:v,warnNote:j})=>{let{t:C}=(0,c.B)(),E=(0,l.useRef)(null);(0,l.useEffect)(()=>{e&&E.current?.focus()},[e,a]);let N="warn"===a?d.warnTitle:"blocked"===a?d.blockedTitle:d.cleanTitle,w=t?.subscribers??[],k=t?.pendingSubscriptionInvoiceCount??0,A=(t?.activeSubscriptionCount??0)===0&&k>0,S="clean"===a||"blocked"===a&&!A;return(0,r.jsx)(n.lG,{open:e,onOpenChange:e=>{e||u||y()},"data-sentry-element":"Dialog","data-sentry-component":"SunsetGuardDialog","data-sentry-source-file":"SunsetGuardDialog.tsx",children:(0,r.jsxs)(n.Cf,{size:"sm",...S?{}:{"aria-describedby":void 0},"data-sentry-element":"DialogContent","data-sentry-source-file":"SunsetGuardDialog.tsx",children:[(0,r.jsx)(n.c7,{closeLabel:C("close-dialog"),"data-sentry-element":"DialogHeader","data-sentry-source-file":"SunsetGuardDialog.tsx",children:(0,r.jsx)(n.L3,{ref:E,tabIndex:-1,"data-sentry-element":"DialogTitle","data-sentry-source-file":"SunsetGuardDialog.tsx",children:N})}),"loading"===a?(0,r.jsx)(n.R4,{children:(0,r.jsx)(o.tm,{})}):(0,r.jsxs)(n.R4,{className:"flex flex-col gap-4",children:[p?(0,r.jsx)(s.F,{variant:"warning",children:C("apps.sunset-guard.conflict-alert")}):null,"load_error"===a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.F,{variant:"error",children:C("apps.sunset-guard.error-body")}),(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:C("apps.sunset-guard.error-proceed-note")})]}):null,"clean"===a?(0,r.jsx)(n.rr,{children:d.cleanBody}):null,"warn"===a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.F,{variant:"warning",children:d.warnBody}),v?(0,r.jsx)(o.G,{rows:v}):null,j,b&&h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Sz,{}),(0,r.jsx)(o.Er,{checked:m,onCheckedChange:h})]}):null]}):null,"blocked"===a?(0,r.jsxs)(r.Fragment,{children:[A?null:(0,r.jsx)(n.rr,{children:d.blockedBody}),(0,r.jsx)(o.ud,{tier:"blocked",count:k}),(0,r.jsx)(o.rb,{subscribers:w,totalCount:t?.subscriberTotalCount??w.length}),(0,r.jsx)("p",{className:"typography-body-small-14px-regular text-content-secondary",children:d.blockedGuidance})]}):null,f&&"blocked"!==a?(0,r.jsx)(s.F,{variant:"error",children:C("apps.sunset-guard.mutation-error")}):null]}),"loading"===a?null:(0,r.jsx)(n.Es,{children:"blocked"===a?(0,r.jsx)(i.$,{variant:"secondary",size:"40",onClick:y,children:C("apps.sunset-guard.blocked-close")}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.$,{variant:"secondary",size:"40",disabled:u,onClick:y,children:d.cancel}),"load_error"===a?(0,r.jsx)(i.$,{variant:"secondary",size:"40",disabled:u,onClick:g,children:C("apps.sunset-guard.error-retry")}):null,"load_error"===a||"clean"===a||"warn"===a?(0,r.jsx)(i.$,{variant:"destructive",size:"40",loading:u,disabled:u||"warn"===a&&b&&!m,onClick:x,className:"h-auto min-h-10 whitespace-normal",children:(0,r.jsx)("span",{className:"text-center",children:"warn"===a?d.warnConfirm:d.cleanConfirm})}):null]})})]})})}},58846:(e,a,t)=>{"use strict";t.d(a,{h:()=>l});var r=t(3379),n=t(78057),s=t(6865),i=t(54352);let l=({isOpen:e,impact:a,isLoading:t,isError:l,canBlock:c=!0,analytics:o})=>{let d,[u,p]=(0,r.useState)(!1),[f,m]=(0,r.useState)(null),[h,x]=(0,r.useState)(!1),[y,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),v=(0,r.useRef)(!1);(0,r.useEffect)(()=>{e||(p(!1),m(null),x(!1),g(!1),b.current=null,v.current=!1)},[e]);let j=f??a;
1d=t?"loading":f?(0,i.Eo)(f,{canBlock:c}):l||!a?"load_error":(0,i.Eo)(a,{canBlock:c});let{surface:C,appUuid:E,appName:N}=o;(0,r.useEffect)(()=>{e&&"loading"!==d&&"load_error"!==d&&b.current!==d&&(b.current=d,(0,s.P)(o,n.Cq.SUNSET_IMPACT_SHOWN,{affectedFanCount:j?.affectedFanCount,impactState:d}))},[e,d]);let w=(0,r.useCallback)(e=>{m(e.impact),x(!0),g(!1),p(!1),"blocked_active_subscriptions"===e.type&&(0,s.P)({surface:C,appUuid:E,appName:N},n.Cq.SUNSET_BLOCKED,{affectedFanCount:e.impact.affectedFanCount})},[C,E,N]),k=(0,r.useCallback)(()=>{g(!0)},[]),A=(0,r.useCallback)(()=>{g(!1),x(!1)},[]),S=(0,r.useCallback)(e=>{p(e),e&&!v.current&&(v.current=!0,(0,s.P)({surface:C,appUuid:E,appName:N},n.Cq.SUNSET_IMPACT_ACKNOWLEDGED,{affectedFanCount:j?.affectedFanCount}))},[C,E,N,j?.affectedFanCount]),_=j?.affectedFanCount??0;return{state:d,impact:j,displayedFanCount:_,confirmInput:(0,i.sS)({acknowledged:u,impact:j}),acknowledged:u,acknowledge:S,hasConflict:h,hasMutationError:y,applyGuardRejection:w,applyMutationError:k,startConfirm:A}}},72294:(e,a,t)=>{"use strict";t.d(a,{V:()=>m});var r=t(27707),n=t(5111),s=t(3379),i=t(84961),l=t(1496),c=t(62877),o=t(77625),d=t(33954),u=t(49576),p=t(81573),f=t(3732);let m=({challenge:e,clientName:a,clientId:t,grantableScopes:m,unavailableScopes:h,incompatibleAccount:x})=>{let{t:y}=(0,i.B)(),[g,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),C=(0,c.A)(),E=(0,s.useRef)(!1),{showErrorToast:N}=(0,p.d)(),w=(0,u.h)(),k=(0,s.useRef)(!1),{mutateAsync:A}=d.i.oauth.submitConsentDecision.useMutation();(0,s.useEffect)(()=>(o.n.getState().setOAuthContext({clientName:a}),()=>{o.n.getState().setOAuthContext(null)}),[a]);let S=(0,s.useCallback)(async a=>{if(!k.current){k.current=!0,b(!0);try{let{redirectTo:r}=await A({challenge:e,decision:a,clientId:t,location:w?.location?{countryCode:w.location.countryCode,regionName:w.location.regionName}:void 0});window.location.href=r}catch(a){k.current=!1,b(!1);let e=a instanceof n.HN?a.data?.code:void 0;"PRECONDITION_FAILED"===e?j(!0):"CONFLICT"===e?N(y("oauth.errors.account-mismatch"),a):"NOT_FOUND"===e?N(y("oauth.errors.already-completed"),a):N(y("oauth.errors.server-error"),a)}}},[A,e,t,w,N,y]);(0,s.useEffect)(()=>{C&&E.current&&(E.current=!1,j(!1),S("accept"))},[C,S]);let _=(0,s.useCallback)(()=>{E.current=!0,S("accept")},[S]),I=(0,s.useCallback)(()=>{E.current=!1,S("reject")},[S]),M=(0,s.useCallback)(()=>{j(!1)},[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background-primary p-6",children:(0,r.jsx)(f.N,{clientName:a,grantableScopes:m,unavailableScopes:h,incompatibleAccount:x,isLoading:g,onAllow:_,onDeny:I,"data-sentry-element":"OAuthConsentView","data-sentry-source-file":"OAuthConsentPage.tsx"})}),v&&(0,r.jsx)(l.O,{open:!0,onClose:M,oauthClientName:a})]})}},94216:(e,a,t)=>{"use strict";t.d(a,{P:()=>n});var r=t(68192);let n=()=>{let{isSurfacesEnabled:e,isLoading:a,isAppStoreFlagsClientReady:t}=(0,r.v)();return{isEmbeddedSurfaceEnabled:e,isEmbeddedSurfaceFlagLoading:a||!t}}}},e=>{e.O(0,[9702,1874,6220,8916,5186,9787,6970,4752,7010,8719,9888,5557,2674,2838,476,7962,7734,2694,2540,8057,1573,8930,607,4076,6981,7402,636,6593,8792],()=>e(e.s=46248)),_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.