@tanay-wispr/webflow-package 4.4.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/global.js +1 -0
  2. package/package.json +1 -1
package/dist/global.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(()=>{document.addEventListener("DOMContentLoaded",async()=>{let e=await(async()=>{try{let t=await navigator.userAgentData.getHighEntropyValues(["architecture","platform"]);return t.platform==="macOS"?t.architecture==="arm"?"mac_m1":"mac_intel":t.platform}catch{let{userAgent:t}=navigator;return t.includes("Macintosh")?"mac_intel":t.includes("Windows")?"Windows":t.includes("Linux")?"Linux":/iPhone|iPad|iPod/.test(t)?"iOS":/Android/.test(t)?"Android":"Unknown"}})();console.log("Platform: "+e),window.userPlatform=e;function d(){return new Promise(t=>{let r=0,i=50;function o(){if(r>=i){console.warn("PostHog not fully ready after max attempts, proceeding with limited functionality"),t(!1);return}if(r++,typeof posthog<"u"&&typeof posthog.getFeatureFlag=="function"&&posthog.get_distinct_id&&typeof posthog.get_distinct_id=="function")try{let n=posthog.get_distinct_id();setTimeout(()=>t(!0),50)}catch(n){console.error("Error getting distinct ID:",n),setTimeout(o,100)}else setTimeout(o,100)}o()})}await d();let l="download-vs-getstarted",a=(posthog.get_property("$override_feature_flags")||{})[l]||posthog.getFeatureFlag(l);window.useGetStarted=a==="get-started",posthog.capture("$feature_flag_called",{$feature_flag:l,$feature_flag_response:a}),console.log("Get Started exp:",window.useGetStarted),window.useGetStarted&&["app-download","mac-download","windows-download","download-btn"].forEach(r=>{document.querySelectorAll(`[${r}]`).forEach(o=>{o.removeAttribute(r),o.hasAttribute("href")&&!o.href.includes("/get-started")&&(o.href="/get-started"),o.onclick=n=>{let c=o.getAttribute("cta_location")||"page";return posthog.capture("download_page_redirect",{source:c,device_type:e}),!0}})});let s={mac_m1:"https://dl.wisprflow.ai/mac-apple/latest",mac_intel:"https://dl.wisprflow.ai/mac-intel/latest",Windows:"https://wispr-packages.s3.us-west-2.amazonaws.com/wispr-flow/win32/x64/Wispr+Flow+Setup.exe"},u={mac_m1:"/congratulations-mac",mac_intel:"/congratulations-mac",Windows:"/congratulations-windows"};document.querySelectorAll("[nav-link]").forEach(function(t){t.onclick=()=>(posthog.capture("nav_click",{nav_item:t.getAttribute("nav-link")}),!0)}),document.querySelectorAll("[cta]").forEach(function(t){t.onclick=()=>(posthog.capture("cta_click",{title:t.innerText,cta_location:t.getAttribute("cta_location"),cta_type:t.getAttribute("cta_type"),device_type:e}),!0)}),document.querySelectorAll("[download-btn]").forEach(function(t){t.onclick=()=>{let r=t.getAttribute("cta_location")||"page";return posthog.capture("app_download",{device_type:e,source:r,"$feature/download-vs-getstarted":a}),!0}}),document.querySelectorAll("[web-demo-open]").forEach(function(t){t.onclick=()=>(posthog.capture("web_demo_open",{title:t.innerText,device_type:window.userPlatform,source:t.getAttribute("cta_location")}),!0)}),document.querySelectorAll("[web-demo-close]").forEach(function(t){t.onclick=()=>(posthog.capture("web_demo_close",{device_type:window.userPlatform}),!0)}),document.querySelectorAll("[windows-download]").forEach(function(t){let r=t.getAttribute("cta_location")||"page";window.useGetStarted?(t.href="/get-started",t.onclick=()=>(posthog.capture("download_page_redirect",{source:r,device_type:e}),!0)):(t.href=s.Windows,e==="Windows"&&(t.onclick=()=>(setTimeout(()=>{window.location.href=u.Windows},5e3),!0)))}),document.querySelectorAll("[mac-download]").forEach(function(t){let r=t.getAttribute("cta_location")||"page";window.useGetStarted?(t.href="/get-started",t.onclick=()=>(posthog.capture("download_page_redirect",{source:r,device_type:e}),!0)):e==="mac_m1"||e==="mac_intel"?(t.href=s[e],t.onclick=()=>(setTimeout(()=>{window.location.href=u[e]},5e3),!0)):t.href="/get-started"}),document.querySelectorAll("[app-download]").forEach(function(t){let r=t.querySelectorAll("div"),i=t.id,o=i==="nav-download"?"nav":i==="footer-download"?"footer":t.getAttribute("cta_location")||"pricing";if(window.useGetStarted){var n=t.querySelector("svg");n&&n.remove(),r&&r.forEach(function(c){c.innerText="Get Started"}),t.href="/get-started",t.onclick=()=>(posthog.capture("download_page_redirect",{source:o,device_type:e}),!0)}else if(e==="mac_m1"||e==="mac_intel")(o==="nav"||o==="footer")&&r.forEach(function(c){c.innerText="Download for free"}),t.href=s[e],t.onclick=()=>(posthog.capture("app_download",{device_type:e,source:o,"$feature/download-vs-getstarted":a}),setTimeout(()=>{window.location.href=u[e]},5e3),!0);else if(e==="Windows")(o==="nav"||o==="footer")&&r.forEach(function(c){c.innerText="Download for free"}),t.href=s.Windows,t.onclick=()=>(posthog.capture("app_download",{device_type:e,source:o,"$feature/download-vs-getstarted":a}),setTimeout(()=>{window.location.href=u.Windows},5e3),!0);else{var n=t.querySelector("svg");n&&n.remove(),r&&r.forEach(function(f){f.innerText="Get Started"}),t.href="/get-started",t.onclick=()=>(posthog.capture("download_page_redirect",{source:o,device_type:e}),!0)}})});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanay-wispr/webflow-package",
3
- "version": "4.4.1",
3
+ "version": "4.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },