<div class="profile-container">
	<div class="yp_profile">
		<div class="card-container">
			<div class="cover-container">
				<img src="{{USER cover}}" alt="{{USER name}}" id="yp_cover">
				<?php if ($pt->isowner == true) { ?>
					<div class="edit-cover-container hidde">
						<a href="{{LINK settings/avatar}}" data-load="?link1=settings&page=avatar"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z" /></svg></a>
						<?php if ($pt->profile_user->ex_cover != 'upload/photos/d-cover.jpg') { ?>
						<span class="btn btn-upload-image btn-file" onclick="PT_StartRepositioner();">
							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,15H23V17H21V15M21,11H23V13H21V11M23,19H21V21C22,21 23,20 23,19M13,3H15V5H13V3M21,7H23V9H21V7M21,3V5H23C23,4 22,3 21,3M1,7H3V9H1V7M17,3H19V5H17V3M17,19H19V21H17V19M3,3C2,3 1,4 1,5H3V3M9,3H11V5H9V3M5,3H7V5H5V3M1,11V19A2,2 0 0,0 3,21H15V11H1M3,19L5.5,15.79L7.29,17.94L9.79,14.72L13,19H3Z" /></svg>
						</span>
						<?php } ?>
					</div>
				<?php } ?>
			</div>
		  
			<?php if ($pt->isowner == true) { ?>
				<div class="cover-container-2">
					<img src="{{USER full_cover}}" alt="{{USER name}}">
					<div class="user-reposition-dragable-container">
						<span class="btn btn-upload-image btn-file" onclick="Wo_SubmitRepositioner();">
							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>
						</span>
						<span class="btn btn-upload-image btn-file" onclick="PT_StopRepositioner();">
							<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>
						</span>
					</div>
					<div class="user-cover-uploading-progress user-repositioning-icons-container"></div>
				</div>
				<form class="cover-position-form hidden" method="post">
					<input class="cover-position" name="pos" value="0" type="hidden">
					<input name="user_id" value="{{USER id}}" type="hidden">
				</form>
			<?php } ?>
		</div>
		<div class="pt_timeline_usr">
			<div class="container-home">
				<div class="pt_chnl_info">
					<div class="yp_inner_profile_area">
						<div class="avatar-container">
							<a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}"><img src="{{USER avatar}}" alt="{{USER name}}"></a>
						</div>
						<div class="info-container">
							<h4><a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}">{{USER name_v}} <?php if ($pt->profile_user->is_pro > 0 && !empty($pt->pro_packages[$pt->profile_user->pro_type])) { ?>
				<span class="icon_pro">
					<svg xmlns="http://www.w3.org/2000/svg" width="42" height="20" viewBox="0 0 42 20">
					  <g id="pro" transform="translate(-1739 -2240)">
					    <rect id="bg" width="42" height="20" rx="8" transform="translate(1739 2240)" fill="#3f90cf"/>
					    <text id="PRO-2" data-name="PRO" transform="translate(1760.053 2254.134)" fill="#fff" font-size="12" font-weight="500"><tspan x="-11" y="0">PRO</tspan></text>
					  </g>
					</svg>
				</span>
				<?php } ?></a></h4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if ($pt->profile_user->privacy->show_subscriptions_count == 'yes') { ?>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>{{SUBS}} {{LANG subscribers}}</p><?php } ?>
						</div>
					</div>
					<div class="subscribe-btn-container">
						<div>{{NOTIFY_BUTTON}}</div>
						<div>{{BLOCK_BUTTON}}</div>
						<div>{{MESSAGE_BUTTON}}</div>
						<div>{{SUBSCIBE_BUTTON}}</div>
					</div>
				</div>
				<div class="links-container">
					<ul>
						<li><a href="{{LINK @{{USER username}}?page=videos}}" class="<?php echo ($pt->second_page == 'videos') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=videos">{{LANG videos}}</a></li>
						<li><a href="{{LINK @{{USER username}}?page=play-lists}}" class="<?php echo ($pt->second_page == 'play-lists') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=play-lists">{{LANG play_lists}}</a></li>
                        <?php if ($pt->config->shorts_system == 'on') { ?>
                          <li>
                            <a href="{{LINK @{{USER username}}?page=shorts}}" class="<?php echo ($pt->second_page == 'shorts') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=shorts">{{LANG shorts}}</a>
                          </li>
                          <?php } ?>
						<li><a href="{{LINK @{{USER username}}?page=liked-videos}}" class="<?php echo ($pt->second_page == 'liked-videos') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=liked-videos">{{LANG liked_videos}}</a></li>
						<?php if ($pt->config->post_system == 'on') { ?>
							<li>
								<a href="{{LINK @{{USER username}}?page=activities}}" class="<?php echo ($pt->second_page == 'activities') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=activities">{{LANG activities}}</a>
							</li>
						<?php } ?>
						<li><a href="{{LINK @{{USER username}}?page=about}}" class="<?php echo ($pt->second_page == 'about') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=about">{{LANG about_profile}}</a></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div class="page-container">
		<div class="container-home">
			{{SECOND_PAGE}}
		</div>
	</div>
	<input type="hidden" id="profile-id" value="{{USER id}}">
