diff --git a/.gitignore b/.gitignore index 51131f6..17bcfcb 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,15 @@ -/.project -/settings.php -/.buildpath -/.settings/ +# App config files +/config/settings.php +/log.html + +# Build folder +/public/* +!/public/index.php + +# Dependencies files +/vendor/ +/node_modules/ +/composer.dev.lock + +# Lint caches +/.php-cs-fixer.cache diff --git a/.htaccess b/.htaccess deleted file mode 100644 index f3a6dd0..0000000 --- a/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ -## Jul - deny access to the top-level git repository -RewriteEngine On -RewriteRule \.git - [F,L] diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..839ff05 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,38 @@ +in([__DIR__.'/lib', __DIR__.'/public']) + ->append([__DIR__.'/config/settings-sample.php']) + ->name('*.php'); + +return (new PhpCsFixer\Config()) + ->setIndent("\t") + ->setLineEnding("\n") + ->setRules([ + 'single_quote' => true, + 'array_syntax' => ['syntax' => 'short'], + 'braces_position' => [ + 'classes_opening_brace' => 'same_line', + 'functions_opening_brace' => 'same_line', + 'anonymous_functions_opening_brace' => 'same_line' + ], + 'concat_space' => ['spacing' => 'none'], + 'constant_case' => ['case' => 'lower'], + 'lowercase_keywords' => true, + 'visibility_required' => ['elements' => ['method', 'property', 'const']], + 'no_unused_imports' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => true, + 'single_blank_line_at_eof' => true, + 'no_empty_statement' => true, + 'trim_array_spaces' => true, + 'new_with_parentheses' => true + ]) + ->setFinder($finder); diff --git a/background.php b/background.php deleted file mode 100755 index 5906aec..0000000 --- a/background.php +++ /dev/null @@ -1,19 +0,0 @@ -=8.4", + "franzz/objects": "dev-vue" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.75" + }, + "autoload": { + "psr-4": { + "Franzz\\MyThoughts\\": "lib/", + "Franzz\\Objects\\": "../objects/inc/" + }, + "files": [ + "config/settings.php" + ] + }, + "scripts": { + "lint": "php-cs-fixer fix --dry-run --diff", + "lint-fix": "php-cs-fixer fix" + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..429d761 --- /dev/null +++ b/composer.json @@ -0,0 +1,31 @@ +{ + "name": "franzz/mythoughts", + "description": "MyThoughts", + "type": "project", + "license": "GPL-3.0-or-later", + "repositories": [ + { + "type": "git", + "url": "https://git.lutran.fr/franzz/objects" + } + ], + "require": { + "php": ">=8.4", + "franzz/objects": "dev-vue" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.75" + }, + "autoload": { + "psr-4": { + "Franzz\\MyThoughts\\": "lib/" + }, + "files": [ + "config/settings.php" + ] + }, + "scripts": { + "lint": "php-cs-fixer fix --dry-run --diff", + "lint-fix": "php-cs-fixer fix" + } +} diff --git a/config.php b/config.php deleted file mode 100755 index fa48f61..0000000 --- a/config.php +++ /dev/null @@ -1,996 +0,0 @@ -asMessageStack = array(); - $this->asMessageStack[self::ERROR_TAB] = array(); - $this->asMessageStack[self::WARNING_TAB] = array(); - $this->iExtractMode = self::MODE_ARRAY; - } - - protected function addError($sError) - { - $this->addMessage(self::ERROR_TAB, $sError); - } - - protected function addWarning($sWarning) - { - $this->addMessage(self::WARNING_TAB, $sError); - } - - private function addMessage($sType, $sMessage) - { - $this->asMessageStack[$sType][] = $sMessage; - } - - protected function getCleanErrorStack() - { - return $this->getCleanMessageStack(self::ERROR_TAB); - } - - protected function getCleanWarningStack() - { - return $this->getCleanMessageStack(self::WARNING_TAB); - } - - private function getCleanMessageStack($sType) - { - switch($this->iExtractMode) - { - case self::MODE_TEXT: - $oMessageStack = implode("\n", $this->asMessageStack[$sType]); - break; - case self::MODE_ARRAY: - $oMessageStack = $this->asMessageStack[$sType]; - break; - case self::MODE_FILE: - $oMessageStack = implode("

", $this->asMessageStack[$sType]); - break; - } - $this->asMessageStack[$sType] = array(); - return $oMessageStack; - } - - function __destruct() - { - $sErrorStack = $this->getCleanErrorStack(); - - switch($this->iExtractMode) - { - case self::MODE_TEXT: - echo $sErrorStack; - break; - case self::MODE_ARRAY: - if(count($sErrorStack)>0) - { - pre($sErrorStack, 'Error Stack'); - } - break; - case self::MODE_FILE: - if($sErrorStack!='') - { - @file_put_contents('log.html', '

'.date('r')."

".$sErrorStack.'

