PageSourceSearch

https://www.steamboatpilot.com/wp-content/plugins/swift-auth/build/index.js?ver=c4e94b8a22198b424058

js steamboatpilot.com collected 2026-10-02 02:50:44 UTC 30,232 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={338(e,t,a){var n=a(795);t.H=n.createRoot,n.hydrateRoot},795(e){e.exports=window.ReactDOM}},t={};const a=window.React;var n=function a(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,a),i.exports}(338);let o=!1;window.SwiftAuth?.isInitialized&&(o=!0),window.addEventListener("swiftauth:initialized",()=>{o=!0,d()}),setTimeout(()=>{o||(console.warn("[authBridge] Legacy bundle init timeout, proceeding anyway"),o=!0,d())},2e3);let i=new Set,s=!1,r=null,l=u(),c=null,m=!1;function u(){const e=window.swiftAuthConfig||{},t=window.SwiftAuth?.getState?.()||{},a=t.authLevel||"anonymous",n="full"===a,i=t.sub||null,r=window.SwiftAuth?.getEntitlementStatus?.()||{hasActive:!1},l=!!e.paywall?.enabled;return{user:n?{sub:i}:null,profile:t.profile||null,isLoading:!o,isAuthenticated:n,authLevel:a,sub:i,hydrated:s,isEntitled:r.hasActive,isPaywallSite:l}}function d(){const e=u();e.authLevel===l.authLevel&&e.sub===l.sub&&e.isAuthenticated===l.isAuthenticated&&e.profile===l.profile&&e.isLoading===l.isLoading&&e.isEntitled===l.isEntitled||(l=e,i.forEach(e=>e()))}async function f(){if(s)return!0;if(r)return r;const e=u();if(!e.isAuthenticated||"full"!==e.authLevel)return!1;const t=window.SwiftAuth?.getUserDataManager?.();if(!t||!t.isReady())return!1;try{return r=t.hydrate(),await r,s=!0,d(),console.log("[authBridge] Profile hydrated successfully"),!0}catch(e){return console.warn("[authBridge] Profile hydration failed:",e),r=null,!1}}function w(){window.location.pathname.includes("/myprofile/")&&!s&&f()}async function g(){if(m)return;if(!u().isAuthenticated)return;const e=window.SwiftAuth?.getUserDataManager?.();if(e&&e.isReady())try{m=!0;const t=await e.getProfile();t&&!window.SwiftAuth.getState().profile?(l={...l,profile:t},i.forEach(e=>e())):d()}catch(e){console.warn("SwiftAuth Bridge: Failed to fetch profile",e),m=!1}}"undefined"!=typeof window&&(window.addEventListener("swiftauth:statechange",function(){m=!1,d(),g()}),window.addEventListener("swiftauth:login",()=>{f()}),window.addEventListener("swiftauth:logout",()=>{s=!1,r=null,d()})),l=u(),w();const p=function(e){return i.add(e),1===i.size&&(c||(w(),c=setInterval(()=>{d(),g(),w()},2e3))),()=>{i.delete(e),0===i.size&&c&&(clearInterval(c),c=null)}},h=function(){return l},E=(0,a.createContext)(null),y=({children:e})=>{const t=(0,a.useSyncExternalStore)(p,h),n={user:t.user,profile:t.profile,isLoading:t.isLoading,isAuthenticated:t.isAuthenticated,authLevel:t.authLevel,isEntitled:t.isEntitled,isPaywallSite:t.isPaywallSite,signOut:async()=>{try{if(window.SwiftAuth?.logout){const e=await window.SwiftAuth.logout();e?.success&&(window.location.href="/")}}catch(e){console.error("SwiftAuth: signOut failed",e)}}};return(0,a.createElement)(E.Provider,{value:n},e)},b=()=>{const e=(0,a.useContext)(E);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},v=()=>{const{isAuthenticated:e,isLoading:t,isEntitled:n,isPaywallSite:o}=b();if(t)return null;if(e){const e=o&&!n;return(0,a.createElement)("div",{className:"swift-auth-user"},e&&(0,a.createElement)("a",{href:"/subscribe/",className:"swift-nav-subscribe-link",onClick:()=>{try{sessionStorage.setItem("swift_conversion_source","navbar"),sessionStorage.setItem("swift_conversion_url",window.location.href)}catch(e){}window.SwiftAnalytics?.trackBeginCheckout&&window.SwiftAnalytics.trackBeginCheckout("navbar",window.location.href)}},"Subscribe"),(0,a.createElement)("a",{href:"/myprofile/","data-swift-auth-nav":"user",className:"nav-link desktop-account-icon"+(e?" swift-hide-mobile":""),"aria-label":"My profile"},(0,a.createElement)("div",{className:"user-icon-wrapper logged-in d-flex align-items-center",id:"userStatus"},(0,a.createElement)("svg",{className:"svg-icon fa-user",viewBox:"0 0 512 512"},(0,a.createElement)("use",{href:"#fa-user"})),(0,a.createElement)("span",{className:"status-dot"}))))}return(0,a.createElement)("div",{className:"swift-auth-guest"},(0,a.createElement)("a",{href:"/authentication/","data-swift-auth-nav":"guest",className:"nav-link desktop-account-login",onClick:e=>{window.SwiftAuth?.setReturnUrl&&window.SwiftAuth.setReturnUrl(window.location.href)}},(0,a.createElement)("button",{role:"button",className:"btn btn-primary btn-sm"},"Sign In")))},N=(e=1e4)=>new Promise((t,a)=>{const n=Date.now(),o=()=>{const i=window.SwiftAuth?.getUserDataManager?.();return i&&i.isReady()?t(i):Date.now()-n>e?a(new Error("UserDataManager not ready within timeout")):void setTimeout(o,250)};o()}),S=async()=>{const e=await N();return await e.getProfile()||{}},A=async e=>{const t=await N();return await t.updateProfile(e)},C=async()=>{const e=await N();return await e.getBookmarks()||[]};const P=()=>{const{authLevel:e,isLoading:t}=b(),[n,o]=(0,a.useState)(""),[i,s]=(0,a.useState)(""),[r,l]=(0,a.useState)(null),[c,m]=(0,a.useState)(1),[u,d]=(0,a.useState)(!1),[f,w]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),[h,E]=(0,a.useState)(null),[y,v]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let a=!0,n=null;return(async()=>
1{if(console.log("SwiftAuth Onboarding: Starting load",{authLoading:t,authLevel:e}),t)console.log("SwiftAuth Onboarding: Waiting for auth...");else{if("full"!==e)return console.log("SwiftAuth Onboarding: Not authenticated (waiting 2.5s for auth update)"),void(n=setTimeout(()=>{a&&"full"!==e&&(console.log("SwiftAuth Onboarding: Still not authenticated after delay"),v(!0))},2500));try{console.log("SwiftAuth Onboarding: Loading profile...");const e=await S();if(console.log("SwiftAuth Onboarding: Profile loaded",e),a){if(e?.givenName||e?.familyName){const t=[e.givenName,e.familyName].filter(Boolean).join(" ");o(t)}e?.postalCode&&(s(e.postalCode),console.log("SwiftAuth Onboarding: Pre-filled zip code:",e.postalCode)),C(Boolean(e?.postalCode||e?.givenName||e?.familyName)),v(!0)}}catch(e){console.error("SwiftAuth: Failed to load profile for onboarding:",e),a&&v(!0)}}})(),()=>{a=!1,n&&clearTimeout(n)}},[e,t]);const P=()=>{p(null),m(2)},k=async()=>{w(!0),E(null),p(null);try{console.log("SwiftAuth Onboarding: Requesting geolocation...");const e=await async function(){try{const e=await async function(){return new Promise((e,t)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(e,t,{enableHighAccuracy:!0,timeout:3e4,maximumAge:3e5}):t(new Error("Geolocation is not supported by this browser"))})}(),{latitude:t,longitude:a}=e.coords;console.log("Geolocation: Got coordinates",{latitude:t,longitude:a});const n=await async function(e,t){const a=window.swiftAuthConfig?.googleMaps?.apiKey;if(!a)throw new Error("Google Maps API key not configured. Please contact support.");const n=new URL("https://maps.googleapis.com/maps/api/geocode/json");n.searchParams.set("latlng",`${e},${t}`),n.searchParams.set("key",a);const o=await fetch(n.toString());if(!o.ok)throw new Error(`Reverse geocoding failed: ${o.statusText}`);const i=await o.json();if("OK"!==i.status)throw new Error(`Reverse geocoding error: ${i.status}`);return i}(t,a);return console.log("Geolocation: Google reverse geocode success",n),function(e,t,a){const n=e.results?.[0];if(!n)throw new Error("No results found for location");const o={};return n.address_components?.forEach(e=>{const t=e.types;t.includes("postal_code")&&(o.postalCode=e.long_name),t.includes("locality")&&(o.city=e.long_name),t.includes("administrative_area_level_2")&&(o.county=e.long_name),t.includes("administrative_area_level_1")&&(o.state=e.long_name),t.includes("country")&&(o.country=e.long_name)}),{postalCode:o.postalCode||null,city:o.city||null,county:o.county||null,state:o.state||null,country:o.country||null,latitude:t,longitude:a,formattedAddress:n.formatted_address||null,locationUpdatedAt:(new Date).toISOString()}}(n,t,a)}catch(e){if(console.error("Geolocation error details:",{code:e.code,message:e.message,type:e.constructor.name,isSecureContext:window.isSecureContext,protocol:window.location.protocol}),1===e.code)throw new Error("Location permission denied. Please enter your zip code manually.");if(2===e.code)throw new Error("Location unavailable. Please enter your zip code manually.");if(3===e.code)throw new Error("Location request timed out. Please try again or enter your zip code manually.");throw e}}();console.log("SwiftAuth Onboarding: Geolocation success",e),l(e),e.postalCode?s(e.postalCode):E("We got your location, but couldn't find a zip code. Please enter it manually.")}catch(e){console.error("SwiftAuth Onboarding: Geolocation error",e);const t=function(e){return 1===e.code?"No problem! You can enter your postal code manually instead.":2===e.code?window.isSecureContext||"localhost"===window.location.hostname?navigator.platform.toUpperCase().indexOf("MAC")>=0?"Location unavailable. On Mac, check System Settings → Privacy & Security → Location Services. Or enter your postal code manually.":"We couldn't detect your location. Please enter your postal code manually.":"Location requires HTTPS. Please enter your postal code manually.":3===e.code?"Location request timed out. Please try again or enter your postal code manually.":e.message?e.message:"Unable to get your location. Please enter your postal code manually."}(e);E(t)}finally{w(!1)}};return y?"full"!==e?(0,a.createElement)("div",{className:"swift-onboarding-container"},(0,a.createElement)("div",{className:"swift-onboarding-card"},(0,a.createElement)("div",{className:"alert alert-warning"},(0,a.createElement)("strong",null,"Authentication Required"),(0,a.createElement)("p",null,"Please sign in to complete your profile."),(0,a.createElement)("a",{href:"/authentication/",className:"btn btn-primary"},"Sign In")))):(0,a.createElement)("div",{className:"swift-onboarding-container"},(0,a.createElement)("div",{className:"swift-onboarding-card"},(0,a.createElement)("div",{className:"swift-onboarding-progress"}
1,(0,a.createElement)("span",{className:"swift-onboarding-step "+(1===c?"active":"completed")},"1"),(0,a.createElement)("span",{className:"swift-onboarding-step-line"}),(0,a.createElement)("span",{className:"swift-onboarding-step "+(2===c?"active":"")},"2")),1===c&&(0,a.createElement)("div",{className:"swift-onboarding-step-content"},(0,a.createElement)("div",{className:"swift-onboarding-header"},(0,a.createElement)("h2",null,"What's your name?"),(0,a.createElement)("p",{className:"swift-onboarding-subtitle"},"This helps us personalize your experience.")),(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),P()},className:"swift-onboarding-form"},(0,a.createElement)("div",{className:"form-group"},(0,a.createElement)("label",{htmlFor:"full-name",className:"form-label"},"Full Name ",(0,a.createElement)("span",{className:"text-muted"},"(optional)")),(0,a.createElement)("input",{type:"text",id:"full-name",className:"form-control form-control-lg",placeholder:"Your name",value:n,onChange:e=>o(e.target.value),disabled:u,autoComplete:"name",autoFocus:!0})),g&&(0,a.createElement)("div",{className:"alert alert-danger",role:"alert"},g),(0,a.createElement)("div",{className:"swift-onboarding-actions"},(0,a.createElement)("button",{type:"submit",className:"btn btn-primary btn-lg",disabled:u},"Next"),(0,a.createElement)("button",{type:"button",className:"swift-btn swift-btn-outline",onClick:P,disabled:u},"Skip")))),2===c&&(0,a.createElement)("div",{className:"swift-onboarding-step-content"},(0,a.createElement)("div",{className:"swift-onboarding-header"},(0,a.createElement)("h2",null,"Where are you reading from?"),(0,a.createElement)("p",{className:"swift-onboarding-subtitle"},"This helps us bring you local news and stories relevant to your community.")),(0,a.createElement)("form",{onSubmit:async e=>{e.preventDefault(),p(null),d(!0);try{const{givenName:e,familyName:t}=(e=>{const t=e.trim();if(!t)return{givenName:"",familyName:""};const a=t.indexOf(" ");return-1===a?{givenName:t,familyName:""}:{givenName:t.substring(0,a),familyName:t.substring(a+1).trim()}})(n),a={givenName:e,familyName:t,postalCode:i.trim(),onboardingCompleted:!0};r&&(a.city=r.city,a.county=r.county,a.state=r.state,a.country=r.country,a.latitude=r.latitude,a.longitude=r.longitude,a.formattedAddress=r.formattedAddress,a.locationUpdatedAt=r.locationUpdatedAt),console.log("SwiftAuth Onboarding: Saving profile",a),await A(a);const o=window.SwiftAuth?.getReturnUrl?.();window.location.href=!o||o.includes("/authentication")||o.includes("/logout")?"/":o}catch(e){console.error("SwiftAuth: Onboarding error",e),p(e.message||"Failed to save your information. Please try again."),d(!1)}},className:"swift-onboarding-form"},!i&&!h&&(0,a.createElement)("div",{className:"form-group"},(0,a.createElement)("button",{type:"button",className:"btn btn-primary btn-lg btn-block",onClick:k,disabled:f||u},f?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),"Locating..."):(0,a.createElement)(a.Fragment,null,(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-geo-alt-fill me-2",viewBox:"0 0 16 16",style:{marginBottom:"2px"}},(0,a.createElement)("path",{d:"M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"})),"Locate me")),(0,a.createElement)("p",{className:"text-center text-muted mt-2 mb-3"},"or")),h&&(0,a.createElement)("div",{className:"alert alert-info mb-3",role:"alert"},h,h.includes("denied")&&(0,a.createElement)("button",{type:"button",className:"btn btn-sm btn-link",onClick:k,disabled:f},"Try again")),(0,a.createElement)("div",{className:"form-group"},(0,a.createElement)("label",{htmlFor:"postal-code",className:"form-label"},"Postal Code"),(0,a.createElement)("input",{type:"text",id:"postal-code",className:"form-control form-control-lg",placeholder:"e.g., 12345, SW1A 1AA, 110001",value:i,onChange:e=>s(e.target.value),disabled:u||f,autoFocus:h||N}),i&&r&&(0,a.createElement)("small",{className:"form-text text-success"},(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"
1currentColor",className:"bi bi-check-circle-fill me-1",viewBox:"0 0 16 16"},(0,a.createElement)("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})),"Location detected")),g&&(0,a.createElement)("div",{className:"alert alert-danger",role:"alert"},g),(0,a.createElement)("div",{className:"swift-onboarding-actions"},(0,a.createElement)("button",{type:"submit",className:"btn btn-primary btn-lg",disabled:u||!i.trim()},u?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),"Saving..."):"Done"),(0,a.createElement)("button",{type:"button",className:"swift-btn swift-btn-outline",onClick:async()=>{d(!0);try{await A({onboardingCompleted:!0})}catch(e){console.error("SwiftAuth: Failed to mark onboarding as complete:",e)}const e=window.SwiftAuth?.getReturnUrl?.();window.location.href=!e||e.includes("/authentication")||e.includes("/logout")?"/":e},disabled:u},"Skip for now")),(0,a.createElement)("div",{className:"swift-onboarding-back"},(0,a.createElement)("button",{type:"button",className:"btn btn-link",onClick:()=>{p(null),E(null),m(1)},disabled:u||f},"← Back")))))):(0,a.createElement)("div",{className:"swift-onboarding-container"},(0,a.createElement)("div",{className:"swift-onboarding-card"},(0,a.createElement)("div",{className:"swift-onboarding-header"},(0,a.createElement)("h2",null,"Welcome!"),(0,a.createElement)("p",{className:"swift-onboarding-subtitle"},"Just a moment while we get things ready...")),(0,a.createElement)("div",{className:"swift-onboarding-loading"},(0,a.createElement)("div",{className:"swift-onboarding-shimmer"}),(0,a.createElement)("div",{className:"swift-onboarding-shimmer"}),(0,a.createElement)("div",{className:"swift-onboarding-shimmer"}))))},k=()=>{const[e,t]=(0,a.useState)([]),[n,o]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!1;return(async()=>{const e=await N();return await e.getFollowedTopicsOnly()||[]})().then(function(a){if(!e){const e=a.filter(function(e){return"news"!==e.topicId});t(e),o(!1)}}).catch(function(){e||o(!1)}),function(){e=!0}},[]),n?null:(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Followed Topics (",e.length,")")),(0,a.createElement)("div",{className:"swift-section-content"},0===e.length?(0,a.createElement)("p",{className:"swift-empty-message"},"No followed topics yet. Follow topics from article pages to get personalized notifications."):(0,a.createElement)("div",{className:"swift-list"},e.map(function(n){var o=!1!==n.notificationsEnabled;return(0,a.createElement)("div",{key:n.topicId||n.SK,className:"swift-list-item swift-topic-item"},(0,a.createElement)("div",{className:"swift-topic-info"},(0,a.createElement)("span",{className:"swift-item-title"},n.topicName||n.topicId),(0,a.createElement)("span",{className:"swift-topic-badge"},(e=>{var t=e.topicType||"category";return t.charAt(0).toUpperCase()+t.slice(1)})(n))),(0,a.createElement)("div",{className:"swift-topic-actions"},(0,a.createElement)("label",{className:"swift-toggle",title:o?"Notifications on":"Notifications off"},(0,a.createElement)("input",{type:"checkbox",checked:o,onChange:function(){(async(a,n)=>{var o=!n;try{await(async(e,t)=>{const a=await N();return await a.updateTopicNotification(e,t)})(a,o);var i=e.map(function(e){return e.topicId===a?Object.assign({},e,{notificationsEnabled:o}):e});t(i),window.dispatchEvent(new CustomEvent("swiftauth:topics_changed",{detail:{topics:i}}))}catch(e){console.error("Failed to toggle notification:",e)}})(n.topicId,o)}}),(0,a.createElement)("span",{className:"swift-toggle-slider"}),(0,a.createElement)("span",{className:"swift-toggle-label"},o?"Notifications on":"Notifications off")),(0,a.createElement)("button",{onClick:function(){(async a=>{try{await(async e=>{const t=await N();return await t.unfollowTopic(e)})(a);const n=e.filter(function(e){return e.topicId!==a});t(n),window.dispatchEvent(new CustomEvent("swiftauth:topics_changed",{detail:{topics:n}}))}catch(e){console.error("Failed to unfollow topic:",e)}})(n.topicId)},className:"swift-item-remove","aria-label":"Unfollow",title:"Unfollow topic"},"×")))}))))};function x(){return(window.swiftAuthAjax||{}).ajaxUrl||"/wp-admin/admin-ajax.php"}const L=async()=>{const e=await function(e,t={}){return fetch(x()+"?action=swift_get_nonce",{credentials:"same-origin"}).then(function(e){return e.json()}).then(function(e){return e.data.nonce}).then(function(a){var n=new FormData;n.append("action",e),n.append("nonce",a),Object.keys(t).forEach(function(e){n.append(e,t[e])});var o={},i=function(){try{var e=window.swiftAuthConfig||{},t=e.cognito&&e.cognito.clientId;if(!t)return null;var a="CognitoIdentityServiceProvider."+t+".LastAuthUser",n=localStorage.getItem(a);if(!n)return null;var o="CognitoIdentityServiceProvider."+t+"."+n+".idToken";return localStorage.getItem(o)}catch(e){return null}}();return i&&(o.Authorization="Bearer "+i),fetch(x(),{method:"POST",body:n,credentials:"same-origin",headers:o}).then(function(e){return e.json()})})}("swift_photo_purchases");if(e.success)return e.licenses||[];throw new Error(e.error||"Failed to fetch purchases")},I=window.swiftAuthConfig?.photoSales?.licenseTermsUrl||"/photo-license-terms/",O=()=>{const[e,t]=(0,a.useState)([]),[n,o]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!1;return L().then(a=>{e||t(a)}).catch(e=>{console.error("Failed to load photo purchases:",e)}).finally(()=>{e||o(!1)}),()=>{e=!0}},[]),n?(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Purchased Photos")),(0,a.createElement)("div",{className:"swift-section-content"},(0,a.createElement)("p",{className:"swift-empty-message"},"Loading..."))):(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Purchased Photos (",e.length,")"),e.length>0&&(0,a.createElement)("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"swift-btn swift-btn-outline swift-btn-sm"},"License Terms")),(0,a.createElement)("div",{className:"swift-section-content"},0===e.length?(0,a.createElement)("p",{className:"swift-empty-message"},"No photo purchases yet."):(0,a.createElement)("div",{className:"swift-photo-purchases-gri
1d"},e.map(e=>{const t=e.licenseId,n=e.photoCaption||"Photo",o=e.postTitle||"",i=e.photoUrl||"",s=e.createdAt?new Date(e.createdAt).toLocaleDateString():"",r=e.amountCents?"$"+(e.amountCents/100).toFixed(2):"";return(0,a.createElement)("div",{key:t,className:"swift-photo-purchase-item"},i&&(0,a.createElement)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"swift-photo-purchase-thumb"},(0,a.createElement)("img",{src:i,alt:n,loading:"lazy"})),(0,a.createElement)("div",{className:"swift-photo-purchase-info"},(0,a.createElement)("div",{className:"swift-photo-purchase-caption"},n),o&&(0,a.createElement)("div",{className:"swift-photo-purchase-article"},"From: ",e.postId?(0,a.createElement)("a",{href:"/?p="+e.postId},o):o),(0,a.createElement)("div",{className:"swift-photo-purchase-meta"},s&&(0,a.createElement)("span",null,s),r&&(0,a.createElement)("span",null," · ",r))),i&&(0,a.createElement)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"swift-btn swift-btn-primary swift-btn-sm"},"Download"))}))))},F=()=>(0,a.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},(0,a.createElement)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,a.createElement)("circle",{cx:"12",cy:"12",r:"3"})),T=()=>(0,a.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},(0,a.createElement)("path",{d:"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"}),(0,a.createElement)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})),_=({name:e,visible:t,onToggle:n,...o})=>(0,a.createElement)("div",{className:"swift-password-wrapper"},(0,a.createElement)("input",{name:e,type:t?"text":"password",className:"swift-input",...o}),(0,a.createElement)("button",{type:"button",className:"swift-password-toggle",onClick:n,"aria-label":t?"Hide password":"Show password"},t?(0,a.createElement)(T,null):(0,a.createElement)(F,null))),B=()=>{const{isAuthenticated:e,isLoading:t,signOut:n}=b(),[o,i]=(0,a.useState)(null),[s,r]=(0,a.useState)([]),[l,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[d,f]=(0,a.useState)({text:"",type:""}),[w,g]=(0,a.useState)(!1),[p,h]=(0,a.useState)({text:"",type:""}),[E,y]=(0,a.useState)(!1),[v,P]=(0,a.useState)({currentPassword:!1,newPassword:!1,confirmPassword:!1});return(0,a.useEffect)(()=>{if(!e)return;let t=!1;return c(!0),(async()=>{try{const[e,a]=await Promise.all([S(),C()]);t||(i(e),r(a),window.SwiftAnalytics&&window.SwiftAnalytics.trackProfileViewed())}catch(e){console.error("Failed to load profile data:",e)}finally{t||c(!1)}})(),()=>{t=!0}},[e]),t||e?t||l?(0,a.createElement)("div",{className:"swift-profile-loading text-center"},"Loading your profile..."):(0,a.createElement)("div",{className:"swift-profile-container"},(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Profile Information")),(0,a.createElement)("div",{className:"swift-section-content"},(0,a.createElement)("form",{onSubmit:async e=>{e.preventDefault(),u(!0),f({text:"Saving...",type:"info"});const t=new FormData(e.target),a={givenName:t.get("givenName"),familyName:t.get("familyName"),postalCode:t.get("postalCode")};try{await A(a),f({text:"Changes saved successfully!",type:"success"}),setTimeout(()=>f({text:"",type:""}),3e3)}catch(e){f({text:"Failed to save changes.",type:"danger"})}finally{u(!1)}}},(0,a.createElement)("div",{className:"swift-form-row"},(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"First Name"),(0,a.createElement)("input",{name:"givenName",defaultValue:o?.givenName||"",className:"swift-input"})),(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"Last Name"),(0,a.createElement)("input",{name:"familyName",defaultValue:o?.familyName||"",className:"swift-input"}))),(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"Email"),(0,a.createElement)("div",{className:"swift-email-display"},o?.email||"N/A")),(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"Postal Code"),(0,a.createElement)("input",{name:"postalCode",defaultValue:o?.postalCode||"",className:"swift-input"})),(0,a.createElement)("div",{className:"swift-form-actions"},(0,a.createElement)("button",{type:"submit",className:"swift-btn swift-btn-primary",disabled:m},m?"Saving...":"Save Changes"),d.text&&(0,a.createElement)("span",{className:`swift-save-status text-${d.type}`},d.text))))),(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Change Password"),(0,a.createElement)("button",{type:"button",className:"swift-btn swift-btn-outline swift-btn-sm",onClick:()=>{g(!w),h({text:"",type:""})}},w?"Cancel":"Change Password")),w&&(0,a.createElement)("div",{className:"swift-section-content"},(0,a.createElement)("form",{onSubmit:async e=>{e.preventDefault();const t=new FormData(e.target),a=t.get("currentPassword"),n=t.get("newPassword");if(n===t.get("confirmPassword"))if(n.length<8)h({text:"Password must be at least 8 characters.",type:"danger"});else{y(!0),h({text:"",type:""});try{await window.SwiftAuth.changePassword(a,n),h({text:"Password changed successfully!",type:"success"}),e.target.reset(),setTimeout(()=>{g(!1),h({text:"",type:""})},3e3)}catch(e){const t=e.message||"Failed to change password.";h({text:t,type:"danger"})}finally{y(!1)}}else h({text:"New passwords do not match.",type:"danger"})}},(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"Current Password"),(0,a.createElement)(_,{name:"currentPassword",required:!0,autoComplete:"current-password",visible:v.currentPassword,onToggle:()=>P(e=>({...e,currentPassword:!e.currentPassword}))})),(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"New Password"),(0,a.createElement)(_,{name:"newPassword",required:!0,minLength:8,autoComplete:"new-password",visible:v.newPassword,onToggle:()=>P(e=>({...e,newPassword:!e.newPassword}))})),(0,a.createElement)("div",{className:"swift-form-group"},(0,a.createElement)("label",null,"Confirm New Password"),(0,a.createElement)(_,{name:"confirmPassword",required:!0,minLength:8,autoComplete:"new-password",visible:v.confirmPassword,onToggle:()=>P(e=>({...e,confirmPassword:!e.confirmPassword}))})),(0,a.createElement)("div",{className:"swift-form-actions"},(0,a.createElement)("button",{type:"submit",className:"swift-btn swift-btn-primary",disabled:E},E?"Changing...":"Update Password"),p.text&&(0,a.createElement)("span",{className:`swift-save-status text-${p.type}`},p.text))))),(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-header"},(0,a.createElement)("h3",null,"Bookmarks (",s.length,")")),(0,a.createElement)("div",{className:"swift-section-content"},0===s.length?(0,a.createElement)("p",{className:"swift-empty-message"},"No bookmarks yet."):(0,a.createElement)("div",{className:"swift-list"},s.map((e,t)=>{const n=e.postId||e.SK?.replace("BOOKMARK#","")||t,o=e.articleUrl||e.bookmarkShortlink||e.url||"#",i=e.articleTitle||e.bookmarkTitle||e.title||"Untitled";return(0,a.createElement)("div",{key:e.SK||n,className:"swift-list-item"},(0,a.createElement)("a",{href:o,className:"swift-item-title"},i),(0,a.createElement)("button",{onClick:()=>(async e=>{try{await(async e=>{const t=await N();return await t.removeBookmark(e)})(e),r(s.filter(t=>(t.postId||t.SK?.replace("BOOKMARK#",""))!==e)),window.SwiftAnalytics&&window.SwiftAnalytics.trackBookmarkRemoved(e)}catch(e){console.error("Failed to remove bookmark:",e)}})(n),className:"swift-item-remove","aria-label":"Remove"},"×"))})))),(0,a.createElement)(k,null),window.swiftAuthConfig?.photoSales?.enabled&&(0,a.createElement)(O,null),(0,a.createElement)("div",{className:"swift-profile-footer"},(0,a.createElement)("button",{onClick:n,className:"swift-btn swift-btn-outline"},"Sign Out"))):(0,a.createElement)("div",{className:"swift-profile-container"},(0,a.createElement)("div",{className:"swift-profile-section"},(0,a.createElement)("div",{className:"swift-section-content",style:{textAlign:"center",padding:"40px 20px"}},(0,a.createElement)("h3",null,"Please Log In"),(0,a.createElement)("p",{style:{marginBottom:"20px"}},"You need to be logged in to view your profile."),(0,a.createElement)("a",{href:"/authentication/",className:"swift-btn swift-btn-primary"},"Log In"))))};document.addEventListener("DOMContentLoaded",()=>{window.swiftAuthConfig,document.addEventListener("click",e=>{const t=e.target.closest("[data-swift-subscribe]");if(!t)return;e.preventDefault();const a=t.getAttribute("href")||"/subscribe/",n=window.location.href,o=a.includes("?")?"&":"?",i=`${a}${o}return_to=${encodeURIComponent(n)}`;window.location.href=i});const e=document.getElementById("swift-auth-nav-root");e&&(0,n.H)(e).render((0,a.createElement)(y,null,(0,a.createElement)(v,null)));const t=document.getElementById("swift-profile-root");t&&(0,n.H)(t).render((0,a.createElement)(y,null,(0,a.createElement)(B,null)));const o=document.getElementById("swift-onboarding-root");o&&(0,n.H)(o).render((0,a.createElement)(y,null,(0,a.createElement)(P,null)))})})();

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.