</div>


<script type="text/javascript">
    $('.cover-container, .edit-cover-container').hover(function() { 
      $('.edit-cover-container').removeClass('hidde'); 
  });
  $('.cover-container, .edit-cover-container').mouseleave(function() {                  
     $('.edit-cover-container').addClass('hidde'); 
  });
  
  $('.avatar-container, .edit-avatar-container').hover(function() { 
      $('.edit-avatar-container').removeClass('hidden'); 
  });
  $('.avatar-container, .edit-avatar-container').mouseleave(function() {                  
     $('.edit-avatar-container').addClass('hidden'); 
  });

  function PT_StartRepositioner() {
    $('.cover-container').hide();
    $('.cover-container-2').show();
    $('.cover-container-2 img').css('cursor', '-webkit-grab').draggable({
      scroll: false,
      axis: "y",
      cursor: "-webkit-grab",
      drag: function (event, ui) {
        y1 = $('.cover-container-2').height();
        y2 = $('.cover-container-2').find('img').height();
        if (ui.position.top >= 0) {
            ui.position.top = 0;
        }else{
          if (ui.position.top <= (y1-y2)) {
              ui.position.top = y1-y2;
          }
        }
      },
      stop: function(event, ui) {
          $('input.cover-position').val(ui.position.top);
      }
    });
  }

  function PT_StopRepositioner() {
    $('.cover-container').show();
    $('.cover-container-2').hide();
  }

  function Wo_SubmitRepositioner() {
      if ($('input.cover-position').length == 1) {
          posY = $('input.cover-position').val();
          $('form.cover-position-form').submit();
      }
  }
  $('form.cover-position-form').ajaxForm({
        url:  '{{LINK aj/user/re_cover}}?hash=' + $('.main_session').val(),
        dataType:  'json', 
        beforeSend: function() {
            $('.user-reposition-dragable-container').hide();
            $('.user-repositioning-icons-container1').show();
            $('.user-repositioning-icons-container').html('<div class="pace-activity-parent"><div class="pace-activity"></div></div>').fadeIn('fast');
        },
        success: function(data) {
            if (data.status == 200) {
              $('.cover-container img').attr('src', data.url + '?time=' + Math.random()).on("load", function () {
                $('.cover-container').show();
                $('.cover-container-2').hide();
                $('.user-reposition-dragable-container').show();
                $('.user-repositioning-icons-container1').fadeOut('fast');
                $('.user-repositioning-icons-container').fadeOut('fast').html('');
                var div = document.getElementById("yp_bg_color");
                div.pseudoStyle("before","background-image","url('"+data.url+"')");
              });
            }
        }
    });
  

</script>

<?php if (!empty($pt->profile_user->google_tracking_code)) { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo($pt->profile_user->google_tracking_code) ?>"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '<?php echo($pt->profile_user->google_tracking_code) ?>');
</script>

<?php } ?>