', FILE_APPEND); - } - break; - } - } -} - -class Session extends PhpObject -{ - private $iUserId; - private $sLogin; - private $sToken; - private $sPostToken; - - private $oMySql; - - const SESSION_ID_USER = 'id_user'; - const SESSION_USER = 'user'; - const SESSION_TOKEN = 'token'; - const SESSION_POST_TOKEN = 'post_token'; - - public function __construct($oMySql) - { - parent::__construct(); - $this->iUserId = $this->sLogin = $this->sToken = $this->sPostToken = false; - $this->oMySql = $oMySql; - $this->syncSession(); - } - - public function getUserId() - { - return $this->iUserId; - } - - private function syncSession() - { - if(isset($_SESSION[self::SESSION_ID_USER])) - { - $this->iUserId = $_SESSION[self::SESSION_ID_USER]; - } - if(isset($_SESSION[self::SESSION_USER])) - { - $this->sLogin = $_SESSION[self::SESSION_USER]; - } - if(isset($_SESSION[self::SESSION_TOKEN])) - { - $this->sToken = $_SESSION[self::SESSION_TOKEN]; - } - if(isset($_SESSION[self::SESSION_POST_TOKEN])) - { - $this->sPostToken = $_SESSION[self::SESSION_POST_TOKEN]; - } - } - - private function setSession($iUserId, $sLogin) - { - $_SESSION[self::SESSION_ID_USER] = $iUserId; - $_SESSION[self::SESSION_USER] = $sLogin; - - //Token - $sToken = $this->createToken(); - $_SESSION[self::SESSION_TOKEN] = $sToken; - $this->setTokenCookie($sToken); - - $this->syncSession(); - } - - public function register($asData) - { - $sLogin = strtolower($asData['user']); - $sPass = $asData['pass']; - - if($sLogin=='' || $sPass=='') - { - $this->addError('Empty mandatory fields (Nickname or password)'); - } - elseif(htmlspecialchars($sLogin, ENT_QUOTES)!=$sLogin) - { - $this->addError('Nickname: HTML characters are forbidden'); - } - elseif($this->oMySql->selectRow(MySqlManager::USERS_TABLE, array('user'=>$sLogin))) - { - $this->addError('Nickname: This is already a user called by that name, choose a different one'); - } - else - { - $asData['pass'] = self::encryptPassword($sPass); - $iUserId = $this->oMySql->insertRow(MySqlManager::USERS_TABLE, $asData); - return $this->logMeIn($sLogin, $sPass); - } - return false; - } - - public function logMeIn($sLogin, $sPass) - { - $bResult = false; - $asUser = $this->oMySql->selectRow(MySqlManager::USERS_TABLE, array('user'=>$sLogin)); - if(!$asUser) - { - $this->addError('Utilisateur inconnu'); - } - elseif(!$this->checkPassword($sPass, $asUser['pass'])) - { - $this->addError('mot de pass incorrect'); - } - else - { - $this->setSession($asUser[MySqlManager::getId(MySqlManager::USERS_TABLE)], $sLogin); - $bResult = true; - } - return $bResult; - } - - public function isLogguedIn() - { - $bLogguedIn = false; - if($this->iUserId && $this->sLogin && $this->sToken) - { - //check if token is set and valid - if($this->checkToken()) - { - //Check if user got a actual account in the database - $bLogguedIn = $this->checkAccount($this->sLogin, $this->iUserId); - } - else - { - $this->addError('Authentication problem, please sign in again'); - } - } - return $bLogguedIn; - } - - private function checkAccount($sUserName, $iUserId=0) - { - $asConstraints = array('user'=>$sUserName); - if($iUserId>0) - { - $asConstraints[MySqlManager::getId(MySqlManager::USERS_TABLE)] = $iUserId; - } - return $this->oMySql->selectValue(MySqlManager::USERS_TABLE, 'COUNT(1)', $asConstraints); - } - - public function logMeOut() - { - $_SESSION = array(); - $this->setTokenCookie('', -1); - return session_destroy(); - } - - private static function encryptPassword($sPass) - { - $sRandomText = 'F_RA-1H"2{bvj)5f?0sd3r#fP,K]U|w}hGiN@(sZ.sDe!7*x/:Mq+&'; - for($iIndex=0; $iIndex < strlen($sPass); $iIndex++) - { - $sPass[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sPass[$iIndex]; - } - return md5($sPass); - } - - private static function createToken() - { - return self::encryptPassword( $_SERVER['HTTP_USER_AGENT']. - $_SERVER['REMOTE_ADDR']. - $_SERVER['REQUEST_TIME']. - strstr(microtime(), ' ', true). - $_SERVER['SERVER_SIGNATURE']. - $_SERVER['SERVER_ADMIN']); - } - - //Session Token - - private static function setTokenCookie($sToken, $iTime=1) - { - setcookie(self::SESSION_TOKEN, $sToken, time()+60*60*24*$iTime); - $_COOKIE[self::SESSION_TOKEN] = $sToken; - } - - private function checkToken() - { - return ($this->sToken && array_key_exists(self::SESSION_TOKEN, $_COOKIE) && $_COOKIE[self::SESSION_TOKEN] == $this->sToken); - } - - //Post Token - - private function refreshPostToken() - { - $this->sPostToken = self::createToken(); - $_SESSION[self::SESSION_POST_TOKEN] = $this->sPostToken; - } - - public function getNewPostToken() - { - $this->refreshPostToken(); - return $this->sPostToken; - } - - public function checkPostToken($sPostToken) - { - return ($this->sPostToken && $sPostToken!='' && $sPostToken == $this->sPostToken); - } - - private static function checkPassword($sClearPass, $sEncodedPass) - { - return self::encryptPassword($sClearPass) == $sEncodedPass; - } -} - -class Mask extends PhpObject -{ - public $sMaskName; - public $sFilePath; - private $sMask; - private $asTags; - private $asPartsSource; - private $aoInstances; - - const MASK_FOLDER = 'mask/'; - const START_TAG = 'START'; - const END_TAG = 'END'; - const TAG_MARK = '#'; - - public function __construct($sFileName='') - { - //init - parent::__construct(); - $this->sMaskName = ''; - $this->sFilePath = ''; - $this->sMask = ''; - $this->asTags = array(); - $this->asPartsSource = array(); - $this->aoInstances = array(); - $this->sFilePath = ''; - - //load file - if($sFileName!='') - { - $this->initFile($sFileName); - } - } - - public function initFile($sFileName) - { - $sFilePath = self::MASK_FOLDER.$sFileName.'.html'; - if(file_exists($sFilePath)) - { - $this->sFilePath = $sFilePath; - $sSource = file_get_contents($this->sFilePath); - $this->initMask($sFileName, $sSource); - } - else - { - $this->addError('Fichier introuvable à l\'adresse : '.$sFilePath); - } - } - - public function initFileFromString($sSource, $sPartName='', $iInstanceNb=0) - { - $this->initMask($sPartName.' (from row) '.$iInstanceNb, $sSource); - } - - private function initMask($sMaskName, $sSource) - { - $this->sMaskName = $sMaskName; - $this->sMask = $sSource; - $this->setParts(); - } - - private function setParts() - { - while(preg_match('/\<\!-- \[PART\] (?P\S+) \[START\] --\>/', $this->sMask, $asMatch)) - { - $sPartName = $asMatch['part']; - - $this->asPartsSource[$sPartName] = $this->getCleanPart($sPartName); - $this->aoInstances[$sPartName] = array(); - } - } - - private function getCleanPart($sPartName) - { - $iStartPos = $this->getPartStartPos($sPartName); - $iEndPos = $this->getPartEndPos($sPartName); - $sPart = substr($this->sMask, $iStartPos, $iEndPos-$iStartPos); - $sExtendedPart = $this->getPartPattern($sPartName, self::START_TAG).$sPart. $this->getPartPattern($sPartName, self::END_TAG); - $this->sMask = str_replace($sExtendedPart, $this->getPartTagPattern($sPartName), $this->sMask); - return $sPart; - } - - private function getPartStartPos($sPartName) - { - $sPartStartPattern = $this->getPartPattern($sPartName, self::START_TAG); - return strpos($this->sMask, $sPartStartPattern) + strlen($sPartStartPattern); - } - - private function getPartEndPos($sPartName) - { - $sPartEndPattern = $this->getPartPattern($sPartName, self::END_TAG); - return strpos($this->sMask, $sPartEndPattern); - } - - private function getPartPattern($sPartName, $sAction) - { - return ''; - } - - private function getPartTagPattern($sPartName, $bMark=true) - { - $sPartTag = 'PART '.$sPartName; - return $bMark?$this->addTagMark($sPartTag):$sPartTag; - } - - public function addInstance($sPartName, $asTags) - { - $this->newInstance($sPartName); - foreach($asTags as $sTagName=>$sTagValue) - { - $this->setInstanceTag($sPartName, $sTagName, $sTagValue); - } - } - - public function newInstance($sPartName) - { - //Finding the part - $oMask = &$this->findPart($this, $sPartName); - - //Retrieving source html - $sPartSource = $oMask->asPartsSource[$sPartName]; - - //Creating new instance - $oInstance = new Mask(); - $oInstance->initFileFromString($sPartSource, $sPartName); - $oMask->aoInstances[$sPartName][] = $oInstance; - } - - public function setInstanceTag($sPartName, $sTagName, $sTagValue) - { - $oMask = &$this->findPart($this, $sPartName); - $oMask->getCurrentInstance($sPartName)->setTag($sTagName, $sTagValue); - } - - private function &findPart($oMask, $sPartName) - { - if(array_key_exists($sPartName, $oMask->aoInstances)) - { - return $oMask; - } - else //not tested - { - foreach($oMask->aoInstances as $sLevelPartName=>$aoInstances) - { - if(!empty($aoInstances)) - { - //take last instances - return $this->findPart($oMask->getCurrentInstance($sLevelPartName), $sPartName); - } - } - } - $this->addError('No part found : '.$sPartName); - } - - private function getCurrentInstance($sPartName) - { - if(!empty($this->aoInstances[$sPartName])) - { - return end($this->aoInstances[$sPartName]); - } - else - { - return false; - } - } - - public function setTag($sTagName, $sTagValue) - { - $this->asTags[$sTagName] = $sTagValue; - } - - public function getMask() - { - $sCompletedMask = $this->sMask; - - //build parts - foreach($this->aoInstances as $sPart=>$aoParts) - { - $sTagValue = ''; - foreach($aoParts as $oInstance) - { - $sTagValue .= $oInstance->getMask(); - } - $this->setTag($this->getPartTagPattern($sPart, false), $sTagValue); - } - - //replace tags - if(!empty($this->asTags)) - { - $asTags = $this->addTagMark(array_keys($this->asTags)); - $sCompletedMask = str_replace($asTags, $this->asTags, $sCompletedMask); - } - return $sCompletedMask; - } - - private function addTagMark($oData) - { - return array_map_encapsulate($oData, self::TAG_MARK); - } -} - -class MyThoughts extends PhpObject -{ - //Constants - const URL_DATE_FORMAT = 'Ymd'; - const LAYOUT_DATE_FORMAT = 'F \t\h\e jS, Y'; - const MYSQL_DATE_FORMAT = 'Y-m-d'; - const LAYOUT_TIME_FORMAT = 'G:i'; - const WELCOME_MSG_FILE = 'welcome'; - - //settings - const SETTING_LAYOUT = 'layout'; - const LAYOUT_ONE_PAGE = '1'; - const LAYOUT_TWO_PAGES = '2'; - const SETTING_FONT = 'font'; - const FONT_THOUGHTS = 'thoughts'; - const FONT_ARIAL = 'Arial'; - const FONT_VERDANA = 'Verdana'; - const SETTING_SIZE = 'Size'; - const SIZE_16 = '16'; - const SIZE_18 = '18'; - const SIZE_20 = '20'; - - //Objects - private $oMySql; - private $oSession; - private $oCalendar; - private $asSettings; - - //Masks - private $oMainMask; - private $oPageMask; - private $oMenuMask; - - function __construct() - { - parent::__construct(); - $this->oMySql = new MySqlManager(); - $this->oSession = new Session($this->oMySql); - $this->oCalendar = new Calendar($this->oMySql, $this->oSession); - $this->oMainMask = new Mask('index'); - $this->oPageMask = new Mask(); - $this->oMenuMask = new Mask(); - $this->asSettings = array(); - } - - - - - public function logMeOut() - { - $this->oSession->logMeOut(); - self::relocate(); - } - - public function isLogguedIn() - { - return $this->oSession->isLogguedIn(); - } - - public function checkPostToken($sPostToken) - { - return $this->oSession->checkPostToken($sPostToken); - } - - public function setPage($sPage) - { - $this->oPageMask->initFile($sPage); - } - - public function setPageTitle($sTitle) - { - $this->oMainMask->setTag('title', $sTitle); - } - - public function setCalendarDate($iYear=0, $iMonth=0) - { - $this->oCalendar->setDate($iYear, $iMonth); - } - - private static function relocate($sPage='', $asVar=array()) - { - $asVar['p'] = $sPage; - header('Location:index.php?'.implodeAll($asVar, '=', '&')); - die(); - } - - - - public function updateThought($iThoughtId, $sThought) - { - $asValues = array('thought'=>$this->encodeThought($sThought)); - $asConstraints = array( MySqlManager::getId(MySqlManager::THOUGHTS_TABLE)=>$iThoughtId, - MySqlManager::getId(MySqlManager::USERS_TABLE)=>$this->oSession->getUserId()); - $this->oMySql->updateRow(MySqlManager::THOUGHTS_TABLE, $asConstraints, $asValues); - } - - - - private function shuffleText($sText) - { - $sRandomText = "let's_mess%a&bit;with~it,!just§for¨the^sake*of-it"; - for($iIndex=0; $iIndex < strlen($sText); $iIndex++) - { - $sText[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sText[$iIndex]; - } - return $sText; - } - - public function activateMenu() - { - $this->oMenuMask->initFile('menu'); - } - - //settings - - public static function getSettingsList() - { - //TODO Save on database (param table) - return array(self::SETTING_FONT, self::SETTING_SIZE, self::SETTING_LAYOUT); - } - - private static function getDefaultSetting($sSettingName) - { - switch($sSettingName) - { - case self::SETTING_FONT: - return self::FONT_THOUGHTS; - case self::SETTING_LAYOUT: - return self::LAYOUT_ONE_PAGE; - } - return false; - } - - private function getSetting($sSettingName) - { - if(!array_key_exists($sSettingName, $this->asSettings)) - { - $asConstraint = array(MySqlManager::getText(MySqlManager::SETTINGS_TABLE)=>$sSettingName, MySqlManager::getId(MySqlManager::USERS_TABLE)=>$this->oSession->getUserId()); - $oValue = $this->oMySql->selectValue(MySqlManager::SETTINGS_TABLE, 'value', $asConstraint); - $this->asSettings[$sSettingName] = (!$oValue)?self::getDefaultSetting($sSettingName):$oValue; - } - return $this->asSettings[$sSettingName]; - } - - private function setSetting($sValue, $sSettingName) - { - $this->oMySql->insertUpdateRow(MySqlManager::SETTINGS_TABLE, array('setting'=>$sSettingName, MySqlManager::getId(MySqlManager::USERS_TABLE)=>$this->oSession->getUserId()), array('value'=>$sValue)); - } - - public function setSettings($asSettings) - { - array_walk($asSettings, array($this, 'setSetting')); - } - - /* Pages */ - - public function logonPage($sPreviousLogin) - { - $this->setPageTitle('Login'); - $this->setPage('logon'); - $sPreviousLogin = ($sPreviousLogin=='')?'':$sPreviousLogin; - $this->oPageMask->setTag('login', $sPreviousLogin); - } - - public function writingPage($iThoughtId=0) - { - $sThought = ''; - $iThoughtTime = ''; - if($iThoughtId!=0) - { - //load a thought - $asConstraints = array( MySqlManager::getId(MySqlManager::THOUGHTS_TABLE)=>$iThoughtId, - MySqlManager::getId(MySqlManager::USERS_TABLE)=>$this->oSession->getUserId()); - $asThought = $this->oMySql->selectRow(MySqlManager::THOUGHTS_TABLE, $asConstraints); - $sThought = $this->decodeThought($asThought['thought']); - $iThoughtTime = 'Saved at '.date(self::LAYOUT_TIME_FORMAT, strtotime($asThought['led'])); - } - - $this->setPage('write_thought'); - $this->oPageMask->setTag('font', $this->getSetting(self::SETTING_FONT)); - $this->oPageMask->setTag('size', $this->getSetting(self::SETTING_SIZE)); - $this->oPageMask->setTag('thought', $sThought); - $this->oPageMask->setTag('thought_id', $iThoughtId); - $this->oPageMask->setTag('last_saved', $iThoughtTime); - $this->setPageTitle('Talk to me'); - } - - public function readingPage($iTimeStamp=0) - { - if($iTimeStamp==0) - { - $iTimeStamp = strtotime('now'); - } - $sMySqlDate = date(self::MYSQL_DATE_FORMAT, $iTimeStamp); - $sLayoutDate = date(self::LAYOUT_DATE_FORMAT, $iTimeStamp); - - $asConstraints = array('DATE(led)'=>$sMySqlDate, MySqlManager::getId(MySqlManager::USERS_TABLE)=>$this->oSession->getUserId()); - $asThougths = $this->oMySql->selectRows(array('from'=>MySqlManager::THOUGHTS_TABLE, 'constraint'=>$asConstraints)); - - $this->setPage('read_thought'); - $this->setPageTitle('Thoughts on '.$sLayoutDate); - $this->oPageMask->setTag('date', $sLayoutDate); - - foreach($asThougths as $asThought) - { - $asThoughtParagraphs = explode("\n", $this->decodeThought($asThought['thought'])); - $this->oPageMask->newInstance('THOUGHT'); - $this->oPageMask->setInstanceTag('THOUGHT', 'time', date(self::LAYOUT_TIME_FORMAT, strtotime($asThought['led']))); - foreach($asThoughtParagraphs as $sParagraph) - { - $asParagraphTags = array('thought_paragraph'=>$sParagraph); - $this->oPageMask->addInstance('THOUGHT_PARA', $asParagraphTags); - } - } - - //calendar update - $this->setCalendarDate(date('Y', $iTimeStamp), date('m', $iTimeStamp)); - - return (count($asThougths)>0); - } - - public function settingsPage() - { - $this->setPage('settings'); - $this->setPageTitle('Settings'); - $asSettingsOptions = array( self::SETTING_LAYOUT => array( - 'One extensible page' => self::LAYOUT_ONE_PAGE, - 'Two Pages, Diary like' => self::LAYOUT_TWO_PAGES), - self::SETTING_FONT => array( - 'AES Crawl' => self::FONT_THOUGHTS, - 'Arial' => self::FONT_ARIAL, - 'Verdana' => self::FONT_VERDANA), - self::SETTING_SIZE => array( - '16pt' => self::SIZE_16, - '18pt' => self::SIZE_18, - '20pt' => self::SIZE_20)); - - foreach(self::getSettingsList() as $sSettingName) - { - $this->oPageMask->newInstance('SETTING'); - $this->oPageMask->setInstanceTag('SETTING', 'setting_name', $sSettingName); - $sUserSetting = $this->getSetting($sSettingName); - foreach($asSettingsOptions[$sSettingName] as $sOptionName=>$sOptionValue) - { - if($sOptionValue == self::getDefaultSetting($sSettingName)) - { - $sOptionName .= ' (Default)'; - } - $sSelectedOption = ($sUserSetting==$sOptionValue)?'selected':''; - $asSettingOptions = array( 'setting_option_value'=>$sOptionValue, - 'setting_option_selected'=>$sSelectedOption, - 'setting_option_name'=>$sOptionName); - $this->oPageMask->addInstance('SETTING_OPTION', $asSettingOptions); - } - } - } - - /* Final processes */ - - private function collectErrors() - { - $asErrors = array_merge($this->getCleanErrorStack(), - $this->oMySql->getCleanErrorStack(), - $this->oSession->getCleanErrorStack(), - $this->oCalendar->getCleanErrorStack(), - $this->oMainMask->getCleanErrorStack(), - $this->oPageMask->getCleanErrorStack(), - $this->oMenuMask->getCleanErrorStack()); - - //$asErrors = array_map('getCleanErrorStack', array($this, $this->oMySql, $this->oSession, $this->oCalendar, $this->oMainMask, $this->oPageMask, $this->oMenuMask)); - //pre($asErrors, 'static error stock', true); - - $oErrorMask = new Mask(); - if(!empty($asErrors)) - { - $oErrorMask->initFile('errors'); - foreach($asErrors as $sError) - { - $oErrorMask->addInstance('ERROR', array('error'=>$sError)); - } - } - return $oErrorMask->getMask(); - } - -} - -class Calendar extends PhpObject -{ - const CAL_YEAR = 'cy'; - const CAL_MONTH = 'cm'; - - private $oMySql; - private $oSession; - private $oMask; - - private $iUserId; - private $iYear; - private $iMonth; - - function __construct($oMySql, $oSession) - { - parent::__construct(); - $this->oMySql = $oMySql; - $this->oSession = $oSession; - $this->oMask = new Mask('calendar'); - $this->iYear = 0; - $this->iMonth = 0; - } - - public function setDate($iYear=0, $iMonth=0) - { - if($iYear==0) - { - $iYear = date('Y'); - } - if($iMonth==0) - { - $iMonth = date('m'); - } - $this->iYear = $iYear; - $this->iMonth = $iMonth; - } - - private function getThoughts() - { - //TODO essayer avec selectRows - $sQuery = "SELECT DATE_FORMAT(led, '%d') AS day - FROM ".MySqlManager::THOUGHTS_TABLE." - WHERE ".MySqlManager::getId(MySqlManager::USERS_TABLE)." = ".$this->oSession->getUserId()." - AND YEAR(led) = ".$this->iYear." - AND MONTH(led) = ".$this->iMonth." - GROUP BY day - ORDER BY day"; - - return $this->oMySql->getArrayQuery($sQuery, true); - } - - private function getUpdatedLink($asParams) - { - $sCurrentVariables = $_SERVER['QUERY_STRING']; - $asCurrentVariables = explode('&', $sCurrentVariables); - foreach($asCurrentVariables as $sParam) - { - $sKey = strstr($sParam, '=', true); - $sValue = substr(strstr($sParam, '='), 1); - $asVariables[$sKey] = $sValue; - } - return '?'.implodeAll(array_merge($asVariables, $asParams), '=', '&'); - } - - private function getLink($iOffset) - { - $iTimeStamp = mktime(0, 0, 0, $this->iMonth + $iOffset, 1, $this->iYear); - return $this->getUpdatedLink(array(self::CAL_MONTH=>date('n', $iTimeStamp), self::CAL_YEAR=>date('Y', $iTimeStamp))); - } - - private function setMaskItems() - { - //week starting on the sunday : offset = 0, monday : offset = 1 - $iOffset = 1; - - //days in the month - $iMonthLastDay = date('d', mktime(0, 0, 0, $this->iMonth+1, 0, $this->iYear)); - $asDays = range(1, $iMonthLastDay); - - $iDayNb = 1 - date($iOffset?'N':'w', mktime(0, 0, 0, $this->iMonth, 1, $this->iYear)) + $iOffset; - $iCalendarLastDay = $iMonthLastDay + (7 - date($iOffset?'N':'w', mktime(0, 0, 0, $this->iMonth+1, 0, $this->iYear))) + $iOffset; - - //days with thoughts - $asThoughts = $this->getThoughts(); - - while($iDayNb < $iCalendarLastDay) - { - $iCurrentDayTimeStamp = mktime(0, 0, 0, $this->iMonth, $iDayNb, $this->iYear); - $sItemDate = date('d', $iCurrentDayTimeStamp); - - //new week - if(date('w', $iCurrentDayTimeStamp) == $iOffset) - { - $this->oMask->newInstance('WEEK'); - } - - //day within month - if(date('n', $iCurrentDayTimeStamp)==$this->iMonth) - { - $bThoughts = in_array($iDayNb, $asThoughts); - - $sItemClass = $bThoughts?'full':'empty'; - $sItemLink = $bThoughts?$this->getUpdatedLink(array('d'=>date(MyThoughts::URL_DATE_FORMAT, $iCurrentDayTimeStamp), 'p'=>'r')):'#'; - $sItemLinkTitle = $bThoughts?'See my thoughts on '.date(MyThoughts::LAYOUT_DATE_FORMAT, $iCurrentDayTimeStamp):''; - } - else - { - $sItemClass = 'disabled'; - $sItemLink = '#'; - $sItemLinkTitle = ''; - } - - $this->oMask->addInstance('DAY', array('item_day'=>$sItemDate, 'item_class'=>$sItemClass, 'item_link'=>$sItemLink, 'item_link_title'=>$sItemLinkTitle)); - $iDayNb++; - } - - //column titles - $asDayNames = array('1'=>'Mon', '2'=>'Tue', '3'=>'Wed', '4'=>'Thu', '5'=>'Fri', '6'=>'Sat', $iOffset?'7':'0'=>'Sun'); - ksort($asDayNames); - foreach($asDayNames as $sDayName) - { - $this->oMask->addInstance('TITLE', array('day_name'=>$sDayName)); - } - - } - - public function getCalendar() - { - $sResult = ''; - if($this->iYear!=0 && $this->iMonth!=0) - { - $this->oMask->setTag('link_prev', $this->getLink(-1)); - $this->oMask->setTag('current_month', date('F', mktime(0, 0, 0, $this->iMonth, 1, $this->iYear))); - $this->oMask->setTag('link_next', $this->getLink(1)); - $this->setMaskItems(); - $sResult = $this->oMask->getMask(); - } - return $sResult; - } -} - -function arrayKeyFilter($asArray, $sCallBack) -{ - $asValidKeys = array_flip(array_filter(array_keys($asArray), $sCallBack)); - return array_intersect_key($asArray, $asValidKeys); -} - -function array_map_encapsulate($oData, $sChar) -{ - if(is_array($oData)) - { - $asChar = array_fill(1, count($oData), $sChar); - return array_combine(array_keys($oData), array_map('array_map_encapsulate', $oData, $asChar)); - } - else - { - return $sChar.$oData.$sChar; - } -} - -function implodeAll($asText, $sKeyValueSeparator='', $sRowSeparator='', $sKeyPre='', $sValuePost=false) -{ - if($sValuePost===false) - { - $sValuePost = $sKeyPre; - } - $asCombinedText = array(); - foreach($asText as $sKey=>$sValue) - { - $asCombinedText[] = $sKeyPre.$sKey.$sKeyValueSeparator.$sValue.$sValuePost; - } - return implode($sRowSeparator, $asCombinedText); -} - -function cleanPost(&$asData) -{ - //get rid of magic quotes - if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) - { - cleanData($asData, 'stripslashes'); - } -} -function cleanData(&$oData, $sCleaningFunc) -{ - if(!is_array($oData)) - { - $oData = call_user_func($sCleaningFunc, $oData); - } - elseif(!empty($oData)) - { - $asKeys = array_map($sCleaningFunc, array_keys($oData)); - $asValues = array_map($sCleaningFunc, $oData); - $oData = array_combine($asKeys, $asValues); - } -} - -//debug -function pre($sText, $sTitle='Test', $bDie=false, $bLog=false) -{ - if($bLog) - { - file_put_contents('log', ($sTitle!=''?$sTitle." :\n":'').print_r($sText, true)."\n\n"); - } - echo '
'.$sTitle.'
'.print_r($sText, true).'
'; - if($bDie) - { - die('[die() called by the test function '.__FUNCTION__.'()]'); - } -} -?> \ No newline at end of file diff --git a/config/apache-localhost.conf b/config/apache-localhost.conf new file mode 100644 index 0000000..5de1995 --- /dev/null +++ b/config/apache-localhost.conf @@ -0,0 +1,46 @@ +# Serve https://localhost/mythoughts/ from the public web root. +# +# Include this from the site VirtualHost (or paste the Alias/Directory block +# into the existing one). Everything outside public/ - lib/, config/, vendor/, +# node_modules/ - stays off the document root and is never web-reachable. + +Alias /mythoughts /var/www/html/mythoughts/public + + + Options FollowSymLinks + AllowOverride None + Require all granted + + DirectoryIndex index.php + + + # Vite writes content-hashed asset names, so they are safe to pin. + + Header set Cache-Control "public, max-age=31536000, immutable" + + + + + AddOutputFilterByType BROTLI_COMPRESS \ + text/html \ + text/plain \ + text/css \ + text/javascript \ + application/javascript \ + application/json \ + application/manifest+json \ + image/svg+xml + + + + AddOutputFilterByType DEFLATE \ + text/html \ + text/plain \ + text/css \ + text/javascript \ + application/javascript \ + application/json \ + application/manifest+json \ + image/svg+xml + + diff --git a/config/log.html b/config/log.html new file mode 100644 index 0000000..158f968 --- /dev/null +++ b/config/log.html @@ -0,0 +1,2 @@ + +[03.09.2026 17:30:38] Notice - /var/www/html/objects/inc/Db.php - Last query had no effect on db: "UPDATE users SET token = '', token_exp = '0000-00-00 00:00:00' WHERE id_user = '2' LIMIT 1;" \ No newline at end of file diff --git a/config/settings-sample.php b/config/settings-sample.php new file mode 100644 index 0000000..bec0a6c --- /dev/null +++ b/config/settings-sample.php @@ -0,0 +1,13 @@ +oMySql = $oMySql; - $this->setUserId(0); - $this->sApiKey = $sApiKey; - if($bAutoLogin) $this->autoLogIn(); - } - - private function setUserId($iUserId) - { - $this->iUserId = $iUserId; - } - - public function getUserId() - { - return $this->iUserId; - } - - public function isLoggedIn() - { - return ($this->getUserId() > 0); - } - - public function logMeIn($sToken) - { - $sDesc = ''; - if($sToken!='') - { - $sLoginToken = addslashes(strstr($sToken, self::TOKEN_SEP, true)); - $sPassToken = substr(strstr($sToken, self::TOKEN_SEP), strlen(self::TOKEN_SEP)); - if($sLoginToken!='' && $sPassToken!='') - { - $asEmpl = $this->oMySql->selectRow(MyThoughts::USER_TABLE, array("MD5(".MySqlManager::getText(MyThoughts::USER_TABLE).")"=>$sLoginToken)); - if(!empty($asEmpl)) - { - if(self::CheckPassword($sPassToken, $asEmpl['pass'])) - { - $this->setUserId($asEmpl[MySqlManager::getId(MyThoughts::USER_TABLE)]); - $this->resetAuthCookie($this->getUserId()); - } - else $sDesc = 'wrong password'; - } - else $sDesc = 'unknown nickname'; - } - else $sDesc = 'corrupted token, please login again'; - } - else $sDesc = 'no credentials has been received by the server'; - - return MyThoughts::getJsonResult($this->isLoggedIn(), $sDesc); - } - - public function autoLogIn() - { - if(isset($_COOKIE[self::USER_COOKIE_PASS])) - { - $sCookie = $_COOKIE[self::USER_COOKIE_PASS]; - $iUserId = addslashes(strstr($sCookie, self::TOKEN_SEP, true)); - $sCookie = substr(strstr($sCookie, self::TOKEN_SEP), strlen(self::TOKEN_SEP)); - - $asEmpl = $this->oMySql->selectRow(MyThoughts::USER_TABLE, array(MySqlManager::getId(MyThoughts::USER_TABLE)=>$iUserId)); - if(!empty($asEmpl)) - { - if($sCookie==$asEmpl['cookie']) - { - $this->setUserId($asEmpl[MySqlManager::getId(MyThoughts::USER_TABLE)]); - - //Reset pass once a day - if(mb_substr($asEmpl['led'], 0, 10) != date('Y-m-d')) $this->resetAuthCookie($this->getUserId()); - } - else $this->addError('token corrompu pour le user '.$asEmpl[MySqlManager::getId(MyThoughts::USER_TABLE)]); - } - else $this->addError('Utilisateur '.$iUserId.' inconnu'); - } - } - - public function addUser($sSafeNickName, $sNickName, $bLogMeIn=false) - { - $sPass = self::HashPassword(self::getLoginToken($sSafeNickName)); - $bExist = $this->oMySql->pingValue(MyThoughts::USER_TABLE, array(MySqlManager::getText(MyThoughts::USER_TABLE)=>$sSafeNickName)); - if($bExist) return -1; - else - { - $iUserId = $this->oMySql->insertRow(MyThoughts::USER_TABLE, array(MySqlManager::getText(MyThoughts::USER_TABLE)=>$sSafeNickName, 'nickname'=>$sNickName)); - if($iUserId>0) - { - $this->resetPass($iUserId); - if($bLogMeIn) $this->logMeIn(md5($sSafeNickName).self::TOKEN_SEP.$this->getLoginToken($sSafeNickName)); - } - } - return $iUserId; - } - - //TODO integrate with logMeIn() - public function checkApiKey($sApiKey) - { - return ($this->sApiKey!='' && $sApiKey==$this->sApiKey); - } - - private function resetPass($iUserId=0) - { - $sUserIdCol = MySqlManager::getId(MyThoughts::USER_TABLE); - $sUserTextCol = MySqlManager::getText(MyThoughts::USER_TABLE); - - $asInfo = array('select'=>array($sUserIdCol, $sUserTextCol), 'from'=>MyThoughts::USER_TABLE); - if($iUserId>0) $asInfo['constraint'] = array($sUserIdCol=>$iUserId); - - $asUsers = $this->oMySql->selectRows($asInfo); - foreach($asUsers as $asUser) - { - $sToken = self::HashPassword(self::getLoginToken($asUser[$sUserTextCol])); - $this->oMySql->updateRow(MyThoughts::USER_TABLE, array(MySqlManager::getId(MyThoughts::USER_TABLE)=>$asUser[$sUserIdCol]), array('pass'=>$sToken)); - } - } - - private static function getLoginToken($sPass) - { - //Add Server Name - $sServerName = array_key_exists('SERVER_NAME', $_SERVER)?$_SERVER['SERVER_NAME']:$_SERVER['PWD']; - $sAppPath = $_SERVER['REQUEST_SCHEME'].'://'.str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME'])); - $_GET['serv_name'] = $sAppPath.(mb_substr($sAppPath, -1)!='/'?'/':''); - return md5($sPass.$_GET['serv_name']); - } - - private function resetAuthCookie($iUserId) - { - $sNewPass = self::getAuthCookie($iUserId); - $iTimeLimit = time()+60*60*24*30; - //mysqli_query($con, "UPDATE EMPLOYEE SET COOKIE = '".addslashes($sNewPass)."' WHERE ID = ".$iUserId); - $this->oMySql->updateRow(MyThoughts::USER_TABLE, array(MySqlManager::getId(MyThoughts::USER_TABLE)=>$iUserId), array("cookie"=>$sNewPass)); - setcookie(self::USER_COOKIE_PASS, $iUserId.self::TOKEN_SEP.$sNewPass, $iTimeLimit); - } - - private static function getAuthCookie() - { - return self::HashPassword - ( - $_SERVER['HTTP_USER_AGENT']. - $_SERVER['REMOTE_ADDR']. - $_SERVER['REQUEST_TIME']. - mb_strstr(microtime(), ' ', true). - $_SERVER['SERVER_SIGNATURE']. - $_SERVER['SERVER_ADMIN'] - ); - } - - private static function HashPassword($sPass) - { - return password_hash($sPass, self::ALGO, array('cost'=>self::COST)); - } - - private static function CheckPassword($sPass, $sHash) - { - return password_verify($sPass, $sHash); - } -} - -?> \ No newline at end of file diff --git a/inc/calendar.php b/inc/calendar.php deleted file mode 100755 index 610af0c..0000000 --- a/inc/calendar.php +++ /dev/null @@ -1,142 +0,0 @@ -oMySql = $oMySql; - $this->oSession = $oSession; - $this->oMask = new Mask('calendar'); - $this->iYear = 0; - $this->iMonth = 0; - } - - public function setDate($iYear=0, $iMonth=0) - { - if($iYear==0) - { - $iYear = date('Y'); - } - if($iMonth==0) - { - $iMonth = date('m'); - } - $this->iYear = $iYear; - $this->iMonth = $iMonth; - } - - private function getThoughts() - { - //TODO essayer avec selectRows - $sQuery = "SELECT DATE_FORMAT(led, '%d') AS day - FROM ".MySqlManager::THOUGHTS_TABLE." - WHERE ".MySqlManager::getId(MySqlManager::USERS_TABLE)." = ".$this->oSession->getUserId()." - AND YEAR(led) = ".$this->iYear." - AND MONTH(led) = ".$this->iMonth." - GROUP BY day - ORDER BY day"; - - return $this->oMySql->getArrayQuery($sQuery, true); - } - - private function getUpdatedLink($asParams) - { - $sCurrentVariables = $_SERVER['QUERY_STRING']; - $asCurrentVariables = explode('&', $sCurrentVariables); - foreach($asCurrentVariables as $sParam) - { - $sKey = strstr($sParam, '=', true); - $sValue = substr(strstr($sParam, '='), 1); - $asVariables[$sKey] = $sValue; - } - return '?'.implodeAll(array_merge($asVariables, $asParams), '=', '&'); - } - - private function getLink($iOffset) - { - $iTimeStamp = mktime(0, 0, 0, $this->iMonth + $iOffset, 1, $this->iYear); - return $this->getUpdatedLink(array(self::CAL_MONTH=>date('n', $iTimeStamp), self::CAL_YEAR=>date('Y', $iTimeStamp))); - } - - private function setMaskItems() - { - //week starting on the sunday : offset = 0, monday : offset = 1 - $iOffset = 1; - - //days in the month - $iMonthLastDay = date('d', mktime(0, 0, 0, $this->iMonth+1, 0, $this->iYear)); - $asDays = range(1, $iMonthLastDay); - - $iDayNb = 1 - date($iOffset?'N':'w', mktime(0, 0, 0, $this->iMonth, 1, $this->iYear)) + $iOffset; - $iCalendarLastDay = $iMonthLastDay + (7 - date($iOffset?'N':'w', mktime(0, 0, 0, $this->iMonth+1, 0, $this->iYear))) + $iOffset; - - //days with thoughts - $asThoughts = $this->getThoughts(); - - while($iDayNb < $iCalendarLastDay) - { - $iCurrentDayTimeStamp = mktime(0, 0, 0, $this->iMonth, $iDayNb, $this->iYear); - $sItemDate = date('d', $iCurrentDayTimeStamp); - - //new week - if(date('w', $iCurrentDayTimeStamp) == $iOffset) - { - $this->oMask->newInstance('WEEK'); - } - - //day within month - if(date('n', $iCurrentDayTimeStamp)==$this->iMonth) - { - $bThoughts = in_array($iDayNb, $asThoughts); - - $sItemClass = $bThoughts?'full':'empty'; - $sItemLink = $bThoughts?$this->getUpdatedLink(array('d'=>date(MyThoughts::URL_DATE_FORMAT, $iCurrentDayTimeStamp), 'p'=>'r')):'#'; - $sItemLinkTitle = $bThoughts?'See my thoughts on '.date(MyThoughts::LAYOUT_DATE_FORMAT, $iCurrentDayTimeStamp):''; - } - else - { - $sItemClass = 'disabled'; - $sItemLink = '#'; - $sItemLinkTitle = ''; - } - - $this->oMask->addInstance('DAY', array('item_day'=>$sItemDate, 'item_class'=>$sItemClass, 'item_link'=>$sItemLink, 'item_link_title'=>$sItemLinkTitle)); - $iDayNb++; - } - - //column titles - $asDayNames = array('1'=>'Mon', '2'=>'Tue', '3'=>'Wed', '4'=>'Thu', '5'=>'Fri', '6'=>'Sat', $iOffset?'7':'0'=>'Sun'); - ksort($asDayNames); - foreach($asDayNames as $sDayName) - { - $this->oMask->addInstance('TITLE', array('day_name'=>$sDayName)); - } - - } - - public function getCalendar() - { - $sResult = ''; - if($this->iYear!=0 && $this->iMonth!=0) - { - $this->oMask->setTag('link_prev', $this->getLink(-1)); - $this->oMask->setTag('current_month', date('F', mktime(0, 0, 0, $this->iMonth, 1, $this->iYear))); - $this->oMask->setTag('link_next', $this->getLink(1)); - $this->setMaskItems(); - $sResult = $this->oMask->getMask(); - } - return $sResult; - } -} -?> \ No newline at end of file diff --git a/inc/mythoughts.php b/inc/mythoughts.php deleted file mode 100755 index 9c8b4da..0000000 --- a/inc/mythoughts.php +++ /dev/null @@ -1,342 +0,0 @@ -oClassManagement = $oClassManagement; - $this->setContext($sProcessPage); - - //Load classes - $this->oClassManagement->incClass('mysqlmanager'); - $this->oClassManagement->incClass('auth', true); - //$this->oClassManagement->incClass('calendar', true); - - //Init objects - $this->oMySql = new MySqlManager(Settings::DB_SERVER, Settings::DB_LOGIN, Settings::DB_PASS, Settings::DB_NAME, self::getSqlOptions() , Settings::DB_ENC); - if($this->oMySql->sDbState == MySqlManager::DB_NO_DATA) $this->install(); - else $this->oAuth = new Auth($this->oMySql, Settings::API_KEY); - } - - private function install() - { - $this->oAuth = new Auth($this->oMySql, Settings::API_KEY, false); - - //Install DB - $this->oMySql->install(); - $this->addUser('franzz'); - } - - private function setContext($sProcessPage) - { - //Browser <> PHP <> MySql synchronization - date_default_timezone_set(Settings::TIMEZONE); - ini_set('default_charset', Settings::TEXT_ENC); - header('Content-Type: text/html; charset='.Settings::TEXT_ENC); - mb_internal_encoding(Settings::TEXT_ENC); - mb_http_output(Settings::TEXT_ENC); - mb_http_input(Settings::TEXT_ENC); - mb_language('uni'); - mb_regex_encoding(Settings::TEXT_ENC); - - $this->asContext['process_page'] = basename($sProcessPage); - - $sServerName = array_key_exists('SERVER_NAME', $_SERVER)?$_SERVER['SERVER_NAME']:$_SERVER['PWD']; - $sAppPath = 'http://'.str_replace('http://', '', $sServerName.dirname($_SERVER['SCRIPT_NAME'])); - $this->asContext['serv_name'] = $sAppPath.(mb_substr($sAppPath, -1)!='/'?'/':''); - } - - public function addUncaughtError($sError) - { - $this->addError('Uncaught errors:'."\n".$sError); - } - - /* Authorizations handling */ - - public function isLoggedIn() - { - return $this->oAuth->isLoggedIn(); - } - - public function logMeIn($sToken) - { - return $this->oAuth->logMeIn($sToken); - } - - public function checkApiKey($sApiKey) - { - return $this->oAuth->checkApiKey($sApiKey); - } - - /* Building main pages */ - - public function getPage($bLoggedIn) - { - /*$asMaskPaths = glob('masks/*.html'); - $asMaskNames = array_map('basename', $asMaskPaths, array_fill(1, count($asMaskPaths), '.html'));*/ - - //Constants - $asPages = array('logon', 'write', 'settings', 'template'); - foreach($asPages as $sPage) $asGlobalVars['consts']['pages'][$sPage] = $this->getPageContent($sPage); - $asGlobalVars['consts']['token_sep'] = Auth::TOKEN_SEP; - $asGlobalVars['consts']['error'] = self::ERROR; - $asGlobalVars['consts']['success'] = self::SUCCESS; - $asGlobalVars['consts']['context'] = $this->asContext; - $asGlobalVars['vars']['id'] = $this->oAuth->getUserId(); - $asGlobalVars['vars']['log_in'] = $bLoggedIn; - - //Main Page - $sPage = $this->getPageContent('index'); - $sPage = str_replace('asGlobalVars', json_encode($asGlobalVars), $sPage); - return $sPage; - } - - private function getPageContent($sPage) - { - $sPageFile = 'masks/'.$sPage.'.html'; - return file_get_contents($sPageFile); - } - - /* DB structure. See MySqlManager::__construct */ - - private static function getSqlOptions() - { - return array - ( - 'tables' => array - ( - self::USER_TABLE =>array(MySqlManager::getText(self::USER_TABLE), 'nickname', 'pass', 'cookie'), - self::THOUGHT_TABLE =>array(MySqlManager::getId(self::USER_TABLE), - MySqlManager::getText(self::THOUGHT_TABLE)), - self::SETTINGS_TABLE=>array(MySqlManager::getId(self::USER_TABLE), - MySqlManager::getText(self::SETTINGS_TABLE), - 'value') - ), - 'types' => array - ( - MySqlManager::getText(self::USER_TABLE)=>"varchar(50) NOT NULL", - 'nickname'=>'varchar(60) NOT NULL', - 'pass'=>"varchar(256) NOT NULL", - 'cookie'=>"varchar(255) NOT NULL", - MySqlManager::getText(self::THOUGHT_TABLE)=>"longtext", - MySqlManager::getText(self::SETTINGS_TABLE)=>"varchar(20) NOT NULL", - 'value'=>"varchar(20) NOT NULL" - ), - 'constraints' => array - ( - self::USER_TABLE=>"UNIQUE KEY `username` (`".MySqlManager::getText(self::USER_TABLE)."`)" - ), - 'cascading_delete' => array - ( - self::USER_TABLE=>array(self::SETTINGS_TABLE) - ) - ); - } - - /* My Thoughts public functions */ - - public function register($sNickName) - { - $iUserId = $this->addUser($sNickName, true); - $bSuccess = false; - $sDesc = ''; - switch($iUserId) - { - case -1: - $sDesc = 'There is already a user using this nickname, sorry!'; - break; - case 0: - $sDesc = 'A database error occured. Contact admin'; - break; - default: - $bSuccess = true; - } - return self::getJsonResult($bSuccess, $sDesc); - } - - public function updateThought($sThought, $iThoughtId=0) - { - if($iThoughtId==0) - { - $iThoughtId = $this->addThought($sThought); - $sDesc = 'created'; - } - else - { - $asKeys = array(MySqlManager::getId(self::USER_TABLE) => $this->oAuth->getUserId(), - MySqlManager::getId(self::THOUGHT_TABLE)=> $iThoughtId); - $asThought = array(MySqlManager::getText(self::THOUGHT_TABLE) => self::encodeThought($sThought)); - $iThoughtId = $this->oMySql->updateRow(self::THOUGHT_TABLE, $asKeys, $asThought); - $sDesc = 'updated'; - } - $bSuccess = ($iThoughtId>0); - $sDesc = 'thought '.($bSuccess?'':'not ').$sDesc; - return self::getJsonResult($bSuccess, $sDesc, $this->getThoughtInfo($iThoughtId)); - } - - /* My Thoughts private functions */ - - private function addUser($sNickName, $bLogMeIn=false) - { - $iUserId = $this->oAuth->addUser(self::getSafeNickName($sNickName), $sNickName, $bLogMeIn); - if($iUserId>0) $this->addThought(file_get_contents(self::WELCOME_MSG_FILE), $iUserId); - return $iUserId; - } - - private function addThought($sThought, $iUserId=-1) - { - if($iUserId==-1) $iUserId = $this->oAuth->getUserId(); - if($iUserId!=0) - { - $asThought = array( MySqlManager::getId(self::USER_TABLE) => $iUserId, - MySqlManager::getText(self::THOUGHT_TABLE) => self::encodeThought($sThought)); - $ithoughtId = $this->oMySql->insertRow(self::THOUGHT_TABLE, $asThought); - } - else $this->addError('Adding a thought with no user id'); - return $ithoughtId; - } - - private function getThoughtInfo($iThoughtId, $bThoughtContent=false) - { - $asThoughtInfo = array(); - if($iThoughtId>0) - { - $asThoughtInfo = $this->oMySql->selectRow(self::THOUGHT_TABLE, $iThoughtId); - if(!$bThoughtContent) unset($asThoughtInfo[MySqlManager::getText(self::THOUGHT_TABLE)]); - } - else $this->addError('getting thought info with no thought id'); - return $asThoughtInfo; - } - - /* Static toolbox functions */ - - private static function encodeThought($sthought) - { - return base64_encode(serialize(explode("\n", self::shuffleText($sthought)))); - } - - private static function decodeThought($sEncodedThought) - { - return self::shuffleText(implode("\n", unserialize(base64_decode($sEncodedThought)))); - } - - private static function shuffleText($sText) - { - $sRandomText = "let's_mess%a&bit;with~it,!just§for¨the^sake*of-it"; - for($iIndex=0; $iIndex < strlen($sText); $iIndex++) - { - $sText[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sText[$iIndex]; - } - return $sText; - } - - public static function getJsonResult($bSuccess, $sDesc='', $asVars=array()) - { - header('Content-type: application/json'); - return json_encode(array('result'=>$bSuccess?self::SUCCESS:self::ERROR, 'desc'=>ToolBox::mb_ucwords($sDesc))+$asVars); - } - - public function getSafeNickName($sNickName) - { - return $sNickName; - } - - public static function getDateTimeDesc($oTime) - { - $iTimeStamp = is_numeric($oTime)?$oTime:strtotime($oTime); - $sCurTimeStamp = time(); - - $asWeekDays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satursday', 'sunday'); - $asMonths = array('january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'); - $sSep = '|'; - $sFormat = 'Y'.$sSep.'n'.$sSep.'W'.$sSep.'N'.$sSep.'j'.$sSep.'G'; - list($sYear, $sMonth, $sWeek, $sWeekDay, $sDay, $sHour) = explode($sSep, date($sFormat, $iTimeStamp)); - list($sCurYear, $sCurMonth, $sCurWeek, $sCurWeekDay, $sCurDay, $sCurHour) = explode($sSep, date($sFormat, $sCurTimeStamp)); - - $sDesc = ''; - if($iTimeStamp>$sCurTimeStamp) $sDesc = 'in the future'; - elseif($sCurTimeStamp-$iTimeStamp<60) $sDesc = 'a few seconds ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*10) $sDesc = 'a few minutes ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*20) $sDesc = '15 minutes ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*50) $sDesc = 'half an hour ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*2) $sDesc = 'an hour ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24 && $sDay==$sCurDay) $sDesc = 'at '.$sHour.' o\'clock'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24) $sDesc = 'yesterday'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7 && $sWeek==$sCurWeek) $sDesc = $asWeekDays[$sWeekDay-1]; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7) $sDesc = 'last '.$asWeekDays[$sWeekDay-1]; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*9) $sDesc = 'a week ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*12) $sDesc = '10 days ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*16) $sDesc = '2 weeks ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*23) $sDesc = '3 weeks ago'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*31 && $sMonth==$sCurMonth) $sDesc = 'on '.$asMonths[$sMonth-1].', '.$sDay; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*30*2 && $sMonth==($sCurMonth-1)) $sDesc = 'last month'; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*365 && $sYear==$sCurYear) $sDesc = 'in '.$asMonths[$sMonth-1]; - elseif($sCurTimeStamp-$iTimeStamp<60*60*24*365) $sDesc = 'in '.$asMonths[$sMonth-1].' '.$sYear; - elseif($sYear==($sCurYear-1)) $sDesc = 'last year'; - else $sDesc = 'in '.$sYear; - - //return self::mb_ucfirst($sDesc); - return $sDesc; - } -} - -?> \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100755 index dd2ff0b..0000000 --- a/index.php +++ /dev/null @@ -1,190 +0,0 @@ -isLoggedIn(); - -$sResult = ''; -if($sAction=='logmein') $sResult = $oMyThoughts->logMeIn($sToken); -elseif($sAction!='' && $bLoggedIn) -{ - switch ($sAction) - { - case 'update': - $sResult = $oMyThoughts->updateThought($sContent, $iId); - break; - default: - $sResult = MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); - } -} -elseif($sAction!='' && !$bLoggedIn) -{ - if($oMyThoughts->checkApiKey($iApiKey)) - { - switch ($sAction) - { - case '': - //$sResult = $oMyThoughts->apifunction(); - break; - default: - $sResult = MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); - } - } - elseif($sAction=='register') $sResult = $oMyThoughts->register($sNickName); - else $sResult = MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); -} -else $sResult = $oMyThoughts->getPage($bLoggedIn); - -$sDebug = ob_get_clean(); -if(Settings::DEBUG && $sDebug!='') $oMyThoughts->addUncaughtError($sDebug); - -echo $sResult; - -/* - -//load classes -session_start(); -require_once 'config.php'; - -//clean sent values -cleanPost($_POST); -cleanPost($_GET); -cleanPost($_REQUEST); - -//general -$sPage = (isset($_GET['p']) && $_GET['p']!='')?$_GET['p']:'w'; -$sPostToken = isset($_POST['post_token'])?$_POST['post_token']:''; - -//logon -$sLogin = (isset($_POST['login']) && $_POST['login']!='Nickname')?$_POST['login']:''; -$sPass = (isset($_POST['pass']) && $_POST['pass']!='Password')?$_POST['pass']:''; -$bRegister = (isset($_POST['register']) && $_POST['register']==1); - -//writing pad -$sThought = isset($_POST['thoughts'])?$_POST['thoughts']:''; -$iThoughtId = (isset($_POST['thought_id']) && $_POST['thought_id']!='')?$_POST['thought_id']:0; //update or insert -$bFinishedWriting = isset($_POST['finished']); - -//calendar -$iDay = isset($_GET['d'])?$_GET['d']:date(MyThoughts::URL_DATE_FORMAT); //d = yyyymmdd -$iCalYear = isset($_GET[Calendar::CAL_YEAR])?$_GET[Calendar::CAL_YEAR]:0; //cy = yyyy -$iCalMonth = isset($_GET[Calendar::CAL_MONTH])?$_GET[Calendar::CAL_MONTH]:0; //cm = m - -$oMyThougths = new MyThoughts(); -$bValidPost = ($sPostToken!='' && $oMyThougths->checkPostToken($sPostToken)); - -if($bValidPost) -{ - if($bRegister) - { - $oMyThougths->register($sLogin, $sPass); - $sPage = 'r'; - } - elseif($sLogin!='' && $sPass!='') - { - $oMyThougths->logMeIn($sLogin, $sPass); - } -} - -//if loggued in -if(!$oMyThougths->isLogguedIn()) -{ - $oMyThougths->logonPage($sLogin); -} -else -{ - $oMyThougths->activateMenu(); - $oMyThougths->setCalendarDate(); - switch($sPage) - { - case 'w': //write a thought - if($bValidPost && $sThought!='' && $sThought!='Talk to me.') - { - if($iThoughtId==0) - { - $iThoughtId = $oMyThougths->addThought($sThought); - } - else - { - $oMyThougths->updateThought($iThoughtId, $sThought); - } - } - if($bFinishedWriting) - { - $oMyThougths->readingPage(); - } - else - { - $oMyThougths->writingPage($iThoughtId); - } - break; - case 'r': //read a thought (per day) - if($iDay<=0 || !$oMyThougths->readingPage(strtotime($iDay))) - { - $oMyThougths->writingPage(); - } - break; - case 's': // go to settings page - if($bValidPost) - { - $asSettings = array_intersect_key($_POST, array_flip($oMyThougths->getSettingsList())); - $oMyThougths->setSettings($asSettings); - $oMyThougths->writingPage(); - } - else - { - $oMyThougths->settingsPage(); - } - break; - case 'q': //quit - $oMyThougths->logMeOut(); - } - - if($iCalYear!=0 && $iCalMonth!=0) - { - $oMyThougths->setCalendarDate($iCalYear, $iCalMonth); - } -} -echo $oMyThougths->getPage(); - -*/ -?> \ No newline at end of file diff --git a/lib/Controller.php b/lib/Controller.php new file mode 100644 index 0000000..28221a8 --- /dev/null +++ b/lib/Controller.php @@ -0,0 +1,150 @@ +asReq = [ + 't' => (string) ($asReq['t'] ?? ''), + 'id' => self::positiveInt($asReq['id'] ?? 0), + 'dir' => (string) ($asReq['dir'] ?? ''), + 'date' => (string) ($asReq['date'] ?? ''), + 'content' => (string) ($asReq['content'] ?? ''), + 'has_content'=> array_key_exists('content', $asReq), + 'name' => (string) ($asReq['name'] ?? ''), + 'email' => (string) ($asReq['email'] ?? ''), + 'password' => (string) ($asReq['password'] ?? ''), + 'remember' => !empty($asReq['remember']), + 'field' => (string) ($asReq['field'] ?? ''), + 'value' => (string) ($asReq['value'] ?? ''), + //sendBeacon cannot set headers, so the unload close falls back to + //carrying the token in the body. + 'csrf_token'=> (string) ($_SERVER['HTTP_X_CSRF_TOKEN'] ?? ($_POST['csrf_token'] ?? '')) + ]; + + //Authentication and CSRF protection share the same server-side session. + $this->initCsrfToken(); + + $this->oMyThoughts = new MyThoughts($sProcessPage, $this->asReq['t']); + + //Validate CSRF, then release the session lock before long-running work. + $bValidMutationRequest = $this->validateMutationRequest($sAction); + if(!$bValidMutationRequest || !in_array($sAction, self::SESSION_WRITING_ACTIONS, true)) $this->closeSession(); + + if(!$bValidMutationRequest) $sResult = MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + else $sResult = ($sAction == '') ? $this->oMyThoughts->getAppMainPage($this->getCsrfToken()) : $this->dispatch($sAction); + + //Clean errors + $sDebug = ob_get_clean(); + if($sDebug != '') $this->oMyThoughts->addUncaughtError($sDebug); + $this->closeSession(); + + return $sResult; + } + + private function dispatch(string $sAction): string { + $oJournal = $this->oMyThoughts->getJournal(); + + return match($sAction) { + /* Account */ + 'signup' => $this->oMyThoughts->signup($this->asReq['name'], $this->asReq['email'], $this->asReq['password'], $this->asReq['t']), + 'login' => $this->oMyThoughts->login($this->asReq['email'], $this->asReq['password'], $this->asReq['t'], $this->asReq['remember']), + 'logout' => $this->oMyThoughts->logout(), + 'account' => $this->oMyThoughts->updateAccount($this->asReq['field'], $this->asReq['value']), + + /* Reading the book */ + 'book' => $oJournal->getBook(), + 'entries' => $oJournal->getEntries($this->asReq['dir'], $this->asReq['id']), + 'date' => $oJournal->getEntryIdAtDate($this->asReq['date']), + + /* Writing in it */ + 'open_entry' => $oJournal->openEntry(), + 'save_entry' => $oJournal->saveEntry($this->asReq['id'], $this->asReq['content']), + 'close_entry' => $oJournal->closeEntry($this->asReq['id'], $this->asReq['content'], $this->asReq['has_content']), + 'delete_entry' => $oJournal->deleteEntry($this->asReq['id']), + + default => MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND) + }; + } + + /* CSRF & session */ + + private function validateMutationRequest(string $sAction): bool { + return + PHP_SAPI === 'cli' + || + !in_array($sAction, self::MUTATING_ACTIONS, true) + || + (($_SERVER['REQUEST_METHOD'] ?? '') === 'POST' && $this->checkCsrfToken($this->asReq['csrf_token'])) + ; + } + + private function getCsrfToken(): string { + if($this->sCsrfToken === '') $this->initCsrfToken(); + return $this->sCsrfToken; + } + + private function initCsrfToken(): void { + if(PHP_SAPI === 'cli') return; + + if(session_status() !== PHP_SESSION_ACTIVE) { + session_set_cookie_params(['httponly' => true, 'secure' => User::isSecureRequest(), 'samesite' => 'Lax']); + session_start(); + } + + if(empty($_SESSION['csrf_token'])) $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); + $this->sCsrfToken = $_SESSION['csrf_token']; + } + + private function checkCsrfToken(string $sClientToken): bool { + $sServerToken = $this->getCsrfToken(); + return PHP_SAPI === 'cli' || ($sServerToken !== '' && $sClientToken !== '' && hash_equals($sServerToken, $sClientToken)); + } + + private function closeSession(): void { + if(session_status() === PHP_SESSION_ACTIVE) session_write_close(); + } + + private static function positiveInt($oValue): int { + return filter_var($oValue, FILTER_VALIDATE_INT, ['options' => ['default' => 0, 'min_range' => 0]]); + } +} diff --git a/lib/Journal.php b/lib/Journal.php new file mode 100644 index 0000000..2f0d26e --- /dev/null +++ b/lib/Journal.php @@ -0,0 +1,386 @@ +oDb = &$oDb; + $this->oUser = &$oUser; + } + + /* Reading */ + + /** + * Everything the book needs to render on load: the tail of the stream (what + * you were last writing), plus every entry's date for the bookmark rail and + * the calendar. Bookmarks stay cheap - id and timestamp only, no content. + */ + public function getBook(): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + + $this->sealStaleEntries(); + + $asEntries = $this->getEntryWindow(); + + return MyThoughts::getJsonResult(true, '', [ + 'entries' => $asEntries, + 'bookmarks' => $this->getBookmarks(), + 'has_older' => $this->hasOlderThan($asEntries[0]['id'] ?? 0), + 'has_newer' => false + ]); + } + + public function getEntries(string $sDirection, int $iCursorId): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + + $asEntries = match($sDirection) { + 'before' => $this->getEntryWindow($iCursorId, 'before'), + 'after' => $this->getEntryWindow($iCursorId, 'after'), + 'around' => $this->getEntryWindow($iCursorId, 'around'), + default => null + }; + + if($asEntries === null) return MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); + + return MyThoughts::getJsonResult(true, '', [ + 'entries' => $asEntries, + 'has_older' => $this->hasOlderThan($asEntries[0]['id'] ?? 0), + 'has_newer' => $this->hasNewerThan(end($asEntries)['id'] ?? 0) + ]); + } + + /** + * Resolve a calendar click to a cursor: the first entry written on or after + * the given day, falling back to the last entry before it when that day and + * everything after it is blank. + */ + public function getEntryIdAtDate(string $sDate): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + + $oDate = \DateTime::createFromFormat('Y-m-d', $sDate); + if(!$oDate) return MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); + $sDate = $oDate->format('Y-m-d'); + + $sMidnight = $sDate.' 00:00:00'; + $iEntryId = $this->selectFirstId(['started_on' => $sMidnight], ['started_on' => ' >= '], 'ASC'); + if(!$iEntryId) $iEntryId = $this->selectFirstId(['started_on' => $sMidnight], ['started_on' => ' < '], 'DESC'); + if(!$iEntryId) return MyThoughts::getJsonResult(false, 'book.no_entry_yet'); + + return MyThoughts::getJsonResult(true, '', ['id' => (int) $iEntryId]); + } + + /* Writing */ + + /** + * Hand back the entry this session should be writing into: the one still + * open from a reload a minute ago, or a fresh one stamped with now. + */ + public function openEntry(): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + + $this->sealStaleEntries(); + + $iEntryId = (int) $this->selectFirstId(['status' => self::STATUS_OPEN], [], 'DESC'); + + if($iEntryId <= 0) { + $iEntryId = $this->oDb->insertRow(self::ENTRY_TABLE, [ + Db::getId(User::USER_TABLE) => $this->oUser->getUserId(), + 'content' => '', + 'status' => self::STATUS_OPEN, + 'started_on' => date(Db::TIMESTAMP_FORMAT), + 'closed_on' => MyThoughts::ZERO_TIMESTAMP, + 'timezone' => date_default_timezone_get() + ]); + + if($iEntryId <= 0) return MyThoughts::getJsonResult(false, 'error.commit_db'); + } + + return MyThoughts::getJsonResult(true, '', ['entry' => $this->getEntryById($iEntryId)]); + } + + public function saveEntry(int $iEntryId, string $sContent): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + if(!$this->ownsEntry($iEntryId)) return MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); + + $sContent = self::normaliseContent($sContent); + + if($this->oDb->updateRow(self::ENTRY_TABLE, $iEntryId, ['content' => $sContent]) === false) { + return MyThoughts::getJsonResult(false, 'error.commit_db'); + } + + return MyThoughts::getJsonResult(true, '', ['id' => $iEntryId, 'saved_at' => time()]); + } + + /** + * Seal an entry: what was written stays as a journal entry, and an entry + * nobody actually wrote in is dropped rather than left as a blank page. + */ + public function closeEntry(int $iEntryId, string $sContent = '', bool $bHasContent = false): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + if(!$this->ownsEntry($iEntryId)) return MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); + + $asResult = $this->sealEntry($iEntryId, $bHasContent ? $sContent : null); + return MyThoughts::getJsonResult($asResult['result'], $asResult['desc_lang_id'], $asResult['data']); + } + + /** + * Shared by the explicit close and by the stale-entry sweep, which runs + * inside other endpoints and so must not emit a response of its own. + */ + private function sealEntry(int $iEntryId, ?string $sContent = null): array { + $asData = ['status' => self::STATUS_CLOSED, 'closed_on' => date(Db::TIMESTAMP_FORMAT)]; + + //The unload beacon carries the last keystrokes the debounced autosave + //never got to send, so trust it over what is already stored. + if($sContent !== null) $asData['content'] = self::normaliseContent($sContent); + + $sStored = $asData['content'] ?? (string) $this->oDb->selectValue(self::ENTRY_TABLE, 'content', $iEntryId); + + if(trim($sStored) === '') { + $this->oDb->deleteRow(self::ENTRY_TABLE, $iEntryId); + return MyThoughts::getResult(true, '', ['id' => $iEntryId, 'discarded' => true]); + } + + if($this->oDb->updateRow(self::ENTRY_TABLE, $iEntryId, $asData) === false) { + return MyThoughts::getResult(false, 'error.commit_db'); + } + + return MyThoughts::getResult(true, '', ['entry' => $this->getEntryById($iEntryId), 'discarded' => false]); + } + + public function deleteEntry(int $iEntryId): string { + if(!$this->oUser->isLoggedIn()) return MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); + if(!$this->ownsEntry($iEntryId)) return MyThoughts::getJsonResult(false, MyThoughts::NOT_FOUND); + + if(!$this->oDb->deleteRow(self::ENTRY_TABLE, $iEntryId)) return MyThoughts::getJsonResult(false, 'error.commit_db'); + + return MyThoughts::getJsonResult(true, 'book.entry_deleted', ['id' => $iEntryId]); + } + + /* Internals */ + + /** + * @param int $iCursorId 0 for the newest window + * @param string $sDirection before|after|around, relative to the cursor + */ + private function getEntryWindow(int $iCursorId = 0, string $sDirection = 'latest'): array { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + + //"around" is two half-windows so the target entry lands mid-book with + //something to read on either side of it. + if($sDirection == 'around' && $iCursorId > 0) { + $asBefore = $this->selectEntries([$sIdColumn => $iCursorId], [$sIdColumn => ' < '], 'DESC', (int) (self::CHUNK_SIZE / 2)); + $asFrom = $this->selectEntries([$sIdColumn => $iCursorId], [$sIdColumn => ' >= '], 'ASC', (int) (self::CHUNK_SIZE / 2)); + return array_merge(array_reverse($asBefore), $asFrom); + } + + //selectEntries() scopes every read to the logged-in user, so the window + //itself only has to say where in the stream it starts. + $asConstraints = []; + $asOperators = []; + + if($iCursorId > 0 && $sDirection == 'before') { + $asConstraints[$sIdColumn] = $iCursorId; + $asOperators[$sIdColumn] = ' < '; + } + elseif($iCursorId > 0 && $sDirection == 'after') { + $asConstraints[$sIdColumn] = $iCursorId; + $asOperators[$sIdColumn] = ' > '; + } + + //"after" reads forward; everything else reads backward from the cursor + //and is flipped, so the caller always gets chronological order. + $bForward = ($sDirection == 'after'); + $asEntries = $this->selectEntries($asConstraints, $asOperators, $bForward ? 'ASC' : 'DESC', self::CHUNK_SIZE); + + return $bForward ? $asEntries : array_reverse($asEntries); + } + + private function selectEntries(array $asConstraints, array $asOperators, string $sOrder, int $iLimit): array { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + $asConstraints[Db::getId(User::USER_TABLE)] = $this->oUser->getUserId(); + + $asRows = $this->oDb->selectRows([ + 'select' => [$sIdColumn.' AS id', 'content', 'status', 'timezone', 'UNIX_TIMESTAMP(started_on) AS time', 'UNIX_TIMESTAMP(closed_on) AS closed'], + 'from' => self::ENTRY_TABLE, + 'constraint'=> $asConstraints, + 'constOpe' => $asOperators, + 'orderBy' => [$sIdColumn => $sOrder], + 'limit' => $iLimit + ]); + + return array_map([self::class, 'castEntry'], $asRows); + } + + private function getEntryById(int $iEntryId): array { + $asEntries = $this->selectEntries([Db::getId(self::ENTRY_TABLE) => $iEntryId], [], 'ASC', 1); + return $asEntries[0] ?? []; + } + + /** + * The bookmark rail and the calendar both need every entry's date, and + * nothing else - so this deliberately never selects content. + */ + private function getBookmarks(): array { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + + $asRows = $this->oDb->selectRows([ + 'select' => [ + $sIdColumn.' AS id', + 'UNIX_TIMESTAMP(started_on) AS time', + 'timezone', + 'status', + 'LEFT(content, 60) AS preview' + ], + 'from' => self::ENTRY_TABLE, + 'constraint'=> [Db::getId(User::USER_TABLE) => $this->oUser->getUserId()], + 'orderBy' => [$sIdColumn => 'ASC'] + ]); + + return array_map(static function(array $asRow): array { + return [ + 'id' => (int) $asRow['id'], + 'time' => (int) $asRow['time'], + 'timezone' => $asRow['timezone'], + 'status' => $asRow['status'], + 'preview' => trim(preg_replace('/\s+/u', ' ', $asRow['preview'] ?? '')) + ]; + }, $asRows); + } + + private function hasOlderThan(int $iEntryId): bool { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + return ($iEntryId > 0) && ($this->selectFirstId([$sIdColumn => $iEntryId], [$sIdColumn => ' < '], 'DESC') !== false); + } + + private function hasNewerThan(int $iEntryId): bool { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + return ($iEntryId > 0) && ($this->selectFirstId([$sIdColumn => $iEntryId], [$sIdColumn => ' > '], 'ASC') !== false); + } + + /** + * @return int|false Id of the first matching entry in the given order + */ + private function selectFirstId(array $asConstraints, array $asOperators, string $sOrder) { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + $asConstraints[Db::getId(User::USER_TABLE)] = $this->oUser->getUserId(); + + $asRows = $this->oDb->selectRows([ + 'select' => [$sIdColumn], + 'from' => self::ENTRY_TABLE, + 'constraint'=> $asConstraints, + 'constOpe' => $asOperators, + 'orderBy' => [$sIdColumn => $sOrder], + 'limit' => 1 + ]); + + return empty($asRows) ? false : (int) $asRows[0]; + } + + private function ownsEntry(int $iEntryId): bool { + if($iEntryId <= 0) return false; + + $iOwnerId = $this->oDb->selectValue( + self::ENTRY_TABLE, + Db::getId(User::USER_TABLE), + [Db::getId(self::ENTRY_TABLE) => $iEntryId] + ); + + return ($iOwnerId !== false) && ((int) $iOwnerId === $this->oUser->getUserId()); + } + + /** + * Close anything the browser abandoned. Without this a stale open entry + * would silently swallow tomorrow's writing into yesterday's timestamp. + */ + private function sealStaleEntries(): void { + $sIdColumn = Db::getId(self::ENTRY_TABLE); + + //Db::updateRows only builds equality constraints, so the cutoff has to + //be resolved to a list of ids first. + $asStale = $this->oDb->selectRows([ + 'select' => [$sIdColumn], + 'from' => self::ENTRY_TABLE, + 'constraint'=> [ + Db::getId(User::USER_TABLE) => $this->oUser->getUserId(), + 'status' => self::STATUS_OPEN, + 'led' => date(Db::TIMESTAMP_FORMAT, time() - self::OPEN_ENTRY_TTL) + ], + 'constOpe' => ['led' => ' < '] + ]); + + foreach($asStale as $iStaleId) $this->sealEntry((int) $iStaleId); + + //Blank pages left behind by earlier sessions - nothing was written, so + //they are not entries and should not show up as bookmarks. + $asBlank = $this->oDb->selectRows([ + 'select' => [$sIdColumn], + 'from' => self::ENTRY_TABLE, + 'constraint'=> [ + Db::getId(User::USER_TABLE) => $this->oUser->getUserId(), + 'status' => self::STATUS_CLOSED, + 'TRIM(content)' => '' + ] + ]); + + foreach($asBlank as $iBlankId) $this->oDb->deleteRow(self::ENTRY_TABLE, (int) $iBlankId); + } + + private static function castEntry(array $asRow): array { + return [ + 'id' => (int) $asRow['id'], + 'content' => (string) $asRow['content'], + 'status' => $asRow['status'], + 'timezone' => $asRow['timezone'], + 'time' => (int) $asRow['time'], + 'closed' => (int) $asRow['closed'] + ]; + } + + /** + * Plain text in, plain text out: normalise line endings, strip control + * characters the book can never render, and cap the size. + * + * Tab and newline are the two the page does render - the text column sets a + * tab-size and the paginator breaks paragraphs on newlines - so they are + * held back from the sweep. Everything else in \p{C} (other controls, zero + * width joiners, bidi overrides) would either draw nothing or quietly + * corrupt the character offsets the caret is placed with. + */ + private static function normaliseContent(string $sContent): string { + $sContent = str_replace(["\r\n", "\r"], "\n", $sContent); + $sContent = preg_replace('/[^\P{C}\n\t]+/u', '', $sContent) ?? ''; + return mb_substr($sContent, 0, self::MAX_CONTENT_LENGTH); + } +} diff --git a/lib/MyThoughts.php b/lib/MyThoughts.php new file mode 100644 index 0000000..ecb69a2 --- /dev/null +++ b/lib/MyThoughts.php @@ -0,0 +1,201 @@ +oUser = new User($this->oDb); + $this->oLang = new Translator($this->oUser->getLang(), self::DEFAULT_LANG); + $this->oJournal = new Journal($this->oDb, $this->oUser); + } + + public function getUser(): User { + return $this->oUser; + } + + public function getJournal(): Journal { + return $this->oJournal; + } + + protected function install() { + $this->oDb->install(); + } + + protected function getSqlOptions() { + return [ + 'tables' => [ + User::USER_TABLE => ['name', 'email', 'password', 'token', 'token_exp', 'language', 'timezone', 'clearance'], + Journal::ENTRY_TABLE=> [Db::getId(User::USER_TABLE), 'content', 'status', 'started_on', 'closed_on', 'timezone'] + ], + 'types' => [ + 'name' => 'VARCHAR(100) NOT NULL', + 'email' => 'VARCHAR(320) NOT NULL', + 'password' => "VARCHAR(255) NOT NULL DEFAULT ''", + 'token' => "VARCHAR(64) NOT NULL DEFAULT ''", + 'token_exp' => 'TIMESTAMP DEFAULT 0', + 'language' => 'VARCHAR(2)', + 'timezone' => 'CHAR(64) NOT NULL', //see mysql.time_zone_name + 'clearance' => 'TINYINT(1) DEFAULT '.User::CLEARANCE_USER, + 'content' => 'LONGTEXT', + 'status' => 'VARCHAR(10)', + 'started_on'=> 'TIMESTAMP DEFAULT 0', //DEFAULT 0 removes auto-set to current time + 'closed_on' => 'TIMESTAMP DEFAULT 0' + ], + 'constraints' => [ + User::USER_TABLE => 'UNIQUE KEY `uni_email` (`email`)', + //The book is always read as "this user's entries, in order", + //so the reading order is indexed rather than the id alone. + Journal::ENTRY_TABLE=> ['INDEX `idx_user_entry` (`id_user`, `id_entry`)', 'INDEX `idx_user_date` (`id_user`, `started_on`)'] + ], + //Deliberately no 'cascading_delete': Db cascades by reusing the same + //id in the linked table, which would delete unrelated rows here. + //The generated foreign keys already guard referential integrity. + ]; + } + + /* Pages & API */ + + public function getAppMainPage(string $sCsrfToken = ''): string { + $asViteAssets = $this->getViteAssets(); + + return parent::getMainPage( + [ + 'user' => $this->oUser->getUserInfo(), + 'consts' => [ + 'title' => self::PROJECT_NAME, + 'languages' => self::LANGUAGES, + 'chunk_size' => Journal::CHUNK_SIZE, + 'default_timezone' => Settings::TIMEZONE, + 'autosave_delay' => 1200, //ms of stillness before a save + 'autosave_max_wait' => 8000, //ms of continuous typing before a forced save + 'csrf_token' => $sCsrfToken + ] + ], + self::MAIN_PAGE, + [ + 'tags' => [ + 'language' => $this->oLang->getLanguage(), + 'title' => self::PROJECT_NAME, + 'app_entry' => $asViteAssets['app'] + ], + 'instances' => [ + 'css' => $asViteAssets['css'], + 'module' => $asViteAssets['module'] + ] + ] + ); + } + + public function signup(string $sName, string $sEmail, string $sPassword, string $sTimezone): string { + $asResult = $this->oUser->signup($sName, $sEmail, $sPassword, $this->oLang->getLanguage(), $sTimezone); + return self::getJsonResult($asResult['result'], $asResult['desc_lang_id'], $asResult['data'], $asResult['desc_lang_params']); + } + + public function login(string $sEmail, string $sPassword, string $sTimezone, bool $bRemember): string { + $asResult = $this->oUser->login($sEmail, $sPassword, $sTimezone, $bRemember); + return self::getJsonResult($asResult['result'], $asResult['desc_lang_id'], $asResult['data'], $asResult['desc_lang_params']); + } + + public function logout(): string { + $asResult = $this->oUser->logout(); + return self::getJsonResult($asResult['result'], $asResult['desc_lang_id'], $asResult['data']); + } + + public function updateAccount(string $sField, string $sValue): string { + $asResult = $this->oUser->updateSettings($sField, $sValue); + + //A language change has to reach the next page load's translations too. + if($asResult['result'] && $sField == 'language') $this->oLang->setLanguage($this->oUser->getLang(), self::DEFAULT_LANG); + + return self::getJsonResult($asResult['result'], $asResult['desc_lang_id'], $asResult['data'], $asResult['desc_lang_params']); + } + + /* Vite assets */ + + private function getViteAssets(): array { + $sManifestPath = __DIR__.'/../public/.vite/manifest.json'; + + if(!file_exists($sManifestPath)) { + $this->addError('Vite manifest not found - run "npm run dev" or "npm run prod" to build the frontend.'); + return ['app' => '', 'css' => [], 'module' => []]; + } + + $asManifest = json_decode(file_get_contents($sManifestPath), true); + $asAppImport = $asManifest[self::VITE_APP] ?? []; + + //Recursive search for chunk imports + $asImports = []; + $asSeenImports = [self::VITE_APP => true]; + $this->appendViteImportedChunks($asManifest, $asAppImport, $asSeenImports, $asImports); + + //CSS + $asCssFiles = []; + foreach(array_merge([$asAppImport], $asImports) as $asChunk) { + foreach($asChunk['css'] ?? [] as $sCssFile) $asCssFiles[] = $sCssFile; + } + + //Modules + $asModuleFiles = []; + foreach($asImports as $asImport) { + if(str_ends_with($asImport['file'] ?? '', '.js')) $asModuleFiles[] = $asImport['file']; + } + + return [ + 'app' => $asAppImport['file'] ?? '', + 'css' => self::getViteAssetInstances($asCssFiles), + 'module' => self::getViteAssetInstances($asModuleFiles) + ]; + } + + private function appendViteImportedChunks($asManifest, $asChunk, &$asSeenImports, &$asImports): void { + foreach($asChunk['imports'] ?? [] as $sImport) { + if(isset($asSeenImports[$sImport]) || !isset($asManifest[$sImport])) continue; + + $asSeenImports[$sImport] = true; + $this->appendViteImportedChunks($asManifest, $asManifest[$sImport], $asSeenImports, $asImports); + $asImports[] = $asManifest[$sImport]; + } + } + + private static function getViteAssetInstances(array $asFilePaths): array { + return array_map(static function($sFilePath) { return ['filename' => $sFilePath]; }, $asFilePaths); + } +} diff --git a/lib/User.php b/lib/User.php new file mode 100644 index 0000000..e134879 --- /dev/null +++ b/lib/User.php @@ -0,0 +1,277 @@ + 0, + 'name' => '', + 'email' => '', + 'language' => '', + 'timezone' => '', + 'clearance' => self::CLEARANCE_USER + ]; + + //Session & Cookie + private const SESSION_ID_USER = 'id_user'; + private const COOKIE_TOKEN = 'mythoughts'; + private const COOKIE_DURATION = 60 * 60 * 24 * 90; //3 months + + private Db $oDb; + private int $iUserId = 0; + private array $asUserInfo = self::DEFAULT_USER; + + public function __construct(Db &$oDb) { + parent::__construct(__CLASS__); + $this->oDb = &$oDb; + $this->setUserId(0); + $this->checkSession(); + } + + /* Identity */ + + public function getUserId(): int { + return $this->iUserId; + } + + public function isLoggedIn(): bool { + return ($this->iUserId > 0); + } + + public function getUserInfo(): array { + return $this->asUserInfo; + } + + public function getLang(): string { + return $this->asUserInfo['language']; + } + + public function getTimezone(): string { + return $this->asUserInfo['timezone']; + } + + public function setUserId($iUserId): void { + $this->iUserId = 0; + $this->asUserInfo = self::DEFAULT_USER; + + if($iUserId > 0) { + $asUser = $this->getUserById($iUserId); + if(!empty($asUser)) { + $this->iUserId = (int) $iUserId; + $this->asUserInfo = $asUser; + } + } + } + + private function getUserById($iUserId): array { + if($iUserId <= 0) return []; + + $asSelect = array_keys(self::DEFAULT_USER); + $asSelect[array_search('id', $asSelect)] = Db::getId(self::USER_TABLE).' AS id'; + + $asUser = $this->oDb->selectRow(self::USER_TABLE, [Db::getId(self::USER_TABLE) => $iUserId], $asSelect); + if(empty($asUser)) return []; + + $asUser['id'] = (int) $asUser['id']; + $asUser['clearance'] = (int) $asUser['clearance']; + return $asUser; + } + + /* Sign up & log in */ + + public function signup(string $sName, string $sEmail, string $sPassword, string $sLang, string $sTimezone): array { + $sEmail = mb_strtolower(trim($sEmail)); + $sName = mb_substr(trim($sName), 0, self::MAX_NAME_LENGTH); + + if($sName === '') return MyThoughts::getResult(false, 'account.name_required'); + if(!filter_var($sEmail, FILTER_VALIDATE_EMAIL)) return MyThoughts::getResult(false, 'account.invalid_email'); + if(mb_strlen($sPassword) < self::MIN_PASSWORD_LENGTH) return MyThoughts::getResult(false, 'account.password_too_short', [], [self::MIN_PASSWORD_LENGTH]); + + //Taken emails must not be distinguishable from a wrong password, so the + //message stays the same one login gives - no account enumeration here. + if($this->oDb->selectId(self::USER_TABLE, ['email' => $sEmail]) > 0) { + return MyThoughts::getResult(false, 'account.invalid_credentials'); + } + + $iUserId = $this->oDb->insertRow(self::USER_TABLE, [ + 'name' => $sName, + 'email' => $sEmail, + 'password' => password_hash($sPassword, PASSWORD_DEFAULT), + 'language' => $sLang, + 'timezone' => $sTimezone, + 'clearance' => self::CLEARANCE_USER + ]); + + if($iUserId <= 0) return MyThoughts::getResult(false, 'error.commit_db'); + + $this->openSessionFor($iUserId, true); + return MyThoughts::getResult(true, 'account.welcome', ['user' => $this->getUserInfo()]); + } + + public function login(string $sEmail, string $sPassword, string $sTimezone, bool $bRemember): array { + $sEmail = mb_strtolower(trim($sEmail)); + + $asDbUser = $this->oDb->selectRow( + self::USER_TABLE, + ['email' => $sEmail], + [Db::getId(self::USER_TABLE), 'password', 'timezone'] + ); + $iUserId = (int) ($asDbUser[Db::getId(self::USER_TABLE)] ?? 0); + + //password_verify against a dummy hash on unknown emails keeps the + //response time of "no such user" and "wrong password" comparable. + $sHash = $asDbUser['password'] ?? ''; + $bValid = ($sHash !== '') ? password_verify($sPassword, $sHash) : password_verify($sPassword, '$2y$10$'.str_repeat('.', 53)); + + if($iUserId <= 0 || !$bValid) return MyThoughts::getResult(false, 'account.invalid_credentials'); + + if($sTimezone !== '' && $sTimezone !== ($asDbUser['timezone'] ?? '')) { + $this->oDb->updateRow(self::USER_TABLE, $iUserId, ['timezone' => $sTimezone]); + } + + $this->openSessionFor($iUserId, $bRemember); + return MyThoughts::getResult(true, 'account.logged_in', ['user' => $this->getUserInfo()]); + } + + public function logout(): array { + $this->clearTokenCookie(); + + $_SESSION = []; + if(session_status() === PHP_SESSION_ACTIVE) session_regenerate_id(true); + + $this->setUserId(0); + return MyThoughts::getResult(true, 'account.logged_out'); + } + + public function updateSettings(string $sField, string $sValue): array { + if(!$this->isLoggedIn()) return MyThoughts::getResult(false, MyThoughts::UNAUTHORIZED); + if(!in_array($sField, ['name', 'language', 'timezone'], true)) return MyThoughts::getResult(false, MyThoughts::NOT_FOUND); + + $sValue = mb_substr(trim($sValue), 0, self::MAX_NAME_LENGTH); + if($sField === 'name' && $sValue === '') return MyThoughts::getResult(false, 'account.name_required'); + if($sField === 'timezone' && !in_array($sValue, \DateTimeZone::listIdentifiers(), true)) return MyThoughts::getResult(false, MyThoughts::NOT_FOUND); + + if(!$this->oDb->updateRow(self::USER_TABLE, $this->iUserId, [$sField => $sValue])) { + return MyThoughts::getResult(false, 'error.commit_db'); + } + + $this->setUserId($this->iUserId); + return MyThoughts::getResult(true, 'account.saved', ['user' => $this->getUserInfo()]); + } + + /* Session plumbing */ + + private function openSessionFor(int $iUserId, bool $bRemember): void { + $this->setUserId($iUserId); + + if(session_status() === PHP_SESSION_ACTIVE) { + session_regenerate_id(true); + $_SESSION[self::SESSION_ID_USER] = $iUserId; + } + + if($bRemember) $this->setTokenCookie(); + else $this->clearTokenCookie(); + } + + private function checkSession(): void { + $iUserId = (int) ($_SESSION[self::SESSION_ID_USER] ?? 0); + if($iUserId > 0) $this->setUserId($iUserId); + else $this->checkTokenCookie(); + } + + /** + * Cookie holds ":"; only a hash of the secret is stored, + * so a dump of the users table cannot be replayed as a login. + */ + private function checkTokenCookie(): void { + $sCookie = $_COOKIE[self::COOKIE_TOKEN] ?? ''; + if($sCookie === '') return; + + $asParts = explode(':', $sCookie, 2); + if(count($asParts) != 2) return; + + $iUserId = (int) $asParts[0]; + $sSecret = $asParts[1]; + if($iUserId <= 0 || $sSecret === '') return; + + $asToken = $this->oDb->selectRow(self::USER_TABLE, $iUserId, ['token', 'token_exp']); + $sStoredHash = $asToken['token'] ?? ''; + + if($sStoredHash === '' || strtotime($asToken['token_exp'] ?? '0') < time()) { + $this->clearTokenCookie(); + return; + } + + if(!hash_equals($sStoredHash, hash('sha256', $sSecret))) { + $this->clearTokenCookie(); + return; + } + + $this->setUserId($iUserId); + if(!$this->isLoggedIn()) { + $this->clearTokenCookie(); + return; + } + + if(session_status() === PHP_SESSION_ACTIVE) $_SESSION[self::SESSION_ID_USER] = $iUserId; + + //Sliding expiry: an active reader is never logged out mid-journal. + $this->setTokenCookie(); + } + + private function setTokenCookie(): void { + if(!$this->isLoggedIn()) return; + + $sSecret = bin2hex(random_bytes(32)); + $iExpiry = time() + self::COOKIE_DURATION; + + $this->oDb->updateRow(self::USER_TABLE, $this->iUserId, [ + 'token' => hash('sha256', $sSecret), + 'token_exp' => date(Db::TIMESTAMP_FORMAT, $iExpiry) + ]); + + $this->writeCookie($this->iUserId.':'.$sSecret, $iExpiry); + } + + private function clearTokenCookie(): void { + if($this->isLoggedIn()) { + $this->oDb->updateRow(self::USER_TABLE, $this->iUserId, ['token' => '', 'token_exp' => MyThoughts::ZERO_TIMESTAMP]); + } + + $this->writeCookie('', time() - 3600); + unset($_COOKIE[self::COOKIE_TOKEN]); + } + + private function writeCookie(string $sValue, int $iExpiry): void { + if(PHP_SAPI === 'cli' || headers_sent()) return; + + setcookie(self::COOKIE_TOKEN, $sValue, [ + 'expires' => $iExpiry, + 'path' => dirname($_SERVER['SCRIPT_NAME'] ?? '/'), + 'httponly' => true, + 'secure' => self::isSecureRequest(), + 'samesite' => 'Lax' + ]); + } + + public static function isSecureRequest(): bool { + return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https'); + } +} diff --git a/log.html b/log.html deleted file mode 100755 index e69de29..0000000 diff --git a/masks/calendar.html b/masks/calendar.html deleted file mode 100755 index 488bca6..0000000 --- a/masks/calendar.html +++ /dev/null @@ -1,27 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - -
- <-  - #current_month# - ->  -
#day_name#
#item_day#
-
\ No newline at end of file diff --git a/masks/errors.html b/masks/errors.html deleted file mode 100755 index 9766838..0000000 --- a/masks/errors.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
    - -
  • #error#
  • - -
