1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BsT-2Kzx.js","assets/index-fhNmtqR0.js","assets/index-CYi2wWBx.js"])))=>i.map(i=>d[i]); 2import{r as b,x as d,C as T,_ as S,j as i,B as j,G as L,t as g,y as _,z as N}from"./index-fhNmtqR0.js";import{L as O}from"./label-DW9JlLIS.js";const P="kult_post_auth_video";function Q(t){try{localStorage.setItem(P,t)}catch{}}function X(){try{const t=localStorage.getItem(P);return t&&localStorage.removeItem(P),t||null}catch{return null}}function G(t){b.useEffect(function(){if(t){var e=document.querySelectorAll('script[src="'.concat(t,'"]'))[0];e||(e=document.createElement("script"),e.src=t,e.async=!0,document.body.appendChild(e))}},[t])}var R=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},r=n.pollFrequency,a=r===void 0?1e3:r,s=n.retries,c=s===void 0?100:s,p=n.parent,u=p===void 0?window:p;if(u&&u.hasOwnProperty(e))return Promise.resolve(u[e]);if(!c)return Promise.resolve(void 0);var f=c-1;return new Promise(function(h){return setTimeout(h,typeof a=="function"?a({retries:f}):a)}).then(function(){return t(e,{pollFrequency:a,parent:u,retries:f})})},B="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",z=function(e){var n=e.authOptions,r=e.onSuccess,a=e.onError;return R("AppleID").then(function(){window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(n);var s=window.AppleID.auth.signIn();return n.usePopup?s.then(function(c){return r&&r(c),c}).catch(function(c){return a?a(c):console.error(c),null}):(s&&typeof s.catch=="function"&&s.catch(function(){}),null)}).catch(function(s){return a?a(s):console.error(s),null})};const F={APPLE_SCRIPT_SRC:B,signIn:z};var M=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function x(){return x=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},x.apply(this,arguments)}function A(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function V(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?A(Object(n),!0).forEach(function(r){$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W(t,e){if(t==null)return{};var n=q(t,e),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function q(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,s;for(s=0;s<r.length;s++)a=r[s],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}var H=` 3.react-apple-signin-auth-btn { 4 background-color: transparent; 5 border: none; 6 padding: 0; 7 cursor: pointer; 8 border-radius: 4px; 9 padding: 0 8px 0 2px; 10 font-size: 14px; 11 font-size: 1em; 12 line-height: 1; 13 border: 1px solid #000; 14 overflow: hidden; 15 display: inline-flex; 16 justify-content: center; 17 align-items: center; 18} 19.react-apple-signin-auth-btn-light { 20 background-color: #FFF; 21 color: #000; 22 border-color: #000; 23} 24.react-apple-signin-auth-btn-dark { 25 background-color: #000; 26 color: #FFF; 27 border-color: #FFF; 28}`.replace(/ {2}|\n/g,""),U=function(e){var n=e.onSuccess,r=e.onError,a=e.skipScript,s=a===void 0?!1:a,c=e.authOptions,p=e.iconProps,u=e.render,f=e.uiType,h=f===void 0?"dark":f,v=e.className,w=e.noDefaultStyle,y=w===void 0?!1:w,o=e.buttonExtraChildren,l=o===void 0?"Continue with Apple":o,m=W(e,M);G(s?null:F.APPLE_SCRIPT_SRC);var C=function(E){E&&(E.preventDefault(),E.stopPropagation()),F.signIn({authOptions:c,onSuccess:n,onError:r})},I=V({children:d.createElement(d.Fragment,null,d.createElement("svg",x({width:"24px",height:"44px",viewBox:"0 0 24 44"},p),d.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("rect",{fill:h==="light"?"#FFF":"#000",x:"0",y:"0",width:"24",height:"44"}),d.createElement("path",{d:"M12.2337427,16.9879688 C12.8896607,16.9879688 13.7118677,16.5445313 14.2014966,15.9532812 C14.6449341,15.4174609 14.968274,14.6691602 14.968274,13.9208594 C14.968274,13.8192383 14.9590357,13.7176172 14.9405591,13.6344727 C14.2107349,13.6621875 13.3330982,14.1241016 12.8065162,14.7430664 C12.3907935,15.2142188 12.012024,15.9532812 12.012024,16.7108203 C12.012024,16.8216797 12.0305005,16.9325391 12.0397388,16.9694922 C12.0859302,16.9787305 12.1598365,16.9879688 12.2337427,16.9879688 Z M9.92417241,28.1662891 C10.8202857,28.1662891 11.2175318,27.56
2858008 12.3353638,27.5658008 C13.4716724,27.5658008 13.721106,28.1478125 14.7188404,28.1478125 C15.6980982,28.1478125 16.3540162,27.2424609 16.972981,26.3555859 C17.6658521,25.339375 17.9522388,24.3416406 17.9707154,24.2954492 C17.9060474,24.2769727 16.0306763,23.5101953 16.0306763,21.3576758 C16.0306763,19.491543 17.5088013,18.6508594 17.5919459,18.5861914 C16.612688,17.1819727 15.1253248,17.1450195 14.7188404,17.1450195 C13.6194849,17.1450195 12.7233716,17.8101758 12.1598365,17.8101758 C11.5501099,17.8101758 10.7463794,17.1819727 9.79483648,17.1819727 C7.98413335,17.1819727 6.14571538,18.6785742 6.14571538,21.5054883 C6.14571538,23.2607617 6.8293482,25.1176563 7.67003179,26.3186328 C8.39061773,27.3348438 9.01882085,28.1662891 9.92417241,28.1662891 Z",fill:h==="light"?"#000":"#FFF",fillRule:"nonzero"}))),l),onClick:C},m);return u?u(I):d.createElement(d.Fragment,null,d.createElement("button",x({className:"".concat(y?"":"react-apple-signin-auth-btn react-apple-signin-auth-btn-".concat(h)).concat(v?" ".concat(v):""),type:"button","aria-label":"Signin with apple ID"},I)),y?null:d.createElement("style",null,H))};const k=T.isNativePlatform();function D({className:t=""}){return i.jsx("svg",{viewBox:"0 0 24 24",className:t,fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M16.365 1.43c0 1.14-.493 2.27-1.177 3.08-.744.9-1.99 1.57-2.987 1.49-.12-1.17.461-2.35 1.179-3.08.744-.9 2.07-1.57 2.985-1.49zM20.5 17.36c-.49 1.07-.726 1.55-1.358 2.5-.88 1.32-2.12 2.96-3.66 2.97-1.37.01-1.72-.89-3.58-.88-1.86.01-2.25.9-3.62.89-1.54-.02-2.71-1.5-3.59-2.81C2.13 16.06 1.86 11.55 3.51 9.18c1.05-1.51 2.71-2.39 4.27-2.39 1.59 0 2.59.87 3.9.87 1.27 0 2.05-.87 3.89-.87 1.39 0 2.86.76 3.91 2.07-3.43 1.88-2.87 6.78.02 8.5z"})})}function K({className:t=""}){return i.jsxs("svg",{viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[i.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),i.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.99.69-2.26 1.1-3.71 1.1-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),i.jsx("path",{fill:"#FBBC05",d:"M5.84 14.14c-.22-.69-.35-1.42-.35-2.14s.13-1.45.35-2.14V7.02H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.98l2.83-2.21z"}),i.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.02l3.66 2.84c.87-2.6 3.3-4.48 6.16-4.48z"})]})}function ee({variant:t="default",disabled:e=!1}){const[n,r]=b.useState(!1),[a,s]=b.useState(!1),c="pt.kult.web",p="616275939450-vqtur9r55lothanupvrop7dsdngv3oku.apps.googleusercontent.com",u="",f=T.getPlatform()==="ios",h=!f||!!u;b.useEffect(()=>{!k||!p||!h||S(async()=>{const{SocialLogin:o}=await import("./index-BsT-2Kzx.js").then(l=>l.i);return{SocialLogin:o}},__vite__mapDeps([0,1])).then(({SocialLogin:o})=>{o.initialize({google:{webClientId:p,...f?{iOSClientId:u}:{},iOSServerClientId:p,mode:"online"}})})},[p,u,h,f]);const v=async o=>{if(!o.credential){g.error("Falha ao obter token do Google");return}try{await N(o.credential),window.location.href="/"}catch(l){g.error(l instanceof Error?l.message:"Falha ao entrar com Google")}},w=async()=>{s(!0);try{const{SocialLogin:o}=await S(async()=>{const{SocialLogin:m}=await import("./index-BsT-2Kzx.js").then(C=>C.i);return{SocialLogin:m}},__vite__mapDeps([0,1])),{result:l}=await o.login({provider:"google",options:{scopes:["email","profile"]}});if(l.responseType!=="online"||!l.idToken)throw new Error("Não recebi um idToken do Google");await N(l.idToken),window.location.href="/"}catch(o){o?.code!=="USER_CANCELLED"&&g.error(o instanceof Error?o.message:"Falha ao entrar com Google")}finally{s(!1)}},y=async()=>{r(!0);try{const{SignInWithApple:o}=await S(async()=>{const{SignInWithApple:m}=await import("./index-CYi2wWBx.js");return{SignInWithApple:m}},__vite__mapDeps([2,1])),{response:l}=await o.authorize({clientId:c??"",redirectURI:window.location.origin,scopes:"email name",state:Math.random().toString(36).slice(2),nonce:Math.random().toString(36).slice(2)});await _({user:l.identityToken,...l.email?{email:l.email}:{},...l.givenName||l.familyName?{fullName:{givenName:l.givenName??"",familyName:l.familyName??""}}:{}}),window.location.href="/"}catch(o){o?.code!=="1001"&&g.error(o instanceof Error?o.message:"Falha ao entrar com Apple")}finally{r(!1)}};return k?i.jsxs("div",{className:"flex flex-col gap-2",children:[h?i.jsxs(j,{type:"button",onClick:w,disabled:a||!p||e,className:"w-full rounded-full border border-border bg-card text-foreground hover:bg-muted",children:[a?i.jsx(O,{className:"h-4 w-4 animate-spin"}):i.jsx(K,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2",children:"Continuar com Google"})]}):i.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"Google Sign In não configurado (VITE_GOOGLE_IOS_CLIENT_ID ausente)."}),i.jsxs(j,{type:"button",onClick:y,disabled:n||e,className:"w-full rounded-full bg-black text-white hover:bg-black/90 border-0",children:[n?i.jsx(O,{className:"h-4 w-4 animate-spin"}):i.jsx(D,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2",children:"Continuar com Apple"})]})]}):i.jsxs("div",{className:`flex flex-col gap-2 ${e?"pointer-events-none opacity-50":""}`,children:[i.jsx("div",{className:"w-full overflow-hidden",children:i.jsx(L,{onSuccess:v,onError:()=>g.error("Falha ao entrar com Google"),shape:"pill",theme:"outline",text:"continue_with",size:"large",width:"100%"})}),i.jsx(U,{uiType:"dark",authOptions:{clientId:c,scope:"name email",redirectURI:`${window.location.origin}/auth/callback/apple`,usePopup:!0},onSuccess:async o=>{r(!0);try{await _({user:o.authorization.id_token,...o.user?.name?{fullName:{givenName:o.user.name.firstName??"",familyName:o.user.name.lastName??""}}:{}}),window.location.href="/"}catch(l){g.error(l instanceof Error?l.message:"Falha ao entrar com Apple")}finally{r(!1)}},onError:o=>{o?.error!=="popup_closed_by_user"&&g.error("Falha ao entrar com Apple"),r(!1)},render:o=>i.jsxs(j,{...o,type:"button",disabled:n||e,className:"w-full rounded-full bg-black text-white hover:bg-black/90 border-0",children:[n?i.jsx(O,{className:"h-4 w-4 animate-spin"}):i.jsx(D,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2",children:"Continuar com Apple"})]})})]})}export{ee as S,X as c,Q as s};
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.