<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace WordfenceLS;

abstract class Model_Asset {

	protected $handle;
	protected $source;
	protected $dependencies;
	protected $version;
	protected $registered = false;

	public function __construct($handle, $source = '', $dependencies = array(), $version = false) {
		$this->handle = $handle;
		$this->source = $source;
		$this->dependencies = $dependencies;
		$this->version = $version;
	}

	public function getSourceUrl() {
		if (empty($this->source))
			return null;
		$url = $this->source;
		if (is_string($this->version))
			$url = add_query_arg('ver', $this->version, $this->source);
		return $url;
	}

	public abstract function enqueue(); 

	public abstract function isEnqueued();

	public abstract function renderInline();

	public function renderInlineIfNotEnqueued() {
		if (!$this->isEnqueued())
			$this->renderInline();
	}

	public function setRegistered() {
		$this->registered = true;
		return $this;
	}

	public function register() {
		return $this->setRegistered();
	}

	public static function js($file) {
		return self::_pluginBaseURL() . 'js/' . self::_versionedFileName($file);
	}
	
	public static function css($file) {
		return self::_pluginBaseURL() . 'css/' . self::_versionedFileName($file);
	}
	
	public static function img($file) {
		return self::_pluginBaseURL() . 'img/' . $file;
	}
	
	protected static function _pluginBaseURL() {
		return plugins_url('', WORDFENCE_LS_FCPATH) . '/';
	}
	
	protected static function _versionedFileName($subpath) {
		$version = WORDFENCE_LS_BUILD_NUMBER;
		if (