-
\ No newline at end of file diff --git a/masks/home.html b/masks/home.html deleted file mode 100755 index 8964acb..0000000 --- a/masks/home.html +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/masks/index.html b/masks/index.html deleted file mode 100755 index be88851..0000000 --- a/masks/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - My Thoughts - - -
- - - \ No newline at end of file diff --git a/masks/logon.html b/masks/logon.html deleted file mode 100755 index 7d60567..0000000 --- a/masks/logon.html +++ /dev/null @@ -1,56 +0,0 @@ -
-
-
-

-

-
-

-

-
-
- \ No newline at end of file diff --git a/masks/menu.html b/masks/menu.html deleted file mode 100755 index d878146..0000000 --- a/masks/menu.html +++ /dev/null @@ -1,4 +0,0 @@ -Write .  -Settings .  -Sign out -#calendar# \ No newline at end of file diff --git a/masks/read_thought.html b/masks/read_thought.html deleted file mode 100755 index 388feaa..0000000 --- a/masks/read_thought.html +++ /dev/null @@ -1,14 +0,0 @@ -

Thoughts on #date#.

-
- -
-
At #time#
-
- -

#thought_paragraph#

- -

* * *

-
-
- -
diff --git a/masks/settings.html b/masks/settings.html deleted file mode 100755 index df30cd6..0000000 --- a/masks/settings.html +++ /dev/null @@ -1,19 +0,0 @@ -
-
- - - - - - - -
#setting_name# - -
- -
-
\ No newline at end of file diff --git a/masks/template.html b/masks/template.html deleted file mode 100755 index 902c817..0000000 --- a/masks/template.html +++ /dev/null @@ -1,11 +0,0 @@ -
- - -
- -#errors# \ No newline at end of file diff --git a/masks/write.html b/masks/write.html deleted file mode 100755 index d986aaf..0000000 --- a/masks/write.html +++ /dev/null @@ -1,176 +0,0 @@ -
-
- - -
- \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7167a94 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2452 @@ +{ + "name": "mythoughts", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mythoughts", + "version": "2.0.0", + "dependencies": { + "@fontsource-variable/caveat": "^5.3.0", + "sass": "^1.103.1", + "vue": "^3.5.42" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@vitejs/plugin-vue": "^6.0.8", + "eslint": "^10.9.1", + "eslint-plugin-vue": "^10.10.0", + "globals": "^17.12.0", + "vite": "^8.2.2" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@fontsource-variable/caveat": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource-variable/caveat/-/caveat-5.3.0.tgz", + "integrity": "sha512-Q3mjghoYIlXgwqBPJKZ4q6f3zu921Gq7UU76r9Z+NAmhapHfX130GIFpOCYf8vt2SIcgCi9RHDT7anfJKg/kiA==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@oxc-project/types": { + "version": "0.148.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.148.0.tgz", + "integrity": "sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz", + "integrity": "sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.6.0", + "@parcel/watcher-darwin-arm64": "2.6.0", + "@parcel/watcher-darwin-x64": "2.6.0", + "@parcel/watcher-freebsd-x64": "2.6.0", + "@parcel/watcher-linux-arm-glibc": "2.6.0", + "@parcel/watcher-linux-arm-musl": "2.6.0", + "@parcel/watcher-linux-arm64-glibc": "2.6.0", + "@parcel/watcher-linux-arm64-musl": "2.6.0", + "@parcel/watcher-linux-x64-glibc": "2.6.0", + "@parcel/watcher-linux-x64-musl": "2.6.0", + "@parcel/watcher-win32-arm64": "2.6.0", + "@parcel/watcher-win32-x64": "2.6.0" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.6.0.tgz", + "integrity": "sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.6.0.tgz", + "integrity": "sha512-Y3QV0gl7Q1zbfueunkWIERICbEojQFCgpyG7YqOGNFLsckXyI1xu9mAIUpKY9QBYzBtSkN8dBPwd3yiAO9ovMw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.6.0.tgz", + "integrity": "sha512-Ohv6OpzhUfKYD7Beb8kDvG0jbIxORCYY1JRdZnaBtnjjkJxgD7ZVL0nw2sCYd0yTMKTvz3nnTnOF3cDifK+kvw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.6.0.tgz", + "integrity": "sha512-5HmXvDgs8VK+74jF9y9/2FE3/OnlcKmc56tjmSrEuZjpSZOGL+fvAu+HKJBdPs9uwoP2hE6TlSUpXZ/C5jUFmQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.6.0.tgz", + "integrity": "sha512-Ps/hui3A+vMbjdqlqAowK2ZL8+BO8dBjxeWXj6npTBs3jx4wWmbPpaLuqwrQrSqIVMCnpWo238bJ1U37GhQOYg==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.6.0.tgz", + "integrity": "sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==", + "cpu": [ + "arm" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.6.0.tgz", + "integrity": "sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.6.0.tgz", + "integrity": "sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.6.0.tgz", + "integrity": "sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.6.0.tgz", + "integrity": "sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.6.0.tgz", + "integrity": "sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.6.0.tgz", + "integrity": "sha512-cA+/pXV2YkfxlIcXOQ5fSWqAzzPyD78/x5qbK/I0vUkrlYHA8TIz+MXjAbGouguKVSI4bOmkTSJ1/poVSsgt+A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.7.tgz", + "integrity": "sha512-EypzgnYCwyVY4NDHKzGmNJT5b+XaQEBniHxsMdeIQLB/tcCzZnhqrzHpZFbX9iaxx+5RiB8caATBtfvZP7zVxQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.7.tgz", + "integrity": "sha512-l17HE9EweWaqJZhuUuNBN/FzM62xw+DECVnJyvMsxn8vJFAGLy5QfLDoYAcronkAN8VxKZHezDpulHDPx95vFw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.7.tgz", + "integrity": "sha512-8ED8ELFvHXc6OCETIn4gXObPiaR6bckM/ipXtbzlPVDRMBfEGjCKgO90F9YtfdpDatVx/ZQw7aZ1vUMf/+T3Mw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.7.tgz", + "integrity": "sha512-/WPripjtiAIZ2tWY7ddijORT0Ujg87wxWW/qcoFVCKAWVDPhtY0xr7Dj0M3GyNGz60jGwTElhro/mkF9dT7dDQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.7.tgz", + "integrity": "sha512-14DI4NcqpvbICxSnGLx3PmtDaWqRP/KGSGb6C+JLLVPeZRl6dKdHba3pGsqT3vpdTqhEYIPG0MMQ8c0xYqoJxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.7.tgz", + "integrity": "sha512-bxrWIRvHWQvbJwi+VIie/kDJmQxcNE6xxWwZdqF/ExVAigtHkv54WTLQPb+QsZdnFy18fg7JPfWGL0RH6vwIlQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.7.tgz", + "integrity": "sha512-toOY2BChBZyuxU7OYX6Tn389di4IzAqPTycVcci0O7FSfBqzRB3RZn+K5Is6ANf4tmgRd/K1yZTsNTXbkXsnLg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.7.tgz", + "integrity": "sha512-lAIXTH/aiLRLxsTgQvfhjo4K1ydWIp00+V0voOr9beb/9ZmkUFrSIb03dXNFRgMNvkE6oGsF10ioQ6UsI+vS5Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.7.tgz", + "integrity": "sha512-kdnwS28Pkenp/mZMRwjXXXwxQ7pIsm+bF919LUK93BOyhcLsrVKdP2p9fxpiPNPAbNuch8ypQt0pm2P2LYCAGg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.7.tgz", + "integrity": "sha512-516OdsyLdr5E65paF3yBF55t8mfm9+gmtCsK3xI7XKXIT7EfRlHhxL8K/NR6Hu8BWSgF5+1w74lTL0+nxcc8Qw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.7.tgz", + "integrity": "sha512-r8/z8n7GFaYRln3xmP1Cxy0HH/HLM0uBUPkEuSVEfKGDA89M0FsZRZJRSwe/tJjRx+fpH/gjorfhB8tmEbSFLA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.7.tgz", + "integrity": "sha512-pAsE8iiDxUg1xBqdhrTfg45AVDVpirjz00sblEYClGNNcMnDb+e8beQgqIAw6LvauX/APvgxUnwrgun/YYGBhw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.7.tgz", + "integrity": "sha512-lTcIYmmnQQA8Or/2DatS6oSqcdLHvendjS+zLu+FwgToynWMRSmQdpM65fTANJgIS4mjbMOo5KT2lnT9SAb96w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.7.tgz", + "integrity": "sha512-e3Gu3WxbNk/UqQhxqU7YIYO+9ZBvWNz3U+h/qRFosscMFzdRPbXYSaSWgSnklv2fz1TgzBTcti2z35c/7irsHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.7.tgz", + "integrity": "sha512-W/jg5qoRSqjsEv0+dZi4e687mcHqmVuU0P4fK6qS/xjetW2Gmc1W8j//z5nAeNcC8Ttm0hV46IjcYeuVwYhuiw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.8.tgz", + "integrity": "sha512-0ZjgOg7oO6farnNGup7yvoM/YXZV84OZxHAwtflItNa/6zzQyVb5LNxyea3FEKEX2XlagIKzrlH7wwxkKgtiew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.42.tgz", + "integrity": "sha512-2Ye1ilMtKXxl8qZUrQ5j0CdgenFp/HFQmta6rfRyfEsTG69L6Wk+tWuNoHYHMx9E8tF2Slvdg1FuwDvAXdy1LQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/shared": "3.5.42", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.42.tgz", + "integrity": "sha512-qbhQZEFmycr+ni/qyuccS4sucNN7VAbDfbkvNxWOX2VfgFm90MNs3/UhRNKoPMEIVn0F8gdlYjLPvqxHwHeQOA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.42", + "@vue/shared": "3.5.42" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.42.tgz", + "integrity": "sha512-fkCAFB4okcAANGMThboWnScp/gzWjU0ZSkVnjTIiplmMDq2uq0tIB3j+xVu4rhv5rvOgBySCysudmbMd6xRRqw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/compiler-core": "3.5.42", + "@vue/compiler-dom": "3.5.42", + "@vue/compiler-ssr": "3.5.42", + "@vue/shared": "3.5.42", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.19", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.42.tgz", + "integrity": "sha512-xmLk3wLkbizPAiLyomjgFFosf2ys9b5Ghb+oh/k2tnvipNz8OFrQOiTcWCzyK7MpBp9KkyGtfvgfLUivbmuGYA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.42", + "@vue/shared": "3.5.42" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.42.tgz", + "integrity": "sha512-TzNNfKpb7hDxbQltwAut8VDQA5YP+BuRlxntHUuRjyKwlMvmAPbs3unhCvieijifY6vFfVBwsS7wG/C7uq+bEQ==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.42" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.42.tgz", + "integrity": "sha512-9uACtuHs7vJGkm5Bp3xu4xRDLFTIYy5DgxpToVjqGIAhAEKwQfsaLvKINhM6nFVp6bZPRFGdDqd1g52MqKsotA==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.42", + "@vue/shared": "3.5.42" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.42.tgz", + "integrity": "sha512-rsCmhiWLaRxGltLwhlCWyYkFn7WAbKRh0q17eZ1A6Dq6eqc2ACQ61IIryxz0LrsvCzHSilLA9JHovVwM8CNE2g==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.42", + "@vue/runtime-core": "3.5.42", + "@vue/shared": "3.5.42", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.42.tgz", + "integrity": "sha512-2++5dUyYS4gvo7xQXSECUDhB7TS0aOl5SeVfC5qSq1Jgfhjvegw1zqhwTIR3imZ+QYPJQw9gfcFvXGAjGZ7ajQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.42", + "@vue/runtime-dom": "3.5.42", + "@vue/shared": "3.5.42" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.42.tgz", + "integrity": "sha512-2rPxex1jQf4jvl9MOHl6YaXCPcrNqz/FstMOEh3QWY+/OME9nQTvl9WYeCwhW7AFjaR0SnngZGlp/wkR6rkI6g==", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true, + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "devOptional": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.9.1.tgz", + "integrity": "sha512-9VaAkDURekixUQJy0oJYl2DcN6oKMfxay7XzaGYAWQwsb6qfKf+x76R2k1L8kb1boc+FyCAaTA9GmiKaaiaF+A==", + "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.7.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-vue": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-10.10.0.tgz", + "integrity": "sha512-dL9x9rBHqqNcByWiLOHK6L0SB97V82/NC0cZRn9cXPjM7pCuWlpQQP9bFH4vjBv80ej1ZpzAkuD8zWH1o9bZbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "natural-compare": "^1.4.0", + "nth-check": "^2.1.1", + "postcss-selector-parser": "^7.1.4", + "semver": "^7.8.5", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "@stylistic/eslint-plugin": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0", + "@typescript-eslint/parser": "^7.0.0 || ^8.0.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "vue-eslint-parser": "^10.3.0" + }, + "peerDependenciesMeta": { + "@stylistic/eslint-plugin": { + "optional": true + }, + "@typescript-eslint/parser": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.12.0.tgz", + "integrity": "sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/immutable": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz", + "integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==", + "license": "MIT" + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT", + "optional": true + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.27.tgz", + "integrity": "sha512-79Iho8QeYyooJ8e9lCRyTVlyTAkS/kXBYKff6TMzS3kEWGQ8Ds5UEtXpGrSUDLUWok6QTvxeYy0GO8fopHnaSA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.18", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.6.tgz", + "integrity": "sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rolldown": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.7.tgz", + "integrity": "sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.148.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.7", + "@rolldown/binding-android-arm64": "1.2.7", + "@rolldown/binding-darwin-arm64": "1.2.7", + "@rolldown/binding-darwin-x64": "1.2.7", + "@rolldown/binding-freebsd-x64": "1.2.7", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.7", + "@rolldown/binding-linux-arm64-gnu": "1.2.7", + "@rolldown/binding-linux-arm64-musl": "1.2.7", + "@rolldown/binding-linux-ppc64-gnu": "1.2.7", + "@rolldown/binding-linux-s390x-gnu": "1.2.7", + "@rolldown/binding-linux-x64-gnu": "1.2.7", + "@rolldown/binding-linux-x64-musl": "1.2.7", + "@rolldown/binding-openharmony-arm64": "1.2.7", + "@rolldown/binding-win32-arm64-msvc": "1.2.7", + "@rolldown/binding-win32-x64-msvc": "1.2.7" + } + }, + "node_modules/sass": { + "version": "1.103.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.103.1.tgz", + "integrity": "sha512-9icZURbP51S6S0QGoyaeqk9uB06GNWxsFYWfH5RgpFgqK5FA8tJcM3AdVxrZEVJ7dz+L87nG95gBKf4VuaMHGw==", + "license": "MIT", + "dependencies": { + "chokidar": "^5.0.0", + "immutable": "^5.1.5", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=20.19.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.2.tgz", + "integrity": "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.26", + "rolldown": "~1.2.4", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.4.0 || ^0.5.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.42.tgz", + "integrity": "sha512-4RyHQTbQvOPs3MfvUO1Sg0YRrKNnA0mAVtvpd12Tg1fKDN7OHBUl1IqSn8zGJjK9nI3NkNp8cgTpVrSZC5TTcA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.42", + "@vue/compiler-sfc": "3.5.42", + "@vue/runtime-dom": "3.5.42", + "@vue/server-renderer": "3.5.42", + "@vue/shared": "3.5.42" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-eslint-parser": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-10.4.1.tgz", + "integrity": "sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.0", + "eslint-scope": "^8.2.0 || ^9.0.0", + "eslint-visitor-keys": "^4.2.0 || ^5.0.0", + "espree": "^10.3.0 || ^11.0.0", + "esquery": "^1.6.0", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b386ded --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "mythoughts", + "description": "A journal that behaves like an open book: write the left page, then the right, then turn.", + "version": "2.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite build --mode development --watch", + "prod": "vite build", + "lint": "eslint src" + }, + "author": "Franzz", + "dependencies": { + "@fontsource-variable/caveat": "^5.3.0", + "sass": "^1.103.1", + "vue": "^3.5.42" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@vitejs/plugin-vue": "^6.0.8", + "eslint": "^10.9.1", + "eslint-plugin-vue": "^10.10.0", + "globals": "^17.12.0", + "vite": "^8.2.2" + }, + "allowScripts": { + "@parcel/watcher@2.6.0": true + } +} diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..afaaa4b --- /dev/null +++ b/public/index.php @@ -0,0 +1,7 @@ +handle(__FILE__, $argv ?? []); diff --git a/resources/lang/en.json b/resources/lang/en.json new file mode 100644 index 0000000..d1d01fe --- /dev/null +++ b/resources/lang/en.json @@ -0,0 +1,66 @@ +{ + "meta": { + "locale": "en_GB", + "page_desc": "A quiet place to write. Your thoughts, on paper." + }, + "error": { + "no_auth": "You need to be signed in to do that.", + "not_found": "That does not exist.", + "no_data": "Nothing to show yet.", + "commit_db": "Could not save. Please try again.", + "network": "Could not reach the server. Your writing is kept locally until it comes back.", + "unexpected": "Something went wrong." + }, + "account": { + "sign_in": "Sign in", + "sign_up": "Create an account", + "sign_out": "Sign out", + "have_account": "Already have a book?", + "no_account": "Start a new book", + "name": "Your name", + "email": "Email", + "password": "Password", + "remember": "Keep me signed in", + "name_required": "Please tell me what to call you.", + "invalid_email": "That does not look like an email address.", + "password_too_short": "Pick a password of at least $0 characters.", + "invalid_credentials": "Those details do not match a book here.", + "welcome": "Your book is open. Start writing.", + "logged_in": "Welcome back.", + "logged_out": "Your book is closed.", + "saved": "Saved.", + "settings": "Settings", + "language": "Language", + "timezone": "Time zone" + }, + "book": { + "title": "MyThoughts", + "tagline": "Your thoughts, on paper.", + "write_here": "Write here…", + "first_page": "This is the first page of your book.", + "no_entry_yet": "Nothing was written around that date.", + "entry_deleted": "That entry was torn out.", + "entries": "Entries", + "bookmarks": "Bookmarks", + "loading": "Turning pages…", + "today": "Today", + "go_to_writing": "Back to today's page", + "empty_entry": "Blank page" + }, + "action": { + "prev_page": "Previous page", + "next_page": "Next page", + "calendar": "Jump to a date", + "close": "Close", + "save": "Save", + "delete": "Tear out this entry", + "confirm_delete": "Tear out the entry of $0? This cannot be undone." + }, + "save": { + "saving": "Saving…", + "saved": "Saved $0", + "pending": "Unsaved changes", + "failed": "Could not save", + "just_now": "just now" + } +} diff --git a/resources/lang/fr.json b/resources/lang/fr.json new file mode 100644 index 0000000..442dd0f --- /dev/null +++ b/resources/lang/fr.json @@ -0,0 +1,66 @@ +{ + "meta": { + "locale": "fr_FR", + "page_desc": "Un endroit calme pour écrire. Vos pensées, sur le papier." + }, + "error": { + "no_auth": "Il faut être connecté pour faire ça.", + "not_found": "Ça n'existe pas.", + "no_data": "Rien à afficher pour l'instant.", + "commit_db": "Enregistrement impossible. Réessayez.", + "network": "Serveur injoignable. Votre texte est gardé en local jusqu'à son retour.", + "unexpected": "Quelque chose s'est mal passé." + }, + "account": { + "sign_in": "Se connecter", + "sign_up": "Créer un compte", + "sign_out": "Se déconnecter", + "have_account": "Vous avez déjà un carnet ?", + "no_account": "Commencer un carnet", + "name": "Votre nom", + "email": "Email", + "password": "Mot de passe", + "remember": "Rester connecté", + "name_required": "Dites-moi comment vous appeler.", + "invalid_email": "Cette adresse email n'a pas l'air valide.", + "password_too_short": "Choisissez un mot de passe d'au moins $0 caractères.", + "invalid_credentials": "Ces informations ne correspondent à aucun carnet.", + "welcome": "Votre carnet est ouvert. À vous d'écrire.", + "logged_in": "Content de vous revoir.", + "logged_out": "Votre carnet est refermé.", + "saved": "Enregistré.", + "settings": "Réglages", + "language": "Langue", + "timezone": "Fuseau horaire" + }, + "book": { + "title": "MyThoughts", + "tagline": "Vos pensées, sur le papier.", + "write_here": "Écrivez ici…", + "first_page": "C'est la première page de votre carnet.", + "no_entry_yet": "Rien n'a été écrit autour de cette date.", + "entry_deleted": "Cette page a été arrachée.", + "entries": "Entrées", + "bookmarks": "Marque-pages", + "loading": "On tourne les pages…", + "today": "Aujourd'hui", + "go_to_writing": "Revenir à la page du jour", + "empty_entry": "Page blanche" + }, + "action": { + "prev_page": "Page précédente", + "next_page": "Page suivante", + "calendar": "Aller à une date", + "close": "Fermer", + "save": "Enregistrer", + "delete": "Arracher cette page", + "confirm_delete": "Arracher l'entrée du $0 ? C'est irréversible." + }, + "save": { + "saving": "Enregistrement…", + "saved": "Enregistré $0", + "pending": "Modifications non enregistrées", + "failed": "Enregistrement impossible", + "just_now": "à l'instant" + } +} diff --git a/resources/masks/index.html b/resources/masks/index.html new file mode 100644 index 0000000..0a9a35c --- /dev/null +++ b/resources/masks/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + [#]title[#] + + + + + + + + + +
+ + diff --git a/scripts/functions.js b/scripts/functions.js deleted file mode 100755 index 35f050a..0000000 --- a/scripts/functions.js +++ /dev/null @@ -1,588 +0,0 @@ -function emptyBox(element, text) -{ - //var textarea = $('#thoughts_form textarea[name="thoughts"]'); - if(element.value == text) - { - element.value = ''; - } - else if(element.value == '') - { - element.value = text; - } -} - -function setHeight(element) -{ - var padtext = element.value; - var height = Math.max(300, 130 + Math.round((padtext.length / 85 + padtext.split("\n").length) * 20)); - //alert(height); - element.style.height = height+'px'; -} - -function goTo(url) -{ - window.location.href = url; -} - -function addInput(form, name, type, value) -{ - var registerInput = document.createElement('input'); - registerInput.setAttribute('type', type); - registerInput.setAttribute('name', name); - registerInput.setAttribute('value', value); - document.forms[form].appendChild(registerInput); -} - -/* -texts = new Object(); -texts['thoughts'] = 'Talk to me.'; -texts['login'] = 'Nickname'; -texts['pass'] = 'Password'; - -window.onload = function () -{ - for (i in texts) - { - var id = document.getElementById(i); - if(id) - { - id.addEventListener('focus', function() {emptyBox(this, texts[this.name]);}, false); - id.addEventListener('blur', function() {emptyBox(this, texts[this.name]);}, false); - } - } -}; -*/ - -function getInfo(action, fOnSuccess, vars, fOnError, sType/*, bProcessIcon*/) -{ - if(!vars) vars = {}; - sType = sType || 'GET'; - //bProcessIcon = bProcessIcon || false; - //if(bProcessIcon) self.addBufferIcon(); - - vars['a'] = action; - $.ajax( - { - url: oMyThoughts.consts.context.process_page, - type:sType, - data: vars, - dataType: 'json' - }) - .done(function(oData) - { - if(oData.result==oMyThoughts.consts.error) - { - if(!fOnError) console.log(oData.desc); - else fOnError(oData.desc); - } - else - { - //if(bProcessIcon) self.resetIcon(); - fOnSuccess(oData); - } - }) - .fail(function(jqXHR, textStatus, errorThrown) - { - //if(bProcessIcon) self.resetIcon(); - if(!fOnError) console.log(textStatus+' '+errorThrown); - else fOnError(textStatus); - }); -} - -function feedback(sClass, sMsg, $Box) -{ - $Box = $Box || $('#feedback'); - sMsg = sMsg || ''; - var sHeight = 20; - $('.feedback').each(function(){sHeight += $(this).outerHeight() + 10;}); - if(sClass=='error' && sMsg=='') sMsg = 'Oops ! An unknown error occured'; - $('', {'class':'feedback round '+sClass}) - .css('top', sHeight+'px') - //.append($('', {'class':'fa fa-standalone fa-'+sClass})) - .append(addPunctuation(sMsg)) - .appendTo($Box) - .slideDown('fast') - .delay(5000) - .slideUp('fast', function(){$(this).remove();}); -}; - -function addPunctuation(sMsg) -{ - var asPunctuations = ['?', '!', '.', ',', ':', ';', '-', '/']; - return sMsg+($.inArray(sMsg.slice(-1), asPunctuations)==-1?'.':''); -}; - -function copyArray(asArray) -{ - return asArray.slice(0); //trick to copy array -} - -$.prototype.addButton = function(sType, sTitle, oClickLink, sId, sButtonClass) -{ - $This = $(this); - var asAttributes = {id:(sId || ''), - 'class':'main-button fa-stack fa-lg'+(typeof sButtonClass != 'undefined'?' '+sButtonClass:''), - title:sTitle}; - - //Link - var bLink = (typeof oClickLink == 'string'); - if(bLink) - { - asAttributes.href = oClickLink; - //asAttributes.target = '_blank'; - } - var $Button = $('', asAttributes) - .append($('', {'class':'fa fa-circle fa-stack-2x'})) - .append($('', {'class':'fa fa-stack-1x fa-inverse fa-'+sType})) - //.append($('', {'class':'value'}).text(sTitle)) - .appendTo($This); - - //Function - if(!bLink) $Button.click(function(e){e.preventDefault(); oClickLink($(this));}); - - return $This; -}; - - -$.prototype.addDefaultValue = function(sDefaultValue, sInitValue) -{ - sInitValue = sInitValue || ''; - return $(this) - .data('default_value', sDefaultValue) - .val(sInitValue==''?sDefaultValue:sInitValue) - .addClass(sInitValue==''?'default_text':'') - .focus(function() - { - var $This = $(this); - if($This.val() == $This.data('default_value')) $This.val(''); - $This.removeClass('default_text'); - }) - .blur(function() - { - var $This = $(this); - if($This.val() == '') $This.val($This.data('default_value')).addClass('default_text'); - }); -}; - -$.prototype.checkForm = function(sSelector) -{ - sSelector = sSelector || 'input[type="password"], input[type="text"], textarea'; - var $This = $(this); - var bOk = true; - $This.find(sSelector).each(function() - { - $This = $(this); - bOk = bOk && $This.val()!='' && $This.val()!=$This.data('default_value'); - }); - return bOk; -}; - -$.fn.toEm = function(settings){ - settings = jQuery.extend({ - scope: 'body' - }, settings); - var that = parseInt(this[0],10), - scopeTest = jQuery('
 
').appendTo(settings.scope), - scopeVal = scopeTest.height(); - scopeTest.remove(); - return (that / scopeVal).toFixed(8) + 'em'; -}; - -$.fn.toPx = function(settings){ - settings = jQuery.extend({ - scope: 'body' - }, settings); - var that = parseFloat(this[0]), - scopeTest = jQuery('
 
').appendTo(settings.scope), - scopeVal = scopeTest.height(); - scopeTest.remove(); - return Math.round(that * scopeVal) + 'px'; -}; - -function getElem(anchor, path) -{ - return (typeof path == 'object' && path.length > 1)?getElem(anchor[path.shift()], path):anchor[(typeof path == 'object')?path.shift():path]; -} - -function setElem(anchor, path, value) -{ - if(typeof path == 'object' && path.length > 1) - { - var nextlevel = path.shift(); - if(typeof anchor[nextlevel] === 'undefined') anchor[nextlevel] = {}; - if(typeof anchor[nextlevel] !== 'object') console.log('Error - setElem() : Already existing path at level'+nextlevel+'. Cancelling setElem() action'); - return setElem(anchor[nextlevel], path, value); - } - else return anchor[(typeof path == 'object')?path.shift():path] = value; -} - -function getLoginToken(sPass) -{ - if(!window.location.origin) window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); - return md5(sPass+window.location.origin+window.location.pathname); -} - -var defaultDiacriticsRemovalap = [ - {'base':'A', 'letters':'\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F'}, - {'base':'AA','letters':'\uA732'}, - {'base':'AE','letters':'\u00C6\u01FC\u01E2'}, - {'base':'AO','letters':'\uA734'}, - {'base':'AU','letters':'\uA736'}, - {'base':'AV','letters':'\uA738\uA73A'}, - {'base':'AY','letters':'\uA73C'}, - {'base':'B', 'letters':'\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181'}, - {'base':'C', 'letters':'\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E'}, - {'base':'D', 'letters':'\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779'}, - {'base':'DZ','letters':'\u01F1\u01C4'}, - {'base':'Dz','letters':'\u01F2\u01C5'}, - {'base':'E', 'letters':'\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E'}, - {'base':'F', 'letters':'\u0046\u24BB\uFF26\u1E1E\u0191\uA77B'}, - {'base':'G', 'letters':'\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E'}, - {'base':'H', 'letters':'\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D'}, - {'base':'I', 'letters':'\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197'}, - {'base':'J', 'letters':'\u004A\u24BF\uFF2A\u0134\u0248'}, - {'base':'K', 'letters':'\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2'}, - {'base':'L', 'letters':'\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780'}, - {'base':'LJ','letters':'\u01C7'}, - {'base':'Lj','letters':'\u01C8'}, - {'base':'M', 'letters':'\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C'}, - {'base':'N', 'letters':'\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4'}, - {'base':'NJ','letters':'\u01CA'}, - {'base':'Nj','letters':'\u01CB'}, - {'base':'O', 'letters':'\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C'}, - {'base':'OI','letters':'\u01A2'}, - {'base':'OO','letters':'\uA74E'}, - {'base':'OU','letters':'\u0222'}, - {'base':'OE','letters':'\u008C\u0152'}, - {'base':'oe','letters':'\u009C\u0153'}, - {'base':'P', 'letters':'\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754'}, - {'base':'Q', 'letters':'\u0051\u24C6\uFF31\uA756\uA758\u024A'}, - {'base':'R', 'letters':'\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782'}, - {'base':'S', 'letters':'\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784'}, - {'base':'T', 'letters':'\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786'}, - {'base':'TZ','letters':'\uA728'}, - {'base':'U', 'letters':'\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244'}, - {'base':'V', 'letters':'\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245'}, - {'base':'VY','letters':'\uA760'}, - {'base':'W', 'letters':'\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72'}, - {'base':'X', 'letters':'\u0058\u24CD\uFF38\u1E8A\u1E8C'}, - {'base':'Y', 'letters':'\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE'}, - {'base':'Z', 'letters':'\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762'}, - {'base':'a', 'letters':'\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250'}, - {'base':'aa','letters':'\uA733'}, - {'base':'ae','letters':'\u00E6\u01FD\u01E3'}, - {'base':'ao','letters':'\uA735'}, - {'base':'au','letters':'\uA737'}, - {'base':'av','letters':'\uA739\uA73B'}, - {'base':'ay','letters':'\uA73D'}, - {'base':'b', 'letters':'\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253'}, - {'base':'c', 'letters':'\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184'}, - {'base':'d', 'letters':'\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A'}, - {'base':'dz','letters':'\u01F3\u01C6'}, - {'base':'e', 'letters':'\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD'}, - {'base':'f', 'letters':'\u0066\u24D5\uFF46\u1E1F\u0192\uA77C'}, - {'base':'g', 'letters':'\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F'}, - {'base':'h', 'letters':'\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265'}, - {'base':'hv','letters':'\u0195'}, - {'base':'i', 'letters':'\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131'}, - {'base':'j', 'letters':'\u006A\u24D9\uFF4A\u0135\u01F0\u0249'}, - {'base':'k', 'letters':'\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3'}, - {'base':'l', 'letters':'\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747'}, - {'base':'lj','letters':'\u01C9'}, - {'base':'m', 'letters':'\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F'}, - {'base':'n', 'letters':'\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5'}, - {'base':'nj','letters':'\u01CC'}, - {'base':'o', 'letters':'\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275'}, - {'base':'oi','letters':'\u01A3'}, - {'base':'ou','letters':'\u0223'}, - {'base':'oo','letters':'\uA74F'}, - {'base':'p','letters':'\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755'}, - {'base':'q','letters':'\u0071\u24E0\uFF51\u024B\uA757\uA759'}, - {'base':'r','letters':'\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783'}, - {'base':'s','letters':'\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B'}, - {'base':'t','letters':'\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787'}, - {'base':'tz','letters':'\uA729'}, - {'base':'u','letters': '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289'}, - {'base':'v','letters':'\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C'}, - {'base':'vy','letters':'\uA761'}, - {'base':'w','letters':'\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73'}, - {'base':'x','letters':'\u0078\u24E7\uFF58\u1E8B\u1E8D'}, - {'base':'y','letters':'\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF'}, - {'base':'z','letters':'\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763'} -]; - -var diacriticsMap = {}; -for (var i=0; i < defaultDiacriticsRemovalap.length; i++) -{ - var letters = defaultDiacriticsRemovalap[i].letters; - for (var j=0; j < letters.length ; j++) diacriticsMap[letters[j]] = defaultDiacriticsRemovalap[i].base; -} - -// "what?" version ... http://jsperf.com/diacritics/12 -function removeDiacritics(str) -{ - return str.replace(/[^\u0000-\u007E]/g, function(a) - { - return diacriticsMap[a] || a; - }); -} - -function md5(str) -{ - var xl; - - var rotateLeft = function (lValue, iShiftBits) { - return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); - }; - - var addUnsigned = function (lX, lY) { - var lX4, lY4, lX8, lY8, lResult; - lX8 = (lX & 0x80000000); - lY8 = (lY & 0x80000000); - lX4 = (lX & 0x40000000); - lY4 = (lY & 0x40000000); - lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); - if (lX4 & lY4) { - return (lResult ^ 0x80000000 ^ lX8 ^ lY8); - } - if (lX4 | lY4) { - if (lResult & 0x40000000) { - return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); - } else { - return (lResult ^ 0x40000000 ^ lX8 ^ lY8); - } - } else { - return (lResult ^ lX8 ^ lY8); - } - }; - - var _F = function (x, y, z) { - return (x & y) | ((~x) & z); - }; - var _G = function (x, y, z) { - return (x & z) | (y & (~z)); - }; - var _H = function (x, y, z) { - return (x ^ y ^ z); - }; - var _I = function (x, y, z) { - return (y ^ (x | (~z))); - }; - - var _FF = function (a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(_F(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var _GG = function (a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(_G(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var _HH = function (a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(_H(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var _II = function (a, b, c, d, x, s, ac) { - a = addUnsigned(a, addUnsigned(addUnsigned(_I(b, c, d), x), ac)); - return addUnsigned(rotateLeft(a, s), b); - }; - - var convertToWordArray = function (str) { - var lWordCount; - var lMessageLength = str.length; - var lNumberOfWords_temp1 = lMessageLength + 8; - var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; - var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; - var lWordArray = new Array(lNumberOfWords - 1); - var lBytePosition = 0; - var lByteCount = 0; - while (lByteCount < lMessageLength) { - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = (lWordArray[lWordCount] | (str.charCodeAt(lByteCount) << lBytePosition)); - lByteCount++; - } - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); - lWordArray[lNumberOfWords - 2] = lMessageLength << 3; - lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; - return lWordArray; - }; - - var wordToHex = function (lValue) { - var wordToHexValue = '', - wordToHexValue_temp = '', - lByte, lCount; - for (lCount = 0; lCount <= 3; lCount++) { - lByte = (lValue >>> (lCount * 8)) & 255; - wordToHexValue_temp = '0' + lByte.toString(16); - wordToHexValue = wordToHexValue + wordToHexValue_temp.substr(wordToHexValue_temp.length - 2, 2); - } - return wordToHexValue; - }; - - var x = [], - k, AA, BB, CC, DD, a, b, c, d, S11 = 7, - S12 = 12, - S13 = 17, - S14 = 22, - S21 = 5, - S22 = 9, - S23 = 14, - S24 = 20, - S31 = 4, - S32 = 11, - S33 = 16, - S34 = 23, - S41 = 6, - S42 = 10, - S43 = 15, - S44 = 21; - - str = utf8_encode(str); - x = convertToWordArray(str); - a = 0x67452301; - b = 0xEFCDAB89; - c = 0x98BADCFE; - d = 0x10325476; - - xl = x.length; - for (k = 0; k < xl; k += 16) { - AA = a; - BB = b; - CC = c; - DD = d; - a = _FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); - d = _FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); - c = _FF(c, d, a, b, x[k + 2], S13, 0x242070DB); - b = _FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); - a = _FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); - d = _FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); - c = _FF(c, d, a, b, x[k + 6], S13, 0xA8304613); - b = _FF(b, c, d, a, x[k + 7], S14, 0xFD469501); - a = _FF(a, b, c, d, x[k + 8], S11, 0x698098D8); - d = _FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); - c = _FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); - b = _FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); - a = _FF(a, b, c, d, x[k + 12], S11, 0x6B901122); - d = _FF(d, a, b, c, x[k + 13], S12, 0xFD987193); - c = _FF(c, d, a, b, x[k + 14], S13, 0xA679438E); - b = _FF(b, c, d, a, x[k + 15], S14, 0x49B40821); - a = _GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); - d = _GG(d, a, b, c, x[k + 6], S22, 0xC040B340); - c = _GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); - b = _GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); - a = _GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); - d = _GG(d, a, b, c, x[k + 10], S22, 0x2441453); - c = _GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); - b = _GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); - a = _GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); - d = _GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); - c = _GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); - b = _GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); - a = _GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); - d = _GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); - c = _GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); - b = _GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); - a = _HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); - d = _HH(d, a, b, c, x[k + 8], S32, 0x8771F681); - c = _HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); - b = _HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); - a = _HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); - d = _HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); - c = _HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); - b = _HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); - a = _HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); - d = _HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); - c = _HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); - b = _HH(b, c, d, a, x[k + 6], S34, 0x4881D05); - a = _HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); - d = _HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); - c = _HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); - b = _HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); - a = _II(a, b, c, d, x[k + 0], S41, 0xF4292244); - d = _II(d, a, b, c, x[k + 7], S42, 0x432AFF97); - c = _II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); - b = _II(b, c, d, a, x[k + 5], S44, 0xFC93A039); - a = _II(a, b, c, d, x[k + 12], S41, 0x655B59C3); - d = _II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); - c = _II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); - b = _II(b, c, d, a, x[k + 1], S44, 0x85845DD1); - a = _II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); - d = _II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); - c = _II(c, d, a, b, x[k + 6], S43, 0xA3014314); - b = _II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); - a = _II(a, b, c, d, x[k + 4], S41, 0xF7537E82); - d = _II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); - c = _II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); - b = _II(b, c, d, a, x[k + 9], S44, 0xEB86D391); - a = addUnsigned(a, AA); - b = addUnsigned(b, BB); - c = addUnsigned(c, CC); - d = addUnsigned(d, DD); - } - - var temp = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d); - - return temp.toLowerCase(); -} - -function utf8_encode(argString) -{ - if (argString === null || typeof argString === 'undefined') { - return ''; - } - - // .replace(/\r\n/g, "\n").replace(/\r/g, "\n"); - var string = (argString + ''); - var utftext = '', - start, end, stringl = 0; - - start = end = 0; - stringl = string.length; - for (var n = 0; n < stringl; n++) { - var c1 = string.charCodeAt(n); - var enc = null; - - if (c1 < 128) { - end++; - } else if (c1 > 127 && c1 < 2048) { - enc = String.fromCharCode( - (c1 >> 6) | 192, (c1 & 63) | 128 - ); - } else if ((c1 & 0xF800) != 0xD800) { - enc = String.fromCharCode( - (c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128 - ); - } else { - // surrogate pairs - if ((c1 & 0xFC00) != 0xD800) { - throw new RangeError('Unmatched trail surrogate at ' + n); - } - var c2 = string.charCodeAt(++n); - if ((c2 & 0xFC00) != 0xDC00) { - throw new RangeError('Unmatched lead surrogate at ' + (n - 1)); - } - c1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000; - enc = String.fromCharCode( - (c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128 - ); - } - if (enc !== null) { - if (end > start) { - utftext += string.slice(start, end); - } - utftext += enc; - start = end = n + 1; - } - } - - if (end > start) { - utftext += string.slice(start, stringl); - } - - return utftext; -} \ No newline at end of file diff --git a/scripts/jquery-te-1.4.0.min.js b/scripts/jquery-te-1.4.0.min.js deleted file mode 100755 index 6e9f58d..0000000 --- a/scripts/jquery-te-1.4.0.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * - * jQuery TE 1.4.0 , http://jqueryte.com/ - * Copyright (C) 2013, Fatih Koca (fattih@fattih.com), (http://jqueryte.com/about) - - * jQuery TE is provided under the MIT LICENSE. - * -*/ -(function(e){e.fn.jqte=function(t){function l(e,t,n,r,i){var s=f.length+1;return f.push({name:e,cls:s,command:t,key:n,tag:r,emphasis:i})}var n=[{title:"Text Format"},{title:"Font Size"},{title:"Color"},{title:"Bold",hotkey:"B"},{title:"Italic",hotkey:"I"},{title:"Underline",hotkey:"U"},{title:"Ordered List",hotkey:"."},{title:"Unordered List",hotkey:","},{title:"Subscript",hotkey:"down arrow"},{title:"Superscript",hotkey:"up arrow"},{title:"Outdent",hotkey:"left arrow"},{title:"Indent",hotkey:"right arrow"},{title:"Justify Left"},{title:"Justify Center"},{title:"Justify Right"},{title:"Strike Through",hotkey:"K"},{title:"Add Link",hotkey:"L"},{title:"Remove Link"},{title:"Cleaner Style",hotkey:"Delete"},{title:"Horizontal Rule",hotkey:"H"},{title:"Source"}];var r=[["p","Normal"],["h1","Header 1"],["h2","Header 2"],["h3","Header 3"],["h4","Header 4"],["h5","Header 5"],["h6","Header 6"],["pre","Preformatted"]];var i=["10","12","16","18","20","24","28"];var s=["0,0,0","68,68,68","102,102,102","153,153,153","204,204,204","238,238,238","243,243,243","255,255,255",null,"255,0,0","255,153,0","255,255,0","0,255,0","0,255,255","0,0,255","153,0,255","255,0,255",null,"244,204,204","252,229,205","255,242,204","217,234,211","208,224,227","207,226,243","217,210,233","234,209,220","234,153,153","249,203,156","255,229,153","182,215,168","162,196,201","159,197,232","180,167,214","213,166,189","224,102,102","246,178,107","255,217,102","147,196,125","118,165,175","111,168,220","142,124,195","194,123,160","204,0,0","230,145,56","241,194,50","106,168,79","69,129,142","61,133,198","103,78,167","166,77,121","153,0,0","180,95,6","191,144,0","56,118,29","19,79,92","11,83,148","53,28,117","116,27,71","102,0,0","120,63,4","127,96,0","39,78,19","12,52,61","7,55,99","32,18,77","76,17,48"];var o=["Web Address","E-mail Address","Picture URL"];var u=e.extend({status:true,css:"jqte",title:true,titletext:n,button:"OK",format:true,formats:r,fsize:true,fsizes:i,funit:"px",color:true,linktypes:o,b:true,i:true,u:true,ol:true,ul:true,sub:true,sup:true,outdent:true,indent:true,left:true,center:true,right:true,strike:true,link:true,unlink:true,remove:true,rule:true,source:true,placeholder:false,br:true,p:true,change:"",focus:"",blur:""},t);e.fn.jqteVal=function(t){e(this).closest("."+u.css).find("."+u.css+"_editor").html(t)};var a=navigator.userAgent.toLowerCase();if(/msie [1-7]./.test(a))u.title=false;var f=[];l("format","formats","","",false);l("fsize","fSize","","",false);l("color","colors","","",false);l("b","Bold","B",["b","strong"],true);l("i","Italic","I",["i","em"],true);l("u","Underline","U",["u"],true);l("ol","insertorderedlist","¾",["ol"],true);l("ul","insertunorderedlist","¼",["ul"],true);l("sub","subscript","(",["sub"],true);l("sup","superscript","&",["sup"],true);l("outdent","outdent","%",["blockquote"],false);l("indent","indent","'",["blockquote"],true);l("left","justifyLeft","","",false);l("center","justifyCenter","","",false);l("right","justifyRight","","",false);l("strike","strikeThrough","K",["strike"],true);l("link","linkcreator","L",["a"],true);l("unlink","unlink","",["a"],false);l("remove","removeformat",".","",false);l("rule","inserthorizontalrule","H",["hr"],false);l("source","displaysource","","",false);return this.each(function(){function B(){if(window.getSelection)return window.getSelection();else if(document.selection&&document.selection.createRange&&document.selection.type!="None")return document.selection.createRange()}function j(e,t){var n,r=B();if(window.getSelection){if(r.anchorNode&&r.getRangeAt)n=r.getRangeAt(0);if(n){r.removeAllRanges();r.addRange(n)}if(!a.match(/msie/))document.execCommand("StyleWithCSS",false,false);document.execCommand(e,false,t)}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection.createRange();n.execCommand(e,false,t)}q(false,false)}function F(t,n,r){if(v.not(":focus"))v.focus();if(window.getSelection){var i=B(),s,o,u;if(i.anchorNode&&i.getRangeAt){s=i.getRangeAt(0);o=document.createElement(t);e(o).attr(n,r);u=s.extractContents();o.appendChild(u);s.insertNode(o);i.removeAllRanges();if(n=="style")q(e(o),r);else q(e(o),false)}}else if(document.selection&&document.selection.createRange&&document.selection.type!="None"){var a=document.selection.createRange();var f=a.htmlText;var l="<"+t+" "+n+'="'+r+'">'+f+"";document.selection.createRange().pasteHTML(l)}}function q(e,t){var n=I();n=n?n:e;if(n&&t==false){if(n.parent().is("[style]"))n.attr("style",n.parent().attr("style"));if(n.is("[style]"))n.find("*").attr("style",n.attr("style"))}else if(e&&t&&e.is("[style]")){var r=t.split(";");r=r[0].split(":");if(e.is("[style*="+r[0]+"]"))e.find("*").css(r[0],r[1]);R(e)}}function R(t){if(t){var t=t[0];if(document.body.createTextRange){var n=document.body.createTextRange();n.moveToElementText(t);n.select()}else if(window.getSelection){var r=window.getSelection();var n=document.createRange();if(t!="undefined"&&t!=null){n.selectNodeContents(t);r.removeAllRanges();r.addRange(n);if(e(t).is(":empty")){e(t).append(" ");R(e(t))}}}}}function U(){if(!p.data("sourceOpened")){var t=I();var n="http://";W(true);if(t){var r=t.prop("tagName").toLowerCase();if(r=="a"&&t.is("[href]")){n=t.attr("href");t.attr(S,"")}else F("a",S,"")}else y.val(n).focus();g.click(function(t){if(e(t.target).hasClass(u.css+"_linktypetext")||e(t.target).hasClass(u.css+"_linktypearrow"))X(true)});w.find("a").click(function(){var t=e(this).attr(u.css+"-linktype");w.data("linktype",t);E.find("."+u.css+"_linktypetext").html(w.find("a:eq("+w.data("linktype")+")").text());V(n);X()});V(n);y.focus().val(n).bind("keypress keyup",function(e){if(e.keyCode==13){z(h.find("["+S+"]"));return false}});b.click(function(){z(h.find("["+S+"]"))})}else W(false)}function z(t){y.focus();R(t);t.removeAttr(S);if(w.data("linktype")!="2")j("createlink",y.val());else{j("insertImage",y.val());v.find("img").each(function(){var t=e(this).prev("a");var n=e(this).next("a");if(t.length>0&&t.html()=="")t.remove();else if(n.length>0&&n.html()=="")n.remove()})}W();v.trigger("change")}function W(e){Q("["+S+"]:not([href])");h.find("["+S+"][href]").removeAttr(S);if(e){p.data("linkOpened",true);d.show()}else{p.data("linkOpened",false);d.hide()}X()}function X(e){if(e)w.show();else w.hide()}function V(e){var t=w.data("linktype");if(t=="1"&&(y.val()=="http://"||y.is("[value^=http://]")||!y.is("[value^=mailto]")))y.val("mailto:");else if(t!="1"&&!y.is("[value^=http://]"))y.val("http://");else y.val(e)}function J(t){if(!p.data("sourceOpened")){if(t=="fSize")styleField=P;else if(t=="colors")styleField=H;K(styleField,true);styleField.find("a").unbind("click").click(function(){var n=e(this).attr(u.css+"-styleval");if(t=="fSize"){styleType="font-size";n=n+u.funit}else if(t=="colors"){styleType="color";n="rgb("+n+")"}var r=G(styleType);F("span","style",styleType+":"+n+";"+r);K("",false);e("."+u.css+"_title").remove();v.trigger("change")})}else K(styleField,false);W(false)}function K(e,t){var n="",r=[{d:"fsizeOpened",f:P},{d:"cpallOpened",f:H}];if(e!=""){for(var i=0;i");Z(false)})}function Z(e){var t=e?true:false;t=e&&D.data("status")?true:false;if(t||!e)D.data("status",false).slideUp(200);else D.data("status",true).slideDown(200)}function et(e){var t=D.closest("."+u.css+"_tool").find("."+u.css+"_tool_label").find("."+u.css+"_tool_text");if(e.length>10)e=e.substr(0,7)+"...";t.html(e)}function tt(e){var t,n,r;t=e.replace(/\n/gim,"").replace(/\r/gim,"").replace(/\t/gim,"").replace(/ /gim," ");n=[/\(.*?)<\/span><\/span>/gim,/<(\w*[^p])\s*[^\/>]*>\s*<\/\1>/gim,/\(.*?)\<\/div>/gim,/\(.*?)\<\/strong>/gim,/\(.*?)\<\/em>/gim];r=["$3
","","$2

","$2","$2
"];for(A=0;A<5;A++){for(var i=0;i(.*?)\<\/p>/ig,"
$2");if(!u.br){n=[/\
(.*?)/ig,/\(.*?)/ig];r=["

$1

","

$1

"];for(var i=0;i(.*?)\<\/p>/ig,"
$1
");return t}function nt(){var e=v.text()==""&&v.html().length<12?"":v.html();l.val(tt(e))}function rt(){v.html(tt(l.val()))}function it(t){var n=false,r=I(),i;if(r){e.each(t,function(t,s){i=r.prop("tagName").toLowerCase();if(i==s)n=true;else{r.parents().each(function(){i=e(this).prop("tagName").toLowerCase();if(i==s)n=true})}});return n}else return false}function st(t){for(var n=0;n0&&it(s)){et(u.formats[i][1]);r=true;break}}if(!r)et(u.formats[0][1])}K("",false);Z(false)}if(!e(this).data("jqte")||e(this).data("jqte")==null||e(this).data("jqte")=="undefined")e(this).data("jqte",true);else e(this).data("jqte",false);if(!u.status||!e(this).data("jqte")){if(e(this).closest("."+u.css).length>0){var t=e(this).closest("."+u.css).find("."+u.css+"_editor").html();var n="";e(e(this)[0].attributes).each(function(){if(this.nodeName!="style")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});var r=e(this).is("[data-origin]")&&e(this).attr("data-origin")!=""?e(this).attr("data-origin"):"textarea";var i=">"+t;if(r=="input"||r=="option"){t=t.replace(/"/g,""").replace(/'/g,"'").replace(//g,">");i='value="'+t+'">'}var o=e(this).clone();e(this).data("jqte",false).closest("."+u.css).before(o).remove();o.replaceWith("<"+r+n+i+"")}return}var l=e(this);var r=e(this).prop("tagName").toLowerCase();e(this).attr("data-origin",r);var c=e(this).is("[value]")||r=="textarea"?e(this).val():e(this).html();c=c.replace(/"/g,'"').replace(/'/g,"'").replace(//g,">").replace(/&/g,"&");e(this).after('
');var h=e(this).next("."+u.css);h.html('
');var p=h.find("."+u.css+"_toolbar");var d=h.find("."+u.css+"_linkform");var v=h.find("."+u.css+"_editor");var m=u.css+"_tool_depressed";d.append('
'+u.button+'
');var g=d.find("."+u.css+"_linktypeselect");var y=d.find("."+u.css+"_linkinput");var b=d.find("."+u.css+"_linkbutton");g.append('
');var w=g.find("."+u.css+"_linktypes");var E=g.find("."+u.css+"_linktypeview");var S=u.css+"-setlink";v.after('
');var x=h.find("."+u.css+"_source");l.appendTo(x);if(r!="textarea"){var n="";e(l[0].attributes).each(function(){if(this.nodeName!="type"&&this.nodeName!="value")n=n+" "+this.nodeName+'="'+this.nodeValue+'"'});l.replaceWith("");l=x.find("textarea")}v.attr("contenteditable","true").html(c);for(var T=0;T0?u.titletext[T].hotkey!=null&&u.titletext[T].hotkey!="undefined"&&u.titletext[T].hotkey!=""?" (Ctrl+"+u.titletext[T].hotkey+")":"":"";var C=u.titletext[T].title!=null&&u.titletext[T].title!="undefined"&&u.titletext[T].title!=""?u.titletext[T].title+N:"";p.append('
');p.find("."+u.css+"_tool[data-tool="+T+"]").data({tag:f[T].tag,command:f[T].command,emphasis:f[T].emphasis,title:C});if(f[T].name=="format"&&e.isArray(u.formats)){var k=u.formats[0][1].length>0&&u.formats[0][1]!="undefined"?u.formats[0][1]:"";p.find("."+u.css+"_tool_"+f[T].cls).find("."+u.css+"_tool_icon").replaceWith(''+k+'');p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var L=0;L'+u.formats[L][1]+"")}p.find("."+u.css+"_formats").data("status",false)}else if(f[T].name=="fsize"&&e.isArray(u.fsizes)){p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var L=0;LAbcdefgh...')}}else if(f[T].name=="color"&&e.isArray(s)){p.find("."+u.css+"_tool_"+f[T].cls).append('
');for(var A=0;A');else p.find("."+u.css+"_cpalette").append('
')}}}}w.data("linktype","0");for(var T=0;T<3;T++){w.append("'+u.linktypes[T]+"");E.html('
'+w.find("a:eq("+w.data("linktype")+")").text()+"
")}var O="";if(/msie/.test(a))O="-ms-";else if(/chrome/.test(a)||/safari/.test(a)||/yandex/.test(a))O="-webkit-";else if(/mozilla/.test(a))O="-moz-";else if(/opera/.test(a))O="-o-";else if(/konqueror/.test(a))O="-khtml-";else O="";if(u.placeholder&&u.placeholder!=""){h.prepend('
'+u.placeholder+"
");var M=h.find("."+u.css+"_placeholder");M.click(function(){v.focus()})}h.find("[unselectable]").css(O+"user-select","none").addClass("unselectable").attr("unselectable","on").on("selectstart mousedown",false);var _=p.find("."+u.css+"_tool");var D=p.find("."+u.css+"_formats");var P=p.find("."+u.css+"_fontsizes");var H=p.find("."+u.css+"_cpalette");var I=function(){var t,n;if(window.getSelection){n=getSelection();t=n.anchorNode}if(!t&&document.selection&&document.selection.createRange&&document.selection.type!="None"){n=document.selection;var r=n.getRangeAt?n.getRangeAt(0):n.createRange();t=r.commonAncestorContainer?r.commonAncestorContainer:r.parentElement?r.parentElement():r.item(0)}if(t){return t.nodeName=="#text"?e(t.parentNode):e(t)}else return false};_.unbind("click").click(function(t){if(e(this).data("command")=="displaysource"&&!p.data("sourceOpened")){p.find("."+u.css+"_tool").addClass(u.css+"_hiddenField");e(this).removeClass(u.css+"_hiddenField");p.data("sourceOpened",true);l.css("height",v.outerHeight());x.removeClass(u.css+"_hiddenField");v.addClass(u.css+"_hiddenField");l.focus();W(false);K("",false);Z();if(u.placeholder&&u.placeholder!="")M.hide()}else{if(!p.data("sourceOpened")){if(e(this).data("command")=="linkcreator"){if(!p.data("linkOpened"))U();else{W(false);Z(false)}}else if(e(this).data("command")=="formats"){if(e(this).data("command")=="formats"&&!e(t.target).hasClass(u.css+"_format"))Y();K("",false);if(v.not(":focus"))v.focus()}else if(e(this).data("command")=="fSize"||e(this).data("command")=="colors"){if(e(this).data("command")=="fSize"&&!e(t.target).hasClass(u.css+"_fontsize")||e(this).data("command")=="colors"&&!e(t.target).hasClass(u.css+"_color"))J(e(this).data("command"));Z(false);if(v.not(":focus"))v.focus()}else{if(v.not(":focus"))v.focus();j(e(this).data("command"),null);K("",false);Z(false);X();e(this).data("emphasis")==true&&!e(this).hasClass(m)?e(this).addClass(m):e(this).removeClass(m);x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}}else{p.data("sourceOpened",false);p.find("."+u.css+"_tool").removeClass(u.css+"_hiddenField");x.addClass(u.css+"_hiddenField");v.removeClass(u.css+"_hiddenField")}if(u.placeholder&&u.placeholder!="")v.html()!=""?M.hide():M.show()}v.trigger("change")}).hover(function(t){if(u.title&&e(this).data("title")!=""&&(e(t.target).hasClass(u.css+"_tool")||e(t.target).hasClass(u.css+"_tool_icon"))){e("."+u.css+"_title").remove();h.append('
'+e(this).data("title")+"
");var n=e("."+u.css+"_title:first");var r=n.find("."+u.css+"_titleArrowIcon");var i=e(this).position();var s=i.left+e(this).outerWidth()-n.outerWidth()/2-e(this).outerWidth()/2;var o=i.top+e(this).outerHeight()+5;n.delay(400).css({top:o,left:s}).fadeIn(200)}},function(){e("."+u.css+"_title").remove()});var ot=null;v.bind("keypress keyup keydown drop cut copy paste DOMCharacterDataModified DOMSubtreeModified",function(){if(!p.data("sourceOpened"))e(this).trigger("change");X();if(e.isFunction(u.change))u.change();if(u.placeholder&&u.placeholder!="")e(this).text()!=""?M.hide():M.show()}).bind("change",function(){if(!p.data("sourceOpened")){clearTimeout(ot);ot=setTimeout(nt,10)}}).keydown(function(e){if(e.ctrlKey){for(var t=0;ta?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ -return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("