CINXE.COM
Online Video Editor by Magisto | Video Templates for Social Media
<!DOCTYPE html> <!-- __ __ _ _ | \/ | __ _ __ _(_)___| |_ ___ | |\/| |/ _` |/ _` | / __| __/ _ \ | | | | (_| | (_| | \__ \ || (_) | |_| |_|\__,_|\__, |_|___/\__\___/ |___/ --> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("https://www.magisto.com/templates?prev_path=/fitness-video&via=footer","20211217110149","https://web.archive.org/","web","/_static/", "1639738909"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Language" content="en"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="canonical" href="https://web.archive.org/web/20211217110149/https://www.magisto.com/templates"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, minimal-ui"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="360"/> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="shortcut icon" href="https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/images/favicon.ico" type="image/vnd.microsoft.icon"/> <link rel="icon" href="https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/images/favicon.ico" type="image/x-icon"/> <link rel="apple-touch-icon" href="https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/images/magisto_ios_icon_large.jpg"/> <title>Online Video Editor by Magisto | Video Templates for Social Media</title> <meta name="description" content="Easily create shareworthy videos in no time with our customized a template video template specially designed for social media. Start your free trial today!"> <meta name="keywords" content="video marketing, promo video, marketing videos, marketing your business, small business marketing, marketing video, online video marketing, marketing videos, marketing video, promotional videos, product video, online video marketing"> <meta name="apple-itunes-app" content="app-id=486781045, app-argument="> <meta name="google-play-app" content="app-id=com.magisto"> <meta property="fb:app_id" content="192161334139408"/> <meta property="og:title" content="Online Video Editor by Magisto | Video Templates for Social Media"/> <meta property="og:type" content="website"/> <meta property="og:description" content="Easily create shareworthy videos in no time with our customized a template video template specially designed for social media. Start your free trial today!"/> <meta property="og:image" content="https://web.archive.org/web/20211217110149im_/https://drrrhyhe9lfip.cloudfront.net/media/images/ogimage150998230369.jpeg"/> <meta property="og:site_name" content="Magisto"/> <meta property="og:url" content="https://web.archive.org/web/20211217110149/https://www.magisto.com/templates"/> <meta property="twitter:card" content="summary"> <meta property="twitter:site" content="@magisto"> <meta name="twitter:url" content="https://web.archive.org/web/20211217110149im_/https://www.magisto.com/templates"> <meta name="twitter:title" content="Online Video Editor by Magisto | Video Templates for Social Media"> <meta name="twitter:description" content="Easily create shareworthy videos in no time with our customized a template video template specially designed for social media. Start your free trial today!"> <meta name="twitter:image" content="https://web.archive.org/web/20211217110149im_/https://drrrhyhe9lfip.cloudfront.net/media/images/ogimage150998230369.jpeg"> <!--<link rel="manifest" href="/media/new/js/apis/web-push/chrome/manifest.json">--> <link rel="manifest" href="/web/20211217110149/https://www.magisto.com/media/new/js/apis/web-push/chrome/manifest_proper_android_appinstall.json"> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/magisto-base-fonts.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/magisto-base-popups.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/magisto-base-headers.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/magisto-base-footer.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/magisto-base.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/elements/form_inputs-templates.css" type="text/css"/> <link rel="Stylesheet" href="/web/20211217110149cs_/https://www.magisto.com/media/new/css/elements/buttons-templates.css" type="text/css"/> <style> nav.topnav { z-index: 998; } #app { height: 100vh; width: 100%; height: auto; } #magisto-modals { position: fixed; top: 0; left: 0; height: 100vh; width: 100%; background-color: rgba(0, 0, 0, 0.4); z-index: 9999; } @-webkit-keyframes global-loader-spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @-moz-keyframes global-loader-spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes global-loader-spinner { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } #global-loader.loader-overlay { width: 100%; height: 100%; position: fixed; top: 0; left: 0; opacity: 1; transition: opacity .5s ease-out; background-color: #FFF; z-index: 99999; } #global-loader .loader-spinner { width: 2.5rem; height: 2.5rem; border-width: 0.125rem; border-style: solid; border-color: rgb(255,255,255) rgb(8, 201, 141) rgb(8, 201, 141); border-radius: 2.5rem; -webkit-animation: 800ms linear 0s infinite normal none running global-loader-spinner; -moz-animation: 800ms linear 0s infinite normal none running global-loader-spinner; animation: 800ms linear 0s infinite normal none running global-loader-spinner; top: 50%; left: 50%; position: absolute; color: #FFF; margin: -1.75rem 0 0 -1.75rem; } #fallback-modal { display: none; } #fallback-modal.fallback-modal-overlay { position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 1000000000; background-color: rgba(0,0,0,0.4); } #fallback-modal .fallback-modal { background-color: #fff; border-radius: 3px; box-shadow: 0 6px 10px 0 rgba(0,0,0,0.12); min-width: 440px; padding: 24px; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); } #fallback-modal .fallback-modal-header { font-size: 18px; color: #1a2e3b; margin-bottom: 26px; } #fallback-modal .fallback-modal-body { font-size: 14px; color: #1a2e3b; margin-bottom: 26px; } #fallback-modal .fallback-modal-buttons:after { content: " "; visibility: hidden; display: block; height: 0; clear: both; } #fallback-modal .fallback-modal-button { min-width: 93px; height: 40px; float: right; background: #08c98d; border-color: #08c98d; border-radius: 3px; color: #fff; font-weight: bold; cursor: pointer; } </style> <script src="https://web.archive.org/web/20211217110149js_/https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=es2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019"></script> <script> var globals = { app : 'magisto', is_debug : false, is_live : true, is_authenticated : false, is_mobile : false, is_iphone : false, is_ipad : false, is_android : false, is_desktop : true, static_url : 'https://web.archive.org/web/20211217110149/https://d1ekrxlws13em5.cloudfront.net/media/', sightera_server : 'www.magisto.com', protocol : 'https', has_https_support : true, prot_and_server : 'https://web.archive.org/web/20211217110149/https://www.magisto.com', user_name : null, is_business : false, is_tryout : false, can_remove_watermark: false, opt_in_trial : false, opt_in_expire_days : false, optin_upsell_id : 'optin-business-upsell-popup', trial_period : false, blocking_opt_in_trial: false, user_plan : '', has_stock : false, has_getty_marketplace: false, can_tweak : false, can_ad : false, can_publish : false, can_custompage : false, publish_branded : false, can_embed : false, can_brand_video : false, send_analytics : false, got_cookies_consent : false, ab_tests : {}, CRM: { track: function(event_name, extra_data) {} }, can_connect_to_vimeo: false, connected_to_vimeo: false, vimeo_account_eligibility: 'None', vimeo_user_email: '', vimeo_auto_share: false, vimeo_share_privacies: JSON.parse('[]'), vimeo_token_invalid: false, vimeo_connect_state: 'None', v6_support: true, }; globals.ab_tests.web_pro_tier = false; globals.ab_tests.web_plus_tier = false; globals.ab_tests.web_upsell_image_text = false; globals.ab_tests.web_pro_upsell_popup = false; globals.prot_and_server = 'https://web.archive.org/web/20211217110149/https://www.magisto.com'; var fb_ad_id = null; var ad_account_id = null; var campaign_ids = null; globals.fb_ad_id = sessionStorage.getItem('fb_ad_id') || fb_ad_id; if(!!globals.fb_ad_id){ globals.ad_account_id = sessionStorage.getItem('ad_account_id') || ad_account_id; globals.campaign_ids = sessionStorage.getItem('campaign_ids') || campaign_ids; sessionStorage.setItem('fb_ad_id', globals.fb_ad_id); sessionStorage.setItem('ad_account_id', globals.ad_account_id); sessionStorage.setItem('campaign_ids', globals.campaign_ids); sessionStorage.setItem('embed_on', globals.outerPlatform); } var _is_mobile = globals.is_mobile, _is_ipad = globals.is_ipad, _is_debug = globals.is_debug, _has_https_support = globals.has_https_support, _protocol = globals.protocol, _prot_and_server = globals.prot_and_server, _sightera_server = globals.sightera_server, _is_authenticated = globals.is_authenticated, _is_channel_admin = false, _is_ie = false; _google_api_key = 'AIzaSyBFf96QRIGzc9SH-IwrQTNc5CO8mr_SyPc'; _google_client_id = '774247004952-e9enabia9n1d5m3o6hc8qp84v2ocjav1.apps.googleusercontent.com'; _google_scope = 'profile email'; _facebook_app_id = '192161334139408'; _facebook_scope = 'email,user_about_me'; var global_debug_queue = []; var global_debug_call = function() {}; </script> <script> globals = globals || {}; globals.login_url = "/connect?login&via=templates"; globals.current_path = "/templates"; </script> <script type="text/javascript" src="//web.archive.org/web/20211217110149js_/https://d1ekrxlws13em5.cloudfront.net/media/cached/js/ada8965565d6.js"></script> <link rel="preload" as="font" href="/web/20211217110149/https://www.magisto.com/media/new/components/flow-player/7.2.6/skin/icons/magisto_player.ttf?ns2aoq" crossorigin="anonymous"/> <script src="https://web.archive.org/web/20211217110149js_/https://d3pvxrmcry8qui.cloudfront.net/unpkg/react@16.13.1/umd/react.production.min.js"></script> <script src="https://web.archive.org/web/20211217110149js_/https://d3pvxrmcry8qui.cloudfront.net/unpkg/react-dom@16.13.1/umd/react-dom.production.min.js"></script> <script src="/web/20211217110149js_/https://www.magisto.com/media/new/js/global.js"></script> <script src="/web/20211217110149js_/https://www.magisto.com/media/js/magisto_popup.js"></script> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://web.archive.org/web/20211217110149/https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-T4P8MR3'); </script> <!-- End Google Tag Manager --> </head> <body ng-cloak class="magisto_app no_footer no_resize" ng-app="magisto"> <a id="page_top" name="page_top" href="javascript:void(0)"></a> <div id="fb-root"></div> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <header id="main_nav" class="mgsto_n_ws "> <div class="mobile_overflow" onclick="hideHamburgerMenu()"></div> <div class="top_nav_placeholder "></div> <nav class="topnav original animate"> <div class="all_wrap "> <div class="hamburger_wrap"> <a id="hamburger_icon" onclick="toggleHamburgerMenu()" class="icon animate" href="javascript:void(0);"><span></span><span></span><span></span><span></span></a> </div> <div class="magisto_logo "> <a href="/web/20211217110149/https://www.magisto.com/" class="animate" onclick="track_tableau_event('press','header','logo','magisto');"> <img src="/web/20211217110149im_/https://www.magisto.com/media/new/img/logo_magisto.png" srcset="/web/20211217110149im_/https://www.magisto.com/media/new/img/logo_magisto_d@2x.png 2x, /web/20211217110149im_/https://www.magisto.com/media/new/img/logo_magisto.png 1x"/> <img class="vimeo_magisto_logo hidden_logo" src="https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/new/img/logo_magisto_by_vimeo.png" srcset="https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/new/img/logo_magisto_by_vimeo@2x.png 2x, https://web.archive.org/web/20211217110149im_/https://d1ekrxlws13em5.cloudfront.net/media/new/img/logo_magisto_by_vimeo.png 1x"/> </a> </div> <ul class="top_menu animated hidden_top_menu"> <li class="first_line only_mobile"> <a href="/web/20211217110149/https://www.magisto.com/connect?business&signup&next=%2Fbusiness%2Fpurchase%3Fvia%3Dget_started_main_cta%26prev_path%3D%2Ftemplates&via=get_started_main_cta&prev_path=/templates" onclick="track_tableau_event('press','header','open create flow','get started'); button_link_track(event,'get_started_main_cta','/templates', '/connect')"><button id="create_btn" class="btn turq btn_create_movie small">Get started</button></a> </li> <li class="nav_features active "> <a href="/web/20211217110149/https://www.magisto.com/templates?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','templates','templates'); track_event('Website Header','Templates','');"> Templates</a></li> <li class="nav_business dropdown_container " onmouseleave="hideDropdownMenu();"> <a id="business_navitem" href="/web/20211217110149/https://www.magisto.com/business-video?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','business','business'); track_event('Website Header','Business','');" onmouseenter="showDropdownMenu(this);"> What you can do <span class="nav_dropdown_icon" onclick="showHideDropdownMenuMobileMenu(this);"></span> </a> <div class="dropdown_box dropdown_box_scroll"> <ul> <li><a href="/web/20211217110149/https://www.magisto.com/video-maker?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','consumer','personal'); track_event('Website Header','Personal','');"><div>Video Maker</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/real-estate-videos?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','Real Estate','');"><div>Real Estate</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/fitness-video?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','Fitness','');"><div>Fitness</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/cooking-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','cooking video maker','');"><div>Cooking</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/photography?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','Photographers','');"><div>Photographers</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/youtube-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','youtube video maker','');"><div>YouTube Ads</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/video-ads-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','video ads','');"><div>Video Ads</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/promo-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','promo video maker','');"><div>Promo</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/facebook-video-ads-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','facebook video ads maker','');"><div>Facebook Ads</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/instagram-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','Instagram video maker','');"><div>Instagram</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/marketing-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','marketing video maker','');"><div>Marketing</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/social-media-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','social media video maker','');"><div>Social Media</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/video-slideshow-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','video slideshow maker','');"><div>Video Slideshow</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/wedding-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','wedding video maker','');"><div>Wedding</div></a></li> <li><a href="/web/20211217110149/https://www.magisto.com/marketing/birthday-video-maker?via=business_top_menu&prev_path=/templates" onclick="track_event('User Menu','birthday video maker','');"><div>Birthday</div></a></li> </ul> </div> </li> <li> <a href="//web.archive.org/web/20211217110149/https://www.magisto.com/blog/?prev_path=/templates&via=header" target="_blank" onclick="track_tableau_event('press','header','consumer','blog');"> Blog</a></li> <!--li class=""> <a href="/features?prev_path=/templates" onclick="track_event('Website Header','Industries','');"> Industries</a></li--> <li class="nav_solutions "> <a href="/web/20211217110149/https://www.magisto.com/promotional-video?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','solutions','solutions'); track_event('Website Header','Solutions','');"> Solutions</a></li> <li class="nav_explore "> <a href="/web/20211217110149/https://www.magisto.com/explore?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','inspiration','explore'); track_event('Website Header','Explore','');"> Explore</a></li> <li class="nav_pricing "> <a href="/web/20211217110149/https://www.magisto.com/pricing?prev_path=/templates&via=top_menu" onclick="track_tableau_event('press','header','pricing','pricing'); track_event('Website Header','Upgrade','');"> Pricing</a></li> <li class="only_mobile"> <a href="/web/20211217110149/https://www.magisto.com/connect?login&next=/templates&via=mobile_tm_login&prev_path=/templates" onclick="button_track(event, {evnt: 'press_button', type: 'mobile_tm_login' , destination_path: '/connect'});hideHamburgerMenu();"> Login </a> </li> <div class="clear"></div> </ul> <div class="user_box"> <div class="side_wrap login only_big"> <a href="/web/20211217110149/https://www.magisto.com/connect?login&next=/&via=tm_login&prev_path=/templates" onclick="track_tableau_event('press','header','open sign in popup','sign in'); "> <button class="btn trans dark">Sign In</button> </a> </div> <div class="side_wrap create"> <a href="/web/20211217110149/https://www.magisto.com/connect?business&signup&next=%2Fbusiness%2Fpurchase%3Fvia%3Dget_started_main_cta%26prev_path%3D%2Ftemplates&via=get_started_main_cta&prev_path=/templates" onclick="track_tableau_event('press','header','open create flow','get started'); button_link_track(event,'get_started_main_cta','/templates', '/connect')"><button id="create_btn" class="btn turq btn_create_movie ">Get started</button></a> </div> </div> </div> </nav> </header> <div class="main_content_wrap_box "> <div id="magisto_body" class=""> <div id="app"></div> <div id="global-loader" class="loader-overlay"> <div class="loader-spinner"></div> </div> <div id="fallback-modal" class="fallback-modal-overlay"> <div class="fallback-modal"> <div class="fallback-modal-header">Browser not supported</div> <div class="fallback-modal-body">Sorry, this browser isn鈥檛 supported. Please try again with Chrome, Firefox, or Safari.</div> <div class="fallback-modal-buttons"> <button title="OK" class="fallback-modal-button" onclick="javascript:window.open('https://web.archive.org/web/20211217110149/https://browsehappy.com/', '_blank')">OK</button> </div> </div> </div> <script> (function() { var isBrowserSupported = typeof Proxy !== 'undefined'; if (!isBrowserSupported) { document.getElementById('fallback-modal').style.display = 'block'; } })() </script> </div> </div> <connect-form-popup></connect-form-popup> <change-user-info-popup></change-user-info-popup> <script type="text/javascript">var app=angular.module('magisto');app.factory('connectService',['$http',function($http){return{password_strength_error_msg:'Your password must be at least 8 characters long and contain 4 or more unique characters',is_password_strength_enough:function(password){var u={};if(password.length<8) return false;for(var i=0;i<password.length;i++){u[password.charAt(i)]=1;} if(Object.keys(u).length<4) return false;return true;},login:function(email,password,extra_params,is_reconnect){var url=globals.prot_and_server+'/api/auth',params={username:email,password:password};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];params['device_id']=common.get_device_id();return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var _err='Invalid email / password';if(is_reconnect) _err='Incorrect password';if(res.data&&res.data.errcode&&res.data.errcode==1110){_err='Request limit reached';}else{if(navigator&&!navigator.onLine){_err='You appear to be offline - Please check your internet connection and try again.' globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'login_new',is_business:extra_params['business'],error:_err}));}} return{success:false,error:_err};});},signup:function(params,newsletter,extra_params){var url=globals.prot_and_server+'/api/account/create',params={full_name:params.name,email:params.email,password1:params.password,tos:params.tos,privacy:params.privacy,advanced_password_check:1};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];if(newsletter) params['newsl']='on';params['device_id']=common.get_device_id();return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true};}else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var err_str='Internal error';if(res.data&&res.data.errors){for(var key in res.data.errors) err_str=res.data.errors[key];if(err_str.toLowerCase()=='user already exists'){if(extra_params['business']) err_str='A Magisto user is already associated with this email, please use a different email to create an account';else err_str='A Magisto user is already associated with this email, please use a different email to create an account';globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',is_business:extra_params['business'],error:err_str}));}}else{if(navigator&&!navigator.onLine){err_str='You appear to be offline - Please check your internet connection and try again.' globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',is_business:extra_params['business'],error:err_str}));}} return{success:false,error:err_str};});},auth_facebook:function(fb_access_token,fb_uid,extra_params){var url=globals.prot_and_server+'/api/auth',params={method:'FB',fb_access_token:fb_access_token,fb_uid:fb_uid};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];params['device_id']=common.get_device_id();return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,new_user:res.data.new_user};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var err='Internal error';var response={success:false};if(res&&res.data&&res.data.errors){if(res.data.errors.errcode&&res.data.errors.errcode==2023){err='A Magisto user with the same account already exists';}else if(res.data.errors.errcode&&res.data.errors.errcode==2100){err='Please approve terms of service.';response.no_terms=true;}else if(res.data.errors.general){err=res.data.errors.general;}} response.error=err;return response;});},auth_gplus:function(auth_result,email,extra_params){var url=globals.prot_and_server+'/api/auth',params={method:'GOOGLE',id_token:auth_result.id_token,google_user:email,google_access_token:auth_result.access_token,id_token:auth_result.id_token,expires:auth_result.expires_in};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];params['device_id']=common.get_device_id();return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,new_user:res.data.new_user};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var err='Internal error';var response={success:false};if(res&&res.data&&res.data.errors){if(res.data.errors.errcode&&res.data.errors.errcode==2023){err='A Magisto user with the same account already exists';}else if(res.data.errors.errcode&&res.data.errors.errcode==2100){err='Please approve terms of service.';response.no_terms=true;response.email=params.google_user;}else if(res.data.errors.general){err=res.data.errors.general;}} response.error=err;return response;});},auth_apple:function(auth_result,extra_params){var url=globals.prot_and_server+'/api/auth';var params;if(auth_result.refresh_token){params={method:'APPLE',client:'WEB',refresh_token:auth_result.refresh_token};} else{params={method:'APPLE',client:'WEB',apple_identity_token:auth_result.id_token,auth_code:auth_result.code,settings:'1'};} if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];params['device_id']=common.get_device_id();return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,new_user:res.data.new_user,refresh_token:res.data.refresh_token};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var err='Internal error';var response={success:false};if(res&&res.data&&res.data.errors){if(res.data.errors.errcode&&res.data.errors.errcode==2023){err='A Magisto user with the same account already exists';}else if(res.data.errors.errcode&&res.data.errors.errcode==2100){err='Please approve terms of service.';response.no_terms=true;}else if(res.data.errors.general){err=res.data.errors.general;}} response.error=err;return response;});},forgot:function(email,extra_params){var url=globals.prot_and_server+'/api/reset/request',params={email:email,detailed:1};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var _err=(res&&res.data&&res.data.error?res.data.error:null)||'Internal error';if(res.data.errcode&&res.data.errcode==1110) _err='Request limit reached';return{success:false,error:_err};});},reset:function(token,password,extra_params){var url=globals.prot_and_server+'/reset/'+token,params={new_password1:password,new_password2:password,json:1,advanced_password_check:1};if(!extra_params)extra_params={};for(var x in extra_params) params[x]=extra_params[x];return $http.post(url,params).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){var _err=(res&&res.data&&res.data.error?res.data.error:null)||'Internal error';if(res.data.errcode&&res.data.errcode==1110) _err='Request limit reached';return{success:false,error:_err};});},is_premium:function(){var url=globals.prot_and_server+'/api/premium/check_packageinfo';return $http.post(url).then(function(res){if(res.data.status&&res.data.status=='OK'){var ret={success:true,is_premium:false};if(res.data.active_package) ret.is_premium=true;return ret;} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){return{success:false,error:(res.data.error||'Internal error')};});},get_business_buynow_url:function(){var url=globals.prot_and_server+'/api/business/buynow';return $http.get(url).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,buynow_url:res.data.buynow_url||null,};} else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){return{success:false,error:(res.data.error||'Internal error')};});},get_special_buynow_url:function(promo_label){var url=globals.prot_and_server+'/api/business/special/buynow';if(promo_label) url+='?promo_label='+promo_label;return $http.get(url).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,buynow_url:res.data.buynow_url};}else{return{success:false,error:(res.data.error||'Internal error')};}},function(res){return{success:false,error:(res.data.error||'Internal error')};});},update_user_details:function(user_data){if(!user_data)return;var url=globals.prot_and_server+'/api/account/change_details';var d={};d.email=user_data.email;d.first_name=user_data.first_name;d.last_name=user_data.last_name;d.full_name=user_data.full_name;if(user_data.fb_access_token){d.fb_token=user_data.fb_access_token;} if(localStorage.getItem('apple_refresh_token')){d.refresh_token=localStorage.getItem('apple_refresh_token');} return $http.post(url,d).then(function(res){if(res.data.status&&res.data.status=='OK'){return{success:true,data:res.data};}else{if(!!res.data&&!!res.data.errors){var errorsArray=Object.keys(res.data.errors).map(function(k){return res.data.errors[k]});return{success:false,errors:errorsArray};} return{success:false,error:((!!res&&res.data&&res.data.error)?res.data.error:'There is a problem with one or more of your details. please try again')};}},function(res){if(!!res.data&&!!res.data.errors){var errorsArray=Object.keys(res.data.errors).map(function(k){return res.data.errors[k]});return{success:false,errors:errorsArray};} return{success:false,error:((!!res&&res.data&&res.data.error)?res.data.error:'There is a problem with one or more of your details. please try again')};});}};}]);app.controller('ConnectPageController',['$scope','$timeout','$rootScope','connectService','$http',function($scope,$timeout,$rootScope,connectService,$http){if(globals.ConnectPageControllerInit===true){return} globals.ConnectPageControllerInit=true;$scope.resetScope=function(){$scope.state=globals.connect_state||'login';$scope.form_size=globals.form_size||null;$scope.hide_left_side=globals.hide_left_side||false;$scope.login_state='login';$scope.is_business=globals.business||false;$scope.is_authenticated=globals.is_authenticated||false;$scope.signup_form={step:1,loading:false,primary_use:false,name:'',email:'',confirm_email:'',password:'',newsletter:true,error:null,email_error:false,password_error:false,name_error:false,confirm_email_error:false,primary_use_error:false,consents:{tos:false,privacy:false}};$scope.login_form={email:'',password:'',error:null,email_error:false,password_error:false};$scope.reconnect={type:'email',email:'',password:'',error:null,password_error:false};$scope.forgot_form={email:'',error:null,email_error:false};$scope.reset_form={password:'',confirm_password:'',error:null,password_error:false,confirm_password_error:false};$scope.social_aprove_details={full_name:false,email:false};$scope.submitting=false;$scope.allocate_opt_in=null;} $scope.resetScope();$scope.$watch('login_form.email',function(val){$scope.login_form.email_error=(!common.validate_email(val));});$scope.$watch('login_form.password',function(val){$scope.login_form.password_error=!(val&&val.length>0);});$scope.$watch('signup_form.name',function(val){$scope.signup_form.name_error=(!common.validate_name(val));});$scope.$watch('signup_form.email',function(val){$scope.signup_form.email_error=(!common.validate_email(val));if($scope.signup_form.confirm_email&&$scope.signup_form.confirm_email!=val){$scope.signup_form.confirm_email_error=true;}else{$scope.signup_form.confirm_email_error=false;}});$scope.$watch('signup_form.confirm_email',function(val){$scope.signup_form.confirm_email_error=(!common.validate_email(val));if($scope.signup_form.email&&$scope.signup_form.email!=val) $scope.signup_form.confirm_email_error=true;});$scope.$watch('signup_form.password',function(val){$scope.signup_form.password_error=!(val&&val.length>0);});$scope.$watch('login_form.password',function(val){$scope.login_form.password_error=!(val&&val.length>0);});$scope.$watch('reconnect.password',function(val){$scope.reconnect.password_error=!(val&&val.length>0);});$scope.$watch('forgot_form.email',function(val){$scope.forgot_form.email_error=(!common.validate_email(val));});$scope.$watch('reset_form.password',function(val){$scope.reset_form.password_error=!(val&&val.length>0);});$scope.$watch('reset_form.confirm_password',function(val){$scope.reset_form.confirm_password_error=!(val&&val.length>0);if($scope.reset_form.confirm_password&&$scope.reset_form.confirm_password!=val) $scope.reset_form.confirm_password_error=true;});$scope.init=function(){if($scope.state=='forgot'||$scope.state=='reset'||$scope.state=='reset_done'||$scope.state=='reset_error'||$scope.state=='reset_email') return;var allocate_opt_in=getQueryParamFromURL('allocoptin',window.location.search);if(allocate_opt_in) $scope.allocate_opt_in=allocate_opt_in;var social_log=getQueryParamFromURL('social_login',window.location.search) if(!!social_log){if(social_log=='gp')$scope.auth_gplus();if(social_log=='fb')$scope.auth_facebook();if(social_log=='apple')$scope.auth_apple();} try{var data=read_cookie('cnct_data');if(data){var data_arr=decodeURIComponent(data).split(':');var t=data_arr[0].toLowerCase();var em=decodeURIComponent(data_arr[1]);var name=decodeURIComponent(data_arr[2]).trim();if(name&&((t=='email'&&em)||t=='fb'||t=='google'||t=='apple')){$scope.reconnect.type=t;$scope.reconnect.name=name;$scope.change_state('reconnect');$timeout(function(){$scope.reconnect.email=em;$scope.reconnect.name=name;$scope.reconnect.type=t;});}}}catch(err){};var currentLocation=window.location;if(currentLocation.pathname=='/connect'){setTimeout(function(){globals.alooma.track('show_connect',globals.alooma.get_utm_data({type:$scope.state,is_business:$scope.is_business}));});}} $rootScope.$on('reset_connect_form',function(e,d){if(!!d)$scope.resetScope();});$rootScope.$on('connect_change_state',function(e,state){if(!!state)$scope.change_state(state);});$scope.$on('change_page_state',function(e,data){if(!!data&&data!==$scope.state) $scope.change_state(data);});$scope.temp_next=false;$scope.change_state=function(state){$timeout(function(){$scope.resetScope();if(state!=='signup'&&globals.connect_next&&globals.connect_next.indexOf("business/purchase")!==-1){$scope.temp_next=globals.connect_next;globals.connect_next='/';} if(state=="signup"&&!!$scope.temp_next)globals.connect_next=$scope.temp_next;if(state=='login'||state=='reconnect') $scope.login_state=state;if(state=='forgot'){try{var email=$('input[name=username]')[0].value;$scope.forgot_form.email=email;}catch(err){};} $scope.state=state;if((state=='login'||state=='signup')&&$scope.temp_next.length){globals.alooma.track('push_'+state,globals.alooma.get_utm_data());} $rootScope.$broadcast('change_page_state',state);});};$scope.change_to_login_state=function(){$scope.state=$scope.login_state;if(globals.connect_next&&globals.connect_next.indexOf("business/purchase")!==-1){globals.connect_next='/';}};$scope.redirectUser=function(){if($scope.signup_form) $scope.signup_form.loading=true;if(!!$scope.go_next){window.location=$scope.go_next;}else{window.location=globals.connect_next||'/';}} $scope.onconnect=function(type,new_user){var complete_connect=function(){try{var flow_type=$scope.is_business?'BUSINESS FLOW':'REGULAR FLOW';var primary_use=(!!$scope.signup_form.primary_use?($scope.signup_form.primary_use=='business'?'/businessuse':'/personaluse'):'/');if(!!$scope.signup_form.primary_use&&$scope.is_business){flow_type=$scope.signup_form.primary_use=='business'?'BUSINESS FLOW BUSINESS USE':'BUSINESS FLOW PERSONAL USE';}else if(!!$scope.signup_form.primary_use&&!$scope.is_business){flow_type=$scope.signup_form.primary_use=='business'?'REGULAR FLOW BUSINESS USE':'REGULAR FLOW PERSONAL USE';} var connect_data={type:new_user?'signup':'login',channel:type,is_business:!!$scope.is_business};$.extend(connect_data,globals.alooma.pop_tracking_data('connect_done')||{});var virtualpage='/virtual/login/done/'+(new_user?'new-user/':'existing-user/')+($scope.is_business?'business/':'consumer/')+(type=='facebook'?'fb':type)+primary_use;pixel_tracking([['ga_page',virtualpage],['bing',virtualpage],['alooma_queue','connect_done',connect_data]]);if(new_user&&type=='facebook'){pixel_tracking(['fb','CompleteRegistration',{content_name:flow_type,status:type}])}}catch(err){console.log(err)};var next='/';if(!new_user&&(globals.via_element=='get_started_main_cta'||globals.via_element=='tm_login'||globals.via_element=='mobile_tm_login')){next='/';}else{next=globals.connect_next||'/';if(next[0]!='/') next='/';} if(new_user&&type=='facebook'&&globals.after_signup){next=globals.after_signup.replaceAll("&","&") next+="&"+location.search.substring(1);} if(new_user&&type=='apple'&&globals.after_signup){next=globals.after_signup.replaceAll("&","&") next+="&"+location.search.substring(1);} if(new_user){if(globals.ab_tests.web_pro_upsell_popup&&!globals.is_mobile){next='/create-wizard?via=first_upsell_popup';} else{next+=(next.indexOf('?')>=0?'&':'?')+'signup=1';}} device_action('register');var query_params=(next.indexOf('?')>=0?'&':'?');try{if(getQueryParam('utm_source'))query_params+='&utm_source='+getQueryParam('utm_source') if(getQueryParam('utm_campaign'))query_params+='&utm_campaign='+getQueryParam('utm_campaign') if(getQueryParam('fb_ad_id'))query_params+='&fb_ad_id='+getQueryParam('fb_ad_id') if(getQueryParam('ad_id'))query_params+='&ad_id='+getQueryParam('ad_id')}catch(err){console.log(err)} try{if($scope.allocate_opt_in){sessionStorage.removeItem('is_optin_flow');}}catch(err){console.log(err)} if(window.publish){$http.get(globals.prot_and_server+'/api/account/settings',{}).then(function(res){if(res.data.status&&res.data.status=='OK'){globals.connect_user_data={is_new_user:new_user,login_type:type,user_data:res.data};if(angular.element("#magisto-connect-form").length){angular.element("#magisto-connect-form").scope().close_popup();} headerReloader();return;}else{return;}},function(res){return;});} else if(new_user&&type=='facebook'){FB.api('/me',{locale:'en_US',fields:'name, email'},function(response){window.location.href=next+query_params||'/video/mine';});}else{$timeout(function(){if(!!$scope.form_size&&$scope.form_size=="minimal"){window.top.location.href=next+query_params;}else{window.location.href=next+query_params;}},400);}} if(type=='facebook'||type=='google'||type=='apple'){if(!!new_user&&!!$scope.signup_form.social_connect){var u={};var strip_name={first_name:$scope.signup_form.name,last_name:'',full_name:$scope.signup_form.name};if(!!$scope.signup_form.name){var s_name=strip_name.full_name.split(' ');if(s_name.length==2){strip_name.first_name=s_name[0];strip_name.last_name=s_name[1];}else if(s_name.length>=3){strip_name.first_name=s_name[0]+' '+s_name[1];strip_name.last_name=s_name[2];}} if(!!$scope.signup_form.name&&!!$scope.signup_form.email){u=strip_name;u.email=$scope.signup_form.email;} if($scope.fb_access_token){u.fb_access_token=$scope.fb_access_token;} if(localStorage.getItem('apple_refresh_token')){u.refresh_token=localStorage.getItem('apple_refresh_token');} if(u.email){connectService.update_user_details(u).then(function(res){if(!!res.success){globals.alooma.track('connect_done',globals.alooma.get_utm_data({type:'signup',channel:type,is_business:!!$scope.is_business}));if(type=='facebook'){pixel_tracking(['fb','CompleteRegistration',{content_name:$scope.is_business?'BUSINESS FLOW':'REGULAR FLOW',status:type}]);} $scope.redirectUser();}else{$scope.login_form.error=res.error||'An error occurred';if(!!res.errors&&res.errors.length){$scope.signup_form.error=res.errors.join('<br />');return;}else if(!!res.data&&res.data.error){$scope.signup_form.error=res.data.error;return;}else if(!!res.error){$scope.signup_form.error=res.error;return;}}});}else{complete_connect();}}else{complete_connect();}}else{complete_connect();}};$scope.get_extra=function(){var extra={store_cnct:1};if($scope.signup_form.primary_use) extra['user_type']=$scope.signup_form.primary_use;if($scope.is_business) extra['business']=true;if($scope.signup_form.consents.tos) extra['tos']=$scope.signup_form.consents.tos;if($scope.signup_form.consents.privacy) extra['privacy']=$scope.signup_form.consents.privacy;if($scope.allocate_opt_in){extra['allocate_opt_in']=$scope.allocate_opt_in;} return extra;};$scope.submit_reconnect=function(){if($scope.submitting) return;$scope.reconnect.error=null;var err=[];if(!$scope.reconnect.password||!$scope.reconnect.password.length) err.push('Please enter a valid password');if(err.length){$scope.reconnect.error=err.join('<br/>');}else{$scope.submitting=true;connectService.login($scope.reconnect.email,$scope.reconnect.password,$scope.get_extra(),true).then(function(res){if(res.success){$scope.onconnect('email',false);$timeout(function(){$scope.submitting=false},1000);}else{$scope.submitting=false $scope.reconnect.error=res.error||'An error occurred';globals.alooma.track('connect_fail',{type:'reconnect',channel:'email',error_type:'invalid_user_or_credentials',is_business:$scope.is_business});}});globals.alooma.track('connect_try',{type:'reconnect',channel:'email',is_business:$scope.is_business});}};$scope.submit_login=function(){if($scope.submitting) return;$scope.login_form.error=null;var err=[];var mail_err=[];var pass_err=[];if(!$scope.login_form.email||!$scope.login_form.email.length) mail_err.push('Please enter a valid Email address');else if(!common.validate_email($scope.login_form.email)) mail_err.push('The Email address you entered is invalid');if(!$scope.login_form.password||!$scope.login_form.password.length) pass_err.push('Please enter a valid password');$scope.login_form.errors={};if(!!mail_err&&mail_err.length)$scope.login_form.errors.email=mail_err.join('<br/>')||null;if(!!pass_err&&pass_err.length)$scope.login_form.errors.password=pass_err.join('<br/>')||null if((!pass_err||pass_err.length==0)&&(!mail_err||mail_err.length==0)){$scope.submitting=true;connectService.login($scope.login_form.email,$scope.login_form.password,$scope.get_extra(),false).then(function(res){if(res.success){$scope.onconnect('email',false);$timeout(function(){$scope.submitting=false},1000);} else{$scope.submitting=false $scope.login_form.error=res.error||'An error occurred';globals.alooma.track('connect_fail',{type:'login',channel:'email',error_type:'invalid_user_or_credentials',is_business:$scope.is_business});}});globals.alooma.track('connect_try',{type:'login',channel:'email',is_business:$scope.is_business});}};$scope.signup_new=function(skip_confirm){if($scope.submitting) return;$scope.signup_form.error=null;$scope.signup_form.errors={};var mail_err=[],name_err=[],pass_err=[] if(!$scope.signup_form.name||!$scope.signup_form.name.length||!common.validate_name($scope.signup_form.name)){name_err.push('Please enter your full name');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Full_name',error:'Please enter your full name'}));} if(!$scope.signup_form.email||!$scope.signup_form.email.length){mail_err.push('Please enter your email address');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Email',error:'Please enter your email address'}));} else if(!common.validate_email($scope.signup_form.email)){mail_err.push('The email address entered is invalid');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Email',error:'The email address entered is invalid'}));} if(!$scope.signup_form.password||!$scope.signup_form.password.length){pass_err.push('Please enter a password');} else if(!connectService.is_password_strength_enough($scope.signup_form.password)){pass_err.push(connectService.password_strength_error_msg);} if(name_err.length)$scope.signup_form.errors.name=name_err.join('<br/>');if(mail_err.length)$scope.signup_form.errors.mail=mail_err.join('<br/>');if(pass_err.length)$scope.signup_form.errors.password=pass_err.join('<br/>');if(name_err.length||mail_err.length||pass_err.length){return} $scope.submit_signup_new();} $scope.submit_signup_new=function(skip_confirm){if($scope.submitting) return;$scope.signup_form.tos_consent=true;$scope.signup_form.privacy_consent=true;var err=[];var name_err=[];var mail_err=[];var pass_err=[];$scope.signup_form.error=null;$scope.signup_form.errors={};var mail_err=[],name_err=[],pass_err=[] if(!$scope.signup_form.name||!$scope.signup_form.name.length||!common.validate_name($scope.signup_form.name)){name_err.push('Please enter your full name');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Full_name',error:'Please enter your full name'}));} if(!$scope.signup_form.email||!$scope.signup_form.email.length){mail_err.push('Please enter your email address');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Email',error:'Please enter your email address'}));} else if(!common.validate_email($scope.signup_form.email)){mail_err.push('The email address entered is invalid');globals.alooma.track('warning_signup_new',globals.alooma.get_utm_data({type:'signup_new',field:'Email',error:'The email address entered is invalid'}));} if(!$scope.signup_form.social_connect){if(!$scope.signup_form.password||!$scope.signup_form.password.length){pass_err.push('Please enter a password');} else if(!connectService.is_password_strength_enough($scope.signup_form.password)){pass_err.push(connectService.password_strength_error_msg);}} if(name_err.length)$scope.signup_form.errors.name=name_err.join('<br/>');if(mail_err.length)$scope.signup_form.errors.mail=mail_err.join('<br/>');if(pass_err.length)$scope.signup_form.errors.password=pass_err.join('<br/>');if(name_err.length||mail_err.length||pass_err.length||err.length){if(err.length){$scope.signup_form.error=err.join('<br/>');}}else{$timeout(function(){$scope.signup_form.consents={tos:1,privacy:1};}).then(function(){if(!!$scope.signup_form.social_connect){if($scope.signup_form.social_connect=='fb'){$scope.auth_facebook();}else if($scope.signup_form.social_connect=='google'){$scope.auth_gplus();}else if($scope.signup_form.social_connect=='apple'){$scope.auth_apple();}}else{var params={name:$scope.signup_form.name,email:$scope.signup_form.email,password:$scope.signup_form.password,tos:$scope.signup_form.consents.tos,privacy:$scope.signup_form.consents.privacy,};$scope.submitting=true;connectService.signup(params,$scope.signup_form.newsletter,$scope.get_extra()).then(function(res){if(res.success){$scope.onconnect('email',true);$timeout(function(){$scope.submitting=false},1000);} else{$scope.submitting=false;$scope.signup_form.error=res.error||'An error occurred';var errtype='other';if((res.error.indexOf('user is already')!=-1)||(res.error.indexOf('is already in use')!=-1)){errtype='existing_user';mail_err.push('Email is already in use.');$scope.signup_form.errors.mail='Email is already in use.'} if((res.error.indexOf('Enter a valid email address.')!=-1)){$scope.signup_form.errors.mail='Enter a valid email address.' mail_err.push('Enter a valid email address.');} globals.alooma.track('connect_fail',{type:'signup',channel:'email',error_type:errtype});return;}});globals.alooma.track('connect_try',{type:'signup',channel:'email',is_business:$scope.is_business});}})}} $scope.auth_facebook=function(n,count){var retries=(count+1)||1;if($scope.submitting) return;if(!window.FB){if(retries>=5&&window.location.pathname!=='/connect'){window.location='/connect?social_login=fb&'+($scope.state);return;} $timeout(function(){$scope.auth_facebook(n,retries)},300);return;}else{$scope.signup_form.errors={};FB.login(function(res){if(res.authResponse&&res.authResponse.accessToken&&res.authResponse.userID){var temp_res=res;$timeout(function(){$scope.submitting=true;$scope.fb_access_token=res.authResponse.accessToken;});connectService.auth_facebook(res.authResponse.accessToken,res.authResponse.userID,$scope.get_extra()).then(function(res){if(res.success){$scope.onconnect('facebook',!!res.new_user);$timeout(function(){$scope.submitting=false},1000);}else{if(!!res.no_terms){FB.api('/me',{locale:'en_US',fields:'name, email'},function(response){$timeout(function(){$scope.submitting=false;$scope.login_form.error=false;$scope.signup_form.step=2;$scope.state='signup';$scope.signup_form.social_email=$scope.signup_form.email=response.email;$scope.signup_form.social_name=$scope.signup_form.name=response.name;$scope.signup_form.social_connect='fb';});});}else{$timeout(function(){$scope.submitting=false;$scope.login_form.error=$scope.signup_form.error=res.error||'An error occurred';var errtype='other';if(res.error.indexOf('already exists')!=-1) errtype='existing_user';globals.alooma.track('connect_fail',{type:$scope.state,channel:'facebook',error_type:errtype,is_business:$scope.is_business});});}}});} else{$timeout(function(){$scope.submitting=false;});}},{scope:'email'});} globals.alooma.track('connect_try',{type:$scope.state,channel:'facebook',is_business:$scope.is_business});};$scope.auth_gplus=function(n,count){var retries=(count+1)||1;if($scope.submitting) return;if(!g_manager.initialized){if(retries>=5&&window.location.pathname!=='/connect'){window.location='/connect?social_login=gp&'+($scope.state);return;} $timeout(function(){$scope.auth_gplus(n,retries)},300);return;}else{$scope.signup_form.errors={};g_manager.handleAuthClick().then(function(res){var basic_profile=res.user.getBasicProfile();var user_email=basic_profile.getEmail();if(!$scope.signup_form.email||(user_email.toLowerCase()===$scope.signup_form.email.toLowerCase())){gplus_do_login(res.auth_result,user_email);}else{$timeout(function(){$scope.signup_form.step=1;$scope.signup_form.error="Please signup and confirm with the same Google account"})}},function(error){});} globals.alooma.track('connect_try',{type:$scope.state,channel:'google',is_business:$scope.is_business});};var gplus_do_login=function(auth_result,email){$timeout(function(){$scope.submitting=true});connectService.auth_gplus(auth_result,email,$scope.get_extra()).then(function(res){if(res.success){$scope.onconnect('google',!!res.new_user);$timeout(function(){$scope.submitting=false},1000);}else{if(!!res.no_terms){$timeout(function(){$scope.submitting=false;$scope.login_form.error=false;$scope.signup_form.step=2;$scope.state='signup';$scope.signup_form.social_connect='google';$scope.signup_form.social_email=$scope.signup_form.email=res.email;});}else{$timeout(function(){$scope.submitting=false;$scope.login_form.error=$scope.signup_form.error=res.error||'An error occurred';});var errtype='other';if(res.error.indexOf('already exists')!=-1) errtype='existing_user';globals.alooma.track('connect_fail',{type:$scope.state,channel:'google',error_type:errtype,is_business:$scope.is_business});}}});};$scope.auth_apple=function(n,count){var complete_auth=function(data){connectService.auth_apple(data,$scope.get_extra()).then(function(res){if(res.success){if(res.refresh_token){localStorage.setItem("apple_refresh_token",res.refresh_token);localStorage.removeItem("apple_auth_code");localStorage.removeItem("apple_identity_token");} $scope.onconnect('apple',!!res.new_user);$timeout(function(){$scope.submitting=false},1000);}else{if(!!res.no_terms){$timeout(function(){$scope.submitting=false;$scope.login_form.error=false;$scope.signup_form.step=2;$scope.state='signup';$scope.signup_form.social_connect='apple';if(res.email){$scope.signup_form.social_email=$scope.signup_form.email=res.email;} if(res.name){$scope.signup_form.social_name=$scope.signup_form.name=res.name;}});}else{if(res.error=='Internal error'){localStorage.removeItem("apple_refresh_token");localStorage.removeItem("apple_auth_code");localStorage.removeItem("apple_identity_token");$scope.auth_apple();} $timeout(function(){$scope.submitting=false;$scope.login_form.error=$scope.signup_form.error=res.error||'An error occurred';});var errtype='other';if(res.error.indexOf('already exists')!=-1) errtype='existing_user';globals.alooma.track('connect_fail',{type:$scope.state,channel:'apple',error_type:errtype,is_business:$scope.is_business});}}});} var apple_signin=function(){AppleID.auth.init({clientId:'com.magisto.applesignin',scope:'name email',redirectURI:location.href,state:$scope.state,usePopup:true});AppleID.auth.signIn();if(document.addEventListener){document.addEventListener('AppleIDSignInOnSuccess',function(data){localStorage.setItem("apple_auth_code",data.detail.authorization.code);localStorage.setItem("apple_identity_token",data.detail.authorization.id_token);complete_auth(data.detail.authorization);});document.addEventListener('AppleIDSignInOnFailure',function(error){localStorage.removeItem("apple_refresh_token");localStorage.removeItem("apple_auth_code");localStorage.removeItem("apple_identity_token");$timeout(function(){$scope.submitting=false;if(error){$scope.login_form.error=$scope.signup_form.error=error||'An error occurred';}});});}else if(document.attachEvent){document.attachEvent('AppleIDSignInOnSuccess',function(data){localStorage.setItem("apple_auth_code",data.detail.authorization.code);localStorage.setItem("apple_identity_token",data.detail.authorization.id_token);complete_auth(data.detail.authorization);});document.attachEvent('AppleIDSignInOnFailure',function(error){localStorage.removeItem("apple_refresh_token");localStorage.removeItem("apple_auth_code");localStorage.removeItem("apple_identity_token");$timeout(function(){$scope.submitting=false;if(error){$scope.login_form.error=$scope.signup_form.error=error||'An error occurred';}});});}} var retries=(count+1)||1;if($scope.submitting) return;if((window.location.pathname!=='/connect'||location.search!=='?social_login=apple&'+($scope.state))&&(!localStorage.getItem('apple_refresh_token')&&!localStorage.getItem('apple_identity_token'))){window.location='/connect?social_login=apple&'+($scope.state);return;}else{if(!localStorage.getItem('apple_auth_code')&&!localStorage.getItem('apple_refresh_token')){if(document.getElementById('apple_script')){apple_signin();} else{var script=document.createElement('script');script.type='text/javascript';script.id='apple_script';script.onload=function(){apple_signin();} script.src='https://web.archive.org/web/20211217110149/https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(script,s);}} else{var params;if(localStorage.getItem('apple_refresh_token')){params={refresh_token:localStorage.getItem('apple_refresh_token')};} else{params={id_token:localStorage.getItem('apple_identity_token'),code:localStorage.getItem('apple_auth_code')};} complete_auth(params);}} globals.alooma.track('connect_try',{type:$scope.state,channel:'apple',is_business:$scope.is_business});};$scope.submit_forgot=function(){if($scope.submitting) return;$scope.forgot_form.error=null;var err=[];if(!$scope.forgot_form.email||!$scope.forgot_form.email.length) err.push('Please enter a valid Email address');else if(!common.validate_email($scope.forgot_form.email)) err.push('The Email address you entered is invalid');if(err.length){$scope.forgot_form.error=err.join('<br/>');} else{$scope.submitting=true;connectService.forgot($scope.forgot_form.email,$scope.get_extra()).then(function(res){if(res.success){$timeout(function(){$scope.submitting=false;$scope.change_state('forgot_done');},1000);} else{$scope.submitting=false $scope.forgot_form.error=res.error||'An error occurred';}});}};$scope.submit_forgot_done=function(){$scope.change_to_login_state();};$scope.submit_reset=function(){if($scope.submitting) return;$scope.reset_form.error=null;var err=[];if(!$scope.reset_form.password||!$scope.reset_form.password.length){err.push('Please enter a password');}else if(!connectService.is_password_strength_enough($scope.reset_form.password)){err.push(connectService.password_strength_error_msg);}else if(!$scope.reset_form.confirm_password||$scope.reset_form.confirm_password!=$scope.reset_form.password){err.push('The two passwords don\'t match.');} if(err.length){$scope.reset_form.error=err.join('<br/>');}else{$scope.submitting=true;var token=window.location.pathname.replace(/\/?chant\//,'').replace(/\/?reset\//,'');connectService.reset(token,$scope.reset_form.password,$scope.get_extra()).then(function(res){if(res.success){$timeout(function(){$scope.submitting=false;$scope.change_state('reset_done');},1000);} else{$scope.submitting=false $scope.reset_form.error=res.error||'An error occurred';}});}};$scope.goto_connect_page=function(state){state=state||'login';if(state=='forgot') window.location.href=(globals.app=="chant"?'/chant':'')+'/reset/request';else window.location.href=(globals.app=="chant"?'/chant':'')+'/connect?'+state;};$scope.goto_my_videos=function(){window.location.href='/video/mine';};$scope.goto_connect_page_in_parent=function(state){state=state||'login';if(state=='forgot') window.top.location.href=(globals.app=="chant"?'/chant':'')+'/reset/request';else window.top.location.href=(globals.app=="chant"?'/chant':'')+'/connect?'+state+((globals.next||globals.after_signup)?'&next='+(globals.next||globals.after_signup):'');} $(document).on('keypress',function(e){if(e.keyCode=='13'){if($scope.state=='login'&&(angular.element('#connect_form_popup.displayed').length||location.pathname=='/connect')) $timeout(function(){$scope.submit_login()});else if($scope.state=='signup'&&$scope.signup_form.step===2) $timeout(function(){if((window.innerWidth<960)||(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))){$scope.submit_signup_new(false)}else{$scope.submit_signup_new(true)}});else if($scope.state=='signup'&&$scope.signup_form.step!==2&&(angular.element('#connect_form_popup.displayed').length||location.pathname=='/connect')){$timeout(function(){$scope.submit_signup_new(skip_confirm);});} else if($scope.state=='reconnect') $timeout(function(){$scope.submit_reconnect()});else if($scope.state=='forgot') $timeout(function(){$scope.submit_forgot()});else if($scope.state=='forgot_done') $timeout(function(){$scope.submit_forgot_done()});else if($scope.state=='reset') $timeout(function(){$scope.submit_reset()});else if($scope.state=='reset_done') $timeout(function(){$scope.goto_connect_page()});else if($scope.state=='reset_error') $timeout(function(){$scope.goto_connect_page('forgot')});}});$scope.init();}]);app.directive('changeUserInfoPopup',['$sce',function($sce){return{restrict:'E',transclude:true,templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/connect_form.html?7064c0f1e3##change_user_info_popup'),};}]);app.directive('connectFormPopup',['$sce',function($sce){return{restrict:'E',transclude:true,templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/connect_form.html?7064c0f1e3##connect_form_popup'),};}]);app.directive('connectForm',['$sce',function($sce){return{restrict:'E',transclude:true,controller:'ConnectPageController',templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/connect_form.html?7064c0f1e3##connect_form_element'),link:function(scope,el,attrs){if(!!globals.outerPlatform){scope.embed_on=globals.outerPlatform;}}};}]);app.directive('minimalConnectForm',['$sce',function($sce){return{restrict:'E',transclude:true,controller:'ConnectPageController',templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/connect_form.html?7064c0f1e3##minimal_connect_form_element'),link:function(scope,el,attrs){if(!!globals.outerPlatform){scope.embed_on=globals.outerPlatform;} if(!!common&&!!common.get_url_param){scope.form_btn_text=common.get_url_param('btnText')||'Create free account';scope.form_btn2_text=common.get_url_param('btn2Text')||'Start';}}};}]);app.directive('formElement',['$sce',function($sce){return{restrict:'E',transclude:true,replace:true,scope:{formId:'@',formClass:'@',formError:'=',},templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/form_element.html##form_element_container'),link:function(scope,el,attrs){}}}]);app.directive('formStep',['$sce',function($sce){return{restrict:'E',transclude:true,replace:true,template:'<div class="form_step"><ng-transclude></ng-transclude></div>',link:function(scope,el,attrs){}}}]);app.directive('formHead',['$sce',function($sce){return{scope:{formTitle:'@',formSubtitle:'@',formError:'=',},restrict:'E',transclude:true,replace:true,templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/form_element.html##form_element_head'),link:function(scope,el,attrs){scope.is_embed=scope.$parent.embed_on;}}}]);app.directive('formFoot',[function(){return{restrict:'E',transclude:true,replace:true,template:'<div class="form_foot"><ng-transclude></ng-transclude></div>',link:function(scope,el,attrs){}}}]);app.directive('formBody',[function(){return{restrict:'E',transclude:true,replace:true,template:'<div class="form_body"><ng-transclude></ng-transclude></div>',link:function(scope,el,attrs){}}}]);app.directive('consentsBox',['$sce',function($sce){return{restrict:'E',templateUrl:$sce.trustAsResourceUrl('/media/templates/connect/form_element.html##consent_box_container'),link:function(scope,el,attrs){}}}]);</script> <div id="magisto_popup_overlay"><div class="close popup_close"></div></div> <message-popup></message-popup> <script> var globals = globals || {}; //debugger; globals.show_page_params = globals.show_page_params || {}; globals.alooma = { uid: '' , /* fv : { events: {play_marketing_video_press:1,press_free_trial:1,play_marketing_video_complete:1,hp_business_button_click:1,show_purchase_screen:1, press_purchase: function(d) {return 'press_purchase:'+ ( isBusinessPlan(d.type) ? 'business' : 'other');}, connect_try: function(d) {return 'connect_try:'+ (d.is_business ? 'business:' : '') + d.channel;}}, pages: {'/business-videos':1,'/video-marketing':1,'/marketing-videos':1,'/real-estate-videos':1,'/video/mine':1,'/business/purchase':1,'/account/settings':1,'/album/mine':1,'/account/upgrade':1,'/explore':1}, calc_events: { play_marketing_video_press: true, show_purchase_screen: true, show_landing_page: function(d) { return d.campaign == 'hp_business_button'}}, version: '1.0', working: false, get_event: function(event_name, data) { if (event_name == 'show_page') { var p = document.location.pathname; return this.pages[p] ? ('show_page:'+p) : null; } else { var ret = this.events[event_name] || null; return (typeof(ret) == 'function') ? ret(data) : (ret ? event_name : null); } }, do_calc: function(event_name, event_data) { var ret = this.calc_events[event_name] || false; if (ret) return (typeof(ret) == 'function') ? ret(event_data) : ret; if (event_name == 'show_page') { var dc = localStorage.getItem('do_calc_fv'); if (dc) { localStorage.removeItem('do_calc_fv'); return dc == 'yy' ? 'force' : true; } } return false; }, mark_for_calc: function(force) { try { localStorage.setItem('do_calc_fv', force ? 'yy' : 'y'); } catch(err) {} }, reset: function() { try { localStorage.setItem('fv', null); console.log('FV: reset'); } catch(err) {} }, store: function(event_name, data, d) { try { if (this.working) return; var key = this.get_event(event_name, data); if (key) { var fv; try { fv = JSON.parse(localStorage.getItem('fv')) || {}; } catch(err){ fv = {} } if (!(fv.v && fv.v == this.version)) fv = {} var ts = Math.round(d.getTime() / 1000); fv.vtid = data.device_id; //TODO: if changed ? fv.v = this.version; if (!fv.data) fv.data = {} fv.data[key] = ts; console.log('FV: store ' + key + ' = ' + ts); var sfv = JSON.stringify(fv); localStorage.setItem('fv', sfv); } } catch(err){ console.log('[FV] error storing ' + event_name + 'in tracking fv: ' + err); } try{ var dc = this.do_calc(event_name, data) if (dc) this.calc(event_name, (dc==='force')); } catch(err){ } }, calc: function(label, force) { try{ setTimeout(function(){globals.alooma.fv._calc(label, force)}); } catch(err){} }, _calc: function(label, force) { if (this.working) return; var fv = JSON.parse(localStorage.getItem('fv')) || {}; var d = new Date(); var n = Math.round(d.getTime() / 1000); var CALC_TIME_DIFF = 7; // in minutes var FIRE_TIME_DIFF = 25; // in hours // need at least 1 client side item in FV if (!fv.data || Object.keys(fv.data).length == 0) return; // calced lately already if (!force && fv.calc_ts && fv.calc_ts > (n-60*CALC_TIME_DIFF)) return; // TODO: if all events already fired in the last X hours // if (fired_ts && fv.fired_ts > (n-3600*FIRE_TIME_DIFF)) // return; this.working = true; console.log('FV: calc ' + JSON.stringify(fv)); var me = this; $.post(globals.prot_and_server + '/api/proxy_kpi', {vtid: fv.vtid, version: fv.v, fv: JSON.stringify(fv.data), now:n, label:label||''}, function(data){ try { if (data.status && data.status == 'OK' && data.events) { if (!fv.fired) fv.fired={}; //console.log('FV: resp ' + JSON.stringify(data)); for (var i=0; i<data.events.length; i++) { if (!fv.fired[data.events[i].name] || fv.fired[data.events[i].name] < n-3600*FIRE_TIME_DIFF) { console.log('FV: firing ' + data.events[i].name); globals.fb_pixel.track_custom(data.events[i].name); //globals.alooma.track('send_facebook_pixel', {type:data.events[i].name}); fv.fired[data.events[i].name] = n; } else { console.log('FV: already fired ' + data.events[i].name + ' ' + (n-fv.fired[data.events[i].name]) + ' sec ago'); } } fv.fired_ts = n; } fv.calc_ts = n; localStorage.setItem('fv', JSON.stringify(fv)); } catch(err){} me.working = false; }).fail(function(data) { try { try{ if (data && data.responseText) { var resp = JSON.parse(data.responseText); if (resp && resp.errcode == 2040) fv.data={} } } catch(err){} fv.calc_ts = n; localStorage.setItem('fv', JSON.stringify(fv)); } catch(err){} me.working = false; }); } }, */ _prepare: function(extra_data, d) { var date_str = ( d.getFullYear() + "-" + ("00" + (d.getMonth() + 1)).slice(-2) + "-" + ("00" + d.getDate()).slice(-2) ), ts_str = ( d.getFullYear() + "-" + ("00" + (d.getMonth() + 1)).slice(-2) + "-" + ("00" + d.getDate()).slice(-2) + " " + ("00" + d.getHours()).slice(-2) + ":" + ("00" + d.getMinutes()).slice(-2) + ":" + ("00" + d.getSeconds()).slice(-2) ); var device_id_arr = common.get_device_id_arr(); var web_origin = 'web'; if (globals.app && globals.app == 'chant') { web_origin = 'chant_web'; } if (globals.app && globals.app == 'shopify') { web_origin = 'shopify_web'; } var data = { log_type: 'web', origin: web_origin, client_date: date_str, client_timestamp: ts_str, device_id: device_id_arr[0], debug_mode: false, plan_type: "" || "free", has_opt_out_trial: false, has_opt_in_trial: false, path: document.location.pathname }; if (device_id_arr[1]) data.is_first = true; if (globals.alooma.uid) data.user_id = parseInt(globals.alooma.uid); if (extra_data) Object.assign(data, extra_data); return data; }, _track: function(event_name, data, cb, d) { if (typeof cb != 'function') cb = function(){}; if(event_name == 'press_button' && data.prev_path){ delete data.prev_path; } else if(event_name == 'show_page' && !!data && !!data.prev_path){ data.prev_path = stripVarsFromString(data.prev_path); } else if(event_name == 'show_page' && !data.prev_path){ if(window.location.host.indexOf('magisto.com') !== -1){ var prev_path = document.referrer.replace(/^[^:]+:\/\/[^/]+/, '').replace(/#.*/, '') data.prev_path = stripVarsFromString(prev_path); } } //setTimeout(function(){try {globals.alooma.fv.store(event_name, data, d); } catch (err) {}}); //console.log('IM HERE'); // fb_segment_tracking try { var e_type = null; if (event_name == 'connect_done') { e_type = data.type == 'signup' ? 'signup' : 'login'; } else if (event_name == 'show_page' && data.is_first) { e_type = 'firstPageView'; } else if (event_name == 'show_landing_page' && data.is_first_time_business) { e_type = 'firstBusinessPageView'; } else if (event_name == 'createmovie') { e_type = 'createmovie'; } else if (event_name == 'show_purchase_screen') { e_type = 'pricingpage'; } if (e_type) pixel_tracking(['fb_custom', 'segment', Object.assign({type: e_type}, globals.alooma.get_device_id_user_segments(12))]); } catch(err) {}; }, track: function(event_name, extra_data, cb) { try { if(!!extra_data && !extra_data["prev_path"]){ var origin = (document.location && document.location.origin ? document.location.origin : window.origin); var prev_path = document.referrer.replace(origin,''); if(!!prev_path){ extra_data["prev_path"] = prev_path; } } var d = new Date(), data = globals.alooma._prepare(extra_data, d); globals.alooma._track(event_name, data, cb, d); /*if(!!globals.is_debug) */ console.log('[al] ' + event_name + ': ' + JSON.stringify(data)); if (cb) setTimeout(cb, 400); // silent fallback } catch(err){ console.log('alooma error: ' + err); if (cb) cb(); } }, queue: function(event_name, extra_data) { try { var data = globals.alooma._prepare(extra_data, new Date()), q = []; try { q = JSON.parse(localStorage.getItem('al_queue')) || []; } catch(err){} q.push({event:event_name, data:data}) localStorage.setItem('al_queue' , JSON.stringify(q)); } catch(err){} }, track_queue: function() { try { var q = JSON.parse(localStorage.getItem('al_queue')) || null; if (q) { var d = new Date(); for (var i=0; i< q.length; i++) { try { globals.alooma._track(q[i].event, q[i].data, null, d); console.log('[al] ' + q[i].event + ': ' + JSON.stringify(q[i].data)); } catch(err){} } localStorage.removeItem('al_queue'); } } catch(err){ console.log('Error processing alooma queue: ' + err); } }, store_tracking_data: function(key, data) { try { localStorage.setItem(key, JSON.stringify(data)); } catch(err){} }, pop_tracking_data: function(key) { var data = null; try { var data = JSON.parse(localStorage.getItem(key)) || null; if (data !== null) localStorage.removeItem(key); } catch(err){} return data; }, get_device_id: function() { return common.get_device_id(); }, _tonum: function(str) { var hash = 0, i, chr; str = str + ''; if (str.length === 0) return hash; for (i = 0; i < str.length; i++) { chr = str.charCodeAt(i); hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } hash = hash >>> 0; return hash; }, get_device_id_user_segments: function(num_segments) { ret = { device_segment: 1 + globals.alooma._tonum(common.get_device_id()) % num_segments}; if (globals.alooma.uid) ret.user_segment = 1 + globals.alooma._tonum(globals.alooma.uid) % num_segments; return ret }, popups_track: function(event_name, extra_params) { var ev; if (event_name == 'show') ev = 'show_popup'; else if (event_name == 'press') ev = 'press_popup'; else return; globals.alooma.track(ev, extra_params); }, get_internal_linking_params: function(via) { return 'via='+encodeURIComponent(via)+'&prev_path='+window.location.pathname; }, get_utm_data: function(params) { var params = params || {}; if (common.get_url_param('utm_campaign')) params.utm_campaign = common.get_url_param('utm_campaign'); if (common.get_url_param('utm_term')) params.utm_term = common.get_url_param('utm_term'); if (common.get_url_param('utm_content')) params.utm_content = common.get_url_param('utm_content'); if (common.get_url_param('utm_medium')) params.utm_medium = common.get_url_param('utm_medium'); if (common.get_url_param('utm_source')) params.utm_source = common.get_url_param('utm_source'); if (common.get_url_param('adgroup')) params.adgroup = common.get_url_param('adgroup'); if (common.get_url_param('matchtype')) params.matchtype = common.get_url_param('matchtype'); if (common.get_url_param('distribution')) params.distribution = common.get_url_param('distribution'); if (common.get_url_param('placement')) params.placement = common.get_url_param('placement'); if (common.get_url_param('partner')) params.partner = common.get_url_param('partner'); if (common.get_url_param('via')) params.via = common.get_url_param('via'); if (common.get_url_param('prev_path')) params.prev_path = common.get_url_param('prev_path'); if (common.get_url_param('campaign_id')) params.campaign_id = common.get_url_param('campaign_id'); if (common.get_url_param('adgroup_id')) params.adgroup_id = common.get_url_param('adgroup_id'); if (common.get_url_param('keyword_id')) params.keyword_id = common.get_url_param('keyword_id'); if (common.get_url_param('ad_id')) params.ad_id = common.get_url_param('ad_id'); if (common.get_url_param('fb_ad_id')) params.ad_id = common.get_url_param('fb_ad_id'); if (common.get_url_param('page_type')) params.type = common.get_url_param('page_type'); if (common.get_url_param('gclid')) params.gclid = common.get_url_param('gclid'); if (common.is_optin_flow()) params.with_optin = true; return params; } }; (function(){ setTimeout(function(){ globals.alooma.track_queue(); try{ globals.alooma.track('show_page',globals.alooma.get_utm_data(globals.show_page_params)); } catch(err){ console.log('Error auto-tracking pageview with alooma: ' + err); } }); })(); </script> <script> function set_fb_tracking(){ !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','//web.archive.org/web/20211217110149/https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '578629842302451'); fbq('track', "PageView"); } function set_bing_tracking(){ (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"33000079"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//web.archive.org/web/20211217110149/https://bat.bing.com/bat.js","uetq"); }; function set_ga_tracking(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//web.archive.org/web/20211217110149/https://www.google-analytics.com/analytics.js','ga'); ga('set', 'anonymizeIp', true); ga('create', 'UA-21702090-1', 'auto'); console.log('INIT GA:UA-21702090-1'); // custom dimensions ga('set', 'dimension3', globals.is_authenticated ? 'logged-in' : 'logged-out'); if (globals.is_business) ga('set', 'dimension4', globals.opt_in_trial ? 'business-trial' : 'business-subscriber'); ga('send', 'pageview'); }; </script> <script type="text/javascript">function init_external_tracking(flush_events){if(typeof set_ga_tracking!=='undefined') set_ga_tracking();if(typeof set_fb_tracking!=='undefined') set_fb_tracking();if(typeof set_bing_tracking!=='undefined') set_bing_tracking();if(flush_events){pixel_tracking([]);}} function flush_page_events(){pixel_tracking([]);} init_external_tracking(false);globals.fb_pixel={_alooma:function(event_name,data){try{var a_data={} if(data) Object.assign(a_data,data);if('type'in a_data) a_data.type2=event_name;else a_data.type=event_name;globals.alooma.track('send_facebook_pixel',a_data);}catch(err){}},set_user_props:function(props,cb){try{FB.getLoginStatus(function(response){if(response&&response.authResponse){FB.AppEvents.setUserID(response.authResponse.userID);FB.AppEvents.updateUserProperties(props) console.log('[fb] [DEBUG] set_user_props: '+JSON.stringify(props));}});}catch(err){console.log('fb tracking error: '+err);}},track:function(event_name,extra_data,cb){if(typeof cb!='function') cb=function(){};try{var data={};if(extra_data) Object.assign(data,extra_data);if(typeof fbq!=='undefined'){fbq('track',event_name,data);console.log('[fb] '+event_name+': '+JSON.stringify(data));}else{console.log('[fb] [DEBUG] '+event_name+': '+JSON.stringify(data));} setTimeout(cb,800);globals.fb_pixel._alooma(event_name,data)}catch(err){console.log('fb tracking error: '+err);cb();}},track_custom:function(event_name,extra_data,cb){if(typeof cb!='function') cb=function(){};try{var data={};if(extra_data) Object.assign(data,extra_data);if(typeof fbq!=='undefined'){fbq('trackCustom',event_name,data);console.log('[fbc] '+event_name+': '+JSON.stringify(data));}else{console.log('[fbc] [DEBUG] '+event_name+': '+JSON.stringify(data));} setTimeout(cb,800);globals.fb_pixel._alooma(event_name,data)}catch(err){console.log('fb custom tracking error: '+err);cb();}},_track_once:function(event_name,extra_data,is_custom,cache_key){try{var c_id='fbpxl_'+(!!cache_key?cache_key:event_name);var last_time=localStorage.getItem(c_id);var d=new Date();var n=Math.round(d.getTime()/1000);var FIRE_TIME_DIFF=3600*24*30;if(last_time){last_time=parseInt(last_time);if(last_time&&last_time>n-FIRE_TIME_DIFF) return;if(last_time==1) return;} localStorage.setItem(c_id,n);if(is_custom) globals.fb_pixel.track_custom(event_name,extra_data);else globals.fb_pixel.track(event_name,extra_data);}catch(err){console.log('fb track_once error: '+err);}},track_once:function(event_name,extra_data,cache_key){globals.fb_pixel._track_once(event_name,extra_data,false,cache_key);},track_custom_once:function(event_name,extra_data,cache_key){globals.fb_pixel._track_once(event_name,extra_data,true,cache_key);}};globals.bing={event:function(label){try{if(window.uetq){window.uetq.push({'ec':'category','ea':'action','el':label});console.log('[bing] '+label);}else{console.log('[bing] [DEBUG] '+label);}}catch(err){console.log('bing error: '+err);}}};globals.ga={event:function(category,action,label,value,cb){try{if(typeof ga!=='undefined'){ga('send','event',category,action,label,(value||0),{'nonInteraction':1});console.log('[GA] E:'+category+' | '+action+' | '+label);}else{console.log('[GA] [DEBUG] E:'+category+' | '+action+' | '+label);}}catch(err){console.log('g.a ev error: '+err);} if(cb&&typeof cb=='function'){setTimeout(cb,800);}},pageview:function(page,cb){try{if(typeof ga!=='undefined'){ga('send','pageview',page);console.log('[GA] P:'+page);}else{console.log('[GA] [DEBUG] P:'+page);}}catch(err){console.log('g.a pv error: '+err)} if(cb&&typeof cb=='function'){setTimeout(cb,800);}},set:function(metric,data,cb){try{if(typeof ga!=='undefined'){ga('set',metric,data);console.log('[GA] S:'+metric,data);}else{console.log('[GA] [DEBUG] P:'+metric,data);}}catch(err){console.log('g.a pv error: '+err)} if(cb&&typeof cb=='function'){setTimeout(cb,800);}}};</script> <!-- Global site tag (gtag.js) - Google Ads: 754306960 --> <!-- /* ----------------- */ /* Google Site Tag */ /* ----------------- */ --> <script async src="https://web.archive.org/web/20211217110149js_/https://www.googletagmanager.com/gtag/js?id=AW-754306960"></script> <script> try{ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-754306960'); } catch(err) {} </script> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://web.archive.org/web/20211217110149if_/https://www.googletagmanager.com/ns.html?id=GTM-T4P8MR3" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- CrazyEgg code --> <script type="text/javascript" src="//web.archive.org/web/20211217110149js_/https://script.crazyegg.com/pages/scripts/0014/1514.js" async="async"></script> <script> var globals = globals || {}; var SharedComponents = {}; globals.bundles = { wizard: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/wizard-bundle.js', wizardVendors: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/vendors-bundle.js', wizardIris: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/iris-bundle.js', wizardBundlesPath: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/', editor: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/editor-bundle.js', editorVendors: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/vendors-bundle.js', editorIris: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/iris-bundle.js', editorBundlesPath: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/', script: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/script-bundle.js', scriptVendors: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/vendors-bundle.js', scriptIris: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/iris-bundle.js', scriptBundlesPath: 'https://web.archive.org/web/20211217110149/https://d3pvxrmcry8qui.cloudfront.net/2ab5e4e0ef_90cdb7c8/', __dont_fail_in_ie8_because_of_trailing_comma_in_object_literal__: true }; </script> <script src="https://web.archive.org/web/20211217110149js_/https://d3pvxrmcry8qui.cloudfront.net/f898d6eb48_573c7bf/magisto-web.js"></script> <script> </script> <script> common.lazy_load_popup('create-split-popup'); </script> <script> globals.CRM.track("trigger_screen_templates"); </script> </body> </html> <!-- FILE ARCHIVED ON 11:01:49 Dec 17, 2021 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 15:25:10 Dec 12, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 3.137 exclusion.robots: 0.024 exclusion.robots.policy: 0.015 esindex: 0.009 cdx.remote: 63.806 LoadShardBlock: 259.441 (3) PetaboxLoader3.resolve: 774.046 (4) PetaboxLoader3.datanode: 115.852 (4) load_resource: 694.466 -->