PageSourceSearch

https://stick.ly/chunk-E7BTPRFP.js

js stick.ly collected 2026-09-24 14:24:47 UTC 4,989 bytes, 1 lines download raw bytes

1import{a as L}from"./chunk-JJOYE3Z2.js";import{f as k}from"./chunk-QHHKP5DR.js";import"./chunk-ZXV3QX2B.js";import"./chunk-THZ2D63W.js";import"./chunk-VOC6FNVG.js";import{a as w,e as y}from"./chunk-FBNJQQ35.js";import"./chunk-X7XWPRUP.js";import"./chunk-OWNE2HX6.js";import{p as b,r as $}from"./chunk-O244GM7M.js";import{r as P}from"./chunk-2BFNCTTG.js";import{Ac as O,Da as p,Lb as m,Nb as U,Tb as n,Ub as a,Vb as I,Z as S,Za as f,ba as E,gc as r,mb as u,mc as M,rb as C,zc as R}from"./chunk-OJHC7XXI.js";import"./chunk-WDH2R6TX.js";import{h as d}from"./chunk-WT3RV3XA.js";var v="stickly-safari",h="stickly-safari://auth/callback",D=/^[A-Za-z0-9._~-]+$/,q=/^[A-Za-z0-9_-]{43,128}$/,z=/^[A-Za-z0-9_-]{32,256}$/,G="The requesting app is not recognized.",X="The return address is not allowed.",F="The secure sign-in challenge is invalid.",j="The sign-in request state is invalid.";function V(i){let e=i.get("state")??"",t=i.get("codeChallenge")??"",o=i.get("codeChallengeMethod"),c=i.get("audience"),l=i.get("redirectUri");if(c!==v)return{ok:!1,reason:G};if(l!==h)return{ok:!1,reason:X};if(o!=="S256"||!q.test(t))return{ok:!1,reason:F};if(e.length<32||e.length>128||!D.test(e))return{ok:!1,reason:j};let _={state:e,codeChallenge:t,codeChallengeMethod:"S256",audience:v,redirectUri:h},A=new URLSearchParams({state:e,codeChallenge:t,codeChallengeMethod:"S256",audience:v,redirectUri:h});return{ok:!0,request:_,returnUrl:`/native-auth?${A.toString()}`};}function K(i,e){if(e.state!==i.state)throw new Error("Native auth state did not match.");if(!z.test(e.code))throw new Error("Native auth code was invalid.");if(!Number.isSafeInteger(e.expiresIn)||e.expiresIn<1||e.expiresIn>
1120)throw new Error("Native auth code lifetime was invalid.");let t=new URL(h);return t.searchParams.set("code",e.code),t.searchParams.set("state",e.state),t.toString();}var T=class i{constructor(e){this.functions=e;}functions;createCallbackUrl(e){return d(this,null,function*(){let o=yield y(this.functions,"createSafariNativeAuthCode")(e);return K(e,o.data);});}static ɵfac=function(t){return new(t||i)(E(w));};static ɵprov=S({token:i,factory:i.ɵfac,providedIn:"root"});};function Y(i,e){if(i&1&&(n(0,"p",11),r(1,0),a(),n(2,"h1",12),r(3,1),a(),n(4,"p",13),R(5),a()),i&2){let t=M();f(5),O(t.errorMessage);}}function B(i,e){i&1&&(n(0,"p",14),r(1,2),a(),n(2,"h1",12),r(3,3),a(),n(4,"p",13),r(5,4),a());}function Q(i,e){i&1&&(n(0,"p",14),r(1,5),a(),n(2,"h1",12),r(3,6),a(),n(4,"p",15),r(5,7),a());}var H=class i{constructor(e,t,o,c,l){this.route=e;this.router=t;this.auth=o;this.nativeAuth=c;this.platformId=l;}route;router;auth;nativeAuth;platformId;viewState="checking";errorMessage="";request;returnUrl="";completionStarted=!1;ngOnInit(){let e=V(this.route.snapshot.queryParamMap);if(e.ok===!1){this.viewState="invalid",this.errorMessage=e.reason;return;}this.request=e.request,this.returnUrl=e.returnUrl,this.handleCurrentUser();}handleCurrentUser(){return d(this,null,function*(){if(!(this.completionStarted||!this.request||!P(this.platformId))){this.completionStarted=!0;try{let e=yield this.auth.waitForCurrentUser();if(!e||e.isAnonymous){yield this.router.navigate(["/login"],{queryParams:{returnUrl:this.returnUrl},replaceUrl:!0});return;}this.viewState="authorizing";let t=yield this.nativeAuth.createCallbackUrl(this.request);window.location.assign(t);}catch{this.viewState="unavailable";}}});}static ɵfac=function(t){return new(t||i)(u(b),u($),u(k),u(T),u(p));};static ɵcmp=C({type:i,selectors:[["app-native-auth"]],decls:7,vars:1,consts:()=>{let e;e="Stickly logo";let t;t="Sign-in blocked";let o;o="This Safari sign-in request is invalid.";let c;c="Couldn\u2019t finish sign-in";let l;l="Return to the Stickly app and try again.";let _;_="No account token was shared. The secure one-time handoff could not be created.";let A;A="Connecting Stickly for Safari";let N;N="Finishing your secure sign-in\u2026";let g;return g="Keep this window open. You\u2019ll return to the Stickly app automatically.",[t,o,c,l,_,A,N,g,[1,"mx-auto","flex","min-h-[60vh]","w-full","max-w-xl","items-center","py-10","text-ink"],[1,"w-full","rounded-[1.5rem]","border","border-border/30","bg-surface/95","p-6","text-center","shadow-medium","sm:p-8"],["src","assets/images/logo_large_white.svg","alt",e,1,"mx-auto","mb-5","w-28"],[1,"mb-2","text-xs","font-extrabold","uppercase","tracking-[0.16em]","text-danger"],[1,"text-2xl","font-extrabold","tracking-[-0.03em]"],["role","alert",1,"mt-3","text-sm","leading-6","text-muted"],[1,"mb-2","text-xs","font-extrabold","uppercase","tracking-[0.16em]","text-accent"],["role","status",1,"mt-3","text-sm","leading-6","text-muted"]];},template:function(t,o){t&1&&(n(0,"app-page-frame")(1,"section",8)(2,"div",9),I(3,"img",10),m(4,Y,6,1)(5,B,6,0)(6,Q,6,0),a()()()),t&2&&(f(4),U(o.viewState==="invalid"?4:o.viewState==="unavailable"?5:6));},dependencies:[L],encapsulation:2});};export{H as NativeAuthComponent};/**i18n:d66136fa260c67025c6e37fa0875946a09ce0639e213b57559c7174a0b1cad56*/

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.