- API Analysis
- Python API Client
- Quick Start for Advanced Users
- 1.1. System Dependencies
- 1.2. Creating a Python Virtual Environment (Best Practice)
- 1.3. Installing Script Dependencies
- 2.1. Saving the Script
- 2.2. Making the Script Globally Executable
- 3.1. Finding Your
PHPSESSID
andrkey
- 3.2. Storing Your Credentials Securely
- 3.3. Security Considerations
- 4.1. Global Options
- 4.2. List Commands
- 4.3. Sublist Commands
- 4.4. Task Commands
- 4.5. Interactive REPL Mode
#API Analysis
#1. Authentication Mechanism
The API does not use a visible token in an Authorization
header. Authentication is managed via session cookies that must be included with every API request to the /api/
endpoints.
- Mechanism: Cookie-based session.
- Required Cookies:
PHPSESSID
: The primary PHP session identifier.rkey
: A custom, long-lived key that appears to be essential for maintaining the authenticated session.
- Required Headers: All API calls observed in the HAR file include the
X-Requested-With: XMLHttpRequest
header, indicating they are intended to be called via AJAX. - Note on Login Flow: The provided HAR data does not include the initial login request. Therefore, to use the generated Python client, you must first log in through a web browser, extract the
PHPSESSID
andrkey
cookie values, and provide them to the client.
#2. API Design Patterns
- Request Chaining: The API is designed hierarchically. Creating a child object (like a task) requires the ID of its parent (a sublist), which in turn requires the ID of its parent (a list). A typical workflow is a chain of
add
requests, where the ID from one response is used in the payload of the next. - Response on Creation: When a new object is created (e.g., adding a task), the API’s response body contains the full, updated data of the parent object. For example, adding a task to a sublist returns the entire sublist object, now including the newly created task in its
items
array. The client code must parse this parent object to find the ID of the newly created child.
#3. Endpoint Reference
The following endpoints were identified from the HAR data. All endpoints use the POST
method and are relative to https://prioritylist.app
.
#List & Group Actions
Endpoint | Method | Description |
---|---|---|
POST /api/groups/pull |
POST |
Fetches all list groups and the lists they contain. |
POST /api/list/add |
POST |
Creates a new list. |
POST /api/list/update |
POST |
Updates the name of an existing list. |
POST /api/list/star |
POST |
Toggles the “starred” status of a list. |
POST /api/list/pull |
POST |
Fetches the detailed contents of a specific list. |
POST /api/list/notes |
POST |
Saves or updates the notes for a list. |
POST /api/list/focus |
POST |
Sets a list to “focus” mode. |
POST /api/list/unfocus |
POST |
Removes a list from “focus” mode. |
Payload for POST /api/list/add
| Parameter | Type | Required | Description |
| :— | :— | :— | :— |
| name
| string | Yes | The name of the new list. |
| group_id
| string | No | The ID of the group to add the list to. |
#Sublist Actions
Endpoint | Method | Description |
---|---|---|
POST /api/sublist/add |
POST |
Adds a new sublist to a parent list. |
POST /api/sublist/update |
POST |
Updates the name of an existing sublist. |
POST /api/sublist/show |
POST |
Toggles the visibility of a sublist in the UI. |
POST /api/sublist/reorder |
POST |
Changes the display order of sublists. |
Payload for POST /api/sublist/add
| Parameter | Type | Required | Description |
| :— | :— | :— | :— |
| list_id
| integer | Yes | The ID of the parent list. |
| name
| string | Yes | The name of the new sublist. |
#Item (Task) Actions
Endpoint | Method | Description |
---|---|---|
POST /api/item/add |
POST |
Creates a new task (item) within a sublist. |
POST /api/item/update |
POST |
Updates an existing task. |
POST /api/item/update-name |
POST |
Updates only the name of a task. |
POST /api/subitems/pull |
POST |
Fetches the sub-items for a given parent item. |
Payload for POST /api/item/add
| Parameter | Type | Required | Description |
| :— | :— | :— | :— |
| sublist_id
| integer | Yes | The ID of the parent sublist. |
| name
| string | Yes | The name of the task. |
| score_i
| integer | Yes | Importance score (e.g., 1-10). |
| score_t
| integer | Yes | Urgency/Time score (e.g., 1-10). |
| d_date
| string | No | Due date in YYYY-MM-DD
format. |
| d_time
| string | No | Due time in HH:MM
format. |
| d_zone
| string | No | Timezone offset (e.g., -0300
). |
| dependency_id
| integer | No | The ID of a prerequisite task. |
#Notification & Access Actions
Endpoint | Method | Description |
---|---|---|
POST /api/notifications/all |
POST |
Fetches all notifications. |
POST /api/notifications/count |
POST |
Gets the count of unread notifications. |
POST /api/access/pull |
POST |
Retrieves sharing information for a list. |
POST /api/access/public |
POST |
Toggles the public visibility of a list. |
#Python API Client
The following Python script provides a reusable PriorityListApiClient
class to interact with the API. It is designed to be used with session cookies extracted from a browser.
import requests
import json
from typing import Dict, Any, Optional
class PriorityListApiClient:
"""
A client for interacting with the prioritylist.app API.
This client handles session management via cookies and provides methods for
automating the creation and management of lists, sublists, and tasks.
"""
def __init__(self, phpsessid: str, rkey: str, base_url: str = "https://prioritylist.app"):
"""
Initializes the API client with the necessary authentication cookies.
Args:
phpsessid (str): The PHPSESSID cookie value from a browser session.
rkey (str): The rkey cookie value from a browser session.
base_url (str, optional): The base URL of the API.
"""
self.base_url = base_url.rstrip('/')
self.session = requests.Session()
# Set common headers observed in the HAR file for all requests
self.session.headers.update({
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0",
"Accept": "text/plain, */*; q=0.01",
"X-Requested-With": "XMLHttpRequest",
"Origin": self.base_url
})
# Set the authentication cookies for the session.
self.session.cookies.set("PHPSESSID", phpsessid, domain="prioritylist.app")
self.session.cookies.set("rkey", rkey, domain="prioritylist.app")
def _make_request(self, endpoint: str, data: Optional[Dict[str, Any]] = None) -> Optional[Dict[str, Any]]:
"""
A helper method to make POST requests to the API and handle responses.
Args:
endpoint (str): The API endpoint path (e.g., '/list/add').
data (dict, optional): The form-encoded payload to send.
Returns:
dict: The 'data' field from the JSON response, or None if an error occurs.
"""
url = f"{self.base_url}/api{endpoint}"
try:
response = self.session.post(url, data=data)
response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx)
json_response = response.json()
if json_response.get("result") == "success":
return json_response.get("data")
else:
print(f"API Error at {endpoint}: {json_response.get('result', 'Unknown error')}")
return None
except requests.exceptions.HTTPError as e:
print(f"HTTP Error for {endpoint}: {e.response.status_code} {e.response.reason}")
print(f"Response body: {e.response.text}")
except requests.exceptions.RequestException as e:
print(f"Request failed for {endpoint}: {e}")
except json.JSONDecodeError:
print(f"Failed to decode JSON from response. URL: {url}, Response: {response.text}")
return None
def create_list(self, name: str) -> Optional[Dict[str, Any]]:
"""Creates a new list and returns its data object."""
print(f"Creating list: '{name}'...")
response_data = self._make_request("/list/add", data={"name": name, "group_id": ""})
if response_data:
# WARNING: This assumes the new list is the last in the returned array.
# A more robust solution would filter by name to find the correct list.
try:
new_list = response_data[0]['lists'][-1]
print(f"-> Success! Created list '{name}' with ID: {new_list['id']}")
return new_list
except (IndexError, KeyError):
print("Could not find the new list in the API response.")
return None
def create_sublist(self, list_id: int, name: str) -> Optional[Dict[str, Any]]:
"""Creates a new sublist and returns its data object."""
print(f"Creating sublist '{name}' in list {list_id}...")
response_data = self._make_request("/sublist/add", data={"list_id": list_id, "name": name})
if response_data:
# WARNING: Assumes the new sublist is the last in the array.
try:
new_sublist = response_data['sublists'][-1]
print(f"-> Success! Created sublist '{name}' with ID: {new_sublist['id']}")
return new_sublist
except (IndexError, KeyError):
print("Could not find the new sublist in the API response.")
return None
def create_task(self, sublist_id: int, name: str, importance: int = 5, time_effort: int = 5, **kwargs) -> Optional[Dict[str, Any]]:
"""Creates a new task and returns its data object."""
print(f"Creating task '{name}' in sublist {sublist_id}...")
payload = {
"sublist_id": sublist_id,
"name": name,
"score_i": importance,
"score_t": time_effort,
"d_date": kwargs.get("d_date", ""),
"d_time": kwargs.get("d_time", ""),
"d_zone": "-0300" if kwargs.get("d_date") else "",
"dependency_id": kwargs.get("dependency_id", "")
}
response_data = self._make_request("/item/add", data=payload)
if response_data:
# WARNING: Assumes the new item is the last in the array.
try:
new_item = response_data['items'][-1]
print(f"-> Success! Created task '{name}' with ID: {new_item['id']}")
return new_item
except (IndexError, KeyError):
print("Could not find the new task in the API response.")
return None
def main():
"""
Main function to demonstrate the use of the ptpython REPL framework.
"""
# --- IMPORTANT: These values must be obtained from a valid, logged-in browser session. ---
# The values below are the dummy data from the provided HAR file.
PHPSESSID_COOKIE = "77n5cmi8mucr04afiukmatp151"
RKEY_COOKIE = "413511bec626a5eb964e337e4165fee629685ac7caa75b21257604bcf5ca4b93911a8f1f6c9d5b902e598db6cc028fe91988db2590daaca4bff55e82d14028ce%3Afvwzb%3Aec91c6f9a5ae2a25515b951b30bb23297d601f184b994eda24654d6edba86bd1"
# 1. Instantiate the client with authentication cookies
client = PriorityListApiClient(phpsessid=PHPSESSID_COOKIE, rkey=RKEY_COOKIE)
# 2. --- Example Workflow Demonstrating Request Chaining ---
print("\\n--- Starting API Automation Workflow ---")
# Step A: Create a new main list
list_obj = client.create_list(name="Project Phoenix")
if not list_obj:
print("Workflow failed: Could not create the main list.")
return
# Step B: Extract the new list's ID from the response
list_id = list_obj['id']
print(f"--> Using new list ID: {list_id}\\n")
# Step C: Create the first sublist using the list_id
sublist1_obj = client.create_sublist(list_id=list_id, name="Phase 1: Research")
if sublist1_obj:
# Step D: Extract the sublist's ID
sublist1_id = sublist1_obj['id']
print(f"--> Using new sublist ID: {sublist1_id}\\n")
# Step E: Create a task in the first sublist
task1_obj = client.create_task(sublist1_id, name="Analyze Market Data", importance=8, time_effort=10)
if task1_obj:
# Step F: Extract the task's ID to use as a dependency
task1_id = task1_obj['id']
print(f"--> Using new task ID for dependency: {task1_id}\\n")
# Step G: Create a second task that depends on the first one
client.create_task(
sublist1_id,
name="Write Competitor Report",
importance=7,
time_effort=5,
dependency_id=task1_id
)
print("\\n--- Workflow Complete ---")
if __name__ == '__main__':
# This block demonstrates how to use the ptpython REPL framework.
# It sets up a REPL environment where the ApiClient can be used interactively.
try:
from ptpython.repl import embed
# --- IMPORTANT: These values must be obtained from a valid, logged-in browser session. ---
# The values below are the dummy data from the provided HAR file.
PHPSESSID_COOKIE = "77n5cmi8mucr04afiukmatp151"
RKEY_COOKIE = "413511bec626a5eb964e337e4165fee629685ac7caa75b21257604bcf5ca4b93911a8f1f6c9d5b902e598db6cc028fe91988db2590daaca4bff55e82d14028ce%3Afvwzb%3Aec91c6f9a5ae2a25515b951b30bb23297d601f184b994eda24654d6edba86bd1"
# Instantiate the client
client = PriorityListApiClient(phpsessid=PHPSESSID_COOKIE, rkey=RKEY_COOKIE)
# Create a namespace for the REPL
namespace = {
'client': client,
'requests': requests,
'json': json,
'main': main
}
print("--- ptpython REPL ---")
print("An 'ApiClient' instance named 'client' is available.")
print("You can now interact with the API, e.g., client.create_list('My New List')")
print("Type 'main()' to run the example workflow.")
# Embed the ptpython REPL
embed(globals=namespace, locals=namespace)
except ImportError:
print("ptpython is not installed. Please run 'pip install ptpython' to use the REPL.")
# Fallback to standard Python REPL if ptpython is not available
import code
code.interact(local=locals())
#Quick Start for Advanced Users
For experienced users familiar with Python and Linux environments:
- Save the script: Save the code as
prioritylist-cli.py
. - Create venv & install:
python3 -m venv .venv source .venv/bin/activate pip install requests ptpython
- Configure credentials: Create
~/.config/prioritylist/config.ini
with yourphpsessid
andrkey
.[auth] phpsessid = YOUR_PHPSESSID_VALUE rkey = YOUR_RKEY_VALUE
- Make executable & move to PATH:
chmod +x prioritylist-cli.py mkdir -p ~/.local/bin mv prioritylist-cli.py ~/.local/bin/ # Ensure ~/.local/bin is in your PATH
- Run:
prioritylist-cli.py list pull-all
#Table of Contents
- Part 1: Environment Setup (The Right Way)
- 1.1. System Dependencies
- 1.2. Creating a Python Virtual Environment (Best Practice)
- 1.3. Installing Script Dependencies
- Part 2: Script Installation & Configuration
- 2.1. Saving the Script
- 2.2. Making the Script Globally Executable
- Part 3: Authentication - The Critical Step
- 3.1. Finding Your
PHPSESSID
andrkey
- 3.2. Storing Your Credentials Securely
- 3.3. Security Considerations
- 3.1. Finding Your
- Part 4: Command Cheatsheet & Usage
- 4.1. Global Options
- 4.2. List Commands
- 4.3. Sublist Commands
- 4.4. Task Commands
- 4.5. Interactive REPL Mode
- Part 5: Troubleshooting
#Part 1: Environment Setup (The Right Way)
We will use a Python virtual environment to keep your system clean and avoid dependency conflicts.
#1.1. System Dependencies
Ensure Python 3, pip, and the venv
module are installed on your openSUSE Tumbleweed system.
sudo zypper install python3 python3-pip python3-venv
#1.2. Creating a Python Virtual Environment (Best Practice)
A virtual environment is an isolated space for your Python project’s dependencies.
- Create a Project Directory: First, make a directory for your script and its environment.
mkdir ~/prioritylist-project cd ~/prioritylist-project
- Create the Virtual Environment: Use Python’s built-in
venv
module to create an environment named.venv
.python3 -m venv .venv
- Activate the Environment: You must “activate” the environment to use it. Your shell prompt will change to indicate it’s active.
source .venv/bin/activate
Note: To leave the environment, simply type
deactivate
. You must activate the environment in any new terminal session where you want to run the script or install packages for it.
#1.3. Installing Script Dependencies
With your environment active, install the required Python libraries. They will be installed inside the .venv
directory, not system-wide.
pip install requests ptpython
#Part 2: Script Installation & Configuration
Now we’ll save the script and make it easy to run from anywhere.
#2.1. Saving the Script
Save the Python code you were given into a file named prioritylist-cli.py
inside your ~/prioritylist-project
directory.
#2.2. Making the Script Globally Executable
To run prioritylist-cli.py
from any directory without typing the full path, we’ll make it executable and move it to a location in your system’s PATH
.
- Grant Execute Permissions:
chmod +x prioritylist-cli.py
- Move to Local Bin Directory: The standard location for user-specific executables is
~/.local/bin
.mkdir -p ~/.local/bin mv prioritylist-cli.py ~/.local/bin/
- Verify your PATH: On most modern Linux systems,
~/.local/bin
is automatically added to yourPATH
when you log in. You can verify this:echo $PATH
If you see
/home/your_username/.local/bin
in the output, you are all set. If not, add the following line to your~/.profile
or~/.bashrc
file and restart your shell session:# Add this line to ~/.profile export PATH="$HOME/.local/bin:$PATH"
#Part 3: Authentication - The Critical Step
The script requires your account’s session cookies to work.
#3.1. Finding Your PHPSESSID
and rkey
- Log In: In Firefox or a Chromium-based browser, log in to https://prioritylist.app.
- Open Developer Tools: Press
F12
or right-click the page and select “Inspect”. - Go to Storage/Application:
- In Firefox, go to the Storage tab.
- In Chrome/Edge, go to the Application tab.
- Find Cookies: In the sidebar, expand “Cookies” and select
https://prioritylist.app
. - Copy Values: Find the rows for
PHPSESSID
andrkey
. Carefully copy the long string from the “Value” column for each.
Important Note on Credentials These cookies can and will expire (e.g., after a few days, or when you log out). If the script suddenly stops working with an “API Error” or “HTTP 401/403” error, the most likely cause is an expired cookie. You will need to repeat this step to get new, valid cookie values.
#3.2. Storing Your Credentials Securely
The script checks for credentials in three places. The configuration file is the most convenient and recommended method.
- Create the Directory:
mkdir -p ~/.config/prioritylist
- Create the Config File:
nano ~/.config/prioritylist/config.ini
- Add Your Credentials: Paste the following into the file, replacing the placeholders with your actual values.
[auth] phpsessid = YOUR_PHPSESSID_VALUE_HERE rkey = YOUR_RKEY_VALUE_HERE
Save and exit (
Ctrl+O
, thenCtrl+X
innano
).
#3.3. Security Considerations
- Treat these credentials like passwords. Anyone with them can access your PriorityList account.
- The
config.ini
file is stored as plain text. On a multi-user system, ensure its permissions are secure (chmod 600 ~/.config/prioritylist/config.ini
). - Avoid passing credentials as command-line arguments (
--phpsessid ...
), as they will be stored in your shell’s history file (.bash_history
).
#Part 4: Command Cheatsheet & Usage
Remember to have your virtual environment active (source ~/prioritylist-project/.venv/bin/activate
) before running commands.
#4.1. Global Options
Option | Description |
---|---|
--json |
Output machine-readable JSON instead of human-friendly text. |
#4.2. List Commands
Action | Description | Example Command |
---|---|---|
pull-all |
Fetch and display all your lists and groups. | prioritylist-cli.py list pull-all |
show |
Show full JSON details for a single list. | prioritylist-cli.py list show 12345 |
add |
Add a new list. | prioritylist-cli.py list add --name "New Project" |
update |
Rename a list. | prioritylist-cli.py list update 12345 --name "Renamed Project" |
delete |
Permanently delete a list. | prioritylist-cli.py list delete 12345 |
star |
Toggle the star status on a list. | prioritylist-cli.py list star 12345 |
#4.3. Sublist Commands
Action | Description | Example Command |
---|---|---|
add |
Add a new sublist to a list. | prioritylist-cli.py sublist add --list-id 12345 --name "Design Phase" |
update |
Rename a sublist. | prioritylist-cli.py sublist update 56789 --name "Final Designs" |
delete |
Permanently delete a sublist. | prioritylist-cli.py sublist delete 56789 |
#4.4. Task Commands
Action | Description | Example Command |
---|---|---|
add |
Add a new task to a sublist. | prioritylist-cli.py task add --sublist-id 56789 --name "Create logo" -i 8 -t 3 |
update |
Update an existing task. | prioritylist-cli.py task update 98765 --name "Finalize logo" --due-date "2024-12-20" |
delete |
Permanently delete a task. | prioritylist-cli.py task delete 98765 |
#4.5. Interactive REPL Mode
Run the script with no arguments to enter a powerful interactive shell.
prioritylist-cli.py
Inside the REPL, a pre-configured client
object is available. You can explore the API directly.
# Example REPL session
>>> # Get details for a list and print it nicely
>>> details = client.get_list_details(12345)
>>> print_json(details)
#Part 5: Troubleshooting
Error Message / Symptom | Likely Cause & Solution |
---|---|
bash: prioritylist-cli.py: command not found |
1. Your ~/.local/bin is not in your PATH . See step 2.2. 2. You have not restarted your shell since modifying your ~/.profile or ~/.bashrc . 3. You are trying to run it from a non-active venv. |
ImportError: No module named 'requests' |
The required Python libraries are not installed in your active virtual environment. Ensure you have run source .venv/bin/activate and then pip install requests ptpython . |
❌ Error: Authentication credentials not found. |
The script could not find your config.ini file. Ensure it is located at ~/.config/prioritylist/config.ini and the keys (phpsessid , rkey ) are spelled correctly. |
❌ API Error... or ❌ HTTP Error... 401/403 |
Your credentials have expired or are incorrect. This is the most common operational error. Repeat Part 3.1 to get new cookie values and update your config.ini file. |
❌ Request failed... ConnectionError |
You have a network problem. Check your internet connection and ensure you can access prioritylist.app in your browser. |
#!/usr/bin/env python3
"""
PriorityList CLI - The Optimized & Integrated Solution
This script is the result of integrating the best features from multiple development
approaches into a single, cohesive, and robust command-line interface.
It combines:
• Full CRUD (Create, Read, Update, Delete) operations for all resources.
• A robust API client with detailed error handling and reliable response parsing.
• A clean, nested command structure (e.g., `list add`, `task delete`).
• An interactive REPL mode (via `ptpython`) for exploratory API calls.
• Strict separation of human-readable and machine-readable (`--json`) output.
• Secure credential management from args, environment, or config file.
"""
from __future__ import annotations
import argparse
import configparser
import json
import os
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import requests
# ─────────────────────────────────────────────────────────────
# Helper Functions
# ─────────────────────────────────────────────────────────────
def print_json(obj: Any) -> None:
"""Prints an object as a formatted JSON string to stdout."""
print(json.dumps(obj, indent=2, ensure_ascii=False))
def print_human(msg: str, *, is_json_mode: bool) -> None:
"""Prints a message to stdout only if not in JSON mode."""
if not is_json_mode:
print(msg)
# ─────────────────────────────────────────────────────────────
# API Client
# ─────────────────────────────────────────────────────────────
class PriorityListApiClient:
"""A robust client for interacting with the prioritylist.app API."""
def __init__(self, phpsessid: str, rkey: str, base_url: str = "https://prioritylist.app") -> None:
self.base_url = base_url.rstrip("/")
self.session = requests.Session()
self.session.headers.update({
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0",
"Accept": "text/plain, */*; q=0.01",
"X-Requested-With": "XMLHttpRequest",
"Origin": self.base_url,
})
self.session.cookies.set("PHPSESSID", phpsessid, domain="prioritylist.app")
self.session.cookies.set("rkey", rkey, domain="prioritylist.app")
def _post(self, endpoint: str, data: Optional[Dict[str, Any]] = None) -> Optional[Dict[str, Any]]:
"""Makes a POST request, handles errors, and returns the 'data' field on success."""
url = f"{self.base_url}/api{endpoint}"
try:
response = self.session.post(url, data=data)
response.raise_for_status()
json_response = response.json()
if json_response.get("result") == "success":
return json_response.get("data")
else:
print(f"❌ API Error at {endpoint}: {json_response.get('result', 'Unknown error')}", file=sys.stderr)
except requests.exceptions.HTTPError as e:
print(f"❌ HTTP Error for {endpoint}: {e.response.status_code} {e.response.reason}", file=sys.stderr)
print(f" Response body: {e.response.text}", file=sys.stderr)
except requests.exceptions.RequestException as e:
print(f"❌ Request failed for {endpoint}: {e}", file=sys.stderr)
except json.JSONDecodeError:
print(f"❌ Failed to decode JSON from response. URL: {url}", file=sys.stderr)
return None
# --- List Operations ---
def get_all_lists(self) -> Optional[List[Dict[str, Any]]]:
return self._post("/groups/pull")
def get_list_details(self, list_id: int) -> Optional[Dict[str, Any]]:
return self._post("/list/pull", {"id": list_id})
def create_list(self, name: str, group_id: str = "") -> Optional[Dict[str, Any]]:
"""Creates a new list and robustly finds and returns it from the response."""
response_data = self._post("/list/add", {"name": name, "group_id": group_id})
if response_data:
try:
for group in response_data:
# Find the list by name to avoid relying on array order.
# Note: This might not be perfect if duplicate names are allowed.
for lst in group.get('lists', []):
if lst['name'] == name:
return lst
except (IndexError, KeyError, TypeError) as e:
print(f"❌ Could not parse created list from API response: {e}", file=sys.stderr)
return None
def update_list(self, list_id: int, name: str) -> bool:
return self._post("/list/update", {"id": list_id, "name": name}) is not None
def delete_list(self, list_id: int) -> bool:
# Note: The delete endpoint was not in the HAR file, this is an educated guess.
# If it fails, the actual endpoint might be different (e.g., /list/remove).
return self._post("/list/delete", {"id": list_id}) is not None
def star_list(self, list_id: int) -> bool:
return self._post("/list/star", {"id": list_id}) is not None
# --- Sublist Operations ---
def create_sublist(self, list_id: int, name: str) -> Optional[Dict[str, Any]]:
"""Creates a new sublist and robustly finds and returns it."""
response_data = self._post("/sublist/add", {"list_id": list_id, "name": name})
if response_data:
try:
for sublist in response_data.get('sublists', []):
if sublist['name'] == name:
return sublist
except (KeyError, TypeError) as e:
print(f"❌ Could not parse created sublist from API response: {e}", file=sys.stderr)
return None
def update_sublist(self, sublist_id: int, name: str) -> bool:
return self._post("/sublist/update", {"id": sublist_id, "name": name}) is not None
def delete_sublist(self, sublist_id: int) -> bool:
# Note: The delete endpoint was not in the HAR file, this is an educated guess.
return self._post("/sublist/delete", {"id": sublist_id}) is not None
# --- Task Operations ---
def create_task(self, sublist_id: int, name: str, **kwargs) -> Optional[Dict[str, Any]]:
"""Creates a new task and robustly finds and returns it."""
payload = {"sublist_id": sublist_id, "name": name}
# Map CLI-friendly names to API parameter names
if 'importance' in kwargs: payload['score_i'] = kwargs.pop('importance')
if 'time' in kwargs: payload['score_t'] = kwargs.pop('time')
if 'due_date' in kwargs: payload['d_date'] = kwargs.pop('due_date')
if 'dependency_id' in kwargs: payload['dependency_id'] = kwargs.pop('dependency_id')
payload.update(kwargs)
if payload.get('d_date'):
payload.setdefault('d_zone', '-0300')
response_data = self._post("/item/add", payload)
if response_data:
try:
for item in response_data.get('items', []):
if item['name'] == name:
return item
except (KeyError, TypeError) as e:
print(f"❌ Could not parse created task from API response: {e}", file=sys.stderr)
return None
def update_task(self, task_id: int, updates: Dict[str, Any]) -> bool:
"""Updates an existing task with only the provided fields."""
payload = updates.copy()
payload['id'] = task_id
if 'd_date' in payload and payload['d_date']:
payload.setdefault('d_zone', '-0300')
return self._post("/item/update", data=payload) is not None
def delete_task(self, task_id: int) -> bool:
# Note: The delete endpoint was not in the HAR file, this is an educated guess.
return self._post("/item/delete", {"id": task_id}) is not None
# ─────────────────────────────────────────────────────────────
# Credentials Helper
# ─────────────────────────────────────────────────────────────
def get_credentials(ns: argparse.Namespace) -> Tuple[str, str]:
"""Retrieves credentials from args, environment variables, or config file."""
if ns.phpsessid and ns.rkey:
return ns.phpsessid, ns.rkey
env_sess, env_rkey = os.getenv("PL_PHPSESSID"), os.getenv("PL_RKEY")
if env_sess and env_rkey:
return env_sess, env_rkey
cfg_file = Path.home() / ".config" / "prioritylist" / "config.ini"
if cfg_file.exists():
# FIX: Disable interpolation to handle '%' characters in cookie values
cp = configparser.ConfigParser(interpolation=None)
cp.read(cfg_file)
if "auth" in cp and "phpsessid" in cp["auth"] and "rkey" in cp["auth"]:
return cp["auth"]["phpsessid"], cp["auth"]["rkey"]
print("❌ Error: Authentication credentials not found.", file=sys.stderr)
print(" Please provide them via flags, environment variables, or a config file.", file=sys.stderr)
sys.exit(1)
# ─────────────────────────────────────────────────────────────
# Command Handlers
# ─────────────────────────────────────────────────────────────
def handle_list_pull_all(client: PriorityListApiClient, ns: argparse.Namespace):
data = client.get_all_lists()
if data is None:
print_human("❌ Could not fetch lists.", is_json_mode=ns.json)
return
if ns.json:
print_json(data)
else:
for group in data:
print_human(f"\n📁 {group.get('name') or 'Uncategorized'}", is_json_mode=ns.json)
for lst in group.get("lists", []):
star = "⭐" if lst.get("starred") else " "
print_human(f" {star} ID: {lst['id']:<6} {lst['name']}", is_json_mode=ns.json)
def handle_list_show(client: PriorityListApiClient, ns: argparse.Namespace):
data = client.get_list_details(ns.list_id)
if data is None:
print_human(f"❌ List {ns.list_id} not found.", is_json_mode=ns.json)
return
print_json(data)
def handle_list_add(client: PriorityListApiClient, ns: argparse.Namespace):
new_list = client.create_list(ns.name)
if new_list:
print_human(f"✅ Created list '{new_list['name']}' (ID: {new_list['id']})", is_json_mode=ns.json)
if ns.json:
print_json(new_list)
else:
print_human(f"❌ Failed to create list '{ns.name}'.", is_json_mode=ns.json)
def handle_list_update(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.update_list(ns.list_id, ns.name)
msg = f"✅ Renamed list {ns.list_id} to '{ns.name}'." if ok else f"❌ Failed to rename list {ns.list_id}."
print_human(msg, is_json_mode=ns.json)
def handle_list_delete(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.delete_list(ns.list_id)
msg = f"✅ Deleted list {ns.list_id}." if ok else f"❌ Failed to delete list {ns.list_id}."
print_human(msg, is_json_mode=ns.json)
def handle_list_star(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.star_list(ns.list_id)
msg = f"✅ Toggled star on list {ns.list_id}." if ok else f"❌ Failed to toggle star on list {ns.list_id}."
print_human(msg, is_json_mode=ns.json)
def handle_sublist_add(client: PriorityListApiClient, ns: argparse.Namespace):
new_sublist = client.create_sublist(ns.list_id, ns.name)
if new_sublist:
msg = f"✅ Created sublist '{new_sublist['name']}' (ID: {new_sublist['id']}) in list {ns.list_id}."
print_human(msg, is_json_mode=ns.json)
if ns.json:
print_json(new_sublist)
else:
print_human(f"❌ Failed to create sublist '{ns.name}'.", is_json_mode=ns.json)
def handle_sublist_update(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.update_sublist(ns.sublist_id, ns.name)
msg = f"✅ Renamed sublist {ns.sublist_id} to '{ns.name}'." if ok else f"❌ Failed to rename sublist {ns.sublist_id}."
print_human(msg, is_json_mode=ns.json)
def handle_sublist_delete(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.delete_sublist(ns.sublist_id)
msg = f"✅ Deleted sublist {ns.sublist_id}." if ok else f"❌ Failed to delete sublist {ns.sublist_id}."
print_human(msg, is_json_mode=ns.json)
def handle_task_add(client: PriorityListApiClient, ns: argparse.Namespace):
params = {
"importance": ns.importance,
"time": ns.time,
"d_date": ns.due_date or "",
"dependency_id": ns.dependency_id or "",
}
new_task = client.create_task(ns.sublist_id, ns.name, **params)
if new_task:
msg = f"✅ Created task '{new_task['name']}' (ID: {new_task['id']}) in sublist {ns.sublist_id}."
print_human(msg, is_json_mode=ns.json)
if ns.json:
print_json(new_task)
else:
print_human(f"❌ Failed to create task '{ns.name}'.", is_json_mode=ns.json)
def handle_task_update(client: PriorityListApiClient, ns: argparse.Namespace):
updates = {k: v for k, v in vars(ns).items() if k in [
'name', 'sublist_id', 'importance', 'time', 'due_date', 'dependency_id'
] and v is not None}
if not updates:
print_human("❌ Error: At least one field to update must be provided.", is_json_mode=ns.json)
sys.exit(1)
# Remap arg names to API field names
if 'importance' in updates: updates['score_i'] = updates.pop('importance')
if 'time' in updates: updates['score_t'] = updates.pop('time')
if 'due_date' in updates: updates['d_date'] = updates.pop('due_date')
ok = client.update_task(ns.task_id, updates)
msg = f"✅ Updated task {ns.task_id}." if ok else f"❌ Failed to update task {ns.task_id}."
print_human(msg, is_json_mode=ns.json)
def handle_task_delete(client: PriorityListApiClient, ns: argparse.Namespace):
ok = client.delete_task(ns.task_id)
msg = f"✅ Deleted task {ns.task_id}." if ok else f"❌ Failed to delete task {ns.task_id}."
print_human(msg, is_json_mode=ns.json)
# ─────────────────────────────────────────────────────────────
# Argument Parser
# ─────────────────────────────────────────────────────────────
def build_parser() -> argparse.ArgumentParser:
p = argparse.ArgumentParser(description="A robust CLI for prioritylist.app.", formatter_class=argparse.RawTextHelpFormatter)
p.add_argument("--phpsessid", help="Your PHPSESSID cookie.")
p.add_argument("--rkey", help="Your rkey cookie.")
p.add_argument("--json", action="store_true", help="Output machine-readable JSON only.")
sp = p.add_subparsers(dest="resource", required=True, help="The resource to manage.")
# --- List Parser ---
ls = sp.add_parser("list", help="Manage lists").add_subparsers(dest="action", required=True)
ls.add_parser("pull-all", help="Fetch all lists and groups").set_defaults(func=handle_list_pull_all)
ls_sh = ls.add_parser("show", help="Show full JSON details for one list")
ls_sh.add_argument("list_id", type=int, help="ID of the list to show")
ls_sh.set_defaults(func=handle_list_show)
ls_add = ls.add_parser("add", help="Add a new list")
ls_add.add_argument("--name", required=True, help="Name for the new list")
ls_add.set_defaults(func=handle_list_add)
ls_upd = ls.add_parser("update", help="Rename a list")
ls_upd.add_argument("list_id", type=int, help="ID of the list to update")
ls_upd.add_argument("--name", required=True, help="New name for the list")
ls_upd.set_defaults(func=handle_list_update)
ls_del = ls.add_parser("delete", help="Delete a list")
ls_del.add_argument("list_id", type=int, help="ID of the list to delete")
ls_del.set_defaults(func=handle_list_delete)
ls_star = ls.add_parser("star", help="Toggle star status on a list")
ls_star.add_argument("list_id", type=int, help="ID of the list to star/unstar")
ls_star.set_defaults(func=handle_list_star)
# --- Sublist Parser ---
sb = sp.add_parser("sublist", help="Manage sublists").add_subparsers(dest="action", required=True)
sb_add = sb.add_parser("add", help="Add a new sublist")
sb_add.add_argument("--list-id", type=int, required=True, help="ID of the parent list")
sb_add.add_argument("--name", required=True, help="Name for the new sublist")
sb_add.set_defaults(func=handle_sublist_add)
sb_upd = sb.add_parser("update", help="Rename a sublist")
sb_upd.add_argument("sublist_id", type=int, help="ID of the sublist to update")
sb_upd.add_argument("--name", required=True, help="New name for the sublist")
sb_upd.set_defaults(func=handle_sublist_update)
sb_del = sb.add_parser("delete", help="Delete a sublist")
sb_del.add_argument("sublist_id", type=int, help="ID of the sublist to delete")
sb_del.set_defaults(func=handle_sublist_delete)
# --- Task Parser ---
tk = sp.add_parser("task", help="Manage tasks").add_subparsers(dest="action", required=True)
tk_add = tk.add_parser("add", help="Add a new task")
tk_add.add_argument("--sublist-id", type=int, required=True, help="ID of the parent sublist")
tk_add.add_argument("--name", required=True, help="Name for the new task")
tk_add.add_argument("-i", "--importance", type=int, default=5, help="Importance score (1-10)")
tk_add.add_argument("-t", "--time", type=int, default=5, help="Time/Effort score (1-10)")
tk_add.add_argument("-d", "--due-date", help="Due date in YYYY-MM-DD format")
tk_add.add_argument("--dependency-id", type=int, help="ID of a prerequisite task")
tk_add.set_defaults(func=handle_task_add)
tk_upd = tk.add_parser("update", help="Update an existing task")
tk_upd.add_argument("task_id", type=int, help="ID of the task to update")
tk_upd.add_argument("--sublist-id", type=int, help="Move task to a new parent sublist")
tk_upd.add_argument("--name", help="New name for the task")
tk_upd.add_argument("-i", "--importance", type=int, help="New importance score (1-10)")
tk_upd.add_argument("-t", "--time", type=int, help="New time/Effort score (1-10)")
tk_upd.add_argument("-d", "--due-date", help="New due date in YYYY-MM-DD format")
tk_upd.add_argument("--dependency-id", type=int, help="New ID of a prerequisite task")
tk_upd.set_defaults(func=handle_task_update)
tk_del = tk.add_parser("delete", help="Delete a task")
tk_del.add_argument("task_id", type=int, help="ID of the task to delete")
tk_del.set_defaults(func=handle_task_delete)
return p
# ─────────────────────────────────────────────────────────────
# Main Execution
# ─────────────────────────────────────────────────────────────
def main():
"""Main entry point for the script."""
if len(sys.argv) == 1:
try:
from ptpython.repl import embed
print("▶️ No command provided. Starting interactive REPL...")
creds_ns = argparse.Namespace(phpsessid=None, rkey=None)
phpsessid, rkey = get_credentials(creds_ns)
client = PriorityListApiClient(phpsessid, rkey)
namespace = {'client': client, 'print_json': print_json}
print("✅ An API client is available as `client`.")
embed(globals=namespace, locals=namespace)
except ImportError:
print("ℹ️ Optional dependency 'ptpython' not found.", file=sys.stderr)
print(" Run 'pip install ptpython' for an enhanced interactive experience.", file=sys.stderr)
print("\nDisplaying help instead:\n")
build_parser().print_help()
sys.exit(0)
parser = build_parser()
args = parser.parse_args()
phpsessid, rkey = get_credentials(args)
client = PriorityListApiClient(phpsessid, rkey)
if hasattr(args, 'func'):
args.func(client, args)
else:
parser.print_help()
if __name__ == "__main__":
main()
#Command-Line Interface (CLI) and User Experience (UX)
- Nested Command Structure: The CLI now uses a more intuitive
resource action
format (e.g.,list add
,task update
). This is a standard practice for modern CLIs and a vast improvement over the original flat command list. - Interactive REPL Mode: A major feature addition is the
ptpython
-based interactive REPL, which launches if the script is run without arguments. It provides an authenticatedclient
object, allowing for powerful, exploratory API interactions without writing new scripts. - Clear and Concise Output: The use of emojis (✅, ❌, 📁, ⭐) provides immediate visual feedback on the status of operations.
- Scripting-Friendly JSON Mode: The
--json
flag now guarantees that the only output tostdout
is a clean JSON object, making it trivial to pipe the output of this tool to other programs likejq
.
#4. Security Enhancements
- Secure Credential Sourcing: The
get_credentials
function continues to provide a secure and flexible way to manage API keys, preventing them from being hard-coded. It checks arguments, environment variables, and a dedicated config file in a safe order of precedence. - Robust Input Handling: The API client’s improved error handling and response parsing make it less susceptible to crashes or unexpected behavior caused by malformed API responses.
#client-side code
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";function x(e){return null!=e&&e===e.window}var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var Ut="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:Ut,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(t){t=S.merge(this.constructor(),t);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(n){var t=this.length,n=+n+(n<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(o=a[t],o=i&&!Array.isArray(o)?[]:i||S.isPlainObject(o)?o:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(Ut+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(n){return!(!n||"[object Object]"!==o.call(n)||(n=r(n))&&("function"!=typeof(n=v.call(n,"constructor")&&n.constructor)||a.call(n)!==l))},isEmptyObject:function(e){for(var t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,n){n=n||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!=a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var fe=function(n){function ne(n,t){return n="0x"+n.slice(1)-65536,t||(n<0?String.fromCharCode(65536+n):String.fromCharCode(n>>10|55296,1023&n|56320))}function oe(){T()}var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+ +new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){for((f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;o--;)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(n){var t=n.namespaceURI,n=(n.ownerDocument||n).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(r){var t,r=r?r.ownerDocument||r:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(t=C.defaultView)&&t.top!==t&&(t.addEventListener?t.addEventListener("unload",oe,!1):t.attachEvent&&t.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(n,t){if(void 0!==t.getElementById&&E){n=t.getElementById(n);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(t){t=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,r){var n=9===e.nodeType?e.documentElement:e,r=r&&r.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var r=b.attrHandle[t.toLowerCase()],r=r&&j.call(b.attrHandle,t.toLowerCase())?r(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(t){t=se.attr(t,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!=m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){for(;l;){for(a=e;a=a[l];)if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){for(d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];a=++s&&a&&a[l]||(d=s=0)||u.pop();)if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)for(;(a=++s&&a&&a[l]||(d=s=0)||u.pop())&&((x?a.nodeName.toLowerCase()!==f:1!==a.nodeType)||!++d||(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a!==e)););return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){for(var n,r=a(e,o),i=r.length;i--;)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){for(var i,o=s(e,null,r,[]),a=e.length;a--;)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(t){return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(t=t.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=function(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var i,r,a=[k,p];if(n){for(;e=e[u];)if((1===e.nodeType||f)&&s(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||f)if(i=(r=e[S]||(e[S]={}))[e.uniqueID]||(r[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){for(var r=i.length;r--;)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,r){r=!o&&(r||t!==w)||((i=t).nodeType?u:l)(e,t,r);return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r&&!b.relative[e[n].type];n++);return function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v)for(i=Te(p,u),v(i,[],n,r),o=i.length;o--;)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a));if(e){if(y||d){if(y){for(i=[],o=p.length;o--;)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}for(o=p.length;o--;)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);for(a=e,s=[],u=b.preFilter;a;){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){for(n=(t=t||h(e)).length;n--;)((a=Ee(t[n]))[S]?i:o).push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){for(a=0,t||o.ownerDocument==C||(T(o),n=!E);s=v[a++];)if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){for(a=0;s=y[a++];)s(c,f,t,n);if(e){if(0<u)for(;l--;)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=G.needsContext.test(e)?0:o.length;i--&&(a=o[i],!b.relative[s=a.type]);)if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,r,n){if(!n)return!0===e[r]?r.toLowerCase():(r=e.getAttributeNode(r))&&r.specified?r.value:null}),se}(C);S.find=fe,S.expr=fe.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=fe.uniqueSort,S.text=fe.getText,S.isXMLDoc=fe.isXML,S.contains=fe.contains,S.escapeSelector=fe.escape;function h(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r}function T(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}var k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(i,t,n){if(!i)return this;if(n=n||j,"string"!=typeof i)return i.nodeType?(this[0]=i,this.length=1,this):m(i)?void 0!==n.ready?n.ready(i):i(S):S.makeArray(i,this);if(!(r="<"===i[0]&&">"===i[i.length-1]&&3<=i.length?[null,i,null]:q.exec(i))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(i);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(var r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(t){t=t.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var n;r="string"==typeof r?(n={},S.each(r.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);function c(){for(a=a||r.once,o=i=!0;u.length;l=-1)for(t=u.shift();++l<s.length;)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1);r.memory||(t=!1),i=!1,a&&(s=t?[]:"")}var i,t,o,a,s=[],u=[],l=-1,f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;-1<(n=S.inArray(t,s,n));)s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s=s&&[],this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){function a(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}}var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred();if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();for(;t--;)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(t=a?(t.call(e,r),null):(l=t,function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}function V(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType}function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}void 0!==t&&!S.isEmptyObject(r)||(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(t){t=t[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0!==n)return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;return o&&void 0===e?void 0!==(t=Q.get(o,n))||void 0!==(t=Z(o,n))?t:void 0:void this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0);if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(t=a.length;t--;)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){function s(){--r||i.resolveWith(o,[o])}var n,r=1,i=S.Deferred(),o=this,a=this.length;for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var it=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+it+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});function ae(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")}function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=r.ownerDocument,s=r.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,Ut=E.createDocumentFragment().appendChild(E.createElement("div"));(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),Ut.appendChild(fe),y.checkClone=Ut.cloneNode(!0).cloneNode(!0).lastChild.checked,Ut.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!Ut.cloneNode(!0).lastChild.defaultValue,Ut.innerHTML="<option></option>",y.option=!!Ut.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){for(a=a||f.appendChild(t.createElement("div")),u=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[u]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",d=0;o=p[d++];)if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n)for(c=0;o=a[c++];)he.test(o.type||"")&&n.push(o);return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,u,l,c,f,d,h,p,v=Y.get(t);if(V(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;l--;)d=p=(c=Te.exec(e[l])||[])[1],h=(c[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:p,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(c){var t,n,i,r,a,s=new Array(arguments.length),u=S.event.fix(c),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,l),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(r=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==r.namespace&&!u.rnamespace.test(r.namespace)||(u.handleObj=r,u.data=r.data,void 0!==(r=((S.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(t){t=this||t;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(t){t=this||t;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(t){t=t.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"!=typeof e)return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)});for(i in e)this.off(i,t,e[i]);return this}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(a,t){var n,r,i,s;if(1===t.nodeType){if(Y.hasData(a)&&(s=Y.get(a).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(a)&&(a=Q.access(a),a=S.extend({},a),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],"input"===(l=(u=a[r]).nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){var t;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(t=qe(this,e)).insertBefore(e,t.firstChild)})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});function We(e,t,r){var i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=r.call(e),t)e.style[i]=o[i];return r}var Me=new RegExp("^("+it+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Fe=new RegExp(ne.join("|"),"i");function Be(i,o,n){var r,a,s=i.style;return(n=n||Ie(i))&&(""!==(a=n.getPropertyValue(o)||n[o])||ie(i)||(a=S.style(i,o)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(o)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){var e;l&&(u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l),e=C.getComputedStyle(l),n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null)}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,n,r;return null==a&&(e=E.createElement("table"),r=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",r.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(r).appendChild(n),r=C.getComputedStyle(r),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){return S.cssProps[e]||Ue[e]||(e in ze?e:Ue[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=_e.length;n--;)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(n,t){if(t){n=Be(n,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,o,n,r){var i,a=X(o);return Ge.test(o)||(o=Xe(a)),(a=S.cssHooks[o]||S.cssHooks[a])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,o,r)),"normal"===i&&o in Qe&&(i=Qe[o]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,s){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||s)&&"border-box"===S.css(e,"boxSizing",!1,i),s=s?Ke(e,u,s,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return(e&&e.get?e:et.propHooks._default).get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),(n&&n.set?n:et.propHooks._default).set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(t){return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(t=S.css(t.elem,t.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var t=tt||ut(),t=Math.max(0,l.startTime+l.duration-t),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(n,t){n=S.Tween(o,l.opts,n,t,l.opts.specialEasing[n]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){for(var n,r=0,i=(e=m(e)?(t=e,["*"]):e.match(P)).length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in c&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,a){var i=S.isEmptyObject(t),o=S.speed(e,n,a),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){function a(e){var t=e.stop;delete e.stop,t(o)}return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},Ut=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),Ut.type="checkbox",y.checkOn=""!==Ut.value,y.optSelected=it.selected,(Ut=E.createElement("input")).value="t",Ut.type="radio",y.radioValue="t"===Ut.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):!(i&&"get"in i&&null!==(r=i.get(e,t)))&&null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(S.propHooks.selected={get:function(t){t=t.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(t){t=t.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)for(;n=this[u++];)if(s=yt(n),r=1===n.nodeType&&" "+vt(s)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)for(;n=this[u++];)if(s=yt(n),r=1===n.nodeType&&" "+vt(s)+" "){for(a=0;o=e[a++];)for(;-1<r.indexOf(" "+o+" ");)r=r.replace(" "+o+" "," ");s!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"==o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a)for(t=0,n=S(this),r=mt(i);e=r[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else void 0!==i&&"boolean"!=o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==i&&Y.get(this,"__className__")||""))})},hasClass:function(e){for(var n,r=0,t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(t){1===this.nodeType&&(null==(t=i?n.call(this,t,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){for(var t,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length,r=o<0?u:a?o:0;r<u;r++)if(((t=i[r]).selected||r===o)&&!t.disabled&&(!t.parentNode.disabled||!A(t.parentNode,"optgroup"))){if(t=S(t).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=S.makeArray(t),a=i.length;a--;)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;function wt(e){e.stopPropagation()}var bt=/^(?:focusinfocus|focusoutblur)$/;S.extend(S.event,{trigger:function(e,t,n,r){var i,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[],o=f=a=n=n||E;if(3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}for(i=0;(o=p[i++])&&!e.isPropagationStopped();)f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(r,t,n){r=S.extend(new S.Event,n,{type:r,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){function i(e){S.event.simulate(r,e.target,S.event.fix(e))}S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;S.param=function(e,t){function i(e,n){n=m(n)?n():n,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)}var n,r=[];if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)!function Dt(n,e,r,i){if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(var t in e)Dt(n+"["+t+"]",e[t],r,i)}(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))for(;n=i[r++];)"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,n){n=n(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r=r||{})[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n)for(n={};t=Ht.exec(p);)n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){if(e)if(h)T.always(e[T.status]);else for(var t in e)w[t]=[w[t],e[t]];return this},abort:function(t){t=t||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,u,i){var o,a,s,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=i||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,u&&(s=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a=a||i}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,u)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){for(var t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(t){return this[0]&&(m(t)&&(t=t.call(this[0])),t=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,i){return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(y.createHTMLDocument?((o=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(o)):t=E),o=!i&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var o,a,s,i,r=S.css(e,"position"),c=S(e),f={};"static"===r&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),i=S.css(e,"left"),i=("absolute"===r||"fixed"===r)&&-1<(o+i).indexOf("auto")?(a=(r=c.position()).top,r.left):(a=parseFloat(o)||0,parseFloat(i)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),n=n.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;return x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n?r?r[i]:e[t]:void(r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n)},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var r,i;if("string"==typeof t&&(i=e[t],t=e,e=i),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},void 0===e&&(C.jQuery=C.$=S),S}),function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){"use strict";$.ui=$.ui||{};var datepicker_instActive;$.ui.version="1.13.2",$.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};function Datepicker(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.regional.en=$.extend(!0,{},this.regional[""]),this.regional["en-US"]=$.extend(!0,{},this.regional.en),this.dpDiv=datepicker_bindHover($("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function datepicker_bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.on("mouseout",selector,function(){$(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&$(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&$(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",selector,datepicker_handleMouseover)}function datepicker_handleMouseover(){$.datepicker._isDisabledDatepicker((datepicker_instActive.inline?datepicker_instActive.dpDiv.parent():datepicker_instActive.input)[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&$(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&$(this).addClass("ui-datepicker-next-hover"))}function datepicker_extendRemove(target,props){for(var name in $.extend(target,props),props)null==props[name]&&(target[name]=props[name]);return target}$.extend($.ui,{datepicker:{version:"1.13.2"}}),$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){return datepicker_extendRemove(this._defaults,settings||{}),this},_attachDatepicker:function(target,settings){var inst,nodeName=target.nodeName.toLowerCase(),inline="div"===nodeName||"span"===nodeName;target.id||(this.uuid+=1,target.id="dp"+this.uuid),(inst=this._newInst($(target),inline)).settings=$.extend({},settings||{}),"input"===nodeName?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(target,inline){return{id:target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:inline?datepicker_bindHover($("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]),inst.trigger=$([]),input.hasClass(this.markerClassName)||(this._attachments(input,inst),input.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(inst),$.data(target,"datepicker",inst),inst.settings.disabled&&this._disableDatepicker(target))},_attachments:function(input,inst){var buttonImage,buttonText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");inst.append&&inst.append.remove(),buttonText&&(inst.append=$("<span>").addClass(this._appendClass).text(buttonText),input[isRTL?"before":"after"](inst.append)),input.off("focus",this._showDatepicker),inst.trigger&&inst.trigger.remove(),"focus"!==(buttonImage=this._get(inst,"showOn"))&&"both"!==buttonImage||input.on("focus",this._showDatepicker),"button"!==buttonImage&&"both"!==buttonImage||(buttonText=this._get(inst,"buttonText"),buttonImage=this._get(inst,"buttonImage"),this._get(inst,"buttonImageOnly")?inst.trigger=$("<img>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):(inst.trigger=$("<button type='button'>").addClass(this._triggerClass),buttonImage?inst.trigger.html($("<img>").attr({src:buttonImage,alt:buttonText,title:buttonText})):inst.trigger.text(buttonText)),input[isRTL?"before":"after"](inst.trigger),inst.trigger.on("click",function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]?$.datepicker._hideDatepicker():($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]&&$.datepicker._hideDatepicker(),$.datepicker._showDatepicker(input[0])),!1}))},_autoSize:function(inst){var findMax,max,maxI,i,date,dateFormat;this._get(inst,"autoSize")&&!inst.inline&&(date=new Date(2009,11,20),(dateFormat=this._get(inst,"dateFormat")).match(/[DM]/)&&(findMax=function(names){for(i=maxI=max=0;i<names.length;i++)names[i].length>max&&(max=names[i].length,maxI=i);return maxI},date.setMonth(findMax(this._get(inst,dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))),date.setDate(findMax(this._get(inst,dateFormat.match(/DD/)?"dayNames":"dayNamesShort"))+20-date.getDay())),inst.input.attr("size",this._formatDate(inst,date).length))},_inlineDatepicker:function(target,inst){var divSpan=$(target);divSpan.hasClass(this.markerClassName)||(divSpan.addClass(this.markerClassName).append(inst.dpDiv),$.data(target,"datepicker",inst),this._setDate(inst,this._getDefaultDate(inst),!0),this._updateDatepicker(inst),this._updateAlternate(inst),inst.settings.disabled&&this._disableDatepicker(target),inst.dpDiv.css("display","block"))},_dialogDatepicker:function(input,scrollX,onSelect,browserHeight,scrollY){var browserWidth,inst=this._dialogInst;return inst||(this.uuid+=1,browserWidth="dp"+this.uuid,this._dialogInput=$("<input type='text' id='"+browserWidth+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),$("body").append(this._dialogInput),(inst=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},$.data(this._dialogInput[0],"datepicker",inst)),datepicker_extendRemove(inst.settings,browserHeight||{}),scrollX=scrollX&&scrollX.constructor===Date?this._formatDate(inst,scrollX):scrollX,this._dialogInput.val(scrollX),this._pos=scrollY?scrollY.length?scrollY:[scrollY.pageX,scrollY.pageY]:null,this._pos||(browserWidth=document.documentElement.clientWidth,browserHeight=document.documentElement.clientHeight,scrollX=document.documentElement.scrollLeft||document.body.scrollLeft,scrollY=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[browserWidth/2-100+scrollX,browserHeight/2-150+scrollY]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),inst.settings.onSelect=onSelect,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],"datepicker",inst),this},_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");$target.hasClass(this.markerClassName)&&(nodeName=target.nodeName.toLowerCase(),$.removeData(target,"datepicker"),"input"===nodeName?(inst.append.remove(),inst.trigger.remove(),$target.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==nodeName&&"span"!==nodeName||$target.removeClass(this.markerClassName).empty(),datepicker_instActive===inst&&(datepicker_instActive=null,this._curInst=null))},_enableDatepicker:function(target){var nodeName,inline=$(target),inst=$.data(target,"datepicker");inline.hasClass(this.markerClassName)&&("input"===(nodeName=target.nodeName.toLowerCase())?(target.disabled=!1,inst.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==nodeName&&"span"!==nodeName||((inline=inline.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value}))},_disableDatepicker:function(target){var nodeName,inline=$(target),inst=$.data(target,"datepicker");inline.hasClass(this.markerClassName)&&("input"===(nodeName=target.nodeName.toLowerCase())?(target.disabled=!0,inst.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==nodeName&&"span"!==nodeName||((inline=inline.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value}),this._disabledInputs[this._disabledInputs.length]=target)},_isDisabledDatepicker:function(target){if(!target)return!1;for(var i=0;i<this._disabledInputs.length;i++)if(this._disabledInputs[i]===target)return!0;return!1},_getInst:function(target){try{return $.data(target,"datepicker")}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,minDate,maxDate){var settings,date,inst=this._getInst(target);if(2===arguments.length&&"string"==typeof minDate)return"defaults"===minDate?$.extend({},$.datepicker._defaults):inst?"all"===minDate?$.extend({},inst.settings):this._get(inst,minDate):null;settings=minDate||{},"string"==typeof minDate&&((settings={})[minDate]=maxDate),inst&&(this._curInst===inst&&this._hideDatepicker(),date=this._getDateDatepicker(target,!0),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),datepicker_extendRemove(inst.settings,settings),null!==minDate&&void 0!==settings.dateFormat&&void 0===settings.minDate&&(inst.settings.minDate=this._formatDate(inst,minDate)),null!==maxDate&&void 0!==settings.dateFormat&&void 0===settings.maxDate&&(inst.settings.maxDate=this._formatDate(inst,maxDate)),"disabled"in settings&&(settings.disabled?this._disableDatepicker(target):this._enableDatepicker(target)),this._attachments($(target),inst),this._autoSize(inst),this._setDate(inst,date),this._updateAlternate(inst),this._updateDatepicker(inst))},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(inst){inst=this._getInst(inst);inst&&this._updateDatepicker(inst)},_setDateDatepicker:function(inst,date){inst=this._getInst(inst);inst&&(this._setDate(inst,date),this._updateDatepicker(inst),this._updateAlternate(inst))},_getDateDatepicker:function(inst,noDefault){inst=this._getInst(inst);return inst&&!inst.inline&&this._setDateFromField(inst,noDefault),inst?this._getDate(inst):null},_doKeyDown:function(event){var onSelect,dateStr,inst=$.datepicker._getInst(event.target),handled=!0,isRTL=inst.dpDiv.is(".ui-datepicker-rtl");if(inst._keyEvent=!0,$.datepicker._datepickerShowing)switch(event.keyCode){case 9:$.datepicker._hideDatepicker(),handled=!1;break;case 13:return(dateStr=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv))[0]&&$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,dateStr[0]),(onSelect=$.datepicker._get(inst,"onSelect"))?(dateStr=$.datepicker._formatDate(inst),onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst])):$.datepicker._hideDatepicker(),!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(event.target,event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths"),"M");break;case 35:(event.ctrlKey||event.metaKey)&&$.datepicker._clearDate(event.target),handled=event.ctrlKey||event.metaKey;break;case 36:(event.ctrlKey||event.metaKey)&&$.datepicker._gotoToday(event.target),handled=event.ctrlKey||event.metaKey;break;case 37:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,isRTL?1:-1,"D"),handled=event.ctrlKey||event.metaKey,event.originalEvent.altKey&&$.datepicker._adjustDate(event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths"),"M");break;case 38:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,-7,"D"),handled=event.ctrlKey||event.metaKey;break;case 39:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,isRTL?-1:1,"D"),handled=event.ctrlKey||event.metaKey,event.originalEvent.altKey&&$.datepicker._adjustDate(event.target,event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths"),"M");break;case 40:(event.ctrlKey||event.metaKey)&&$.datepicker._adjustDate(event.target,7,"D"),handled=event.ctrlKey||event.metaKey;break;default:handled=!1}else 36===event.keyCode&&event.ctrlKey?$.datepicker._showDatepicker(this):handled=!1;handled&&(event.preventDefault(),event.stopPropagation())},_doKeyPress:function(event){var chars,chr=$.datepicker._getInst(event.target);if($.datepicker._get(chr,"constrainInput"))return chars=$.datepicker._possibleChars($.datepicker._get(chr,"dateFormat")),chr=String.fromCharCode(null==event.charCode?event.keyCode:event.charCode),event.ctrlKey||event.metaKey||chr<" "||!chars||-1<chars.indexOf(chr)},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal)try{$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),inst.input?inst.input.val():null,$.datepicker._getFormatConfig(inst))&&($.datepicker._setDateFromField(inst),$.datepicker._updateAlternate(inst),$.datepicker._updateDatepicker(inst))}catch(err){}return!0},_showDatepicker:function(input){var isFixed,showAnim,duration,inst;"input"!==(input=input.target||input).nodeName.toLowerCase()&&(input=$("input",input.parentNode)[0]),$.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input||(inst=$.datepicker._getInst(input),$.datepicker._curInst&&$.datepicker._curInst!==inst&&($.datepicker._curInst.dpDiv.stop(!0,!0),inst&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0])),!1!==(showAnim=(duration=$.datepicker._get(inst,"beforeShow"))?duration.apply(input,[input,inst]):{})&&(datepicker_extendRemove(inst.settings,showAnim),inst.lastVal=null,$.datepicker._lastInput=input,$.datepicker._setDateFromField(inst),$.datepicker._inDialog&&(input.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(input),$.datepicker._pos[1]+=input.offsetHeight),isFixed=!1,$(input).parents().each(function(){return!(isFixed|="fixed"===$(this).css("position"))}),duration={left:$.datepicker._pos[0],top:$.datepicker._pos[1]},$.datepicker._pos=null,inst.dpDiv.empty(),inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(inst),duration=$.datepicker._checkOffset(inst,duration,isFixed),inst.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":isFixed?"fixed":"absolute",display:"none",left:duration.left+"px",top:duration.top+"px"}),inst.inline||(showAnim=$.datepicker._get(inst,"showAnim"),duration=$.datepicker._get(inst,"duration"),inst.dpDiv.css("z-index",function(elem){for(var position,value;elem.length&&elem[0]!==document;){if(position=elem.css("position"),("absolute"===position||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0}($(input))+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects.effect[showAnim]?inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration):inst.dpDiv[showAnim||"show"](showAnim?duration:null),$.datepicker._shouldFocusInput(inst)&&inst.input.trigger("focus"),$.datepicker._curInst=inst)))},_updateDatepicker:function(inst){this.maxRows=4,(datepicker_instActive=inst).dpDiv.empty().append(this._generateHTML(inst)),this._attachHandlers(inst);var origyearshtml,numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],activeCell=inst.dpDiv.find("."+this._dayOverClass+" a"),onUpdateDatepicker=$.datepicker._get(inst,"onUpdateDatepicker");0<activeCell.length&&datepicker_handleMouseover.apply(activeCell.get(0)),inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<cols&&inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",17*cols+"em"),inst.dpDiv[(1!==numMonths[0]||1!==numMonths[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)&&inst.input.trigger("focus"),inst.yearshtml&&(origyearshtml=inst.yearshtml,setTimeout(function(){origyearshtml===inst.yearshtml&&inst.yearshtml&&inst.dpDiv.find("select.ui-datepicker-year").first().replaceWith(inst.yearshtml),origyearshtml=inst.yearshtml=null},0)),onUpdateDatepicker&&onUpdateDatepicker.apply(inst.input?inst.input[0]:null,[inst])},_shouldFocusInput:function(inst){return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus")},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());return offset.left-=this._get(inst,"isRTL")?dpWidth-inputWidth:0,offset.left-=isFixed&&offset.left===inst.input.offset().left?$(document).scrollLeft():0,offset.top-=isFixed&&offset.top===inst.input.offset().top+inputHeight?$(document).scrollTop():0,offset.left-=Math.min(offset.left,offset.left+dpWidth>viewWidth&&dpWidth<viewWidth?Math.abs(offset.left+dpWidth-viewWidth):0),offset.top-=Math.min(offset.top,offset.top+dpHeight>viewHeight&&dpHeight<viewHeight?Math.abs(dpHeight+inputHeight):0),offset},_findPos:function(obj){for(var position=this._getInst(obj),isRTL=this._get(position,"isRTL");obj&&("hidden"===obj.type||1!==obj.nodeType||$.expr.pseudos.hidden(obj));)obj=obj[isRTL?"previousSibling":"nextSibling"];return[(position=$(obj).offset()).left,position.top]},_hideDatepicker:function(onClose){var showAnim,duration,inst=this._curInst;!inst||onClose&&inst!==$.data(onClose,"datepicker")||this._datepickerShowing&&(showAnim=this._get(inst,"showAnim"),duration=this._get(inst,"duration"),onClose=function(){$.datepicker._tidyDialog(inst)},$.effects&&($.effects.effect[showAnim]||$.effects[showAnim])?inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,onClose):inst.dpDiv["slideDown"===showAnim?"slideUp":"fadeIn"===showAnim?"fadeOut":"hide"](showAnim?duration:null,onClose),showAnim||onClose(),this._datepickerShowing=!1,(onClose=this._get(inst,"onClose"))&&onClose.apply(inst.input?inst.input[0]:null,[inst.input?inst.input.val():"",inst]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(inst){var $target;$.datepicker._curInst&&($target=$(inst.target),inst=$.datepicker._getInst($target[0]),($target[0].id===$.datepicker._mainDivId||0!==$target.parents("#"+$.datepicker._mainDivId).length||$target.hasClass($.datepicker.markerClassName)||$target.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!$target.hasClass($.datepicker.markerClassName)||$.datepicker._curInst===inst)||$.datepicker._hideDatepicker())},_adjustDate:function(inst,offset,period){var target=$(inst),inst=this._getInst(target[0]);this._isDisabledDatepicker(target[0])||(this._adjustInstDate(inst,offset,period),this._updateDatepicker(inst))},_gotoToday:function(date){var target=$(date),inst=this._getInst(target[0]);this._get(inst,"gotoCurrent")&&inst.currentDay?(inst.selectedDay=inst.currentDay,inst.drawMonth=inst.selectedMonth=inst.currentMonth,inst.drawYear=inst.selectedYear=inst.currentYear):(date=new Date,inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear()),this._notifyChange(inst),this._adjustDate(target)},_selectMonthYear:function(inst,select,period){var target=$(inst),inst=this._getInst(target[0]);inst["selected"+("M"===period?"Month":"Year")]=inst["draw"+("M"===period?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10),this._notifyChange(inst),this._adjustDate(target)},_selectDay:function(id,month,year,td){var inst=$(id);$(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(inst[0])||((inst=this._getInst(inst[0])).selectedDay=inst.currentDay=parseInt($("a",td).attr("data-date")),inst.selectedMonth=inst.currentMonth=month,inst.selectedYear=inst.currentYear=year,this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear)))},_clearDate:function(target){target=$(target);this._selectDate(target,"")},_selectDate:function(inst,dateStr){var onSelect=$(inst),inst=this._getInst(onSelect[0]);dateStr=null!=dateStr?dateStr:this._formatDate(inst),inst.input&&inst.input.val(dateStr),this._updateAlternate(inst),(onSelect=this._get(inst,"onSelect"))?onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst]):inst.input&&inst.input.trigger("change"),inst.inline?this._updateDatepicker(inst):(this._hideDatepicker(),this._lastInput=inst.input[0],"object"!=typeof inst.input[0]&&inst.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(dateStr){var altFormat,date,altField=this._get(dateStr,"altField");altField&&(altFormat=this._get(dateStr,"altFormat")||this._get(dateStr,"dateFormat"),date=this._getDate(dateStr),dateStr=this.formatDate(altFormat,date,this._getFormatConfig(dateStr)),$(document).find(altField).val(dateStr))},noWeekends:function(day){day=day.getDay();return[0<day&&day<6,""]},iso8601Week:function(time){var checkDate=new Date(time.getTime());return checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7)),time=checkDate.getTime(),checkDate.setMonth(0),checkDate.setDate(1),Math.floor(Math.round((time-checkDate)/864e5)/7)+1},parseDate:function(format,value,settings){if(null==format||null==value)throw"Invalid arguments";if(""===(value="object"==typeof value?value.toString():value+""))return null;for(var dim,extra,date,iValue=0,shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,shortYearCutoff="string"!=typeof shortYearCutoff?shortYearCutoff:(new Date).getFullYear()%100+parseInt(shortYearCutoff,10),dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,doy=-1,literal=!1,lookAhead=function(matches){matches=iFormat+1<format.length&&format.charAt(iFormat+1)===matches;return matches&&iFormat++,matches},getNumber=function(match){var num=lookAhead(match),num="@"===match?14:"!"===match?20:"y"===match&&num?4:"o"===match?3:2,num=new RegExp("^\\d{"+("y"===match?num:1)+","+num+"}"),num=value.substring(iValue).match(num);if(!num)throw"Missing number at position "+iValue;return iValue+=num[0].length,parseInt(num[0],10)},getName=function(match,names,longNames){var index=-1,names=$.map(lookAhead(match)?longNames:names,function(v,k){return[[k,v]]}).sort(function(a,b){return-(a[1].length-b[1].length)});if($.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()===name.toLowerCase())return index=pair[0],iValue+=name.length,!1}),-1!==index)return index+1;throw"Unknown name at position "+iValue},checkLiteral=function(){if(value.charAt(iValue)!==format.charAt(iFormat))throw"Unexpected literal at position "+iValue;iValue++},iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?checkLiteral():literal=!1;else switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":year=(date=new Date(getNumber("@"))).getFullYear(),month=date.getMonth()+1,day=date.getDate();break;case"!":year=(date=new Date((getNumber("!")-this._ticksTo1970)/1e4)).getFullYear(),month=date.getMonth()+1,day=date.getDate();break;case"'":lookAhead("'")?checkLiteral():literal=!0;break;default:checkLiteral()}if(iValue<value.length&&(extra=value.substr(iValue),!/^\s+/.test(extra)))throw"Extra/unparsed characters found in date: "+extra;if(-1===year?year=(new Date).getFullYear():year<100&&(year+=(new Date).getFullYear()-(new Date).getFullYear()%100+(year<=shortYearCutoff?0:-100)),-1<doy)for(month=1,day=doy;;){if(day<=(dim=this._getDaysInMonth(year,month-1)))break;month++,day-=dim}if((date=this._daylightSavingAdjust(new Date(year,month-1,day))).getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day)throw"Invalid date";return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(format,date,settings){if(!date)return"";function lookAhead(matches){return(matches=iFormat+1<format.length&&format.charAt(iFormat+1)===matches)&&iFormat++,matches}function formatNumber(match,value,len){var num=""+value;if(lookAhead(match))for(;num.length<len;)num="0"+num;return num}function formatName(match,value,shortNames,longNames){return(lookAhead(match)?longNames:shortNames)[value]}var iFormat,dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,output="",literal=!1;if(date)for(iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?output+=format.charAt(iFormat):literal=!1;else switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/864e5),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=lookAhead("y")?date.getFullYear():(date.getFullYear()%100<10?"0":"")+date.getFullYear()%100;break;case"@":output+=date.getTime();break;case"!":output+=1e4*date.getTime()+this._ticksTo1970;break;case"'":lookAhead("'")?output+="'":literal=!0;break;default:output+=format.charAt(iFormat)}return output},_possibleChars:function(format){for(var chars="",literal=!1,lookAhead=function(matches){matches=iFormat+1<format.length&&format.charAt(iFormat+1)===matches;return matches&&iFormat++,matches},iFormat=0;iFormat<format.length;iFormat++)if(literal)"'"!==format.charAt(iFormat)||lookAhead("'")?chars+=format.charAt(iFormat):literal=!1;else switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":lookAhead("'")?chars+="'":literal=!0;break;default:chars+=format.charAt(iFormat)}return chars},_get:function(inst,name){return(void 0!==inst.settings[name]?inst.settings:this._defaults)[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()!==inst.lastVal){var dateFormat=this._get(inst,"dateFormat"),dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){dates=noDefault?"":dates}inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear(),inst.currentDay=dates?date.getDate():0,inst.currentMonth=dates?date.getMonth():0,inst.currentYear=dates?date.getFullYear():0,this._adjustInstDate(inst)}},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date))},_determineDate:function(inst,newDate,defaultDate){newDate=null==newDate||""===newDate?defaultDate:"string"==typeof newDate?function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}for(var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date,year=date.getFullYear(),month=date.getMonth(),day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);matches;){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=7*parseInt(matches[1],10);break;case"m":case"M":month+=parseInt(matches[1],10),day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10),day=Math.min(day,$.datepicker._getDaysInMonth(year,month))}matches=pattern.exec(offset)}return new Date(year,month,day)}(newDate):"number"==typeof newDate?isNaN(newDate)?defaultDate:function(offset){var date=new Date;return date.setDate(date.getDate()+offset),date}(newDate):new Date(newDate.getTime());return(newDate=newDate&&"Invalid Date"===newDate.toString()?defaultDate:newDate)&&(newDate.setHours(0),newDate.setMinutes(0),newDate.setSeconds(0),newDate.setMilliseconds(0)),this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){return date?(date.setHours(12<date.getHours()?date.getHours()+2:0),date):null},_setDate:function(inst,newDate,noChange){var clear=!newDate,origMonth=inst.selectedMonth,origYear=inst.selectedYear,newDate=this._restrictMinMax(inst,this._determineDate(inst,newDate,new Date));inst.selectedDay=inst.currentDay=newDate.getDate(),inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth(),inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear(),origMonth===inst.selectedMonth&&origYear===inst.selectedYear||noChange||this._notifyChange(inst),this._adjustInstDate(inst),inst.input&&inst.input.val(clear?"":this._formatDate(inst))},_getDate:function(inst){return!inst.currentYear||inst.input&&""===inst.input.val()?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay))},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M")},next:function(){$.datepicker._adjustDate(id,+stepMonths,"M")},hide:function(){$.datepicker._hideDatepicker()},today:function(){$.datepicker._gotoToday(id)},selectDay:function(){return $.datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return $.datepicker._selectMonthYear(id,this,"M"),!1},selectYear:function(){return $.datepicker._selectMonthYear(id,this,"Y"),!1}};$(this).on(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")])})},_generateHTML:function(inst){var maxDraw,prev,next,firstDay,showWeek,dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,leadDays,curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,currentText=new Date,today=this._daylightSavingAdjust(new Date(currentText.getFullYear(),currentText.getMonth(),currentText.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel"),gotoDate=this._get(inst,"hideIfNoPrevNext"),buttonPanel=this._get(inst,"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),controls=this._get(inst,"showCurrentAtPos"),currentText=this._get(inst,"stepMonths"),isMultiMonth=1!==numMonths[0]||1!==numMonths[1],currentDate=this._daylightSavingAdjust(inst.currentDay?new Date(inst.currentYear,inst.currentMonth,inst.currentDay):new Date(9999,9,9)),minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-controls,drawYear=inst.drawYear;if(drawMonth<0&&(drawMonth+=12,drawYear--),maxDate)for(maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[0]*numMonths[1]+1,maxDate.getDate())),maxDraw=minDate&&maxDraw<minDate?minDate:maxDraw;this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw;)--drawMonth<0&&(drawMonth=11,drawYear--);for(inst.drawMonth=drawMonth,inst.drawYear=drawYear,controls=this._get(inst,"prevText"),controls=buttonPanel?this.formatDate(controls,this._daylightSavingAdjust(new Date(drawYear,drawMonth-currentText,1)),this._getFormatConfig(inst)):controls,prev=this._canAdjustMonth(inst,-1,drawYear,drawMonth)?$("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:controls}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")).text(controls))[0].outerHTML:gotoDate?"":$("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:controls}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")).text(controls))[0].outerHTML,controls=this._get(inst,"nextText"),controls=buttonPanel?this.formatDate(controls,this._daylightSavingAdjust(new Date(drawYear,drawMonth+currentText,1)),this._getFormatConfig(inst)):controls,next=this._canAdjustMonth(inst,1,drawYear,drawMonth)?$("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:controls}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")).text(controls))[0].outerHTML:gotoDate?"":$("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:controls}).append($("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")).text(controls))[0].outerHTML,currentText=this._get(inst,"currentText"),gotoDate=this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today,currentText=buttonPanel?this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)):currentText,controls="",inst.inline||(controls=$("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(inst,"closeText"))[0].outerHTML),buttonPanel="",showButtonPanel&&(buttonPanel=$("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(isRTL?controls:"").append(this._isInRange(inst,gotoDate)?$("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(currentText):"").append(isRTL?"":controls)[0].outerHTML),firstDay=parseInt(this._get(inst,"firstDay"),10),firstDay=isNaN(firstDay)?0:firstDay,showWeek=this._get(inst,"showWeek"),dayNames=this._get(inst,"dayNames"),dayNamesMin=this._get(inst,"dayNamesMin"),monthNames=this._get(inst,"monthNames"),monthNamesShort=this._get(inst,"monthNamesShort"),beforeShowDay=this._get(inst,"beforeShowDay"),showOtherMonths=this._get(inst,"showOtherMonths"),selectOtherMonths=this._get(inst,"selectOtherMonths"),defaultDate=this._getDefaultDate(inst),html="",row=0;row<numMonths[0];row++){for(group="",this.maxRows=4,col=0;col<numMonths[1];col++){if(selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay)),cornerClass=" ui-corner-all",calender="",isMultiMonth){if(calender+="<div class='ui-datepicker-group",1<numMonths[1])switch(col){case 0:calender+=" ui-datepicker-group-first",cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last",cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle",cornerClass=""}calender+="'>"}for(calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+(/all|left/.test(cornerClass)&&0===row?isRTL?next:prev:"")+(/all|right/.test(cornerClass)&&0===row?isRTL?prev:next:"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,0<row||0<col,monthNames,monthNamesShort)+"</div><table class='ui-datepicker-calendar'><thead><tr>",thead=showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"",dow=0;dow<7;dow++)thead+="<th scope='col'"+(5<=(dow+firstDay+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+dayNames[day=(dow+firstDay)%7]+"'>"+dayNamesMin[day]+"</span></th>";for(calender+=thead+"</tr></thead><tbody>",curRows=this._getDaysInMonth(drawYear,drawMonth),drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth&&(inst.selectedDay=Math.min(inst.selectedDay,curRows)),leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7,curRows=Math.ceil((leadDays+curRows)/7),numRows=isMultiMonth&&this.maxRows>curRows?this.maxRows:curRows,this.maxRows=numRows,printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays)),dRow=0;dRow<numRows;dRow++){for(calender+="<tr>",tbody=showWeek?"<td class='ui-datepicker-week-col'>"+this._get(inst,"calculateWeek")(printDate)+"</td>":"",dow=0;dow<7;dow++)daySettings=beforeShowDay?beforeShowDay.apply(inst.input?inst.input[0]:null,[printDate]):[!0,""],unselectable=(otherMonth=printDate.getMonth()!==drawMonth)&&!selectOtherMonths||!daySettings[0]||minDate&&printDate<minDate||maxDate&&maxDate<printDate,tbody+="<td class='"+(5<=(dow+firstDay+6)%7?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+(printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent||defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime()?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()===currentDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()===today.getTime()?" ui-datepicker-today":""))+"'"+(otherMonth&&!showOtherMonths||!daySettings[2]?"":" title='"+daySettings[2].replace(/'/g,"'")+"'")+(unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth()+"' data-year='"+printDate.getFullYear()+"'")+">"+(otherMonth&&!showOtherMonths?" ":unselectable?"<span class='ui-state-default'>"+printDate.getDate()+"</span>":"<a class='ui-state-default"+(printDate.getTime()===today.getTime()?" ui-state-highlight":"")+(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+(otherMonth?" ui-priority-secondary":"")+"' href='#' aria-current='"+(printDate.getTime()===currentDate.getTime()?"true":"false")+"' data-date='"+printDate.getDate()+"'>"+printDate.getDate()+"</a>")+"</td>",printDate.setDate(printDate.getDate()+1),printDate=this._daylightSavingAdjust(printDate);calender+=tbody+"</tr>"}11<++drawMonth&&(drawMonth=0,drawYear++),group+=calender+="</tbody></table>"+(isMultiMonth?"</div>"+(0<numMonths[0]&&col===numMonths[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}html+=group}return html+=buttonPanel,inst._keyEvent=!1,html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,years,monthNamesShort){var inMinYear,inMaxYear,month,thisYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),determineYear=this._get(inst,"selectMonthLabel"),selectYearLabel=this._get(inst,"selectYearLabel"),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth)monthHtml+="<span class='ui-datepicker-month'>"+years[drawMonth]+"</span>";else{for(inMinYear=minDate&&minDate.getFullYear()===drawYear,inMaxYear=maxDate&&maxDate.getFullYear()===drawYear,monthHtml+="<select class='ui-datepicker-month' aria-label='"+determineYear+"' data-handler='selectMonth' data-event='change'>",month=0;month<12;month++)(!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())&&(monthHtml+="<option value='"+month+"'"+(month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>");monthHtml+="</select>"}if(showMonthAfterYear||(html+=monthHtml+(!secondary&&changeMonth&&changeYear?"":" ")),!inst.yearshtml)if(inst.yearshtml="",secondary||!changeYear)html+="<span class='ui-datepicker-year'>"+drawYear+"</span>";else{for(years=this._get(inst,"yearRange").split(":"),thisYear=(new Date).getFullYear(),year=(determineYear=function(year){year=year.match(/c[+\-].*/)?drawYear+parseInt(year.substring(1),10):year.match(/[+\-].*/)?thisYear+parseInt(year,10):parseInt(year,10);return isNaN(year)?thisYear:year})(years[0]),endYear=Math.max(year,determineYear(years[1]||"")),year=minDate?Math.max(year,minDate.getFullYear()):year,endYear=maxDate?Math.min(endYear,maxDate.getFullYear()):endYear,inst.yearshtml+="<select class='ui-datepicker-year' aria-label='"+selectYearLabel+"' data-handler='selectYear' data-event='change'>";year<=endYear;year++)inst.yearshtml+="<option value='"+year+"'"+(year===drawYear?" selected='selected'":"")+">"+year+"</option>";inst.yearshtml+="</select>",html+=inst.yearshtml,inst.yearshtml=null}return html+=this._get(inst,"yearSuffix"),showMonthAfterYear&&(html+=(!secondary&&changeMonth&&changeYear?"":" ")+monthHtml),html+="</div>"},_adjustInstDate:function(inst,date,period){var year=inst.selectedYear+("Y"===period?date:0),month=inst.selectedMonth+("M"===period?date:0),date=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+("D"===period?date:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,date)));inst.selectedDay=date.getDate(),inst.drawMonth=inst.selectedMonth=date.getMonth(),inst.drawYear=inst.selectedYear=date.getFullYear(),"M"!==period&&"Y"!==period||this._notifyChange(inst)},_restrictMinMax:function(maxDate,newDate){var minDate=this._getMinMaxDate(maxDate,"min"),maxDate=this._getMinMaxDate(maxDate,"max"),newDate=minDate&&newDate<minDate?minDate:newDate;return maxDate&&maxDate<newDate?maxDate:newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");onChange&&onChange.apply(inst.input?inst.input[0]:null,[inst.selectedYear,inst.selectedMonth+1,inst])},_getNumberOfMonths:function(numMonths){numMonths=this._get(numMonths,"numberOfMonths");return null==numMonths?[1,1]:"number"==typeof numMonths?[1,numMonths]:numMonths},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var date=this._getNumberOfMonths(inst),date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:date[0]*date[1]),1));return offset<0&&date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth())),this._isInRange(inst,date)},_isInRange:function(yearSplit,date){var minDate=this._getMinMaxDate(yearSplit,"min"),maxDate=this._getMinMaxDate(yearSplit,"max"),minYear=null,maxYear=null,currentYear=this._get(yearSplit,"yearRange");return currentYear&&(yearSplit=currentYear.split(":"),currentYear=(new Date).getFullYear(),minYear=parseInt(yearSplit[0],10),maxYear=parseInt(yearSplit[1],10),yearSplit[0].match(/[+\-].*/)&&(minYear+=currentYear),yearSplit[1].match(/[+\-].*/)&&(maxYear+=currentYear)),(!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear()<=maxYear)},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");return{shortYearCutoff:shortYearCutoff="string"!=typeof shortYearCutoff?shortYearCutoff:(new Date).getFullYear()%100+parseInt(shortYearCutoff,10),dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,date,month,year){date||(inst.currentDay=inst.selectedDay,inst.currentMonth=inst.selectedMonth,inst.currentYear=inst.selectedYear);date=date?"object"==typeof date?date:this._daylightSavingAdjust(new Date(year,month,date)):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}}),$.fn.datepicker=function(options){if(!this.length)return this;$.datepicker.initialized||($(document).on("mousedown",$.datepicker._checkExternalClick),$.datepicker.initialized=!0),0===$("#"+$.datepicker._mainDivId).length&&$("body").append($.datepicker.dpDiv);var otherArgs=Array.prototype.slice.call(arguments,1);return"string"==typeof options&&("isDisabled"===options||"getDate"===options||"widget"===options)||"option"===options&&2===arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs)):this.each(function(){"string"==typeof options?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.13.2";$.datepicker}),function(z){"use strict";function ve(a){if(!D(a))return Xb;w(a.objectMaxDepth)&&(Xb.objectMaxDepth=Yb(a.objectMaxDepth)?a.objectMaxDepth:NaN),w(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Xb.urlErrorParamsEnabled=a.urlErrorParamsEnabled)}function Yb(a){return X(a)&&0<a}function F(a,b){return b=b||Error,function(){for(var c="["+(a?a+":":"")+(d=arguments[0])+"] http://errors.angularjs.org/1.8.2/"+(a?a+"/":"")+d,d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,f=arguments[d];c+=e(f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):void 0===f?"undefined":"string"!=typeof f?JSON.stringify(f):f)}return new b(c)}}function za(a){if(null!=a&&!$a(a)){if(H(a)||C(a)||x&&a instanceof x)return 1;var b="length"in Object(a)&&a.length;return X(b)&&(0<=b&&b-1 in a||"function"==typeof a.item)}}function r(a,b,d){if(a)if(B(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(H(a)||za(a))for(var f="object"!=typeof a,c=0,e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a);else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Pc(a))for(c in a)b.call(d,a[c],c,a);else if("function"==typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ta.call(a,c)&&b.call(d,a[c],c,a);return a}function Qc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Zb(a){return function(b,d){a(d,b)}}function $b(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(D(g)||B(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&D(p)?ha(p)?a[m]=new Date(p.valueOf()):ab(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):ac(p)?a[m]=p.clone():"__proto__"!==m&&(D(a[m])||(a[m]=H(p)?[]:{}),$b(a[m],[p],!0)):a[m]=p}}return c?a.$$hashKey=c:delete a.$$hashKey,a}function S(a){return $b(a,Ha.call(arguments,1),!1)}function xe(a){return $b(a,Ha.call(arguments,1),!0)}function fa(a){return parseInt(a,10)}function bc(a,b){return S(Object.create(a),b)}function E(){}function Ta(a){return a}function ia(a){return function(){return a}}function cc(a){return B(a.toString)&&a.toString!==la}function A(a){return void 0===a}function w(a){return void 0!==a}function D(a){return null!==a&&"object"==typeof a}function Pc(a){return null!==a&&"object"==typeof a&&!Rc(a)}function C(a){return"string"==typeof a}function X(a){return"number"==typeof a}function ha(a){return"[object Date]"===la.call(a)}function H(a){return Array.isArray(a)||a instanceof Array}function dc(a){switch(la.call(a)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return a instanceof Error}}function B(a){return"function"==typeof a}function ab(a){return"[object RegExp]"===la.call(a)}function $a(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"==typeof a}function ac(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ua(a){return K(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,d){d=a.indexOf(d);return 0<=d&&a.splice(d,1),d}function Ia(a,b,d){function c(a,b,c){if(--c<0)return"...";var f,d=b.$$hashKey;if(H(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Pc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"==typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&(b[f]=e(a[f],c));else for(f in a)ta.call(a,f)&&(b[f]=e(a[f],c));return d?b.$$hashKey=d:delete b.$$hashKey,b}function e(a,b){if(!D(a))return a;if(-1!==(d=g.indexOf(a)))return k[d];if($a(a)||bb(a))throw oa("cpws");var d=!1,e=f(a);return void 0===e&&(e=H(a)?[]:Object.create(Rc(a)),d=!0),g.push(a),k.push(e),d?c(a,e,b):e}function f(a){switch(la.call(a)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new a.constructor(e(a.buffer),a.byteOffset,a.length);case"[object ArrayBuffer]":if(a.slice)return a.slice(0);var b=new ArrayBuffer(a.byteLength);return new Uint8Array(b).set(new Uint8Array(a)),b;case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new a.constructor(a.valueOf());case"[object RegExp]":return(b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0])).lastIndex=a.lastIndex,b;case"[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}var g=[],k=[];if(d=Yb(d)?d:NaN,b){if(function(a){return a&&X(a.length)&&ze.test(la.call(a))}(b)||"[object ArrayBuffer]"===la.call(b))throw oa("cpta");if(a===b)throw oa("cpi");return H(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]}),g.push(a),k.push(b),c(a,b,d)}return e(a,d)}function ec(a,b){return a===b||a!=a&&b!=b}function va(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!=a&&b!=b)return!0;var c,d=typeof a;if(d===typeof b&&"object"===d){if(!H(a)){if(ha(a))return!!ha(b)&&ec(a.getTime(),b.getTime());if(ab(a))return!!ab(b)&&a.toString()===b.toString();if(bb(a)||bb(b)||$a(a)||$a(b)||H(b)||ha(b)||ab(b))return!1;for(c in d=T(),a)if("$"!==c.charAt(0)&&!B(a[c])){if(!va(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&w(b[c])&&!B(b[c]))return!1;return!0}if(!H(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!va(a[c],b[c]))return!1;return!0}}return!1}function db(a,b,d){return a.concat(Ha.call(b,d))}function Va(a,b){var d=2<arguments.length?Ha.call(arguments,2):[];return!B(b)||b instanceof RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Sc(a,b){var d=b;return"string"==typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:$a(b)?d="$WINDOW":b&&z.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE"),d}function eb(a,b){if(!A(a))return X(b)||(b=b?2:null),JSON.stringify(a,Sc,b)}function Tc(a){return C(a)?JSON.parse(a):a}function fc(d,b){d=d.replace(Be,"");d=Date.parse("Jan 01, 1970 00:00:00 "+d)/6e4;return Y(d)?b:d}function Uc(a,b){return(a=new Date(a.getTime())).setMinutes(a.getMinutes()+b),a}function gc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();return Uc(a,d*((b=fc(b,c))-c))}function Aa(a){a=x(a).clone().empty();var b=x("<div></div>").append(a).html();try{return a[0].nodeType===Pa?K(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+K(b)})}catch(d){return K(b)}}function Vc(a){try{return decodeURIComponent(a)}catch(b){}}function hc(a){var b={};return r((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),-1!==(c=a.indexOf("="))&&(e=a.substring(0,c),f=a.substring(c+1)),w(e=Vc(e))&&(f=!w(f)||Vc(f),ta.call(b,e)?H(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))}),b}function ic(a){return ba(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ba(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function Ee(a,b){var d,c,e={};r(Qa,function(b){b+="app",!d&&a.hasAttribute&&a.hasAttribute(b)&&(c=(d=a).getAttribute(b))}),r(Qa,function(b){var e;b+="app",!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(c=(d=e).getAttribute(b))}),d&&(Fe?(e.strictDi=null!==function(a,b){for(var d,e=Qa.length,c=0;c<e;++c)if(d=Qa[c]+b,C(d=a.getAttribute(d)))return d;return null}(d,"strict-di"),b(d,c?[c]:[],e)):z.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Wc(a,b,d){D(d)||(d={}),d=S({strictDi:!1},d);var c=function(){if((a=x(a)).injector()){var c=a[0]===z.document?"document":Aa(a);throw oa("btstrpd",c.replace(/</,"<").replace(/>/,">"))}return(b=b||[]).unshift(["$provide",function(b){b.value("$rootElement",a)}]),d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]),b.unshift("ng"),(c=fb(b,d.strictDi)).invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;if(z&&e.test(z.name)&&(d.debugInfoEnabled=!0,z.name=z.name.replace(e,"")),z&&!f.test(z.name))return c();z.name=z.name.replace(f,""),ca.resumeBootstrap=function(a){return r(a,function(a){b.push(a)}),c()},B(ca.resumeDeferredBootstrap)&&ca.resumeDeferredBootstrap()}function Ge(){z.name="NG_ENABLE_DEBUG_INFO!"+z.name,z.location.reload()}function He(a){if(!(a=ca.element(a).injector()))throw oa("test");return a.get("$$testability")}function Xc(a,b){return b=b||"_",a.replace(Ie,function(a,c){return(c?b:"")+a.toLowerCase()})}function Ke(){U.legacyXHTMLReplacement=!0}function gb(a,b,d){if(!a)throw oa("areq",b||"?",d||"required");return a}function tb(a,b,d){return d&&H(a)&&(a=a[a.length-1]),gb(B(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function Ja(a,b){if("hasOwnProperty"===a)throw oa("badname",b)}function ub(a){for(var c,b=a[0],d=a[a.length-1],e=1;b!==d&&(b=b.nextSibling);e++)!c&&a[e]===b||(c=c||x(Ha.call(a,0,e))).push(b);return c||a}function T(){return Object.create(null)}function jc(a){if(null==a)return"";switch(typeof a){case"string":break;case"number":a=""+a;break;default:a=!cc(a)||H(a)||ha(a)?eb(a):a.toString()}return a}function ja(a,b){if(H(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(D(a))for(d in b=b||{},a)"$"===d.charAt(0)&&"$"===d.charAt(1)||(b[d]=a[d]);return b||a}function xb(a,b){return b.toUpperCase()}function yb(a){return a.replace(qg,xb)}function mc(a){return 1===(a=a.nodeType)||!a||9===a}function gd(a,b){var d,c,e,k,f=b.createDocumentFragment(),g=[];if(nc.test(a)){if(d=f.appendChild(b.createElement("div")),c=(rg.exec(a)||["",""])[1].toLowerCase(),e=U.legacyXHTMLReplacement?a.replace(sg,"<$1></$2>"):a,wa<10)for(c=hb[c]||hb._default,d.innerHTML=c[1]+e+c[2],k=c[0];k--;)d=d.firstChild;else{for(k=(c=qa[c]||[]).length;-1<--k;)d.appendChild(z.document.createElement(c[k])),d=d.firstChild;d.innerHTML=e}g=db(g,d.childNodes),(d=f.firstChild).textContent=""}else g.push(b.createTextNode(a));return f.textContent="",f.innerHTML="",r(g,function(a){f.appendChild(a)}),f}function U(a){if(a instanceof U)return a;var d,b;if(C(a)&&(a=V(a),b=!0),!(this instanceof U)){if(b&&"<"!==a.charAt(0))throw oc("nosel");return new U(a)}b?(b=z.document,pc(this,a=(d=tg.exec(a))?[b.createElement(d[1])]:(d=gd(a,b))?d.childNodes:[])):B(a)?hd(a):pc(this,a)}function qc(a){return a.cloneNode(!0)}function zb(a,b){!b&&mc(a)&&x.cleanData([a]),a.querySelectorAll&&x.cleanData(a.querySelectorAll("*"))}function id(a){for(var b in a)return;return 1}function jd(a){var b=a.ng339,d=b&&Ka[b],c=d&&d.events;(d=d&&d.data)&&!id(d)||c&&!id(c)||(delete Ka[b],a.ng339=void 0)}function kd(a,b,d,c){if(w(c))throw oc("offargs");var e=(c=Ab(a))&&c.events,f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];w(d)&&cb(c||[],d),w(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a),Bb[a]&&g(Bb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];jd(a)}}function rc(a,b){var d=a.ng339;(d=d&&Ka[d])&&(b?delete d.data[b]:d.data={},jd(a))}function Ab(a,b){var d=(d=a.ng339)&&Ka[d];return b&&!d&&(a.ng339=d=++ug,d=Ka[d]={events:{},data:{},handle:void 0}),d}function sc(a,b,d){if(mc(a)){var c,e=w(d),f=!e&&b&&!D(b),g=!b;if(a=(a=Ab(a,!f))&&a.data,e)a[yb(b)]=d;else{if(g)return a;if(f)return a&&a[yb(b)];for(c in b)a[yb(c)]=b[c]}}}function Cb(a,b){return!!a.getAttribute&&-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" ")}function Db(a,b){var d,c;b&&a.setAttribute&&(d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d,r(b.split(" "),function(a){a=V(a),c=c.replace(" "+a+" "," ")}),c!==d&&a.setAttribute("class",V(c)))}function Eb(a,b){var d,c;b&&a.setAttribute&&(d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d,r(b.split(" "),function(a){a=V(a),-1===c.indexOf(" "+a+" ")&&(c+=a+" ")}),c!==d&&a.setAttribute("class",V(c)))}function pc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"==typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function ld(a,b){return Fb(a,"$"+(b||"ngController")+"Controller")}function Fb(a,b,d){for(9===a.nodeType&&(a=a.documentElement),b=H(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(w(d=x.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function md(a){for(zb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Gb(a,d){d||zb(a);d=a.parentNode;d&&d.removeChild(a)}function hd(a){function b(){z.document.removeEventListener("DOMContentLoaded",b),z.removeEventListener("load",b),a()}"complete"===z.document.readyState?z.setTimeout(a):(z.document.addEventListener("DOMContentLoaded",b),z.addEventListener("load",b))}function nd(a,d){d=Hb[d.toLowerCase()];return d&&od[ua(a)]&&d}function xg(a,b,d){d.call(a,b)}function yg(a,b,d){var c=b.relatedTarget;c&&(c===a||zg.call(a,c))||d.call(a,b)}function ng(){this.$get=function(){return S(U,{hasClass:function(a,b){return a.attr&&(a=a[0]),Cb(a,b)},addClass:function(a,b){return a.attr&&(a=a[0]),Eb(a,b)},removeClass:function(a,b){return a.attr&&(a=a[0]),Db(a,b)}})}}function La(a,b){var d=a&&a.$$hashKey;return d?("function"==typeof d&&(d=a.$$hashKey()),d):"function"===(d=typeof a)||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||function(){return++qb})():d+":"+a}function pd(){this._keys=[],this._values=[],this._lastKey=NaN,this._lastIndex=-1}function qd(a){return(a=Function.prototype.toString.call(a).replace(Ag,"")).match(Bg)||a.match(Cg)}function fb(N,b){function d(a){return function(b,c){if(!D(b))return a(b,c);r(b,Zb(a))}}function c(a,b){if(Ja(a,"service"),(B(b)||H(b))&&(b=n.instantiate(b)),!b.$get)throw Ca("pget",a);return p[a+"Provider"]=b}function f(a,b,d){return c(a,{$get:!1!==d?function(a,b){return function(){var c=t.invoke(b,this);if(A(c))throw Ca("undef",a);return c}}(a,b):b})}function g(a){gb(A(a)||H(a),"modulesToLoad","not an array");var c,b=[];return r(a,function(a){function d(a){for(var b=0,c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{C(a)?(c=lc(a),t.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):B(a)||H(a)?b.push(n.invoke(a)):tb(a,"module")}catch(e){throw H(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ca("modulerr",a,e.stack||e.message||e)}}}),b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ca("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),a[b]}catch(f){throw a[b]===h&&delete a[b],f}finally{l.shift()}}function e(a,c,f){for(var g=[],h=0,k=(a=fb.$$annotate(a,b,f)).length;h<k;h++){var l=a[h];if("string"!=typeof l)throw Ca("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){var f;return"string"==typeof c&&(d=c,c=null),c=e(a,c,d),H(a)&&(a=a[a.length-1]),d=a,(d=!wa&&"function"==typeof d&&(Ga(f=d.$$ngIsClass)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d))),f))?(c.unshift(null),new(Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=H(a)?a[a.length-1]:a;return(a=e(a,b,c)).unshift(null),new(Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var h={},l=[],m=new Ib,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ia(b),!1)}),constant:d(function(a,b){Ja(a,"constant"),p[a]=b,s[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){throw ca.isString(b)&&l.push(b),Ca("unpr",l.join(" <- "))}),s={},G=k(s,function(a,c){c=n.get(a+"Provider",c);return t.invoke(c.$get,c,void 0,a)}),t=G;p.$injectorProvider={$get:ia(G)},t.modules=n.modules=T();N=g(N);return(t=G.get("$injector")).strictDi=b,r(N,function(a){a&&t.invoke(a)}),t.loadNewModules=function(a){r(g(a),function(a){a&&t.invoke(a)})},t}function Bf(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,d,c){function f(a){var c;a?(a.scrollIntoView(),B(c=g.yOffset)?c=c():ac(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):X(c)||(c=0),c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))):b.scrollTo(0,0)}function g(a){var b;(a=C(a)?a:X(a)?a.toString():d.hash())?(b=k.getElementById(a))||(b=function(a){var b=null;return Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0}),b}(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;return a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||function(a,b){"complete"===(b=b||z).document.readyState?b.setTimeout(a):x(b).on("load",a)}(function(){c.$evalAsync(g)})}),g}]}function ib(a,b){return a||b?a?b?(H(a)&&(a=a.join(" ")),H(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function ra(a){return D(a)?a:{}}function Fg(a,b,d,c,e){function f(){pa=null,k()}function g(){va(t=A(t=y())?null:t,P)&&(t=P),N=P=t}function k(){var a=N;g(),v===h.url()&&a===t||(v=h.url(),N=t,r(J,function(a){a(h.url(),t)}))}var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,s={},G=e(d);h.isMock=!1,h.$$completeOutstandingRequest=G.completeTask,h.$$incOutstandingRequestCount=G.incTaskCount,h.notifyWhenNoOutstandingRequests=G.notifyWhenNoPendingTasks;var t,N,v=l.href,kc=b.find("base"),pa=null,y=c.history?function(){try{return m.state}catch(a){}}:E;g(),h.url=function(b,d,e){if(A(e)&&(e=null),l!==a.location&&(l=a.location),m!==a.history&&(m=a.history),b){var f=N===e;if(b=ga(b).href,v===b&&(!c.history||f))return h;var k=v&&Da(v)===Da(b);return v=b,N=e,!c.history||k&&f?(k||(pa=b),d?l.replace(b):k?(d=l,e=-1===(f=(e=b).indexOf("#"))?"":e.substr(f),d.hash=e):l.href=b,l.href!==b&&(pa=b)):(m[d?"replaceState":"pushState"](e,"",b),g()),pa=pa&&b,h}return(pa||l.href).replace(/#$/,"")},h.state=function(){return t};var J=[],I=!1,P=null;h.onUrlChange=function(b){return I||(c.history&&x(a).on("popstate",f),x(a).on("hashchange",f),I=!0),J.push(b),b},h.$$applicationDestroyed=function(){x(a).off("hashchange popstate",f)},h.$$checkUrlChange=k,h.baseHref=function(){var a=kc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""},h.defer=function(a,b,c){var d;return b=b||0,c=c||G.DEFAULT_TASK_TYPE,G.incTaskCount(c),d=p(function(){delete s[d],G.completeTask(a,c)},b),s[d]=c,d},h.defer.cancel=function(a){if(s.hasOwnProperty(a)){var b=s[a];return delete s[a],n(a),G.completeTask(E,b),!0}return!1}}function If(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,d,c,e){return new Fg(a,c,b,d,e)}]}function Jf(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),(p=a).n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw F("$cacheFactory")("iid",a);var g=0,k=S({},c,{id:a}),h=T(),l=c&&c.capacity||Number.MAX_VALUE,m=T(),p=null,n=null;return b[a]={put:function(a,b){if(!A(b))return l<Number.MAX_VALUE&&e(m[a]||(m[a]={key:a})),a in h||g++,h[a]=b,l<g&&this.remove(n.key),b},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p),b===n&&(n=b.n),f(b.n,b.p),delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=T(),g=0,m=T(),p=n=null},destroy:function(){m=k=h=null,delete b[a]},info:function(){return S({},k,{size:g})}}}var b={};return a.info=function(){var a={};return r(b,function(b,e){a[e]=b.info()}),a},a.get=function(a){return b[a]},a}}function hg(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Zc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=T();return r(a,function(a,f){if((a=a.trim())in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw $("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f},g[4]&&(p[a]=e[f])}}),e}function e(a){var b=a.require||a.controller&&a.name;return!H(b)&&D(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)}),b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=function(a){var d,b={};for(a=a.split(","),d=0;d<a.length;d++)b[a[d]]=!0;return b}("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=T();this.directive=function pa(b,d){return gb(b,"name"),Ja(b,"directive"),C(b)?(function(a){var b=a.charAt(0);if(!b||b!==K(b))throw $("baddir",a);if(a!==a.trim())throw $("baddir",a)}(b),gb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];return r(f[b],function(f,g){try{var h=a.invoke(f);B(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link)),h.priority=h.priority||0,h.index=g,h.name=h.name||b,h.require=e(h);var k=h,l=h.restrict;if(l&&(!C(l)||!/[EACM]/.test(l)))throw $("badrestrict",l,b);k.restrict=l||"EA",h.$$moduleName=f.$$moduleName,d.push(h)}catch(m){c(m)}}),d}])),f[b].push(d)):r(b,Zb(pa)),this},this.component=function y(a,b){function c(a){function e(b){return B(b)||H(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:function(d,b){if(b&&C(b))return b;if(C(d)){d=wd.exec(d);if(d)return d[3]}}(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",require:b.require};return r(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)}),g}if(!C(a))return r(a,Zb(Va(this,y))),this;var d=b.controller||function(){};return r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,B(d)&&(d[b]=a))}),c.$inject=["$injector"],this.directive(a,c)},this.aHrefSanitizationTrustedUrlList=function(a){return w(a)?(b.aHrefSanitizationTrustedUrlList(a),this):b.aHrefSanitizationTrustedUrlList()},Object.defineProperty(this,"aHrefSanitizationWhitelist",{get:function(){return this.aHrefSanitizationTrustedUrlList},set:function(a){this.aHrefSanitizationTrustedUrlList=a}}),this.imgSrcSanitizationTrustedUrlList=function(a){return w(a)?(b.imgSrcSanitizationTrustedUrlList(a),this):b.imgSrcSanitizationTrustedUrlList()},Object.defineProperty(this,"imgSrcSanitizationWhitelist",{get:function(){return this.imgSrcSanitizationTrustedUrlList},set:function(a){this.imgSrcSanitizationTrustedUrlList=a}});var n=!0,s=!(this.debugInfoEnabled=function(a){return w(a)?(n=a,this):n});this.strictComponentBindingsEnabled=function(a){return w(a)?(s=a,this):s};var G=10;this.onChangesTtl=function(a){return arguments.length?(G=a,this):G};var t=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};var N=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(N=a,this):N};var v=T();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();if(d in v&&v[d]!==c)throw $("ctxoverride",a,b,v[d],c);return v[d]=c,this},function(){function a(b,c){r(c,function(a){v[a.toLowerCase()]=b})}a(W.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),a(W.CSS,["*|style"]),a(W.URL,"area|href area|ping a|href a|ping blockquote|cite body|background del|cite input|src ins|cite q|cite".split(" ")),a(W.MEDIA_URL,"audio|src img|src img|srcset source|src source|srcset track|src video|src video|poster".split(" ")),a(W.RESOURCE_URL,"*|formAction applet|code applet|codebase base|href embed|src frame|src form|action head|profile html|manifest iframe|src link|href media|src object|codebase object|data script|src".split(" "))}(),this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,M,L,u,R){function q(){try{if(!--Ja)throw Ua=void 0,$("infchng",G);L.$apply(function(){for(var a=0,b=Ua.length;a<b;++a)try{Ua[a]()}catch(d){c(d)}Ua=void 0})}finally{Ja++}}function ma(a,b){if(!a)return a;if(!C(a))throw $("srcset",b,a.toString());for(var c="",d=V(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,e=/\s/.test(d)?e:/(,)/,d=d.split(e),e=Math.floor(d.length/2),f=0;f<e;f++)var g=2*f,c=(c=c+u.getTrustedMediaUrl(V(d[g])))+(" "+V(d[1+g]));return d=V(d[2*f]).split(/\s/),c+=u.getTrustedMediaUrl(V(d[0])),2===d.length&&(c+=" "+V(d[1])),c}function w(a,b){if(b)for(var f,c=Object.keys(b),d=0,e=c.length;d<e;d++)this[f=c[d]]=b[f];else this.$attr={};this.$$element=a}function sa(a,b){try{a.addClass(b)}catch(c){}}function da(a,b,c,d,e){a instanceof x||(a=x(a));var f=Xa(a,b,a,c,d,e);da.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw $("multilink");gb(b,"scope"),e&&e.needsNewScope&&(b=b.$parent.$new());var h=(d=d||{}).parentBoundTranscludeFn,k=d.transcludeControllers;if(d=d.futureParentElement,h&&h.$$boundTransclude&&(h=h.$$boundTransclude),d="html"!==(g=g||((d=d&&d[0])&&"foreignobject"!==ua(d)&&la.call(d).match(/SVG/)?"svg":"html"))?x(ja(g,x("<div></div>").append(a).html())):c?Wa.clone.call(a):a,k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);return da.$$addScopeInfo(d,b),c&&c(d,b),f&&f(b,d,d,h),c||(a=f=null),d}}function Xa(a,b,c,d,e,f){for(var l,m,p,I,n,h=[],k=H(a)||a instanceof x,t=0;t<a.length;t++)l=new w,11===wa&&function(a,b,c){var f,d=a[b],e=d.parentNode;if(d.nodeType===Pa)for(;(f=e?d.nextSibling:a[b+1])&&f.nodeType===Pa;)d.nodeValue+=f.nodeValue,f.parentNode&&f.parentNode.removeChild(f),c&&f===a[b+1]&&a.splice(b+1,1)}(a,t,k),(f=(m=tc(a[t],[],l,0===t?d:void 0,e)).length?aa(m,a[t],l,b,c,null,[],[],f):null)&&f.scope&&da.$$addScopeClass(l.$$element),l=f&&f.terminal||!(p=a[t].childNodes)||!p.length?null:Xa(p,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b),(f||l)&&(h.push(t,f,l),I=!0,n=n||f),f=null;return I?function(a,c,d,e){var f,k,l,m,p,t;if(n)for(t=Array(c.length),m=0;m<h.length;m+=3)t[f=h[m]]=c[f];else t=c;for(m=0,p=h.length;m<p;)k=t[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(x(k),l)):l=a,c(f,l,k,d,c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null)):f&&f(a,k.childNodes,void 0,e)}:null}function ka(a,b,c){function d(e,f,g,h,k){return e||((e=a.$new(!1,k)).$$transcluded=!0),b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var f,e=d.$$slots=T();for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function tc(a,b,d,e,f){var h,g=d.$attr;switch(a.nodeType){case 1:Y(b,xa(h=ua(a)),"E",e,f);for(var s=a.attributes,v=0,G=s&&s.length;v<G;v++){var M,l,n,P=!1,N=!1,r=!1,y=!1,u=!1,m=(l=s[v]).name,t=l.value;(M=(n=xa(m.toLowerCase())).match(Ra))?(r="Attr"===M[1],y="Prop"===M[1],u="On"===M[1],m=m.replace(rd,"").toLowerCase().substr(4+M[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):(M=n.match(Sa))&&ca(M[1])&&(N=(P=m).substr(0,m.length-5)+"end",m=m.substr(0,m.length-6)),y||u?(d[n]=t,g[n]=l.name,y?Ea(a,b,n,m):b.push(sd(p,L,c,n,m,!1))):(g[n=xa(m.toLowerCase())]=m,!r&&d.hasOwnProperty(n)||(d[n]=t,nd(a,n)&&(d[n]=!0)),Ia(a,b,t,n,r),Y(b,n,"A",e,f,P,N))}if("input"===h&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off"),!Qa)break;if(D(g=a.className)&&(g=g.animVal),C(g)&&""!==g)for(;a=k.exec(g);)Y(b,n=xa(a[2]),"C",e,f)&&(d[n]=V(a[3])),g=g.substr(a.index+a[0].length);break;case Pa:na(b,a.nodeValue);break;case 8:if(!Oa)break;F(a,b,d,e,f)}return b.sort(ia),b}function F(a,b,c,d,e){try{var h,f=g.exec(a.nodeValue);!f||Y(b,h=xa(f[1]),"M",d,e)&&(c[h]=V(f[2]))}catch(k){}}function U(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw $("uterdir",b,c)}while(1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--),d.push(a),a=a.nextSibling,0<e)}else d.push(a);return x(d)}function W(a,b,c){return function(d,e,f,g,h){return e=U(e[0],b,c),a(d,e,f,g,h)}}function Z(a,b,c,d,e,f){var g;return a?da(b,c,d,e,f):function(){return g||(g=da(b,c,d,e,f),b=c=f=null),g.apply(this,arguments)}}function aa(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){a&&(c&&(a=W(a,c,d)),a.require=u.require,a.directiveName=Q,s!==u&&!u.$$isolateScope||(a=Ba(a,{isolateScope:!0})),h.push(a)),b&&(c&&(b=W(b,c,d)),b.require=u.require,b.directiveName=Q,s!==u&&!u.$$isolateScope||(b=Ba(b,{isolateScope:!0})),k.push(b))}function p(a,e,f,g,l){var n,u,L,y,G,P,M,Q;for(n in b===f?Q=(g=d).$$element:g=new w(Q=x(f),d),G=e,s?y=e.$new(!0):t&&(G=e.$parent),l&&((M=function(a,b,c,d){var e;if(bb(a)||(d=c,c=b,b=a,a=void 0),N&&(e=P),c=c||(N?Q.parent():Q),!d)return l(a,b,e,c,R);var f=l.$$slots[d];if(f)return f(a,b,e,c,R);if(A(f))throw $("noslot",d,Aa(Q))}).$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]}),J&&(P=ea(Q,g,M,J,y,e,s)),s&&(da.$$addScopeInfo(Q,y,!0,!(v&&(v===s||v===s.$$originalDirective))),da.$$addScopeClass(Q,!0),y.$$isolateBindings=s.$$isolateBindings,(u=Da(e,g,y,y.$$isolateBindings,s)).removeWatches&&y.$on("$destroy",u.removeWatches)),P){u=J[n],L=P[n];var Hg=u.$$bindings.bindToController;L.instance=L(),Q.data("$"+u.name+"Controller",L.instance),L.bindingInfo=Da(G,g,L.instance,Hg,u)}for(r(J,function(a,b){var c=a.require;a.bindToController&&!H(c)&&D(c)&&S(P[b].instance,X(b,c,Q,P))}),r(P,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(B(b.$onInit))try{b.$onInit()}catch(e){c(e)}B(b.$doCheck)&&(G.$watch(function(){b.$doCheck()}),b.$doCheck()),B(b.$onDestroy)&&G.$on("$destroy",function(){b.$onDestroy()})}),n=0,u=h.length;n<u;n++)Ca(L=h[n],L.isolateScope?y:e,Q,g,L.require&&X(L.directiveName,L.require,Q,P),M);var R=e;for(s&&(s.template||null===s.templateUrl)&&(R=y),a&&a(R,f.childNodes,void 0,l),n=k.length-1;0<=n;n--)Ca(L=k[n],L.isolateScope?y:e,Q,g,L.require&&X(L.directiveName,L.require,Q,P),M);r(P,function(a){B((a=a.instance).$postLink)&&a.$postLink()})}l=l||{};for(var u,Q,M,q,O,n=-Number.MAX_VALUE,t=l.newScopeDirective,J=l.controllerDirectives,s=l.newIsolateScopeDirective,v=l.templateDirective,L=l.nonTlbTranscludeDirective,G=!1,P=!1,N=l.hasElementTranscludeDirective,y=d.$$element=x(b),R=e,ma=!1,Jb=!1,sa=0,C=a.length;sa<C;sa++){var E=(u=a[sa]).$$start,jb=u.$$end;if(E&&(y=U(b,E,jb)),M=void 0,n>u.priority)break;if((O=u.scope)&&(u.templateUrl||(D(O)?(ba("new/isolated scope",s||t,u,y),s=u):ba("new/isolated scope",s,u,y)),t=t||u),Q=u.name,!ma&&(u.replace&&(u.templateUrl||u.template)||u.transclude&&!u.$$tlb)){for(O=sa+1;ma=a[O++];)if(ma.transclude&&!ma.$$tlb||ma.replace&&(ma.templateUrl||ma.template)){Jb=!0;break}ma=!0}if(!u.templateUrl&&u.controller&&(J=J||T(),ba("'"+Q+"' controller",J[Q],u,y),J[Q]=u),O=u.transclude)if(G=!0,u.$$tlb||(ba("transclusion",L,u,y),L=u),"element"===O)N=!0,n=u.priority,M=y,y=d.$$element=x(da.$$createComment(Q,d[Q])),b=y[0],oa(f,Ha.call(M,0),b),R=Z(Jb,M,e,n,g&&g.name,{nonTlbTranscludeDirective:L});else{var ka=T();if(D(O)){M=z.document.createDocumentFragment();var K,Xa=T(),F=T();for(K in r(O,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a,Xa[a]=b,ka[b]=null,F[b]=c}),r(y.contents(),function(a){var b=Xa[xa(ua(a))];b?(F[b]=!0,ka[b]=ka[b]||z.document.createDocumentFragment(),ka[b].appendChild(a)):M.appendChild(a)}),r(F,function(a,b){if(!a)throw $("reqslot",b)}),ka)ka[K]&&(R=x(ka[K].childNodes),ka[K]=Z(Jb,R,e));M=x(M.childNodes)}else M=x(qc(b)).contents();y.empty(),(R=Z(Jb,M,e,void 0,void 0,{needsNewScope:u.$$isolateScope||u.$$newScope})).$$slots=ka}if(u.template)if(P=!0,ba("template",v,u,y),O=B((v=u).template)?u.template(y,d):u.template,O=Na(O),u.replace){if(g=u,M=nc.test(O)?td(ja(u.templateNamespace,V(O))):[],b=M[0],1!==M.length||1!==b.nodeType)throw $("tplrt",Q,"");oa(f,y,b),O=tc(b,[],C={$attr:{}});var Ig=a.splice(sa+1,a.length-(sa+1));(s||t)&&fa(O,s,t),a=a.concat(O).concat(Ig),ga(d,C),C=a.length}else y.html(O);if(u.templateUrl)P=!0,ba("template",v,u,y),(v=u).replace&&(g=u),p=ha(a.splice(sa,a.length-sa),y,d,f,G&&R,h,k,{controllerDirectives:J,newScopeDirective:t!==u&&t,newIsolateScopeDirective:s,templateDirective:v,nonTlbTranscludeDirective:L}),C=a.length;else if(u.compile)try{q=u.compile(y,d,R);var Y=u.$$originalDirective||u;B(q)?m(null,Va(Y,q),E,jb):q&&m(Va(Y,q.pre),Va(Y,q.post),E,jb)}catch(ca){c(ca,Aa(y))}u.terminal&&(p.terminal=!0,n=Math.max(n,u.priority))}return p.scope=t&&!0===t.scope,p.transcludeOnThisElement=G,p.templateOnThisElement=P,p.transclude=R,l.hasElementTranscludeDirective=N,p}function X(a,b,c,d){if(C(b)){var f=b.match(l);b=b.substring(f[0].length);var h,e,g=f[1]||f[3],f="?"===f[2];if("^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance,e||(h="$"+b+"Controller",e="^^"===g&&c[0]&&9===c[0].nodeType?null:g?c.inheritedData(h):c.data(h)),!e&&!f)throw $("ctreq",b,a)}else if(H(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=X(a,b[g],c,d);else D(b)&&(e={},r(b,function(b,f){e[f]=X(a,b,c,d)}));return e||null}function ea(a,b,c,d,e,f,g){var k,h=T();for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]),m=M(p,m,!0,l.controllerAs),h[l.name]=m,a.data("$"+l.name+"Controller",m.instance)}return h}function fa(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=bc(a[d],{$$isolateScope:b,$$newScope:c})}function Y(b,c,e,g,h,k,l){if(c!==h){var m=null;if(f.hasOwnProperty(c))for(var p=0,n=(h=a.get(c+"Directive")).length;p<n;p++)if(c=h[p],(A(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){if(k&&(c=bc(c,{$$start:k,$$end:l})),!c.$$bindings){var I=m=c,t=c.name,u={isolateScope:null,bindToController:null};if(D(I.scope)&&(!0===I.bindToController?(u.bindToController=d(I.scope,t,!0),u.isolateScope={}):u.isolateScope=d(I.scope,t,!1)),D(I.bindToController)&&(u.bindToController=d(I.bindToController,t,!0)),u.bindToController&&!I.controller)throw $("noctrl",t);D((m=m.$$bindings=u).isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c),m=c}return m}}function ca(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if((b=c[d]).multiElement)return 1}function ga(a,b){var c=b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))}),r(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var p,n,m=[],t=b[0],u=a.shift(),J=bc(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),s=B(u.templateUrl)?u.templateUrl(b,d):u.templateUrl,L=u.templateNamespace;return b.empty(),e(s).then(function(c){var e,I;if(c=Na(c),u.replace){if(c=nc.test(c)?td(ja(L,V(c))):[],e=c[0],1!==c.length||1!==e.nodeType)throw $("tplrt",u.name,s);c={$attr:{}},oa(f,b,e);var v=tc(e,[],c);D(u.scope)&&fa(v,!0),a=v.concat(a),ga(d,c)}else e=t,b.html(c);for(a.unshift(J),p=aa(a,e,d,g,b,u,h,k,l),r(f,function(a,c){a===e&&(f[c]=b[0])}),n=Xa(b[0].childNodes,g);m.length;){c=m.shift(),I=m.shift();var G,y=m.shift(),P=m.shift(),v=b[0];c.$$destroyed||(I!==t&&(G=I.className,l.hasElementTranscludeDirective&&u.replace||(v=qc(e)),oa(y,x(I),v),sa(x(v),G)),I=p.transcludeOnThisElement?ka(c,p.transclude,P):P,p(n,c,v,f,I))}m=null}).catch(function(a){dc(a)&&c(a)}),function(a,b,c,d,e){a=e,b.$$destroyed||(m?m.push(b,c,d,a):(p.transcludeOnThisElement&&(a=ka(b,p.transclude,e)),p(n,b,c,d,a)))}}function ia(a,b){var c=b.priority-a.priority;return 0!=c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ba(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw $("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,Aa(d))}function na(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){var b=!!(a=a.parent()).length;return b&&da.$$addBindingClass(a),function(a,c){var e=c.parent();b||da.$$addBindingClass(e),da.$$addBindingInfo(e,d.expressions),a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ja(a,b){switch(a=K(a||"html")){case"svg":case"math":var c=z.document.createElement("div");return c.innerHTML="<"+a+">"+b+"</"+a+">",c.childNodes[0].childNodes;default:return b}}function za(a){return ma(u.valueOf(a),"ng-prop-srcset")}function Ea(a,b,c,d){if(m.test(d))throw $("nodomevents");var e=function(a,c){return c=c.toLowerCase(),v[a+"|"+c]||v["*|"+c]}(a=ua(a),d),f=Ta;"srcset"!==d||"img"!==a&&"source"!==a?e&&(f=u.getTrusted.bind(u,e)):f=za,b.push({priority:100,compile:function(a,b){var e=p(b[c]),g=p(b[c],function(a){return u.valueOf(a)});return{pre:function(a,b){function c(){var g=e(a);b[0][d]=f(g)}c(),a.$watch(g,c)}}}})}function Ia(a,c,d,e,f){var g=ua(a),k=function(a,b){return"srcdoc"===b?u.HTML:"src"===b||"ngSrc"===b?-1===["img","video","audio","source","track"].indexOf(a)?u.RESOURCE_URL:u.MEDIA_URL:"xlinkHref"===b?"image"===a?u.MEDIA_URL:"a"===a?u.URL:u.RESOURCE_URL:"form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b?u.RESOURCE_URL:"a"!==a||"href"!==b&&"ngHref"!==b?void 0:u.URL}(g,e),l=h[e]||f,p=b(d,!f,k,l);if(p){if("multiple"===e&&"select"===g)throw $("selmulti",Aa(a));if(m.test(e))throw $("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=T());var g=f[e];g!==d&&(p=g&&b(g,!0,k,l),d=g),p&&(f[e]=p(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&f.$$observers[e].$$scope||a).$watch(p,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function oa(a,b,c){var g,h,d=b[0],e=b.length,f=d.parentNode;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c,h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1,a.context===d&&(a.context=c);break}for(f&&f.replaceChild(c,d),a=z.document.createDocumentFragment(),g=0;g<e;g++)a.appendChild(b[g]);for(x.hasData(d)&&(x.data(c,x.data(d)),x(d).off("$destroy")),x.cleanData(a.querySelectorAll("*")),g=1;g<e;g++)delete b[g];b[0]=c,b.length=1}function Ba(a,b){return S(function(){return a.apply(null,arguments)},a,b)}function Ca(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,Aa(d))}}function ra(a,b){if(s)throw $("missingattr",a,b)}function Da(a,c,d,e,f){function g(b,c,e){B(d.$onChanges)&&!ec(c,e)&&(Ua||(a.$$postDigest(q),Ua=[]),m||(m={},Ua.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Kb(e,c))}function h(){d.$onChanges(m),m=void 0}var m,k=[],l={};return r(e,function(e,h){var I,t,u,s,m=e.attrName,n=e.optional;switch(e.mode){case"@":n||ta.call(c,m)||(ra(m,f.name),d[h]=c[m]=void 0),n=c.$observe(m,function(a){(C(a)||Ga(a))&&(g(h,a,d[h]),d[h]=a)}),c.$$observers[m].$$scope=a,C(I=c[m])?d[h]=b(I)(a):Ga(I)&&(d[h]=I),l[h]=new Kb(uc,d[h]),k.push(n);break;case"=":if(!ta.call(c,m)){if(n)break;ra(m,f.name),c[m]=void 0}if(n&&!c[m])break;t=p(c[m]),s=t.literal?va:ec,u=t.assign||function(){throw I=d[h]=t(a),$("nonassign",c[m],m,f.name)},I=d[h]=t(a),(n=function(b){return s(b,d[h])||(s(b,I)?u(a,b=d[h]):d[h]=b),I=b}).$stateful=!0,n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,t.literal),k.push(n);break;case"<":if(!ta.call(c,m)){if(n)break;ra(m,f.name),c[m]=void 0}if(n&&!c[m])break;var v=(t=p(c[m])).literal,L=d[h]=t(a);l[h]=new Kb(uc,d[h]),n=a[e.collection?"$watchCollection":"$watch"](t,function(a,b){if(b===a){if(b===L||v&&va(b,L))return;b=L}g(h,a,b),d[h]=a}),k.push(n);break;case"&":if(n||ta.call(c,m)||ra(m,f.name),(t=c.hasOwnProperty(m)?p(c[m]):E)===E&&n)break;d[h]=function(b){return t(a,b)}}}),{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ua,Ma=/^\w/,Fa=z.document.createElement("div"),Oa=t,Qa=N,Ja=G;w.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&R.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&R.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=ud(a,b);c&&c.length&&R.addClass(this.$$element,c),(c=ud(b,a))&&c.length&&R.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=nd(this.$$element[0],a),g=vd[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g),this[a]=b,e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Xc(a,"-")),"img"===ua(this.$$element)&&"srcset"===a&&(this[a]=b=ma(b,"$set('srcset', value)")),!1!==d&&(null===b||A(b)?this.$$element.removeAttr(e):Ma.test(e)?f&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):function(a,b,c){Fa.innerHTML="<span "+b+">";var d=(b=Fa.firstChild.attributes)[0];b.removeNamedItem(d.name),d.value=c,a.attributes.setNamedItem(d)}(this.$$element[0],e,b)),(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);return e.push(b),L.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||A(c[a])||b(c[a])}),function(){cb(e,b)}}};var Ka=b.startSymbol(),La=b.endSymbol(),Na="{{"===Ka&&"}}"===La?Ta:function(a){return a.replace(/\{\{/g,Ka).replace(/}}/g,La)},Ra=/^ng(Attr|Prop|On)([A-Z].*)$/,Sa=/^(.+)Start$/;return da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];H(b)?c=c.concat(b):c.push(b),a.data("$binding",c)}:E,da.$$addBindingClass=n?function(a){sa(a,"ng-binding")}:E,da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:E,da.$$addScopeClass=n?function(a,b){sa(a,b?"ng-isolate-scope":"ng-scope")}:E,da.$$createComment=function(a,b){var c="";return n&&(c=" "+(a||"")+": ",b&&(c+=b+" ")),z.document.createComment(c)},da}]}function Kb(a,b){this.previousValue=a,this.currentValue=b}function xa(a){return a.replace(rd,"").replace(Jg,function(a,d,c){return c?d.toUpperCase():d})}function ud(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function td(a){var b=(a=x(a)).length;if(b<=1)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Pa&&""===d.nodeValue.trim())&&Kg.call(a,b,1)}return a}function Kf(){var a={};this.has=function(b){return a.hasOwnProperty(b)},this.register=function(b,d){Ja(b,"controller"),D(b)?S(a,b):a[b]=d},this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!D(a.$scope))throw F("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;if(f=!0===f,g&&C(g)&&(l=g),C(c)){if(!(g=c.match(wd)))throw xd("ctrlfmt",c);if(h=g[1],l=l||g[3],!(c=a.hasOwnProperty(h)?a[h]:function(a,b,d){if(!b)return a;for(var c,e=a,f=(b=b.split(".")).length,g=0;g<f;g++)c=b[g],a=a&&(e=a)[c];return!d&&B(a)?Va(e,a):a}(e.$scope,h,!0)))throw xd("ctrlreg",h);tb(c,h,!0)}return f?(f=(H(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),S(function(){var a=b.invoke(c,k,e,h);return a!==k&&(D(a)||B(a))&&(k=a,l&&d(e,l,k,h||c.name)),k},{instance:k,identifier:l})):(k=b.instantiate(c,e,h),l&&d(e,l,k,h||c.name),k)}}]}function Lf(){this.$get=["$window",function(a){return x(a.document)}]}function Mf(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;return a.on("visibilitychange",d),b.$on("$destroy",function(){a.off("visibilitychange",d)}),function(){return e}}]}function Nf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function vc(a){return D(a)?ha(a)?a.toISOString():eb(a):a}function Tf(){this.$get=function(){return function(a){if(!a)return"";var b=[];return Qc(a,function(a,c){null===a||A(a)||B(a)||(H(a)?r(a,function(a){b.push(ba(c)+"="+ba(vc(a)))}):b.push(ba(c)+"="+ba(vc(a))))}),b.join("&")}}}function Uf(){this.$get=function(){return function(a){if(!a)return"";var d=[];return function b(a,e,f){H(a)?r(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!ha(a)?Qc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):(B(a)&&(a=a()),d.push(ba(e)+"="+(null==a?"":ba(vc(a)))))}(a,"",!0),d.join("&")}}}function wc(a,e){if(C(a)){var d=a.replace(Lg,"").trim();if(d){var c=e("Content-Type");if((e=c=c&&0===c.indexOf(yd))||(e=(e=d.match(Mg))&&Ng[e[0]].test(d)),e)try{a=Tc(d)}catch(f){if(!c)return a;throw Lb("baddata",a,f)}}}return a}function zd(a){var d,b=T();return C(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=K(V(a.substr(0,d)));a=V(a.substr(d+1)),e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&r(a,function(g,f){f=K(f),g=V(g);f&&(b[f]=b[f]?b[f]+", "+g:g)}),b}function Ad(a){var b;return function(d){return b=b||zd(a),d?(void 0===(d=b[K(d)])&&(d=null),d):b}}function Bd(a,b,d,c){return B(c)?c(a,b,d):(r(c,function(c){a=c(a,b,d)}),a)}function Sf(){var a=this.defaults={transformResponse:[wc],transformRequest:[function(a){return D(a)&&"[object File]"!==la.call(a)&&"[object Blob]"!==la.call(a)&&"[object FormData]"!==la.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ja(xc),put:ja(xc),patch:ja(xc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfTrustedOrigins=[];Object.defineProperty(this,"xsrfWhitelistedOrigins",{get:function(){return this.xsrfTrustedOrigins},set:function(a){this.xsrfTrustedOrigins=a}}),this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];a=a.then(f,g)}return b.length=0,a}function f(a){var b=S({},a);return b.data=Bd(a.data,a.headers,a.status,g.transformResponse),200<=(a=a.status)&&a<300?b:l.reject(b)}if(!D(b))throw F("$http")("badreq",b);if(!C(p.valueOf(b.url)))throw F("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},b);g.headers=function(b){var f,g,h,c=a.headers,e=S({},b.headers);a:for(f in c=S({},c.common,c[K(b.method)])){for(h in g=K(f),e)if(K(h)===g)continue a;e[f]=c[f]}return function(a,b){var c,e={};return r(a,function(a,d){B(a)?null!=(c=a(b))&&(e[d]=c):e[d]=a}),e}(e,ja(b))}(b),g.method=vb(g.method),g.paramSerializer=C(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer,e.$$incOutstandingRequestCount("$http");var h=[],k=[];return b=l.resolve(g),r(v,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError),(a.response||a.responseError)&&k.push(a.response,a.responseError)}),b=(b=c(b,h)).then(function(b){var c=b.headers,d=Bd(b.data,Ad(c),void 0,b.transformRequest);return A(d)&&r(c,function(a,b){"content-type"===K(b)&&delete c[b]}),A(b.withCredentials)&&!A(a.withCredentials)&&(b.withCredentials=a.withCredentials),s(b,d).then(f,f)}),(b=c(b,k)).finally(function(){e.$$completeOutstandingRequest(E,"$http")})}function s(c,d){function e(a){if(a){var c={};return r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}}),c}}function m(a,b,d,e,f){(200<=(b=-1<=b?b:0)&&b<300?L.resolve:L.reject)({data:a,status:b,headers:Ad(d),config:c,statusText:e,xhrStatus:f})}function s(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function v(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var R,q,L=l.defer(),u=L.promise,ma=c.headers,x="jsonp"===K(c.method),O=c.url;return x?O=p.getTrustedResourceUrl(O):C(O)||(O=p.valueOf(O)),O=function(a,b){return 0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b),a}(O,c.paramSerializer(c.params)),x&&(O=function(a,b){var c=a.split("?");if(2<c.length)throw Lb("badjsonp",a);return r(c=hc(c[1]),function(c,d){if("JSON_CALLBACK"===c)throw Lb("badjsonp",a);if(d===b)throw Lb("badjsonp",b,a)}),a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}(O,c.jsonpCallbackParam)),n.pendingRequests.push(c),u.then(v,v),!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(R=D(c.cache)?c.cache:D(a.cache)?a.cache:N),R&&(w(q=R.get(O))?q&&B(q.then)?q.then(s,s):H(q)?m(q[1],q[0],ja(q[2]),q[3],q[4]):m(q,200,{},"OK","complete"):R.put(O,u)),A(q)&&((q=kc(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(ma[c.xsrfHeaderName||a.xsrfHeaderName]=q),f(c.method,O,d,function(a,c,d,e,f){function g(){m(c,a,d,e,f)}R&&(200<=a&&a<300?R.put(O,[a,c,zd(d),e,f]):R.remove(O)),b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())},ma,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers))),u}var N=k("$http");a.paramSerializer=C(a.paramSerializer)?m.get(a.paramSerializer):a.paramSerializer;var v=[];r(d,function(a){v.unshift(C(a)?m.get(a):m.invoke(a))});var kc=function(a){var b=[Qd].concat(a.map(ga));return function(a){return a=ga(a),b.some(Cc.bind(null,a))}}(c);return n.pendingRequests=[],function(){r(arguments,function(a){n[a]=function(b,c){return n(S({},c||{},{method:a,url:b}))}})}("get","delete","head","jsonp"),function(){r(arguments,function(a){n[a]=function(b,c,d){return n(S({},d||{},{method:a,url:b,data:c}))}})}("post","put","patch"),n.defaults=a,n}]}function Wf(){this.$get=function(){return function(){return new z.XMLHttpRequest}}}function Vf(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return function(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;return f.type="text/javascript",f.src=a,f.async=!0,m=function(a){f.removeEventListener("load",m),f.removeEventListener("error",m),e.body.removeChild(f),f=null;var g=-1,s="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),s=a.type,g="error"===a.type?404:200),d&&d(g,s)},f.addEventListener("load",m),f.addEventListener("error",m),e.body.appendChild(f),m}return function(e,k,h,l,m,p,n,s,G,t){function N(a){J="timeout"===a,pa&&pa(),y&&y.abort()}function v(a,b,c,e,f,g){w(P)&&d.cancel(P),pa=y=null,a(b,c,e,f,g)}if(k=k||a.url(),"jsonp"===K(e))var q=c.createCallback(k),pa=f(k,q,function(a,b){var d=200===a&&c.getResponse(q);v(l,a,d,"",b,"complete"),c.removeCallback(q)});else{var y=b(e,k),J=!1;if(y.open(e,k,!0),r(m,function(a,b){w(a)&&y.setRequestHeader(b,a)}),y.onload=function(){var a=y.statusText||"",b="response"in y?y.response:y.responseText,c=1223===y.status?204:y.status;0===c&&(c=b?200:"file"===ga(k).protocol?404:0),v(l,c,b,y.getAllResponseHeaders(),a,"complete")},y.onerror=function(){v(l,-1,null,null,"","error")},y.ontimeout=function(){v(l,-1,null,null,"","timeout")},y.onabort=function(){v(l,-1,null,null,"",J?"timeout":"abort")},r(G,function(a,b){y.addEventListener(b,a)}),r(t,function(a,b){y.upload.addEventListener(b,a)}),n&&(y.withCredentials=!0),s)try{y.responseType=s}catch(I){if("json"!==s)throw I}y.send(A(h)?null:h)}var P;0<p?P=d(function(){N("timeout")},p):p&&B(p.then)&&p.then(function(){N(w(p.$$timeoutId)?"timeout":"abort")})}}(a,c,a.defer,b,d[0])}]}function Pf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a},this.endSymbol=function(a){return a?(b=a,this):b},this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function h(f,h,n,p){var r=n===e.URL||n===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a))return h?void 0:(h=g(f),r&&(h=e.getTrusted(n,h)),(h=ia(h)).exp=f,h.expressions=[],h.$$watchDelegate=k,h);p=!!p;for(var q,y,u,J=0,I=[],Q=f.length,M=[],L=[];J<Q;){if(-1===(q=f.indexOf(a,J))||-1===(y=f.indexOf(b,q+l))){J!==Q&&M.push(g(f.substring(J)));break}J!==q&&M.push(g(f.substring(J,q))),J=f.substring(q+l,y),I.push(J),J=y+m,L.push(M.length),M.push("")}u=1===M.length&&1===L.length;var R=r&&u?void 0:function(a){try{return a=n&&!r?e.getTrusted(n,a):e.valueOf(a),p&&!w(a)?a:jc(a)}catch(b){c(Ma.interr(f,b))}},P=I.map(function(a){return d(a,R)});if(!h||I.length){var x=function(a){for(var b=0,c=I.length;b<c;b++){if(p&&A(a[b]))return;M[L[b]]=a[b]}return r?e.getTrusted(n,u?M[0]:M.join("")):(n&&1<M.length&&Ma.throwNoconcat(f),M.join(""))};return S(function(a){var b=0,d=I.length,e=Array(d);try{for(;b<d;b++)e[b]=P[b](a);return x(e)}catch(g){c(Ma.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,b){var c;return a.$watchGroup(P,function(d,e){var f=x(d);b.call(this,f,d!==e?c:f,a),c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");return h.startSymbol=function(){return a},h.endSymbol=function(){return b},h}]}function Qf(){this.$get=["$$intervalFactory","$window",function(e,b){function c(a){b.clearInterval(a),delete d[a]}var d={},e=e(function(a,c,e){return a=b.setInterval(a,c),d[a]=e,a},c);return e.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Qg("badprom");if(!d.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var b=d[a],e=b.promise;return e.$$state&&(e.$$state.pur=!0),b.reject("canceled"),c(a),!0},e}]}function Rf(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,d,c){return function(e,f){return function(g,k,h,l){function m(){p?g.apply(null,n):g(s)}var p=4<arguments.length,n=p?Ha.call(arguments,4):[],s=0,G=w(l)&&!l,t=(G?d:b).defer(),r=t.promise;return h=w(h)?h:0,r.$$intervalId=e(function(){G?a.defer(m):c.$evalAsync(m),t.notify(s++),0<h&&h<=s&&(t.resolve(s),f(r.$$intervalId)),G||c.$apply()},k,t,G),r}}}]}function Cd(d,b){d=ga(d);b.$$protocol=d.protocol,b.$$host=d.hostname,b.$$port=fa(d.port)||Rg[d.protocol]||null}function Dd(a,b,d){if(Sg.test(a))throw kb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a),a=ga(a);for(var e=(c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/")).length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/"),b.$$path=d,b.$$search=hc(a.search),b.$$hash=decodeURIComponent(a.hash),b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function yc(a,b){return a.slice(0,b.length)===b}function ya(a,b){if(yc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function zc(a,b,d){this.$$html5=!0,d=d||"",Cd(a,this),this.$$parse=function(a){var d=ya(b,a);if(!C(d))throw kb("ipthprfx",a,b);Dd(d,this,!0),this.$$path||(this.$$path="/"),this.$$compose()},this.$$normalizeUrl=function(a){return b+a.substr(1)},this.$$parseLinkUrl=function(c,f){return f&&"#"===f[0]?(this.hash(f.slice(1)),!0):(w(f=ya(a,c))?(g=f,g=d&&w(f=ya(d,f))?b+(ya("/",f)||f):a+g):w(f=ya(b,c))?g=b+f:b===c+"/"&&(g=b),g&&this.$$parse(g),!!g);var g}}function Ac(a,b,d){Cd(a,this),this.$$parse=function(c){var f,e=ya(a,c)||ya(b,c);A(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",A(e)&&(a=c,this.replace())):A(f=ya(d,e))&&(f=e),Dd(f,this,!1),c=this.$$path;var g=/^\/[A-Z]:(\/.*)/;yc(f,e=a)&&(f=f.replace(e,"")),g.exec(f)||(c=(f=g.exec(c))?f[1]:c),this.$$path=c,this.$$compose()},this.$$normalizeUrl=function(b){return a+(b?d+b:"")},this.$$parseLinkUrl=function(b,d){return Da(a)===Da(b)&&(this.$$parse(b),!0)}}function Ed(a,b,d){this.$$html5=!0,Ac.apply(this,arguments),this.$$parseLinkUrl=function(c,g){return g&&"#"===g[0]?(this.hash(g.slice(1)),!0):(a===Da(c)?f=c:(g=ya(b,c))?f=a+d+g:b===c+"/"&&(f=b),f&&this.$$parse(f),!!f);var f},this.$$normalizeUrl=function(b){return a+d+b}}function Mb(a){return function(){return this[a]}}function Fd(a,b){return function(d){return A(d)?this[a]:(this[a]=b(d),this.$$compose(),this)}}function Yf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this):a},this.html5Mode=function(a){return Ga(a)?(b.enabled=a,this):D(a)?(Ga(a.enabled)&&(b.enabled=a.enabled),Ga(a.requireBase)&&(b.requireBase=a.requireBase),(Ga(a.rewriteLinks)||C(a.rewriteLinks))&&(b.rewriteLinks=a.rewriteLinks),this):b},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state=c.state()}catch(g){throw m.url(e),m.$$state=f,g}}function l(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var s,p=c.baseHref(),n=c.url();if(b.enabled){if(!p&&b.requireBase)throw kb("nobase");s=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(p||"/"),p=e.history?zc:Ed}else s=Da(n),p=Ac;var m,r=s.substr(0,Da(s).lastIndexOf("/")+1);(m=new p(s,r,"#"+a)).$$parseLinkUrl(n,n),m.$$state=c.state();var t=/^\s*(javascript|mailto):/i;f.on("click",function(a){if((e=b.rewriteLinks)&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var e,h,g=x(a.target);"a"!==ua(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;C(e)&&A(g.attr(e))||(e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href"),D(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ga(e.animVal).href),t.test(e)||!e||g.attr("target")||a.isDefaultPrevented()||!m.$$parseLinkUrl(e,h)||(a.preventDefault(),m.absUrl()!==c.url()&&d.$apply()))}}),m.absUrl()!==n&&c.url(m.absUrl(),!0);var N=!0;return c.onUrlChange(function(a,b){yc(a,r)?(d.$evalAsync(function(){var f,c=m.absUrl(),e=m.$$state;m.$$parse(a),m.$$state=b,f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented,m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(N=!1,l(c,e)))}),d.$$phase||d.$digest()):g.location.href=a}),d.$watch(function(){var a,b,f,g,n;(N||m.$$urlUpdatedByLocation)&&(m.$$urlUpdatedByLocation=!1,a=c.url(),b=m.absUrl(),f=c.state(),g=m.$$replace,n=!function(a,b){return a===b||ga(a).href===ga(b).href}(a,b)||m.$$html5&&e.history&&f!==m.$$state,(N||n)&&(N=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(n&&h(b,g,f===m.$$state?null:m.$$state),l(a,f)))}))),m.$$replace=!1}),m}]}function Zf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a},this.$get=["$window",function(d){function e(a){var b=d.console||{},e=b[a]||b.log||E;return function(){var a=[];return r(arguments,function(b){a.push(function(a){return dc(a)&&(a.stack&&f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}(b))}),Function.prototype.apply.call(e,b,a)}}var f=wa||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Tg(a){return a+""}function Ug(a,b){return void 0!==a?a:b}function Gd(a,b){return void 0===a?b:void 0===b?a:a+b}function Z(a,b,d){var c,e,f=a.isPure=function(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!==a.operator&&1;case q.CallExpression:return!1}return void 0===b?Hd:b}(a,d);switch(a.type){case q.Program:c=!0,r(a.body,function(a){Z(a.expression,b,f),c=c&&a.expression.constant}),a.constant=c;break;case q.Literal:a.constant=!0,a.toWatch=[];break;case q.UnaryExpression:Z(a.argument,b,f),a.constant=a.argument.constant,a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:Z(a.left,b,f),Z(a.right,b,f),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:Z(a.left,b,f),Z(a.right,b,f),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:Z(a.test,b,f),Z(a.alternate,b,f),Z(a.consequent,b,f),a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant,a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1,a.toWatch=[a];break;case q.MemberExpression:Z(a.object,b,f),a.computed&&Z(a.property,b,f),a.constant=a.object.constant&&(!a.computed||a.property.constant),a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=!!a.filter&&!b(a.callee.name).$stateful,e=[],r(a.arguments,function(a){Z(a,b,f),c=c&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=c,a.toWatch=d?e:[a];break;case q.AssignmentExpression:Z(a.left,b,f),Z(a.right,b,f),a.constant=a.left.constant&&a.right.constant,a.toWatch=[a];break;case q.ArrayExpression:c=!0,e=[],r(a.elements,function(a){Z(a,b,f),c=c&&a.constant,e.push.apply(e,a.toWatch)}),a.constant=c,a.toWatch=e;break;case q.ObjectExpression:c=!0,e=[],r(a.properties,function(a){Z(a.value,b,f),c=c&&a.value.constant,e.push.apply(e,a.value.toWatch),a.computed&&(Z(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,a.key.toWatch))}),a.constant=c,a.toWatch=e;break;case q.ThisExpression:a.constant=!1,a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Id(a){if(1===a.length){var b=(a=a[0].expression).toWatch;return 1!==b.length||b[0]!==a?b:void 0}}function Jd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function Kd(a){if(1===a.body.length&&Jd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function Ld(a){this.$filter=a}function Md(a){this.$filter=a}function Nb(a,b,d){this.ast=new q(a,d),this.astCompiler=new(d.csp?Md:Ld)(b)}function Bc(a){return B(a.valueOf)?a.valueOf():Wg.call(a)}function $f(){var d,c,a=T(),b={true:!0,false:!1,null:null,undefined:void 0};this.addLiteral=function(a,c){b[a]=c},this.setIdentifierFns=function(a,b){return d=a,c=b,this},this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case"string":return f=b=b.trim(),(d=a[f])||(d=new Nb(d=new Ob(G),e,G).parse(b),a[f]=p(d)),s(d,c);case"function":return s(b,c);default:return s(E,c)}}function g(a,b,c){return null==a||null==b?a===b:!("object"==typeof a&&("object"==typeof(a=Bc(a))&&!c))&&(a===b||a!=a&&b!=b)}function k(a,b,c,d,e){var h;if(1===(f=d.inputs).length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);return g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Bc(b)),h},b,c,e)}for(var l=[],m=[],n=0,p=f.length;n<p;n++)l[n]=g,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var k=f[c](a);(b=b||!g(k,l[c],f[c].isPure))&&(m[c]=k,l[c]=k&&Bc(k))}return b&&(h=d(a,void 0,void 0,m)),h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){return m=u&&d?d[0]:n(a,b,c,d),h(m)&&a.$$postDigest(f),s(m)}var k,m,h=d.literal?l:w,n=d.$$intercepted||d,s=d.$$interceptor||Ta,u=d.inputs&&!n.inputs;return g.literal=d.literal,g.constant=d.constant,g.inputs=d.inputs,p(g),k=a.$watch(g,b,c,e)}function l(a){var b=!0;return r(a,function(a){w(a)||(b=!1)}),b}function m(a,b,c,d){var e=a.$watch(function(a){return e(),d(a)},b,c);return e}function p(a){return a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k),a}function s(a,b){if(!b)return a;a.$$interceptor&&(b=function(a,b){function c(d){return b(a(d))}return c.$stateful=a.$stateful||b.$stateful,c.$$pure=a.$$pure&&b.$$pure,c}(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){return d=c&&g?g[0]:a(d,e,f,g),b(d)};return d.$$intercepted=a,d.$$interceptor=b,d.literal=a.literal,d.oneTime=a.oneTime,d.constant=a.constant,b.$stateful||(c=!a.inputs,d.inputs=a.inputs||[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Hd?function(b){return a(b)}:a}))),p(d)}var G={csp:Ba().noUnsafeEval,literals:Ia(b),isIdentifierStart:B(d)&&d,isIdentifierContinue:B(c)&&c};return f.$$getAst=function(a){return new Nb(new Ob(G),e,G).getAst(a).ast},f}]}function bg(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Nd(function(a){b.$evalAsync(a)},d,a)}],this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function cg(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Nd(function(a){b.defer(a)},d,a)}],this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Nd(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)},this.reject=function(b){m(a,b)},this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!w&&x.length;){var c,a=x.shift();a.pur||(a.pur=!0,c="Possibly unhandled rejection: "+("function"==typeof(c=a.value)?c.toString().replace(/ \{[\s\S]*$/,""):A(c)?"undefined":"string"!=typeof c?function(a,b){var d=[];return Yb(b)&&(a=ca.copy(a,null,b)),JSON.stringify(a,function(a,b){if(D(b=Sc(a,b))){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}(c,void 0):c),dc(a.value)?b(a.value,c):b(c))}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===w&&0===x.length&&a(g),x.push(c)),!c.processScheduled&&c.pending&&(c.processScheduled=!0,++w,a(function(){var e,f,k=c.pending;c.processScheduled=!1,c.pending=void 0;try{for(var l=0,n=k.length;l<n;++l){c.pur=!0,f=k[l][0],e=k[l][c.status];try{B(e)?h(f,e(c.value)):(1===c.status?h:m)(f,c.value)}catch(p){m(f,p),p&&!0===p.$$passToExceptionHandler&&b(p)}}}finally{--w,d&&0===w&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,v("qcycle",b)):function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{(D(b)||B(b))&&(f=b.then),B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}(a,b))}function m(a,b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b,a.$$state.status=2,k(a.$$state)}function n(c,d){var e=c.$$state.pending;c.$$state.status<=0&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0],a=e[f][3];try{n(c,B(a)?a(d):d)}catch(h){b(h)}}})}function s(a){var b=new f;return m(b,a),b}function G(a,b,c){var d=null;try{B(c)&&(d=c())}catch(e){return s(e)}return d&&B(d.then)?d.then(function(){return b(a)},s):b(a)}function t(a,b,c,d){var e=new f;return h(e,a),e.then(b,c,d)}function q(a){if(!B(a))throw v("norslvr",a);var b=new f;return a(function(a){h(b,a)},function(a){m(b,a)}),b}var v=F("$q",TypeError),w=0,x=[];S(f.prototype,{then:function(a,b,c){if(A(a)&&A(b)&&A(c))return this;var d=new f;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([d,a,b,c]),0<this.$$state.status&&k(this.$$state),d},catch:function(a){return this.then(null,a)},finally:function(a,b){return this.then(function(b){return G(b,y,a)},function(b){return G(b,s,a)},b)}});var y=t;return q.prototype=f.prototype,q.defer=c,q.reject=s,q.when=t,q.resolve=y,q.all=function(a){var b=new f,c=0,d=H(a)?[]:{};return r(a,function(a,e){c++,t(a).then(function(a){d[e]=a,--c||h(b,d)},function(a){m(b,a)})}),0===c&&h(b,d),b},q.race=function(a){var b=c();return r(a,function(a){t(a).then(b.resolve,b.reject)}),b.promise},q}function mg(){this.$get=["$window","$timeout",function(f,b){var d=f.requestAnimationFrame||f.webkitRequestAnimationFrame,c=f.cancelAnimationFrame||f.webkitCancelAnimationFrame||f.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};return f.supported=e,f}]}function ag(){var b=10,d=F("$rootScope"),c=null,e=null;this.digestTtl=function(a){return arguments.length&&(b=a),b},this.$get=["$exceptionHandler","$parse","$browser",function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function m(){this.$id=++qb,this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,(this.$root=this).$$suspended=this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function p(a){if(v.$$phase)throw d("inprog",v.$$phase);v.$$phase=a}function n(a,b){for(;a.$$watchersCount+=b,a=a.$parent;);}function s(a,b,c){for(;a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c],a=a.$parent;);}function G(){}function t(){for(;y.length;)try{y.shift()()}catch(a){f(a)}e=null}m.prototype={constructor:m,$new:function(b,c){var d;return c=c||this,b?(d=new m).$root=this.$root:(this.$$ChildScope||(this.$$ChildScope=function(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=++qb,this.$$ChildScope=null,this.$$suspended=!1}return b.prototype=a,b}(this)),d=new this.$$ChildScope),d.$parent=c,d.$$prevSibling=c.$$childTail,c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d,!b&&c===this||d.$on("$destroy",h),d},$watch:function(a,b,d,e){var f=g(a);if(b=B(b)?b:E,f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l={fn:b,last:G,get:f,exp:e||a,eq:!!d};return c=null,k||((k=h.$$watchers=[]).$$digestWatchIndex=-1),k.unshift(l),k.$$digestWatchIndex++,n(this,1),function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--),c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(a.length)return 1===a.length?this.$watch(a[0],function(a,c,f){e[0]=a,d[0]=c,b(e,a===c?e:d,f)}):(r(a,function(d,b){d=g.$watch(d,function(a){e[b]=a,h||(h=!0,g.$evalAsync(c))});f.push(d)}),function(){for(;f.length;)f.shift()()});var l=!0;return g.$evalAsync(function(){l&&b(e,e,g)}),function(){l=!1}},$watchCollection:function(m,b){function c(a){var b,d,g,h;if(!A(e=a)){if(D(e))if(za(e))for(f!==n&&(t=(f=n).length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],(d=h!=h&&g!=g)||h===g||(l++,f[b]=g);else{for(b in f!==p&&(f=p={},t=0,l++),a=0,e)ta.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!=h&&g!=g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(a<t)for(b in l++,f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(m).literal,c.$stateful=!c.$$pure;var e,f,h,d=this,k=1<b.length,l=0,m=g(m,c),n=[],p={},s=!0,t=0;return this.$watch(m,function(){if(s?(s=!1,b(e,e,d)):b(e,h,d),k)if(D(e))if(za(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,h,n,s,q,A,z,r=b,y=w.length?v:this,N=[];p("$digest"),k.$$checkUrlChange(),this===v&&null!==e&&(k.defer.cancel(e),t()),c=null;do{for(s=!1,q=y,n=0;n<w.length;n++){try{(0,(z=w[n]).fn)(z.scope,z.locals)}catch(C){f(C)}c=null}w.length=0;a:do{if(n=!q.$$suspended&&q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if((g=(0,a.get)(q))===(h=a.last)||(a.eq?va(g,h):Y(g)&&Y(h))){if(a===c){s=!1;break a}}else s=!0,(c=a).last=a.eq?Ia(g,null):g,(0,a.fn)(g,h===G?g:h,q),r<5&&(N[A=4-r]||(N[A]=[]),N[A].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}))}catch(E){f(E)}if(!(n=!q.$$suspended&&q.$$watchersCount&&q.$$childHead||q!==y&&q.$$nextSibling))for(;q!==y&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((s||w.length)&&!r--)throw v.$$phase=null,d("infdig",b,N)}while(s||w.length);for(v.$$phase=null;J<x.length;)try{x[J++]()}catch(D){f(D)}x.length=J=0,k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var b,a=this.$parent;for(b in this.$broadcast("$destroy"),this.$$destroyed=!0,this===v&&k.$$applicationDestroyed(),n(this,-this.$$watchersCount),this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling),a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=E,this.$on=this.$watch=this.$watchGroup=function(){return E},this.$$listeners={},this.$$nextSibling=null,function l(a){9===wa&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling)),a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){v.$$phase||w.length||k.defer(function(){w.length&&v.$digest()},null,"$evalAsync"),w.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{v.$$phase=null}}catch(b){f(b)}finally{try{v.$digest()}catch(c){throw f(c),c}}},$applyAsync:function(a){var c=this;a&&y.push(function(){c.$eval(a)}),a=g(a),null===e&&(e=k.defer(function(){v.$apply(t)},null,"$applyAsync"))},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]),c.push(b);for(var d=this;d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++,d=d.$parent;);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var d,l,m,c=[],e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1);do{for(d=e.$$listeners[a]||c,h.currentScope=e,l=0,m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--}while(!g&&(e=e.$parent));return h.currentScope=null,h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var h,k,g=db([e],arguments,1);c=d;){for(h=0,k=(d=(e.currentScope=c).$$listeners[a]||[]).length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}return e.currentScope=null,e}};var v=new m,w=v.$$asyncQueue=[],x=v.$$postDigestQueue=[],y=v.$$applyAsyncQueue=[],J=0;return v}]}function Qe(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationTrustedUrlList=function(b){return w(b)?(a=b,this):a},this.imgSrcSanitizationTrustedUrlList=function(a){return w(a)?(b=a,this):b},this.$get=function(){return function(d,f){var e=f?b:a,f=ga(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Pd(a){var b=[];return w(a)&&r(a,function(a){b.push(function(a){if("self"===a)return a;if(C(a)){if(-1<a.indexOf("***"))throw Ea("iwcard",a);return a=Od(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*"),new RegExp("^"+a+"$")}if(ab(a))return new RegExp("^"+a.source+"$");throw Ea("imatcher")}(a))}),b}function eg(){this.SCE_CONTEXTS=W;var a=["self"],b=[];this.trustedResourceUrlList=function(b){return arguments.length&&(a=Pd(b)),a},Object.defineProperty(this,"resourceUrlWhitelist",{get:function(){return this.trustedResourceUrlList},set:function(a){this.trustedResourceUrlList=a}}),this.bannedResourceUrlList=function(a){return arguments.length&&(b=Pd(a)),b},Object.defineProperty(this,"resourceUrlBlacklist",{get:function(){return this.bannedResourceUrlList},set:function(a){this.bannedResourceUrlList=a}}),this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;return"self"===a?(c=Cc(b,Qd))||(c=Cc(b,c=z.document.baseURI||(Na||((Na=z.document.createElement("a")).href=".",Na=Na.cloneNode(!1)),Na.href))):c=!!a.exec(b.href),c}function f(a){function b(a){this.$$unwrapTrustedValue=function(){return a}}return a&&(b.prototype=new a),b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},b}var g=function(a){throw Ea("unsafe")};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};return h[W.HTML]=f(k),h[W.CSS]=f(k),h[W.MEDIA_URL]=f(k),h[W.URL]=f(h[W.MEDIA_URL]),h[W.JS]=f(k),h[W.RESOURCE_URL]=f(h[W.URL]),{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ea("icontext",a,b);if(null===b||A(b)||""===b)return b;if("string"!=typeof b)throw Ea("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||A(f)||""===f)return f;if((k=h.hasOwnProperty(d)?h[d]:null)&&f instanceof k)return f.$$unwrapTrustedValue();if(B(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue()),d===W.MEDIA_URL||d===W.URL)return c(f.toString(),d===W.MEDIA_URL);if(d===W.RESOURCE_URL){for(var k=ga(f.toString()),r=!1,n=0,s=a.length;n<s;n++)if(e(a[n],k)){r=!0;break}if(r)for(n=0,s=b.length;n<s;n++)if(e(b[n],k)){r=!1;break}if(r)return f;throw Ea("insecurl",f.toString())}if(d===W.HTML)return g(f);throw Ea("unsafe")},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():a}}}]}function dg(){var a=!0;this.enabled=function(b){return arguments.length&&(a=!!b),a},this.$get=["$parse","$sceDelegate",function(b,d){if(a&&wa<8)throw Ea("iequirks");var c=ja(W);c.isEnabled=function(){return a},c.trustAs=d.trustAs,c.getTrusted=d.getTrusted,c.valueOf=d.valueOf,a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ta),c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;return r(W,function(a,d){d=K(d);c[("parse_as_"+d).replace(Dc,xb)]=function(b){return e(a,b)},c[("get_trusted_"+d).replace(Dc,xb)]=function(b){return f(a,b)},c[("trust_as_"+d).replace(Dc,xb)]=function(b){return g(a,b)}}),c}]}function fg(){this.$get=["$window","$document",function(h,l){var d={},c=!((!h.nw||!h.nw.process)&&h.chrome&&(h.chrome.app&&h.chrome.app.runtime||!h.chrome.app&&h.chrome.runtime&&h.chrome.runtime.id))&&h.history&&h.history.pushState,e=fa((/android (\d+)/.exec(K((h.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((h.navigator||{}).userAgent),g=l[0]||{},k=g.body&&g.body.style,h=!1,l=!1;return k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k)),{history:!(!c||e<4||f),hasEvent:function(a){return("input"!==a||!wa)&&(A(d[a])&&(b=g.createElement("div"),d[a]="on"+a in b),d[a]);var b},csp:Ba(),transitions:h,animations:l,android:e}}]}function gg(){this.$get=ia(function(a){return new Yg(a)})}function Yg(a){function b(){var a=e.pop();return a&&a.cb}function d(a){for(var b=e.length-1;0<=b;--b){var c=e[b];if(c.type===a)return e.splice(b,1),c.cb}}var c={},e=[],f=this.ALL_TASKS_TYPE="$$all$$",g=this.DEFAULT_TASK_TYPE="$$default$$";this.completeTask=function(e,h){h=h||g;try{e()}finally{var l=h||g;c[l]&&(c[l]--,c[f]--),l=c[h];var m=c[f];if(!m||!l)for(l=m?d:b;m=l(h);)try{m()}catch(p){a.error(p)}}},this.incTaskCount=function(a){c[a=a||g]=(c[a]||0)+1,c[f]=(c[f]||0)+1},this.notifyWhenNoPendingTasks=function(a,b){c[b=b||f]?e.push({type:b,cb:a}):a()}}function ig(){var a;this.httpOptions=function(b){return b?(a=b,this):a},this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++,C(k)&&!A(d.get(k))||(k=f.getTrustedResourceUrl(k));var l=c.defaults&&c.defaults.transformResponse;return H(l)?l=l.filter(function(a){return a!==wc}):l===wc&&(l=null),c.get(k,S({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,a.data)},function(a){return h||(a=Zg("tpload",k,a.status,a.statusText),b(a)),e.reject(a)})}return g.totalPendingRequests=0,g}]}function jg(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];return r(a,function(a){var c=ca.element(a).data("$binding");c&&r(c,function(c){d?new RegExp("(^|\\s)"+Od(b)+"(\\s|\\||$)").test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})}),g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function kg(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,r,l){B(f)||(l=r,r=f,f=E);var m=Ha.call(arguments,3),p=w(l)&&!l,n=(p?c:d).defer(),s=n.promise,r=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[s.$$timeoutId]}p||a.$apply()},r,"$timeout");return s.$$timeoutId=r,g[r]=n,s}var g={};return f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw $g("badprom");if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a],d=c.promise;return d.$$state&&(d.$$state.pur=!0),c.reject("canceled"),delete g[a],b.defer.cancel(a)},f}]}function ga(a){return C(a)?(wa&&(aa.setAttribute("href",a),a=aa.href),aa.setAttribute("href",a),a=aa.hostname,!ah&&-1<a.indexOf(":")&&(a="["+a+"]"),{href:aa.href,protocol:aa.protocol?aa.protocol.replace(/:$/,""):"",host:aa.host,search:aa.search?aa.search.replace(/^\?/,""):"",hash:aa.hash?aa.hash.replace(/^#/,""):"",hostname:a,port:aa.port,pathname:"/"===aa.pathname.charAt(0)?aa.pathname:"/"+aa.pathname}):a}function Cc(a,b){return a=ga(a),b=ga(b),a.protocol===b.protocol&&a.host===b.host}function lg(){this.$get=ia(z)}function Rd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(a=(e=a).split("; "),c={},k=0;k<a.length;k++)0<(h=(g=a[k]).indexOf("="))&&(l=b(g.substring(0,h)),A(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function pg(){this.$get=Rd}function fd(a){function b(d,c){if(D(d)){var e={};return r(d,function(a,c){e[c]=b(c,a)}),e}return a.factory(d+"Filter",c)}this.register=b,this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}],b("currency",Sd),b("date",Td),b("filter",bh),b("json",ch),b("limitTo",dh),b("lowercase",eh),b("number",Ud),b("orderBy",Vd),b("uppercase",fh)}function bh(){return function(a,b,d,c){if(!za(a)){if(null==a)return a;throw F("filter")("notarray",a)}var e;switch(c=c||"$",Ec(b)){case"function":break;case"boolean":case"null":case"number":case"string":e=!0;case"object":b=function(a,b,d,c){var e=D(a)&&d in a;return!0===b?b=va:B(b)||(b=function(a,b){return!A(a)&&(null===a||null===b?a===b:!(D(b)||D(a)&&!cc(a))&&(a=K(""+a),b=K(""+b),-1!==a.indexOf(b)))}),function(f){return e&&!D(f)?Fa(f,a[d],b,d,!1):Fa(f,a,b,d,c)}}(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,b)}}function Fa(a,b,d,c,e,f){var h,g=Ec(a),k=Ec(b);if("string"===k&&"!"===b.charAt(0))return!Fa(a,b.substring(1),d,c,e);if(H(a))return a.some(function(a){return Fa(a,b,d,c,e)});switch(g){case"object":if(e){for(h in a)if(h.charAt&&"$"!==h.charAt(0)&&Fa(a[h],b,d,c,!0))return!0;return!f&&Fa(a,b,d,c,!1)}if("object"!==k)return d(a,b);for(h in b)if(f=b[h],!B(f)&&!A(f)&&(g=h===c,!Fa(g?a:a[h],f,d,c,g,g)))return!1;return!0;case"function":return!1;default:return d(a,b)}}function Ec(a){return null===a?"null":typeof a}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){A(c)&&(c=b.CURRENCY_SYM),A(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Wd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,c)}}function Ud(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Wd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function Wd(a,b,d,c,e){if(!C(a)&&!X(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="∞";else{for(function(a,b,d,c){var e=a.d,f=e.length-a.i;if(c=e[d=(b=A(b)?Math.min(Math.max(d,f),c):+b)+a.i],0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(d-1<0){for(c=0;d<c;c--)e.unshift(0),a.i++;e.unshift(1),a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);(b=e.reduceRight(function(a,b,c,d){return b+=a,d[c]=b%10,Math.floor(b/10)},0))&&(e.unshift(b),a.i++)}(g=function(a){var d,c,e,f,g,b=0;for(-1<(c=a.indexOf(Xd))&&(a=a.replace(Xd,"")),0<(e=a.search(/e/i))?(c<0&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):c<0&&(c=a.length),e=0;a.charAt(e)===Fc;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Fc;)g--;for(c-=e,d=[],f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}return Yd<c&&(d=d.splice(0,Yd-1),b=c-1,c=1),{d:d,e:b,i:c}}(k),e,b.minFrac,b.maxFrac),h=g.d,k=g.i,e=g.e,f=[],g=h.reduce(function(a,b){return a&&!b},!0);k<0;)h.unshift(0),k++;for(0<k?f=h.splice(k,h.length):(f=h,h=[0]),k=[],h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join("")),h=k.join(d),f.length&&(h+=c+f.join("")),e&&(h+="e+"+e)}return a<0&&!g?b.negPre+h+b.negSuf:b.posPre+h+b.posSuf}function Pb(a,b,d,c){var e="";for((a<0||c&&a<=0)&&(c?a=1-a:(a=-a,e="-")),a=""+a;a.length<b;)a=Fc+a;return d&&(a=a.substr(a.length-b)),e+a}function ea(a,b,d,c,e){return d=d||0,function(f){return f=f["get"+a](),(0<d||-d<f)&&(f+=d),0===f&&-12===d&&(f=12),Pb(f,b,c,e)}}function lb(a,b,d){return function(f,e){f=f["get"+a]();return e[vb((d?"STANDALONE":"")+(b?"SHORT":"")+a)][f]}}function Zd(a){var b=new Date(a,0,1).getDay();return new Date(a,0,(b<=4?5:12)-b)}function $d(a){return function(b){var d=Zd(b.getFullYear());return b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d,Pb(b=1+Math.round(b/6048e5),a)}}function Gc(a,b){return a.getFullYear()<=0?b.ERAS[0]:b.ERAS[1]}function Td(a){function b(a){var b,f,g,k,h;return(b=a.match(d))&&(a=new Date(0),g=f=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours,b[9]&&(f=fa(b[9]+b[10]),g=fa(b[9]+b[11])),k.call(a,fa(b[1]),fa(b[2])-1,fa(b[3])),f=fa(b[4]||0)-f,g=fa(b[5]||0)-g,k=fa(b[6]||0),b=Math.round(1e3*parseFloat("0."+(b[7]||0))),h.call(a,f,g,k,b)),a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var h,l,g="",k=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,C(c)&&(c=(jh.test(c)?fa:b)(c)),X(c)&&(c=new Date(c)),!ha(c)||!isFinite(c.getTime()))return c;for(;d;)d=(l=kh.exec(d))?(k=db(k,l,1)).pop():(k.push(d),null);var m=c.getTimezoneOffset();return f&&(m=fc(f,m),c=gc(c,f,!0)),r(k,function(b){h=lh[b],g+=h?h(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),g}}function ch(){return function(a,b){return A(b)&&(b=2),eb(a,b)}}function dh(){return function(a,b,d){return b=(1/0===Math.abs(Number(b))?Number:fa)(b),Y(b)?a:(X(a)&&(a=a.toString()),za(a)?(d=(d=!d||isNaN(d)?0:fa(d))<0?Math.max(0,a.length+d):d,0<=b?Hc(a,d,d+b):0===d?Hc(a,b,a.length):Hc(a,Math.max(0,d+b),d)):a)}}function Hc(a,b,d){return C(a)?a.slice(b,d):Ha.call(a,b,d)}function Vd(a){function b(b){return b.map(function(b){var e,c=1,d=Ta;return B(b)?d=b:C(b)&&("+"!==b.charAt(0)&&"-"!==b.charAt(0)||(c="-"===b.charAt(0)?-1:1,b=b.substring(1)),""!==b&&(d=a(b)).constant&&(e=d(),d=function(a){return a[e]})),{get:d,descending:c}})}function d(a){switch(typeof a){case"number":case"boolean":case"string":return 1;default:return}}function c(a,b){var l,c=0,d=a.type,h=b.type;return d===h?(h=a.value,l=b.value,"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(h)&&(h=a.index),D(l)&&(l=b.index)),h!==l&&(c=h<l?-1:1)):c="undefined"!==d&&("undefined"===h||"null"!==d&&("null"===h||d<h))?-1:1,c}return function(a,f,g,k){if(null==a)return a;if(!za(a))throw F("orderBy")("notarray",a);H(f)||(f=[f]),0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=B(k)?k:c;return(a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);return c=typeof e,null===e?c="null":"object"===c&&(B(e.valueOf)&&d(e=e.valueOf())||cc(e)&&d(e=e.toString())),{value:e,type:c,index:b}})}})).sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l}),a.map(function(a){return a.value})}}function Ra(a){return B(a)&&(a={link:a}),a.restrict=a.restrict||"AC",ia(a)}function Qb(a,b,d,c,e){this.$$controls=[],this.$error={},this.$$success={},this.$pending=void 0,this.$name=e(b.name||b.ngForm||"")(d),this.$dirty=!1,this.$valid=this.$pristine=!0,this.$submitted=this.$invalid=!1,this.$$parentForm=mb,this.$$element=a,this.$$animate=c,ae(this)}function ae(a){a.$$classCache={},a.$$classCache[be]=!(a.$$classCache[nb]=a.$$element.hasClass(nb))}function ce(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Xc(c,"-"):"",b(a,nb+c,!0===d),b(a,be+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){A(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,a,k),de(this.$pending)&&(this.$pending=void 0)),Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k)),this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=de(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid)),d(this,a,g=this.$pending&&this.$pending[a]?void 0:!this.$error[a]&&(!!this.$$success[a]||null)),this.$$parentForm.$setValidity(a,g,this)}}function de(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Ic(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Sa(a,b,d,c,e,f){var k,g=K(b[0].type);e.android||(k=!1,b.on("compositionstart",function(){k=!0}),b.on("compositionupdate",function(a){!A(a.data)&&""!==a.data||(k=!1)}),b.on("compositionend",function(){k=!1,l()}));var h,m,l=function(a){var e;h&&(f.defer.cancel(h),h=null),k||(e=b.val(),a=a&&a.type,"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e)),(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a))};e.hasEvent("input")?b.on("input",l):(m=function(a,b,c){h=h||f.defer(function(){h=null,b&&b.value===c||l(a)})},b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&b<19||37<=b&&b<=40||m(a,this,this.value)}),e.hasEvent("paste")&&b.on("paste cut drop",m)),b.on("change",l),ee[g]&&c.$$hasNativeValidators&&g===d.type&&b.on("keydown wheel mousedown",function(a){var b,c,d;h||(b=this.validity,c=b.badInput,d=b.typeMismatch,h=f.defer(function(){h=null,b.badInput===c&&b.typeMismatch===d||l(a)}))}),c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Rb(a,b){return function(e,c){var f;if(ha(e))return e;if(C(e)){if('"'===e.charAt(0)&&'"'===e.charAt(e.length-1)&&(e=e.substring(1,e.length-1)),mh.test(e))return new Date(e);if(a.lastIndex=0,e=a.exec(e))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1e3*f.sss||0),f.yyyy<100&&e.setFullYear(f.yyyy),e}return NaN}}function ob(a,b,d,c){return function(e,f,g,k,h,l,m,p){function n(a){return a&&(!a.getTime||a.getTime()===a.getTime())}function s(a){return w(a)&&!ha(a)?r(a)||void 0:a}function r(a,e){var c=k.$options.getOption("timezone");v&&v!==c&&(e=Uc(e,fc(v)));e=d(a,e);return!isNaN(e)&&c&&(e=gc(e,c)),e}Jc(0,f,0,k,a),Sa(0,f,g,k,h,l);var q,v,x,z,y,J,t="time"===a||"datetimelocal"===a;k.$parsers.push(function(c){return k.$isEmpty(c)?null:b.test(c)?r(c,q):void(k.$$parserName=a)}),k.$formatters.push(function(a){if(a&&!ha(a))throw pb("datefmt",a);if(n(a)){q=a;var b=k.$options.getOption("timezone");b&&(q=gc(q,v=b,!0));var d=c;return t&&C(k.$options.getOption("timeSecondsFormat"))&&(d=c.replace("ss.sss",k.$options.getOption("timeSecondsFormat")).replace(/:$/,"")),a=m("date")(a,d,b),t&&k.$options.getOption("timeStripZeroSeconds")&&(a=a.replace(/(?::00)?(?:\.000)?$/,"")),a}return v=q=null,""}),(w(g.min)||g.ngMin)&&(x=g.min||p(g.ngMin)(e),z=s(x),k.$validators.min=function(a){return!n(a)||A(z)||d(a)>=z},g.$observe("min",function(a){a!==x&&(z=s(a),x=a,k.$validate())})),(w(g.max)||g.ngMax)&&(y=g.max||p(g.ngMax)(e),J=s(y),k.$validators.max=function(a){return!n(a)||A(J)||d(a)<=J},g.$observe("max",function(a){a!==y&&(J=s(a),y=a,k.$validate())}))}}function Jc(a,b,d,c,e){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(!d.badInput&&!d.typeMismatch)return a;c.$$parserName=e})}function fe(a){a.$parsers.push(function(b){return a.$isEmpty(b)?null:nh.test(b)?parseFloat(b):void(a.$$parserName="number")}),a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!X(b))throw pb("numfmt",b);b=b.toString()}return b})}function na(a){return w(a)&&!X(a)&&(a=parseFloat(a)),Y(a)?void 0:a}function Kc(a){var b=a.toString(),d=b.indexOf(".");return-1===d?-1<a&&a<1&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ge(a,b,d){var k,h,g,c=(0|(a=Number(a)))!==a,e=(0|b)!==b,f=(0|d)!==d;return(c||e||f)&&(g=c?Kc(a):0,k=e?Kc(b):0,h=f?Kc(d):0,g=Math.max(g,k,h),a*=g=Math.pow(10,g),b*=g,d*=g,c&&(a=Math.round(a)),e&&(b=Math.round(b)),f&&(d=Math.round(d))),0==(a-b)%d}function he(a,b,d,c,e){if(w(c)){if(!(a=a(c)).constant)throw pb("constexpr",d,c);return a(b)}return e}function Lc(a,b){function d(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){if(!a)return a;var b=a;return H(a)?b=a.map(c).join(" "):D(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):C(a)||(b=a+""),b}var e;return a="ngClass"+a,["$parse",function(f){return{restrict:"AC",link:function(g,k,h){function l(a,b){var c=[];return r(a,function(a){(0<b||p[a])&&(p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a))}),c.join(" ")}var s,p=k.data("$classCounts"),n=!0;p||(p=T(),k.data("$classCounts",p)),"ngClass"!==a&&(e=e||f("$index",function(a){return 1&a}),g.$watch(e,function(a){var c;a===b?(c=l((c=s)&&c.split(" "),1),h.$addClass(c)):(c=l((c=s)&&c.split(" "),-1),h.$removeClass(c)),n=a})),g.$watch(f(h[a],c),function(a){var e,f,c;n===b&&(f=d(c=s&&s.split(" "),e=a&&a.split(" ")),c=d(e,c),f=l(f,-1),c=l(c,1),h.$addClass(c),h.$removeClass(f)),s=a})}}}]}function sd(a,b,d,c,e,f){return{restrict:"A",compile:function(g,k){var h=a(k[c]);return function(a,c){c.on(e,function(c){function e(){h(a,{$event:c})}if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(g){d(g)}else a.$apply(e)})}}}}function Sb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=h(d.name||"",!1)(a),this.$$parentForm=mb,this.$options=Tb,this.$$updateEvents="",this.$$updateEventHandler=this.$$updateEventHandler.bind(this),this.$$parsedNgModel=e(d.ngModel),this.$$parsedNgModelAssign=this.$$parsedNgModel.assign,this.$$ngModelGet=this.$$parsedNgModel,this.$$ngModelSet=this.$$parsedNgModelAssign,this.$$pendingDebounce=null,this.$$parserValid=void 0,this.$$parserName="parse",this.$$currentValidationRunId=0,this.$$scope=a,this.$$rootScope=a.$root,this.$$attr=d,this.$$element=c,this.$$animate=f,this.$$timeout=g,this.$$parse=e,this.$$q=k,this.$$exceptionHandler=b,ae(this),function(a){a.$$scope.$watch(function(b){return(b=a.$$ngModelGet(b))===a.$modelValue||a.$modelValue!=a.$modelValue&&b!=b||a.$$setModelValue(b),b})}(this)}function Mc(a){this.$$options=a}function ie(a,b){r(b,function(b,c){w(a[c])||(a[c]=b)})}function Oa(a,b){a.prop("selected",b),a.attr("selected",b)}function je(a,b,d){if(a){if(C(a)&&(a=new RegExp("^"+a+"$")),!a.test)throw F("ngPattern")("noregexp",b,a,Aa(d));return a}}function Ub(a){return a=fa(a),Y(a)?-1:a}var x,sb,lc,Xb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ke=/^\/(.+)\/([a-z]*)$/,ta=Object.prototype.hasOwnProperty,K=function(a){return C(a)?a.toLowerCase():a},vb=function(a){return C(a)?a.toUpperCase():a},Ha=[].slice,Kg=[].splice,re=[].push,la=Object.prototype.toString,Rc=Object.getPrototypeOf,oa=F("ng"),ca=z.angular||(z.angular={}),qb=0,wa=z.document.documentMode,Y=Number.isNaN||function(a){return a!=a};E.$inject=[],Ta.$inject=[];var a,ze=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,V=function(a){return C(a)?a.trim():a},Od=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ba=function(){if(!w(Ba.rules)){var a=z.document.querySelector("[ng-csp]")||z.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ba.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ba;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ba.rules},rb=function(){if(w(rb.name_))return rb.name_;for(var a,c,e,d=Qa.length,b=0;b<d;++b)if(c=Qa[b],a=z.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return rb.name_=e},Be=/:/g,Qa=["ng-","data-ng-","ng:","x-ng-"],Fe=(a=z.document,!(qe=a.currentScript)||(qe instanceof z.HTMLScriptElement||qe instanceof z.SVGScriptElement)&&[(qe=qe.attributes).getNamedItem("src"),qe.getNamedItem("href"),qe.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");if(c.href=b.value,a.location.origin===c.origin)return!0;switch(c.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})),Ie=/[A-Z]/g,Yc=!1,Pa=3,Pe={full:"1.8.2",major:1,minor:8,dot:2,codeName:"meteoric-mining"};U.expando="ng339";var Ka=U.cache={},ug=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var qg=/-([a-z])/g,qh=/^-ms-/,Bb={mouseleave:"mouseout",mouseenter:"mouseover"},oc=F("jqLite"),tg=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,nc=/<|&#?\w+;/,rg=/<([\w:-]+)/,sg=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,qa={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};qa.tbody=qa.tfoot=qa.colgroup=qa.caption=qa.thead,qa.th=qa.td;var Nc,hb={option:[1,'<select multiple="multiple">',"</select>"],_default:[0,"",""]};for(Nc in qa){var le=qa[Nc],me=le.slice().reverse();hb[Nc]=[me.length,"<"+me.join("><")+">","</"+le.join("></")+">"]}hb.optgroup=hb.option;var zg=z.Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))},Wa=U.prototype={ready:hd,toString:function(){var a=[];return r(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return x(0<=a?this[a]:this[this.length+a])},length:0,push:re,sort:[].sort,splice:[].splice},Hb={};r("multiple selected checked disabled readOnly required open".split(" "),function(a){Hb[K(a)]=a});var od={};r("input select option textarea button form details".split(" "),function(a){od[a]=!0});var vd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:sc,removeData:rc,hasData:function(a){for(var b in Ka[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)rc(a[b]),kd(a[b])}},function(a,b){U[b]=a}),r({data:sc,inheritedData:Fb,scope:function(a){return x.data(a,"$scope")||Fb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return x.data(a,"$isolateScope")||x.data(a,"$isolateScopeNoTemplate")},controller:ld,injector:function(a){return Fb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Cb,css:function(a,b,d){if(b=yb(b.replace(qh,"ms-")),!w(d))return a.style[b];a.style[b]=d},attr:function(a,b,d){if((c=a.nodeType)!==Pa&&2!==c&&8!==c&&a.getAttribute){var c=K(b),e=Hb[c];if(!w(d))return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a;null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,e?c:d)}},prop:function(a,b,d){if(!w(d))return a[b];a[b]=d},text:function(){function a(a,d){if(A(d)){var c=a.nodeType;return 1===c||c===Pa?a.textContent:""}a.textContent=d}return a.$dv="",a}(),val:function(a,b){if(A(b)){if(a.multiple&&"select"===ua(a)){var d=[];return r(a.options,function(a){a.selected&&d.push(a.value||a.text)}),d}return a.value}a.value=b},html:function(a,b){if(A(b))return a.innerHTML;zb(a,!0),a.innerHTML=b},empty:md},function(a,b){U.prototype[b]=function(b,c){var f,g=this.length;if(a!==md&&A(2===a.length&&a!==Cb&&a!==ld?b:c)){if(D(b)){for(e=0;e<g;e++)if(a===sc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}for(g=A(e=a.$dv)?Math.min(g,1):g,f=0;f<g;f++)var k=a(this[f],b,c),e=e?e+k:k;return e}for(e=0;e<g;e++)a(this[e],b,c);return this}}),r({removeData:rc,on:function(a,b,d,c){if(w(c))throw oc("onargs");if(mc(a))for(var e=(c=Ab(a,!0)).events,f=(f=c.handle)||(c.handle=function(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var k,f=b[d||c.type],g=f?f.length:0;if(g){A(c.immediatePropagationStopped)&&(k=c.stopImmediatePropagation,c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0,c.stopPropagation&&c.stopPropagation(),k&&k.call(c)}),c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var h=f.specialHandlerWrapper||xg;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};return d.elem=a,d}(a,e)),g=(c=0<=b.indexOf(" ")?b.split(" "):[b]).length,k=function(b,c,g){var k=e[b];k||((k=e[b]=[]).specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f)),k.push(d)};g--;)b=c[g],Bb[b]?(k(Bb[b],yg),k(b,void 0,!0)):k(b)},off:kd,one:function(a,b,d){(a=x(a)).on(b,function e(){a.off(b,d),a.off(b,e)}),a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;zb(a),r(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a),d=b})},children:function(a){var b=[];return r(a.childNodes,function(a){1===a.nodeType&&b.push(a)}),b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){if(1===(d=a.nodeType)||11===d)for(var d=0,c=(b=new U(b)).length;d<c;d++)a.appendChild(b[d])},prepend:function(a,b){var d;1===a.nodeType&&(d=a.firstChild,r(new U(b),function(b){a.insertBefore(b,d)}))},wrap:function(a,c){var d=x(c).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a),d.appendChild(a)},remove:Gb,detach:function(a){Gb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;if(c)for(var e=0,f=(b=new U(b)).length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling),d=g}},addClass:Eb,removeClass:Db,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;A(e)&&(e=!Cb(a,b)),(e?Eb:Db)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:qc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=Ab(a);(g=(g=g&&g.events)&&g[f])&&(c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:E,type:f,target:a},b.type&&(c=S(c,b)),b=ja(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)}))}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<k;g++)A(f)?w(f=a(this[g],b,c,e))&&(f=x(f)):pc(f,a(this[g],b,c,e));return w(f)?f:this}}),U.prototype.bind=U.prototype.on,U.prototype.unbind=U.prototype.off;var rh=Object.create(null);pd.prototype={_idx:function(a){return a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a)),this._lastIndex},_transformKey:function(a){return Y(a)?rh:a},get:function(a){if(a=this._transformKey(a),-1!==(a=this._idx(a)))return this._values[a]},has:function(a){return a=this._transformKey(a),-1!==this._idx(a)},set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length),this._keys[d]=a,this._values[d]=b},delete:function(a){return a=this._transformKey(a),-1!==(a=this._idx(a))&&(this._keys.splice(a,1),this._values.splice(a,1),this._lastKey=NaN,this._lastIndex=-1,!0)}};var Ib=pd,og=[function(){this.$get=[function(){return Ib}]}],Bg=/^([^(]+?)=>/,Cg=/^[^(]*\(\s*([^)]*)\)/m,sh=/,/,th=/^\s*(_?)(\S+?)\1\s*$/,Ag=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Ca=F("$injector");function Ef(){this.$get=E}function Ff(){var a=new Ib,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;return b&&r(b=C(b)?b.split(" "):H(b)?b:[],function(b){b&&(d=!0,a[b]=c)}),d}function f(){r(b,function(b){var d,e,f,c=a.get(b);c&&(d=function(a){C(a)&&(a=a.split(" "));var b=T();return r(a,function(a){a.length&&(b[a]=!0)}),b}(b.attr("class")),f=e="",r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)}),r(b,function(a){e&&Eb(a,e),f&&Db(a,f)}),a.delete(b))}),b.length=0}return{enabled:E,on:E,off:E,pin:E,push:function(g,k,h,l){return l&&l(),(h=h||{}).from&&g.css(h.from),h.to&&g.css(h.to),(h.addClass||h.removeClass)&&(k=h.addClass,l=h.removeClass,k=e(h=a.get(g)||{},k,!0),l=e(h,l,!1),(k||l)&&(a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f))),(g=new d).complete(),g}}}]}function Hf(){this.$get=["$$rAF",function(a){function b(b){d.push(b),1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;return b(function(){a=!0}),function(d){a?d():b(d)}}}]}function Gf(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[],this._tick=function(a){c()?e(a,0,!1):b(a)},this._state=0}return f.chain=function(a,b){var d=0;!function c(){d===a.length?b(!0):a[d](function(a){!1===a?b(!1):(d++,c())})}()},f.all=function(a,b){function c(f){e=e&&f,++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})},f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:E,getPromise:function(){var b;return this.promise||((b=this).promise=a(function(a,c){b.done(function(b){(!1===b?c:a)()})})),this.promise},then:function(a,b){return this.getPromise().then(a,b)},catch:function(a){return this.getPromise().catch(a)},finally:function(a){return this.getPromise().finally(a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}},f}]}function Df(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){return a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null),g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null),g.to&&(b.css(g.to),g.to=null),k||h.complete(),k=!0}),h}var g=e||{};g.$$prepared||(g=Ia(g)),g.cleanupStyles&&(g.from=g.to=null),g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]}fb.$$annotate=function(a,b,d){var c;if("function"==typeof a){if(!(c=a.$inject)){if(c=[],a.length){if(b)throw C(d)&&d||(d=a.name||function(a){return(a=qd(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}(a)),Ca("strictdi",d);r((b=qd(a))[1].split(sh),function(a){a.replace(th,function(a,b,d){c.push(d)})})}a.$inject=c}}else H(a)?(tb(a[b=a.length-1],"fn"),c=a.slice(0,b)):tb(a,"fn",!0);return c};var ne=F("$animate"),Cf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null),this.register=function(c,d){if(c&&"."!==c.charAt(0))throw ne("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g,a.factory(g,d)},this.customFilter=function(a){return 1===arguments.length&&(c=B(a)?a:null),c},this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,ne("nongcls","ng-animate");return d},this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){return d=d&&x(d),h=h&&x(h),b(c,d=d||h.parent(),h),a.push(c,"enter",ra(l))},move:function(c,d,h,l){return d=d&&x(d),h=h&&x(h),b(c,d=d||h.parent(),h),a.push(c,"move",ra(l))},leave:function(b,c){return a.push(b,"leave",ra(c),function(){b.remove()})},addClass:function(b,c,d){return(d=ra(d)).addClass=ib(d.addclass,c),a.push(b,"addClass",d)},removeClass:function(b,c,d){return(d=ra(d)).removeClass=ib(d.removeClass,c),a.push(b,"removeClass",d)},setClass:function(b,c,d,f){return(f=ra(f)).addClass=ib(f.addClass,c),f.removeClass=ib(f.removeClass,d),a.push(b,"setClass",f)},animate:function(b,c,d,f,m){return(m=ra(m)).from=m.from?S(m.from,c):c,m.to=m.to?S(m.to,d):d,m.tempClasses=ib(m.tempClasses,f||"ng-inline-animate"),a.push(b,"animate",m)}}}]}],$=F("$compile"),uc=new function(){};function Of(){this.$get=["$document",function(a){return function(b){return b?!b.nodeType&&b instanceof x&&(b=b[0]):b=a[0].body,b.offsetWidth+1}}]}Zc.$inject=["$provide","$$sanitizeUriProvider"],Kb.prototype.isFirstChange=function(){return this.previousValue===uc};var rd=/^((?:x|data)[:\-_])/i,Jg=/[:\-_]+(.)/g,xd=F("$controller"),wd=/^(\S+)(\s+as\s+([\w$]+))?$/,yd="application/json",xc={"Content-Type":yd+";charset=utf-8"},Mg=/^\[|^\{(?!\{)/,Ng={"[":/]$/,"{":/}$/},Lg=/^\)]\}',?\n/,Lb=F("$http"),Ma=ca.$interpolateMinErr=F("$interpolate");function Xf(){this.$get=function(){var b=ca.callbacks,d={};return{createCallback:function(c){var e="angular.callbacks."+(c="_"+(b.$$counter++).toString(36)),f=function(a){var b=function(a){b.data=a,b.called=!0};return b.id=a,b}(c);return d[e]=b[c]=f,e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id],delete d[a]}}}}Ma.throwNoconcat=function(a){throw Ma("noconcat",a)},Ma.interr=function(a,b){return Ma("interr",a,b.toString())};var Qg=F("$interval"),uh=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Rg={http:80,https:443,ftp:21},kb=F("$location"),Sg=/^\s*[\\/]{2,}/,vh={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){for(var a=this.$$path,b=this.$$hash,d=function(a){var b=[];return r(a,function(a,c){H(a)?r(a,function(a){b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}):b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}),b.length?b.join("&"):""}(this.$$search),b=b?"#"+ic(b):"",c=(a=a.split("/")).length;c--;)a[c]=ic(a[c].replace(/%2F/g,"/"));this.$$url=a.join("/")+(d?"?"+d:"")+b,this.$$absUrl=this.$$normalizeUrl(this.$$url),this.$$urlUpdatedByLocation=!0},absUrl:Mb("$$absUrl"),url:function(a){if(A(a))return this.$$url;var b=uh.exec(a);return!b[1]&&""!==a||this.path(decodeURIComponent(b[1])),(b[2]||b[1]||""===a)&&this.search(b[3]||""),this.hash(b[5]||""),this},protocol:Mb("$$protocol"),host:Mb("$$host"),port:Mb("$$port"),path:Fd("$$path",function(a){return"/"===(a=null!==a?a.toString():"").charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(C(a)||X(a))a=a.toString(),this.$$search=hc(a);else{if(!D(a))throw kb("isrcharg");r(a=Ia(a,{}),function(b,c){null==b&&delete a[c]}),this.$$search=a}break;default:A(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}return this.$$compose(),this},hash:Fd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){return this.$$replace=!0,this}};r([Ed,Ac,zc],function(a){a.prototype=Object.create(vh),a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==zc||!this.$$html5)throw kb("nostate");return this.$$state=A(b)?null:b,this.$$urlUpdatedByLocation=!0,this}});var Ya=F("$parse"),Wg={}.constructor.prototype.valueOf,Vb=T();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Vb[a]=!0});var wh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Ob=function(a){this.options=a};Ob.prototype={constructor:Ob,lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index<this.text.length;){var b,d,c,e;'"'===(a=this.text.charAt(this.index))||"'"===a?this.readString(a):this.isNumber(a)||"."===a&&this.isNumber(this.peek())?this.readNumber():this.isIdentifierStart(this.peekMultichar())?this.readIdent():this.is(a,"(){}[].,;:?")?(this.tokens.push({index:this.index,text:a}),this.index++):this.isWhitespace(a)?this.index++:(d=(b=a+this.peek())+this.peek(2),c=Vb[b],e=Vb[d],Vb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1))}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){return a=a||1,this.index+a<this.text.length&&this.text.charAt(this.index+a)},isNumber:function(a){return"0"<=a&&a<="9"&&"string"==typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||" "===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&d<=56319&&56320<=c&&c<=57343?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){throw d=d||this.index,b=w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d,Ya("lexerr",a,b,this.text)},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=K(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else{if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?((e=this.text.substring(this.index+1,this.index+5)).match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=wh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a)return this.index++,void this.tokens.push({index:b,text:c,constant:!0,value:d});d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer=a,this.options=b};q.Program="Program",q.ExpressionStatement="ExpressionStatement",q.AssignmentExpression="AssignmentExpression",q.ConditionalExpression="ConditionalExpression",q.LogicalExpression="LogicalExpression",q.BinaryExpression="BinaryExpression",q.UnaryExpression="UnaryExpression",q.CallExpression="CallExpression",q.MemberExpression="MemberExpression",q.Identifier="Identifier",q.Literal="Literal",q.ArrayExpression="ArrayExpression",q.Property="Property",q.ObjectExpression="ObjectExpression",q.ThisExpression="ThisExpression",q.LocalsExpression="LocalsExpression",q.NGValueParameter="NGValueParameter",q.prototype={ast:function(a){return this.text=a,this.tokens=this.lexer.lex(a),a=this.program(),0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Jd(a))throw Ya("lval");a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var b,d,a=this.logicalOR();return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var b,a=this.relational();b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var b,a=this.additive();b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var b,a=this.multiplicative();b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var b,a=this.unary();b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a,b;for(this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=Ia(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text)for(;a.push(this.filterChain()),this.expect(","););return a},identifier:function(){var a=this.consume();return a.identifier||this.throwError("is not a valid identifier",a),{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text)for(;!this.peek("]")&&(a.push(this.expression()),this.expect(",")););return this.consume("]"),{type:q.ArrayExpression,elements:a}},object:function(){var b,a=[];if("}"!==this.peekToken().text)for(;!this.peek("}")&&(b={type:q.Property,kind:"init"},this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek()),a.push(b),this.expect(",")););return this.consume("}"),{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Ya("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index))},consume:function(a){if(0===this.tokens.length)throw Ya("ueoe",this.text);var b=this.expect(a);return b||this.throwError("is unexpected, expecting ["+a+"]",this.peek()),b},peekToken:function(){if(0===this.tokens.length)throw Ya("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){var f=(a=this.tokens[a]).text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return!!(a=this.peek(a,b,d,c))&&(this.tokens.shift(),a)},selfReferential:{this:{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}};var Hd=2;Ld.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},Z(a,b.$filter);var c,d="";return this.stage="assign",(c=Kd(a))&&(this.state.computing="assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l")),c=Id(a.body),b.stage="inputs",r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}},b.state.computing=d;var k=b.nextId();b.recurse(a,k),b.return_(k),b.state.inputs.push({name:d,isPure:a.isPure}),a.watchId=c}),this.state.computing="fn",this.stage="main",this.recurse(a),a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;",a=new Function("$filter","getStringValue","ifDefined","plus",a)(this.$filter,Tg,Ug,Gd),this.state=this.stage=void 0,a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;return r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s")),b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")}),b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];"),a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;return r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")}),a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,k,l,m,p,h=this;if(c=c||E,!f&&w(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a}),c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case q.Literal:m=this.escape(a.value),this.assign(b,m),c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){k=a}),m=a.operator+"("+this.ifDefined(k,0)+")",this.assign(b,m),c(m);break;case q.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a}),this.recurse(a.right,void 0,void 0,function(a){k=a}),m="+"===a.operator?this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")",this.assign(b,m),c(m);break;case q.LogicalExpression:b=b||this.nextId(),h.recurse(a.left,b),h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,b)),c(b);break;case q.ConditionalExpression:b=b||this.nextId(),h.recurse(a.test,b),h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,b)),c(b);break;case q.Identifier:b=b||this.nextId(),d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name),h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),h.lazyAssign(h.nonComputedMember("s",a.name),"{}")),h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",a.name))),c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId(),b=b||this.nextId(),h.recurse(a.object,g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,"undefined")}),c(b)},!!e);break;case q.CallExpression:b=b||this.nextId(),a.filter?(k=h.filter(a.callee.name),l=[],r(a.arguments,function(a){var b=h.nextId();h.recurse(a,b),l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){r(a.arguments,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})}),m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+")",h.assign(b,m)},function(){h.assign(b,"undefined")}),c(b)}));break;case q.AssignmentExpression:k=this.nextId(),g={},this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k),m=h.member(g.context,g.name,g.computed)+a.operator+k,h.assign(b,m),c(b||m)})},1);break;case q.ArrayExpression:l=[],r(a.elements,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})}),m="["+l.join(",")+"]",this.assign(b,m),c(b||m);break;case q.ObjectExpression:p=!(l=[]),r(a.properties,function(a){a.computed&&(p=!0)}),p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value,k=h.nextId(),h.recurse(a.value,k),h.assign(h.member(b,g,a.computed),k)})):(r(a.properties,function(b){h.recurse(b.value,a.constant?void 0:h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m)),c(b||m);break;case q.ThisExpression:this.assign(b,"s"),c(b||"s");break;case q.LocalsExpression:this.assign(b,"l"),c(b||"l");break;case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;return c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")")),c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){return this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0)),this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){var c;!0===a?b():((c=this.current().body).push("if(",a,"){"),b(),c.push("}"),d&&(c.push("else{"),d(),c.push("}")))},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(/[^$_a-zA-Z0-9]/g,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(C(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(X(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if(void 0===a)return"undefined";throw Ya("esc")},nextId:function(a,b){var d="v"+this.state.nextId++;return a||this.current().vars.push(d+(b?"="+b:"")),d},current:function(){return this.state[this.state.computing]}},Md.prototype={compile:function(a){var d,c,e,b=this;Z(a,b.$filter),(d=Kd(a))&&(c=this.recurse(d)),(d=Id(a.body))&&(e=[],r(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure,a.input=d,e.push(d),a.watchId=c}));var f=[];return r(a.body,function(a){f.push(b.recurse(a.expression))}),a=0===a.body.length?E:1===a.body.length?f[0]:function(a,b){var c;return r(f,function(d){c=d(a,b)}),c},c&&(a.assign=function(a,b,d){return c(a,d,b)}),e&&(a.inputs=e),a},recurse:function(a,b,d){var c,e,g,f=this;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));return a=e.apply(void 0,p,f),b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var n,p=e(a,c,d,f);if(null!=p.value){n=[];for(var s=0;s<g.length;++s)n.push(g[s](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=c(a,d,f,g);return a=e(a,d,f,g),p.context[p.name]=a,b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){return d=w(d=a(d,c,e,f))?+d:0,b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){return d=w(d=a(d,c,e,f))?-d:-0,b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){return d=!a(d,c,e,f),b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=Gd(k=a(c,e,f,g),c=b(c,e,f,g));return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);return c=b(c,e,f,g),k=(w(k)?k:0)-(w(c)?c:0),d?{value:k}:k}},"binary*":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)*b(c,e,f,g),d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)/b(c,e,f,g),d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)%b(c,e,f,g),d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)===b(c,e,f,g),d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)!==b(c,e,f,g),d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)==b(c,e,f,g),d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)!=b(c,e,f,g),d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)<b(c,e,f,g),d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>b(c,e,f,g),d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)<=b(c,e,f,g),d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>=b(c,e,f,g),d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)&&b(c,e,f,g),d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)||b(c,e,f,g),d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,k){return e=(a(e,f,g,k)?b:d)(e,f,g,k),c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){return c=e&&a in e?e:c,d&&1!==d&&c&&null==c[a]&&(c[a]={}),e=c?c[a]:void 0,b?{context:c,name:a,value:e}:e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var l,m,h=a(e,f,g,k);return null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]),d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,k){return e=a(e,f,g,k),c&&1!==c&&e&&null==e[b]&&(e[b]={}),f=null!=e?e[b]:void 0,d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}},Nb.prototype={constructor:Nb,parse:function(a){a=this.getAst(a);var b=this.astCompiler.compile(a.ast),d=a.ast;return b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression),b.constant=a.ast.constant,b.oneTime=a.oneTime,b},getAst:function(a){var b=!1;return":"===(a=a.trim()).charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2)),{ast:this.ast.ast(a),oneTime:b}}};var Na,Ea=F("$sce"),W={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Dc=/_([a-z])/g,Zg=F("$templateRequest"),$g=F("$timeout"),aa=z.document.createElement("a"),Qd=ga(z.location.href);aa.href="http://[::1]";var ah="[::1]"===aa.hostname;Rd.$inject=["$document"],fd.$inject=["$provide"];var Yd=22,Xd=".",Fc="0";Sd.$inject=["$locale"];var lh={yyyy:ea("FullYear",4,0,!(Ud.$inject=["$locale"]),!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:lb("Month"),MMM:lb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:lb("Month",!1,!0),dd:ea("Date",2),d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:lb("Day"),EEE:lb("Day",!0),a:function(a,b){return a.getHours()<12?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){return(0<=(a=-1*d)?"+":"")+(Pb(Math[0<a?"floor":"ceil"](a/60),2)+Pb(Math.abs(a%60),2))},ww:$d(2),w:$d(1),G:Gc,GG:Gc,GGG:Gc,GGGG:function(a,b){return a.getFullYear()<=0?b.ERANAMES[0]:b.ERANAMES[1]}},kh=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,jh=/^-?\d+$/;Td.$inject=["$locale"];var eh=ia(K),fh=ia(vb);Vd.$inject=["$parse"];var Re=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){var e;"a"===b[0].nodeName.toLowerCase()&&(e="[object SVGAnimatedString]"===la.call(b.prop("href"))?"xlink:href":"href",b.on("click",function(a){b.attr(e)||a.preventDefault()}))}}}),wb={};r(Hb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}var c,e;"multiple"!==a&&(c=xa("ng-"+b),e="checked"===a?function(a,b,e){e.ngModel!==e[c]&&d(a,0,e)}:d,wb[c]=function(){return{restrict:"A",priority:100,link:e}})}),r(vd,function(a,b){wb[b]=function(){return{priority:100,link:function(a,c,e){"ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ke))?e.$set("ngPattern",new RegExp(c[1],c[2])):a.$watch(e[b],function(a){e.$set(b,a)})}}}}),r(["src","srcset","href"],function(a){var b=xa("ng-"+a);wb[b]=["$sce",function(d){return{priority:99,link:function(c,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===la.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null),f.$set(b,d.getTrustedMediaUrl(f[b])),f.$observe(b,function(b){b?(f.$set(k,b),wa&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}]});var mb={$addControl:E,$getControls:ia([]),$$renameControl:function(a,b){a.$name=b},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E,$$setSubmitted:E};Qb.$inject=["$element","$attrs","$scope","$animate","$interpolate"],Qb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ja(a.$name,"input"),this.$$controls.push(a),a.$name&&(this[a.$name]=a),a.$$parentForm=this},$getControls:function(){return ja(this.$$controls)},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d],(this[b]=a).$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name],r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this),r(this.$error,function(b,d){this.$setValidity(d,null,a)},this),r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this),cb(this.$$controls,a),a.$$parentForm=mb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Za),this.$$animate.addClass(this.$$element,Wb),this.$dirty=!0,this.$pristine=!1,this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Za,Wb+" ng-submitted"),this.$dirty=!1,this.$pristine=!0,this.$submitted=!1,r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==mb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted"),this.$submitted=!0,r(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}},ce({clazz:Qb,set:function(a,b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var Se=(se=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||E}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Qb,compile:function(d,f){d.addClass(Za).addClass(nb);var g=f.name?"name":!(!a||!f.ngForm)&&"ngForm";return{pre:function(a,d,e,f){var n,p=f[0];"action"in e||(n=function(b){a.$apply(function(){p.$commitViewValue(),p.$setSubmitted()}),b.preventDefault()},d[0].addEventListener("submit",n),d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})),(f[1]||p.$$parentForm).$addControl(p);var s=g?c(p.$name):E;g&&(s(a,p),e.$observe(g,function(b){p.$name!==b&&(s(a,void 0),p.$$parentForm.$$renameControl(p,b),(s=c(p.$name))(a,p))})),d.on("$destroy",function(){p.$$parentForm.$removeControl(p),s(a,void 0),S(p,mb)})}}}}}]})(),df=se(!0),mh=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,xh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,yh=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,nh=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,pe=/^(\d{4,})-(\d{2})-(\d{2})$/,qe=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Oc=/^(\d{4,})-W(\d\d)$/,re=/^(\d{4,})-(\d\d)$/,se=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ee=T();function Af(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};return{restrict:"E",priority:200,compile:function(b,d){if("hidden"===K(d.type))return{pre:function(b,d,f,g){(b=d[0]).parentNode&&b.parentNode.insertBefore(b,b.nextSibling),Object.defineProperty&&Object.defineProperty(b,"value",a)}}}}}function xf(){function a(a,d,c){var e=w(c)?c:9===wa?"":null;a.prop("value",e),d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return zh.test(d.ngValue)?function(b,d,f){a(d,f,b=b.$eval(f.ngValue))}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}}r(["date","datetime-local","month","time","week"],function(a){ee[a]=!0});var te={text:function(a,b,d,c,e,f){Sa(0,b,d,c,e,f),Ic(c)},date:ob("date",pe,Rb(pe,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ob("datetimelocal",qe,Rb(qe,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:ob("time",se,Rb(se,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ob("week",Oc,function(h,b){if(ha(h))return h;if(C(h)){Oc.lastIndex=0;var d=Oc.exec(h);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Zd(c),e=7*(e-1);return b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds()),new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:ob("month",re,Rb(re,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f,g,k){var l,h,m,p,n,s;Jc(0,b,0,c,"number"),fe(c),Sa(0,b,d,c,e,f),(w(d.min)||d.ngMin)&&(l=d.min||k(d.ngMin)(a),h=na(l),c.$validators.min=function(a,b){return c.$isEmpty(b)||A(h)||h<=b},d.$observe("min",function(a){a!==l&&(h=na(a),l=a,c.$validate())})),(w(d.max)||d.ngMax)&&(m=d.max||k(d.ngMax)(a),p=na(m),c.$validators.max=function(a,b){return c.$isEmpty(b)||A(p)||b<=p},d.$observe("max",function(a){a!==m&&(p=na(a),m=a,c.$validate())})),(w(d.step)||d.ngStep)&&(n=d.step||k(d.ngStep)(a),s=na(n),c.$validators.step=function(a,b){return c.$isEmpty(b)||A(s)||ge(b,h||0,s)},d.$observe("step",function(a){a!==n&&(s=na(a),n=a,c.$validate())}))},url:function(a,b,d,c,e,f){Sa(0,b,d,c,e,f),Ic(c),c.$validators.url=function(a,d){d=a||d;return c.$isEmpty(d)||xh.test(d)}},email:function(a,b,d,c,e,f){Sa(0,b,d,c,e,f),Ic(c),c.$validators.email=function(a,d){d=a||d;return c.$isEmpty(d)||yh.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==V(d.ngTrim);A(d.name)&&b.attr("name",++qb),b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=V(g)),c.$setViewValue(g,a&&a.type))}),c.$render=function(){var a=d.value;e&&(a=V(a)),b[0].checked=a===c.$viewValue},d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,c){b.attr(a,d[a]);var e=d[a];d.$observe(a,function(a){a!==e&&c(e=a)})}Jc(0,b,0,c,"range"),fe(c),Sa(0,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?0:void 0,n=m?100:void 0,s=m?1:void 0,r=b[0].validity;a=w(d.min),e=w(d.max),f=w(d.step);var q=c.$render;c.$render=m&&w(r.rangeUnderflow)&&w(r.rangeOverflow)?function(){q(),c.$setViewValue(b.val())}:q,a&&(p=na(d.min),c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||A(p)||p<=b},g("min",function(a){p=na(a),Y(c.$modelValue)||(m?((a=b.val())<p&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())})),e&&(n=na(d.max),c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||A(n)||b<=n},g("max",function(a){n=na(a),Y(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())})),f&&(s=na(d.step),c.$validators.step=m?function(){return!r.stepMismatch}:function(a,b){return c.$isEmpty(b)||A(s)||ge(b,p||0,s)},g("step",function(a){s=na(a),Y(c.$modelValue)||(m?c.$viewValue!==b.val()&&c.$setViewValue(b.val()):c.$validate())}))},checkbox:function(a,b,d,c,e,f,g,k){var h=he(k,a,"ngTrueValue",d.ngTrueValue,!0),l=he(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)}),c.$render=function(){b[0].checked=c.$viewValue},c.$isEmpty=function(a){return!1===a},c.$formatters.push(function(a){return va(a,h)}),c.$parsers.push(function(a){return a?h:l})},hidden:E,button:E,submit:E,reset:E,file:E},$c=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,k){k[0]&&(te[K(g.type)]||te.text)(e,f,g,k[0],b,a,d,c)}}}}],zh=/^(true|false|\d+)$/,We=["$compile",function(a){return{restrict:"AC",compile:function(b){return a.$$addBindingClass(b),function(b,c,e){a.$$addBindingInfo(c,e.ngBind),c=c[0],b.$watch(e.ngBind,function(a){c.textContent=jc(a)})}}}}],Ye=["$interpolate","$compile",function(a,b){return{compile:function(d){return b.$$addBindingClass(d),function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate)),b.$$addBindingInfo(d,c.expressions),d=d[0],f.$observe("ngBindTemplate",function(a){d.textContent=A(a)?"":a})}}}}],Xe=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});return d.$$addBindingClass(c),function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml),b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],wf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Ze=Lc("",!0),af=Lc("Odd",0),$e=Lc("Even",1),bf=Ra({compile:function(a,b){b.$set("ngCloak",void 0),a.removeClass("ng-cloak")}}),cf=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ed={},Ah={blur:!0,focus:!0};function vf(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!A(a)){var b=[];return a&&r(a.split(g),function(a){a&&b.push(f?V(a):a)}),b}}),c.$formatters.push(function(a){if(H(a))return a.join(e)}),c.$isEmpty=function(a){return!a||!a.length}}}}r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);ed[b]=["$parse","$rootScope","$exceptionHandler",function(d,c,e){return sd(d,c,e,b,a,Ah[a])}]});var ff=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f,d[d.length++]=b.$$createComment("end ngIf",e.ngIf),k={clone:d},a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=ub(k.clone),a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],gf=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){function v(){t&&(t.remove(),t=null),q&&(q.$destroy(),q=null),x&&(d.leave(x).done(function(a){!1!==a&&(t=null)}),t=x,x=null)}var q,t,x,r=0;c.$watch(f,function(f){function m(a){!1===a||!w(k)||k&&!c.$eval(k)||b()}var t=++r;f?(a(f,!0).then(function(a){var b;c.$$destroyed||t!==r||(b=c.$new(),p.template=a,a=n(b,function(a){v(),d.enter(a,null,e).done(m)}),x=a,(q=b).$emit("$includeContentLoaded",f),c.$eval(g))},function(){c.$$destroyed||t!==r||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],zf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){la.call(d[0]).match(/SVG/)?(d.empty(),a(gd(e.template,z.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],hf=Ra({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),nb="ng-valid",be="ng-invalid",Za="ng-pristine",Wb="ng-dirty",pb=F("ngModel");Sb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" "),Sb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);return B(c)&&(c=a(b)),c},this.$$ngModelSet=function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw pb("nonassign",this.$$attr.ngModel,Aa(this.$$element))},$render:E,$isEmpty:function(a){return A(a)||""===a||null===a||a!=a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1,this.$pristine=!0,this.$$animate.removeClass(this.$$element,Wb),this.$$animate.addClass(this.$$element,Za)},$setDirty:function(){this.$dirty=!0,this.$pristine=!1,this.$$animate.removeClass(this.$$element,Za),this.$$animate.addClass(this.$$element,Wb),this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1,this.$untouched=!0,this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0,this.$untouched=!1,this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce),this.$viewValue=this.$$lastCommittedViewValue,this.$render()},$validate:function(){var a,b,d,c,e,f;Y(this.$modelValue)||(a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),(f=this).$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==c&&f.$$writeModelToScope())}))},$$runValidators:function(a,b,d){function f(a,b){k===h.$$currentValidationRunId&&h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;return A(h.$$parserValid)?(f(a,null),1):(h.$$parserValid||(r(h.$validators,function(a,b){f(b,null)}),r(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid)})()&&function(){var c=!0;return r(h.$validators,function(g,e){g=Boolean(g(a,b));c=c&&g,f(e,g)}),c||(r(h.$asyncValidators,function(a,b){f(b,null)}),0)}()?function(){var c=[],d=!0;r(h.$asyncValidators,function(h,g){h=h(a,b);if(!h||!B(h.then))throw pb("nopromise",h);f(g,void 0),c.push(h.then(function(){f(g,!0)},function(){f(g,d=!1)}))}),c.length?h.$$q.all(c).then(function(){g(d)},E):g(!0)}():g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce),(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)&&(this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate())},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;if(this.$$parserValid=!A(a)||void 0,this.$setValidity(this.$$parserName,null),this.$$parserName="parse",this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(A(a=this.$parsers[d](a))){this.$$parserValid=!1;break}Y(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a,e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope()),this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue),r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=a,this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");X(b[a])?b=b[a]:X(b.default)&&-1===this.$options.getOption("updateOn").indexOf(a)?b=b.default:X(b["*"])&&(b=b["*"]),this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a),this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,E))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a,this.$$parserValid=void 0,this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler),(this.$$updateEvents=this.$options.getOption("updateOn"))&&this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}},ce({clazz:Sb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var Tb,uf=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Sb,priority:1,compile:function(b){return b.addClass(Za).addClass("ng-untouched").addClass(nb),{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm,(f=f[2])&&(g.$options=f.$options),g.$$initGetterSetters(),b.$addControl(g),e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)}),a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents(),c.on("blur",function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Bh=/(\s+|^)default(\s+|$)/;function yf(){function a(a,d){this.$$attrs=a,this.$$scope=d}return a.$inject=["$attrs","$scope"],a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Tb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}},{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}}function Ue(){return{restrict:"E",require:["select","?ngModel"],controller:Gh,priority:1,link:{pre:function(a,b,d,c){var g,k,e=c[0],f=c[1];f?(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption(),a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple&&(e.multiple=!0,e.readValue=function(){var a=[];return r(b.find("option"),function(b){b.selected&&!b.disabled&&(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))}),a},e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Oa(x(b),c)})},k=NaN,a.$watch(function(){k!==f.$viewValue||va(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render()),k=f.$viewValue}),f.$isEmpty=function(a){return!a||0===a.length})):e.registerOption=E},post:function(a,b,d,c){var f,e=c[1];e&&(f=c[0],e.$render=function(){f.writeValue(e.$viewValue)})}}}}Mc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;return r(a=S({},a),function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=V(d.replace(Bh,function(){return a.updateOnDefault=!0," "})))},this),b&&(delete a["*"],ie(a,this.$$options)),ie(a,Tb.$$options),new Mc(a)}},Tb=new Mc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var jf=Ra({terminal:!0,priority:1e3}),Ch=F("ngOptions"),Dh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,sf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a,this.viewValue=b,this.label=c,this.group=d,this.disabled=f}function f(a){var b;if(!r&&za(a))b=a;else for(var c in b=[],a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c);return b}var p=a.match(Dh);if(!p)throw Ch("iexp",a,Aa(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);function x(a,b){return v(a,B(a,b))}var t=a&&d(a)||b,w=q&&d(q),v=q?function(a,b){return w(c,b)}:function(a){return La(a)},A=d(p[2]||p[1]),y=d(p[3]||""),J=d(p[4]||""),I=d(p[8]),z={},B=r?function(a,b){return z[r]=b,z[n]=a,z}:function(a){return z[n]=a,z};return{trackBy:q,getTrackByValue:x,getWatchables:d(I,function(a){for(var b=[],d=f(a=a||[]),e=d.length,g=0;g<e;g++){var l=a[k=a===d?g:d[g]],k=B(l,k),l=v(l,k);b.push(l),(p[2]||p[1])&&(l=A(c,k),b.push(l)),p[4]&&(k=J(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=I(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===g?n:g[n],r=B(d[p],p),s=t(c,r),s=new e(p=v(s,r),s,A(c,r),y(c,r),r=J(c,r));a.push(s),b[p]=s}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[x(a)]},getViewValueFromOption:function(a){return q?Ia(a.viewValue):a.viewValue}}}}}var e=z.document.createElement("option"),f=z.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=E},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&a.element;return b&&!b.selected&&(b.selected=!0),a}function p(a,b){(a.element=b).disabled=a.disabled,a.label!==b.label&&(b.label=a.label,b.textContent=a.label),b.value=a.selectValue}var n=l[0],q=l[1],A=h.multiple;l=0;for(var t=k.children(),z=t.length;l<z;l++)if(""===t[l].value){n.hasEmptyOption=!0,n.emptyOption=t.eq(l);break}k.empty(),l=!!n.emptyOption,x(e.cloneNode(!1)).val("?");var v,B=c(h.ngOptions,k,d),C=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"},A?(n.writeValue=function(a){var b;v&&(b=a&&a.map(m)||[],v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)}))},n.readValue=function(){var a=k.val()||[],b=[];return r(a,function(a){(a=v.selectValueMap[a])&&!a.disabled&&b.push(v.getViewValueFromOption(a))}),b},B.trackBy&&d.$watchCollection(function(){if(H(q.$viewValue))return q.$viewValue.map(function(a){return B.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){var b,c;v&&(b=k[0].options[k[0].selectedIndex],c=v.getOptionFromViewValue(a),b&&b.removeAttribute("selected"),c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a))},n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},B.trackBy&&d.$watch(function(){return B.getTrackByValue(q.$viewValue)},function(){q.$render()})),l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1,n.emptyOption=void 0,a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope")),d.$watchCollection(B.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=v.items[b];w(c.group)?Gb(c.element.parentNode):Gb(c.element)}v=B.getOptions();var d={};v.items.forEach(function(a){var b,c;w(a.group)?((b=d[a.group])||(b=f.cloneNode(!1),C.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b),c=e.cloneNode(!1),b.appendChild(c),p(a,c)):(b=e.cloneNode(!1),C.appendChild(b),p(a,b))}),k[0].appendChild(C),q.$render(),q.$isEmpty(a)||(b=n.readValue(),(B.trackBy||A?va(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],kf=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var z,l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},q={},w=b.startSymbol(),t=b.endSymbol(),x=w+l+"-"+p+t,v=ca.noop;r(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+K(c[2]),n[c]=g.attr(k.$attr[b]))}),r(n,function(a,d){q[d]=b(a.replace(c,x))}),f.$watch(l,function(b){var c=parseFloat(b),e=Y(c);e||c in n||(c=a.pluralCat(c-p)),c===z||e&&Y(z)||(v(),A(e=q[c])?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),v=E,h()):v=f.$watch(e,h),z=c)})}}}],ue=F("ngRef"),lf=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=xa(ua(b)),e=a(d.ngRef),f=e.assign||function(){throw ue("nonassign",d.ngRef)};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead")){if("$element"===h.ngRefRead)l=b;else if(!(l=b.data("$"+h.ngRefRead+"Controller")))throw ue("noctrl",h.ngRefRead,d.ngRef)}else l=b.data("$"+c+"Controller");f(a,l=l||b),b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],mf=["$parse","$animate","$compile",function(a,b,d){function f(a,b,c){return La(c)}function g(a,b){return b}var c=F("ngRepeat"),e=function(a,b,c,d,e,f,g){a[c]=d,e&&(a[e]=f),a.$index=b,a.$first=0===b,a.$last=b===g-1,a.$middle=!(a.$first||a.$last),a.$odd=!(a.$even=0==(1&b))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(k,t){var l=t.ngRepeat,m=d.$$createComment("end ngRepeat",l),p=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw c("iexp",l);var n=p[1],q=p[2],w=p[3],t=p[4];if(!(p=n.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/)))throw c("iidexp",n);var z,y,A,x=p[3]||p[1],v=p[2];if(w&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(w)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(w)))throw c("badident",w);return t&&(z={$id:La},y=a(t),A=function(a,b,c,d){return v&&(z[v]=b),z[x]=c,z.$index=d,y(a,z)}),function(a,d,h,k,n){var p=T();a.$watchCollection(q,function(h){var k,q,s,B,C,E,D,H,F,K,t=d[0],y=T();if(w&&(a[w]=h),za(h))H=h,q=A||f;else for(K in q=A||g,H=[],h)ta.call(h,K)&&"$"!==K.charAt(0)&&H.push(K);for(B=H.length,K=Array(B),k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],D=q(a,C,E,k),p[D])F=p[D],delete p[D],y[D]=F,K[k]=F;else{if(y[D])throw r(K,function(a){a&&a.scope&&(p[a.id]=a)}),c("dupes",l,D,E);K[k]={id:D,scope:void 0,clone:void 0},y[D]=!0}for(s in z&&(z[x]=void 0),p){if(D=ub((F=p[s]).clone),b.leave(D),D[0].parentNode)for(k=0,q=D.length;k<q;k++)D[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],(F=K[k]).scope){for(s=t;s=s.nextSibling,s&&s.$$NG_REMOVED;);F.clone[0]!==s&&b.move(ub(F.clone),null,t),t=F.clone[F.clone.length-1],e(F.scope,k,x,E,v,C,B)}else n(function(a,d){F.scope=d;d=m.cloneNode(!1);a[a.length++]=d,b.enter(a,null,t),t=d,F.clone=a,y[F.id]=F,e(F.scope,k,x,E,v,C,B)});p=y})}}}}],nf=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],ef=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],of=Ra(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,c){b.css(c,"")}),a&&b.css(a)})}),pf=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g,k=[],h=[],l=[];d.$watch(e.ngSwitch||e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());for(d=0,e=l.length;d<e;++d){var q=ub(k[d].clone);l[d].$destroy(),(h[d]=a.leave(q)).done(function(a,b){return function(c){!1!==c&&a.splice(b,1)}}(h,d))}k.length=0,l.length=0,(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,f){l.push(f);f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen"),k.push({clone:d}),a.enter(d,f.parent(),f)})})})}}}],qf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){r(d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a}),function(a){c.cases["!"+a]=c.cases["!"+a]||[],c.cases["!"+a].push({transclude:e,element:b})})}}),rf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[],c.cases["?"].push({transclude:e,element:b})}}),Eh=F("ngTransclude"),tf=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());return b.empty(),function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw Eh("orphan",Aa(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude=""),k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Pa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},null,f=f.ngTransclude||f.ngTranscludeSlot),f&&!k.isSlotFilled(f)&&h()}}}}],Te=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],Fh={$setViewValue:E,$render:E},Gh=["$element","$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1,e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Ib;e.selectValueMap={},e.ngModelCtrl=Fh,e.multiple=!1,e.unknownOption=x(z.document.createElement("option")),e.hasEmptyOption=!1,e.emptyOption=void 0,e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b),e.unknownOption.val(b),a.prepend(e.unknownOption),Oa(e.unknownOption,!0),a.val(b)},e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b),e.unknownOption.val(b),Oa(e.unknownOption,!0),a.val(b)},e.generateUnknownOptionValue=function(a){return"? "+La(a)+" ?"},e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()},e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Oa(e.emptyOption,!0))},e.unselectEmptyOption=function(){e.hasEmptyOption&&Oa(e.emptyOption,!1)},b.$on("$destroy",function(){e.renderUnknownOption=E}),e.readValue=function(){var b=(b=a.val())in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null},e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Oa(x(c),!1),e.hasOption(b)?(e.removeUnknownOption(),c=La(b),a.val(c in e.selectValueMap?c:b),Oa(x(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)},e.addOption=function(a,c){8!==c[0].nodeType&&(Ja(a,'"option value"'),""===a&&(e.hasEmptyOption=!0,e.emptyOption=c),c=f.get(a)||0,f.set(a,c+1),d())},e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))},e.hasOption=function(a){return!!f.get(a)},e.$hasEmptyOption=function(){return e.hasEmptyOption},e.$isUnknownOptionSelected=function(){return a[0].options[0]===e.unknownOption[0]},e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};var g=!(e.selectUnknownOrEmptyOption=function(a){null==a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)}),k=!1;e.registerOption=function(a,b,f,g,k){var q,r;f.$attr.ngValue?f.$observe("value",function(a){var d,f=b.prop("selected");w(r)&&(e.removeOption(q),delete e.selectValueMap[r],d=!0),r=La(a),q=a,e.selectValueMap[r]=a,e.addOption(a,b),b.attr("value",r),d&&f&&c()}):g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");w(q)&&(e.removeOption(q),d=!0),q=a,e.addOption(a,b),d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d),e.addOption(a,b),d&&g&&c()}):e.addOption(f.value,b),f.$observe("disabled",function(a){("true"===a||a&&b.prop("selected"))&&(e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render()))}),b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b),d(),(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Ve=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;return w(d.ngValue)||(w(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text())),function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],bd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){var f;e&&(f=c.hasOwnProperty("required")||a(c.ngRequired)(b),c.ngRequired||(c.required=!0),e.$validators.required=function(a,b){return!f||!e.$isEmpty(b)},c.$observe("required",function(a){f!==a&&(f=a,e.$validate())}))}}}],ad=["$parse",function(a){return{restrict:"A",require:"?ngModel",compile:function(b,d){var c,e;return d.ngPattern&&(c=d.ngPattern,e="/"===d.ngPattern.charAt(0)&&ke.test(d.ngPattern)?function(){return d.ngPattern}:a(d.ngPattern)),function(a,b,d,h){var l,m;h&&(l=d.pattern,d.ngPattern?l=e(a):c=d.pattern,m=je(l,c,b),d.$observe("pattern",function(a){var d=m;m=je(a,c,b),(d&&d.toString())!==(m&&m.toString())&&h.$validate()}),h.$validators.pattern=function(a,b){return h.$isEmpty(b)||A(m)||m.test(b)})}}}}],dd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){var f,g;e&&(f=c.maxlength||a(c.ngMaxlength)(b),g=Ub(f),c.$observe("maxlength",function(a){f!==a&&(g=Ub(a),f=a,e.$validate())}),e.$validators.maxlength=function(a,b){return g<0||e.$isEmpty(b)||b.length<=g})}}}],cd=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){var f,g;e&&(f=c.minlength||a(c.ngMinlength)(b),g=Ub(f)||-1,c.$observe("minlength",function(a){f!==a&&(g=Ub(a)||-1,f=a,e.$validate())}),e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g})}}}];z.angular.bootstrap?z.console&&console.log("WARNING: Tried to load AngularJS more than once."):(function(){var a,b;Yc||(b=rb(),(sb=A(b)?z.jQuery:b?z[b]:void 0)&&sb.fn.on?S((x=sb).fn,{scope:Wa.scope,isolateScope:Wa.isolateScope,controller:Wa.controller,injector:Wa.injector,inheritedData:Wa.inheritedData}):x=U,a=x.cleanData,x.cleanData=function(b){for(var c,f,e=0;null!=(f=b[e]);e++)(c=(x._data(f)||{}).events)&&c.$destroy&&x(f).triggerHandler("$destroy");a(b)},ca.element=x,Yc=!0)}(),S(ca,{errorHandlingConfig:ve,bootstrap:Wc,copy:Ia,extend:S,merge:xe,equals:va,element:x,forEach:r,injector:fb,noop:E,bind:Va,toJson:eb,fromJson:Tc,identity:Ta,isUndefined:A,isDefined:w,isString:C,isFunction:B,isObject:D,isNumber:X,isElement:ac,isArray:H,version:Pe,isDate:ha,callbacks:{$$counter:0},getTestability:He,reloadWithDebugInfo:Ge,UNSAFE_restoreLegacyJqLiteXHTMLReplacement:Ke,$$minErr:F,$$csp:Ba,$$encodeUriSegment:ic,$$encodeUriQuery:ba,$$lowercase:K,$$stringify:jc,$$uppercase:vb}),(lc=function(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=F("$injector"),c=F("ng");return(a=b(a,"angular",Object)).$$minErr=a.$$minErr||F,b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");return g&&a.hasOwnProperty(f)&&(a[f]=null),b(a,f,function(){function a(b,c,d,f){return f=f||e,function(){return f[d||"push"]([b,c,arguments]),t}}function b(a,c,d){return d=d||e,function(b,e){return e&&B(e)&&(e.$$moduleName=f),d.push([a,c,arguments]),t}}if(!g)throw d("nomod",f);var e=[],n=[],s=[],G=a("$injector","invoke","push",n),t={_invokeQueue:e,_configBlocks:n,_runBlocks:s,info:function(a){if(w(a)){if(!D(a))throw c("aobj","value");return h=a,this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:G,run:function(a){return s.push(a),this}};return k&&G(k),t})}})}(z))("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Qe}),a.provider("$compile",Zc).directive({a:Re,input:$c,textarea:$c,form:Se,script:Te,select:Ue,option:Ve,ngBind:We,ngBindHtml:Xe,ngBindTemplate:Ye,ngClass:Ze,ngClassEven:$e,ngClassOdd:af,ngCloak:bf,ngController:cf,ngForm:df,ngHide:ef,ngIf:ff,ngInclude:gf,ngInit:hf,ngNonBindable:jf,ngPluralize:kf,ngRef:lf,ngRepeat:mf,ngShow:nf,ngStyle:of,ngSwitch:pf,ngSwitchWhen:qf,ngSwitchDefault:rf,ngOptions:sf,ngTransclude:tf,ngModel:uf,ngList:vf,ngChange:wf,pattern:ad,ngPattern:ad,required:bd,ngRequired:bd,minlength:cd,ngMinlength:cd,maxlength:dd,ngMaxlength:dd,ngValue:xf,ngModelOptions:yf}).directive({ngInclude:zf,input:Af}).directive(wb).directive(ed),a.provider({$anchorScroll:Bf,$animate:Cf,$animateCss:Df,$$animateJs:Ef,$$animateQueue:Ff,$$AnimateRunner:Gf,$$animateAsyncRun:Hf,$browser:If,$cacheFactory:Jf,$controller:Kf,$document:Lf,$$isDocumentHidden:Mf,$exceptionHandler:Nf,$filter:fd,$$forceReflow:Of,$interpolate:Pf,$interval:Qf,$$intervalFactory:Rf,$http:Sf,$httpParamSerializer:Tf,$httpParamSerializerJQLike:Uf,$httpBackend:Vf,$xhrFactory:Wf,$jsonpCallbacks:Xf,$location:Yf,$log:Zf,$parse:$f,$rootScope:ag,$q:bg,$$q:cg,$sce:dg,$sceDelegate:eg,$sniffer:fg,$$taskTrackerFactory:gg,$templateCache:hg,$templateRequest:ig,$$testability:jg,$timeout:kg,$window:lg,$$rAF:mg,$$jqLite:ng,$$Map:og,$$cookieReader:pg})}]).info({angularVersion:"1.8.2"}),ca.module("ngLocale",[],["$provide",function(a){a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,f){var e=0|a,f=f;return void 0===f&&(f=Math.min(function(a){var b=(a+="").indexOf(".");return-1==b?0:a.length-b-1}(a),3)),Math.pow(10,f),1==e&&0==f?"one":"other"}})}]),x(function(){Ee(z.document,Wc)}))}(window),window.angular.$$csp().noInlineStyle||window.angular.element(document.head).prepend(window.angular.element("<style>").text('@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}')),function(angular){"use strict";function routeToRegExp(pattern,opts){var keys=[],pattern=pattern.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(_,slash,key,star){var optional="?"===star||"*?"===star,star="*"===star||"*?"===star;return keys.push({name:key,optional:optional}),slash=slash||"",(optional?"(?:"+slash:slash+"(?:")+(star?"(.+?)":"([^/]+)")+(optional?"?)?":")")}).replace(/([/$*])/g,"\\$1");return opts.ignoreTrailingSlashes&&(pattern=pattern.replace(/\/+$/,"")+"/*"),{keys:keys,regexp:new RegExp("^"+pattern+"(?:[?#]|$)",opts.caseInsensitiveMatch?"i":"")}}var isArray,isObject,isDefined,noop,isEagerInstantiationEnabled,ngRouteModule=angular.module("ngRoute",[]).info({angularVersion:"1.7.5"}).provider("$route",function(){function inherit(parent,extra){return angular.extend(Object.create(parent),extra)}isArray=angular.isArray,isObject=angular.isObject,isDefined=angular.isDefined,noop=angular.noop;var routes={};this.when=function(path,redirectPath){var routeCopy=function(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;i<ii;i++)dst[i]=src[i]}else if(isObject(src))for(var key in dst=dst||{},src)"$"===key.charAt(0)&&"$"===key.charAt(1)||(dst[key]=src[key]);return dst||src}(redirectPath);return angular.isUndefined(routeCopy.reloadOnUrl)&&(routeCopy.reloadOnUrl=!0),angular.isUndefined(routeCopy.reloadOnSearch)&&(routeCopy.reloadOnSearch=!0),angular.isUndefined(routeCopy.caseInsensitiveMatch)&&(routeCopy.caseInsensitiveMatch=this.caseInsensitiveMatch),routes[path]=angular.extend(routeCopy,{originalPath:path},path&&routeToRegExp(path,routeCopy)),path&&(redirectPath="/"===path[path.length-1]?path.substr(0,path.length-1):path+"/",routes[redirectPath]=angular.extend({originalPath:path,redirectTo:path},routeToRegExp(redirectPath,routeCopy))),this},this.caseInsensitiveMatch=!1,this.otherwise=function(params){return"string"==typeof params&&(params={redirectTo:params}),this.when(null,params),this},isEagerInstantiationEnabled=!0,this.eagerInstantiationEnabled=function(enabled){return isDefined(enabled)?(isEagerInstantiationEnabled=enabled,this):isEagerInstantiationEnabled},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","$browser",function($rootScope,$location,$routeParams,$q,$injector,$templateRequest,$sce,$browser){var preparedRoute,preparedRouteIsUpdateOnly,forceReload=!1,$route={routes:routes,reload:function(){var fakeLocationEvent={defaultPrevented:!(forceReload=!0),preventDefault:function(){this.defaultPrevented=!0,forceReload=!1}};$rootScope.$evalAsync(function(){prepareRoute(fakeLocationEvent),fakeLocationEvent.defaultPrevented||commitRoute()})},updateParams:function(newParams){if(!this.current||!this.current.$$route)throw $routeMinErr("norout","Tried updating route with no current route");newParams=angular.extend({},this.current.params,newParams),$location.path(interpolate(this.current.$$route.originalPath,newParams)),$location.search(newParams)}};return $rootScope.$on("$locationChangeStart",prepareRoute),$rootScope.$on("$locationChangeSuccess",commitRoute),$route;function prepareRoute($locationEvent){var params,match,newRoute,oldRoute,lastRoute=$route.current;angular.forEach(routes,function(route,path){!match&&(params=function(on,route){var keys=route.keys,params={};if(!route.regexp)return null;var m=route.regexp.exec(on);if(!m)return null;for(var i=1,len=m.length;i<len;++i){var key=keys[i-1],val=m[i];key&&val&&(params[key.name]=val)}return params}($location.path(),route))&&((match=inherit(route,{params:angular.extend({},$location.search(),params),pathParams:params})).$$route=route)}),preparedRoute=match||routes.null&&inherit(routes.null,{params:{},pathParams:{}}),newRoute=preparedRoute,oldRoute=lastRoute,(preparedRouteIsUpdateOnly=!forceReload&&newRoute&&oldRoute&&newRoute.$$route===oldRoute.$$route&&(!newRoute.reloadOnUrl||!newRoute.reloadOnSearch&&angular.equals(newRoute.pathParams,oldRoute.pathParams)))||!lastRoute&&!preparedRoute||$rootScope.$broadcast("$routeChangeStart",preparedRoute,lastRoute).defaultPrevented&&$locationEvent&&$locationEvent.preventDefault()}function commitRoute(){var nextRoutePromise,lastRoute=$route.current,nextRoute=preparedRoute;preparedRouteIsUpdateOnly?(lastRoute.params=nextRoute.params,angular.copy(lastRoute.params,$routeParams),$rootScope.$broadcast("$routeUpdate",lastRoute)):(nextRoute||lastRoute)&&(forceReload=!1,$route.current=nextRoute,nextRoutePromise=$q.resolve(nextRoute),$browser.$$incOutstandingRequestCount("$route"),nextRoutePromise.then(getRedirectionData).then(handlePossibleRedirection).then(function(keepProcessingRoute){return keepProcessingRoute&&nextRoutePromise.then(resolveLocals).then(function(locals){nextRoute===$route.current&&(nextRoute&&(nextRoute.locals=locals,angular.copy(nextRoute.params,$routeParams)),$rootScope.$broadcast("$routeChangeSuccess",nextRoute,lastRoute))})}).catch(function(error){nextRoute===$route.current&&$rootScope.$broadcast("$routeChangeError",nextRoute,lastRoute,error)}).finally(function(){$browser.$$completeOutstandingRequest(noop,"$route")}))}function getRedirectionData(route){var oldPath,newUrl,data={route:route,hasRedirection:!1};if(route)if(route.redirectTo)angular.isString(route.redirectTo)?(data.path=interpolate(route.redirectTo,route.params),data.search=route.params,data.hasRedirection=!0):(oldPath=$location.path(),newUrl=$location.search(),newUrl=route.redirectTo(route.pathParams,oldPath,newUrl),angular.isDefined(newUrl)&&(data.url=newUrl,data.hasRedirection=!0));else if(route.resolveRedirectTo)return $q.resolve($injector.invoke(route.resolveRedirectTo)).then(function(newUrl){return angular.isDefined(newUrl)&&(data.url=newUrl,data.hasRedirection=!0),data});return data}function handlePossibleRedirection(data){var oldUrl,newUrl,keepProcessingRoute=!0;return data.route!==$route.current?keepProcessingRoute=!1:data.hasRedirection&&(oldUrl=$location.url(),(newUrl=data.url)?$location.url(newUrl).replace():newUrl=$location.path(data.path).search(data.search).replace().url(),newUrl!==oldUrl&&(keepProcessingRoute=!1)),keepProcessingRoute}function resolveLocals(template){if(template){var locals=angular.extend({},template.resolve);angular.forEach(locals,function(value,key){locals[key]=angular.isString(value)?$injector.get(value):$injector.invoke(value,null,null,key)});template=function(route){var template,templateUrl;angular.isDefined(template=route.template)?angular.isFunction(template)&&(template=template(route.params)):angular.isDefined(templateUrl=route.templateUrl)&&(angular.isFunction(templateUrl)&&(templateUrl=templateUrl(route.params)),angular.isDefined(templateUrl)&&(route.loadedTemplateUrl=$sce.valueOf(templateUrl),template=$templateRequest(templateUrl)));return template}(template);return angular.isDefined(template)&&(locals.$template=template),$q.all(locals)}}function interpolate(string,params){var result=[];return angular.forEach((string||"").split(":"),function(key,segmentMatch){0===segmentMatch?result.push(key):(key=(segmentMatch=key.match(/(\w+)(?:[?*])?(.*)/))[1],result.push(params[key]),result.push(segmentMatch[2]||""),delete params[key])}),result.join("")}}]}).run(instantiateRoute),$routeMinErr=angular.$$minErr("ngRoute");function instantiateRoute($injector){isEagerInstantiationEnabled&&$injector.get("$route")}function ngViewFactory($route,$anchorScroll,$animate){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(scope,$element,attr,ctrl,$transclude){var currentScope,currentElement,previousLeaveAnimation,autoScrollExp=attr.autoscroll,onloadExp=attr.onload||"";function cleanupLastView(){previousLeaveAnimation&&($animate.cancel(previousLeaveAnimation),previousLeaveAnimation=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&((previousLeaveAnimation=$animate.leave(currentElement)).done(function(response){!1!==response&&(previousLeaveAnimation=null)}),currentElement=null)}function update(){var newScope,current=$route.current&&$route.current.locals,clone=current&¤t.$template;angular.isDefined(clone)?(newScope=scope.$new(),current=$route.current,clone=$transclude(newScope,function(clone){$animate.enter(clone,null,currentElement||$element).done(function(response){!1===response||!angular.isDefined(autoScrollExp)||autoScrollExp&&!scope.$eval(autoScrollExp)||$anchorScroll()}),cleanupLastView()}),currentElement=clone,(currentScope=current.scope=newScope).$emit("$viewContentLoaded"),currentScope.$eval(onloadExp)):cleanupLastView()}scope.$on("$routeChangeSuccess",update),update()}}}function ngViewFillContentFactory($compile,$controller,$route){return{restrict:"ECA",priority:-400,link:function(scope,$element){var current=$route.current,locals=current.locals;$element.html(locals.$template);var controller,link=$compile($element.contents());current.controller&&(locals.$scope=scope,controller=$controller(current.controller,locals),current.controllerAs&&(scope[current.controllerAs]=controller),$element.data("$ngControllerController",controller),$element.children().data("$ngControllerController",controller)),scope[current.resolveAs||"$resolve"]=locals,link(scope)}}}instantiateRoute.$inject=["$injector"],ngRouteModule.provider("$routeParams",function(){this.$get=function(){return{}}}),ngRouteModule.directive("ngView",ngViewFactory),ngRouteModule.directive("ngView",ngViewFillContentFactory),ngViewFactory.$inject=["$route","$anchorScroll","$animate"],ngViewFillContentFactory.$inject=["$compile","$controller","$route"]}((window,window.angular)),function(window,angular){"use strict";var bind,extend,forEach,isArray,isDefined,lowercase,noop,nodeContains,htmlParser,htmlSanitizeWriter,$sanitizeMinErr=angular.$$minErr("$sanitize");angular.module("ngSanitize",[]).provider("$sanitize",function(){var hasBeenInstantiated=!1,svgEnabled=!1;this.$get=["$$sanitizeUri",function($$sanitizeUri){return hasBeenInstantiated=!0,svgEnabled&&extend(validElements,svgElements),function(html){var buf=[];return htmlParser(html,htmlSanitizeWriter(buf,function(uri,isImage){return!/^unsafe:/.test($$sanitizeUri(uri,isImage))})),buf.join("")}}],this.enableSvg=function(enableSvg){return isDefined(enableSvg)?(svgEnabled=enableSvg,this):svgEnabled},this.addValidElements=function(elements){return hasBeenInstantiated||(isArray(elements)&&(elements={htmlElements:elements}),addElementsTo(svgElements,elements.svgElements),addElementsTo(voidElements,elements.htmlVoidElements),addElementsTo(validElements,elements.htmlVoidElements),addElementsTo(validElements,elements.htmlElements)),this},this.addValidAttrs=function(attrs){return hasBeenInstantiated||extend(validAttrs,arrayToMap(attrs,!0)),this},bind=angular.bind,extend=angular.extend,forEach=angular.forEach,isArray=angular.isArray,isDefined=angular.isDefined,lowercase=angular.$$lowercase,noop=angular.noop,htmlParser=function(html,handler){null==html?html="":"string"!=typeof html&&(html=""+html);var inertBodyElement=getInertBodyElement(html);if(!inertBodyElement)return"";var mXSSAttempts=5;do{if(0===mXSSAttempts)throw $sanitizeMinErr("uinput","Failed to sanitize html because the input is unstable")}while(mXSSAttempts--,html=inertBodyElement.innerHTML,inertBodyElement=getInertBodyElement(html),html!==inertBodyElement.innerHTML);var nextNode,node=inertBodyElement.firstChild;for(;node;){switch(node.nodeType){case 1:handler.start(node.nodeName.toLowerCase(),function(attrs){for(var map={},i=0,ii=attrs.length;i<ii;i++){var attr=attrs[i];map[attr.name]=attr.value}return map}(node.attributes));break;case 3:handler.chars(node.textContent)}if(!((nextNode=node.firstChild)||(1===node.nodeType&&handler.end(node.nodeName.toLowerCase()),nextNode=getNonDescendant("nextSibling",node))))for(;null==nextNode&&(node=getNonDescendant("parentNode",node))!==inertBodyElement;)nextNode=getNonDescendant("nextSibling",node),1===node.nodeType&&handler.end(node.nodeName.toLowerCase());node=nextNode}for(;node=inertBodyElement.firstChild;)inertBodyElement.removeChild(node)},htmlSanitizeWriter=function(buf,uriValidator){var ignoreCurrentElement=!1,out=bind(buf,buf.push);return{start:function(tag,attrs){tag=lowercase(tag),!ignoreCurrentElement&&blockedElements[tag]&&(ignoreCurrentElement=tag),ignoreCurrentElement||!0!==validElements[tag]||(out("<"),out(tag),forEach(attrs,function(value,key){var lkey=lowercase(key),isImage="img"===tag&&"src"===lkey||"background"===lkey;!0!==validAttrs[lkey]||!0===uriAttrs[lkey]&&!uriValidator(value,isImage)||(out(" "),out(key),out('="'),out(encodeEntities(value)),out('"'))}),out(">"))},end:function(tag){tag=lowercase(tag),ignoreCurrentElement||!0!==validElements[tag]||!0===voidElements[tag]||(out("</"),out(tag),out(">")),tag==ignoreCurrentElement&&(ignoreCurrentElement=!1)},chars:function(chars){ignoreCurrentElement||out(encodeEntities(chars))}}},nodeContains=window.Node.prototype.contains||function(arg){return!!(16&this.compareDocumentPosition(arg))};var SURROGATE_PAIR_REGEXP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,NON_ALPHANUMERIC_REGEXP=/([^#-~ |!])/g,voidElements=stringToMap("area,br,col,hr,img,wbr"),blockElements=stringToMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),htmlAttrs=stringToMap("rp,rt"),svgAttrs=extend({},htmlAttrs,blockElements),blockElements=extend({},blockElements,stringToMap("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),htmlAttrs=extend({},htmlAttrs,stringToMap("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),svgElements=stringToMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),blockedElements=stringToMap("script,style"),validElements=extend({},voidElements,blockElements,htmlAttrs,svgAttrs),uriAttrs=stringToMap("background,cite,href,longdesc,src,xlink:href,xml:base"),htmlAttrs=stringToMap("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),svgAttrs=stringToMap("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),validAttrs=extend({},uriAttrs,svgAttrs,htmlAttrs);function stringToMap(str,lowercaseKeys){return arrayToMap(str.split(","),lowercaseKeys)}function arrayToMap(items,lowercaseKeys){for(var obj={},i=0;i<items.length;i++)obj[lowercaseKeys?lowercase(items[i]):items[i]]=!0;return obj}function addElementsTo(elementsMap,newElements){newElements&&newElements.length&&extend(elementsMap,arrayToMap(newElements))}var getInertBodyElement=function(window,document){var inertDocument;if(!document||!document.implementation)throw $sanitizeMinErr("noinert","Can't create an inert html document");var inertBodyElement=((inertDocument=document.implementation.createHTMLDocument("inert")).documentElement||inertDocument.getDocumentElement()).querySelector("body");return inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',inertBodyElement.querySelector("svg")?(inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',inertBodyElement.querySelector("svg img")?function(html){html="<remove></remove>"+html;try{var body=(new window.DOMParser).parseFromString(html,"text/html").body;return body.firstChild.remove(),body}catch(e){return}}:function(html){inertBodyElement.innerHTML=html,document.documentMode&&stripCustomNsAttrs(inertBodyElement);return inertBodyElement}):function(html){html="<remove></remove>"+html;try{html=encodeURI(html)}catch(e){return}var body=new window.XMLHttpRequest;body.responseType="document",body.open("GET","data:text/html;charset=utf-8,"+html,!1),body.send(null);body=body.response.body;return body.firstChild.remove(),body}}(window,window.document);function encodeEntities(value){return value.replace(/&/g,"&").replace(SURROGATE_PAIR_REGEXP,function(value){return"&#"+(1024*(value.charCodeAt(0)-55296)+(value.charCodeAt(1)-56320)+65536)+";"}).replace(NON_ALPHANUMERIC_REGEXP,function(value){return"&#"+value.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function stripCustomNsAttrs(node){for(;node;){if(node.nodeType===window.Node.ELEMENT_NODE)for(var attrs=node.attributes,i=0,l=attrs.length;i<l;i++){var attrNode=attrs[i],attrName=attrNode.name.toLowerCase();"xmlns:ns1"!==attrName&&0!==attrName.lastIndexOf("ns1:",0)||(node.removeAttributeNode(attrNode),i--,l--)}var nextNode=node.firstChild;nextNode&&stripCustomNsAttrs(nextNode),node=getNonDescendant("nextSibling",node)}}function getNonDescendant(nextNode,node){nextNode=node[nextNode];if(nextNode&&nodeContains.call(node,nextNode))throw $sanitizeMinErr("elclob","Failed to sanitize html because the element is clobbered: {0}",node.outerHTML||node.outerText);return nextNode}}).info({angularVersion:"1.7.5"}),angular.module("ngSanitize").filter("linky",["$sanitize",function($sanitize){var LINKY_URL_REGEXP=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,MAILTO_REGEXP=/^mailto:/i,linkyMinErr=angular.$$minErr("linky"),isDefined=angular.isDefined,isFunction=angular.isFunction,isObject=angular.isObject,isString=angular.isString;return function(text,target,attributes){if(null==text||""===text)return text;if(!isString(text))throw linkyMinErr("notstring","Expected string but received: {0}",text);for(var match,url,i,attributesFn=isFunction(attributes)?attributes:isObject(attributes)?function(){return attributes}:function(){return{}},raw=text,html=[];match=raw.match(LINKY_URL_REGEXP);)url=match[0],match[2]||match[4]||(url=(match[3]?"http://":"mailto:")+url),i=match.index,addText(raw.substr(0,i)),function(url,text){var key,linkAttributes=attributesFn(url);for(key in html.push("<a "),linkAttributes)html.push(key+'="'+linkAttributes[key]+'" ');!isDefined(target)||"target"in linkAttributes||html.push('target="',target,'" '),html.push('href="',url.replace(/"/g,"""),'">'),addText(text),html.push("</a>")}(url,match[0].replace(MAILTO_REGEXP,"")),raw=raw.substring(i+match[0].length);return addText(raw),$sanitize(html.join(""));function addText(buf){var chars;buf&&html.push((chars=buf,htmlSanitizeWriter(buf=[],noop).chars(chars),buf.join("")))}}}])}(window,window.angular),function(angular){"use strict";var ngTouch=angular.module("ngTouch",[]);function makeSwipeDirective(directiveName,direction,eventName){ngTouch.directive(directiveName,["$parse","$swipe",function($parse,$swipe){return function(scope,element,attr){var startCoords,valid,swipeHandler=$parse(attr[directiveName]);var pointerTypes=["touch"];angular.isDefined(attr.ngSwipeDisableMouse)||pointerTypes.push("mouse"),$swipe.bind(element,{start:function(coords,event){startCoords=coords,valid=!0},cancel:function(event){valid=!1},end:function(coords,event){!function(deltaX){if(startCoords){var deltaY=Math.abs(deltaX.y-startCoords.y),deltaX=(deltaX.x-startCoords.x)*direction;return valid&&deltaY<75&&0<deltaX&&30<deltaX&&deltaY/deltaX<.3}}(coords)||scope.$apply(function(){element.triggerHandler(eventName),swipeHandler(scope,{$event:event})})}},pointerTypes)}}])}ngTouch.info({angularVersion:"1.8.2"}),ngTouch.factory("$swipe",[function(){var POINTER_EVENTS={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup",cancel:"pointercancel"}};function getCoordinates(e){var originalEvent=e.originalEvent||e,e=originalEvent.touches&&originalEvent.touches.length?originalEvent.touches:[originalEvent],e=originalEvent.changedTouches&&originalEvent.changedTouches[0]||e[0];return{x:e.clientX,y:e.clientY}}function getEvents(pointerTypes,eventType){var res=[];return angular.forEach(pointerTypes,function(eventName){eventName=POINTER_EVENTS[eventName][eventType];eventName&&res.push(eventName)}),res.join(" ")}return{bind:function(element,eventHandlers,pointerTypes){var totalX,totalY,startCoords,lastPos,active=!1;pointerTypes=pointerTypes||["mouse","touch","pointer"],element.on(getEvents(pointerTypes,"start"),function(event){startCoords=getCoordinates(event),active=!0,totalY=totalX=0,lastPos=startCoords,eventHandlers.start&&eventHandlers.start(startCoords,event)});var events=getEvents(pointerTypes,"cancel");events&&element.on(events,function(event){active=!1,eventHandlers.cancel&&eventHandlers.cancel(event)}),element.on(getEvents(pointerTypes,"move"),function(event){var coords;active&&startCoords&&(coords=getCoordinates(event),totalX+=Math.abs(coords.x-lastPos.x),totalY+=Math.abs(coords.y-lastPos.y),lastPos=coords,totalX<10&&totalY<10||(totalX<totalY?(active=!1,eventHandlers.cancel&&eventHandlers.cancel(event)):(event.preventDefault(),eventHandlers.move&&eventHandlers.move(coords,event))))}),element.on(getEvents(pointerTypes,"end"),function(event){active&&(active=!1,eventHandlers.end&&eventHandlers.end(getCoordinates(event),event))})}}}]),makeSwipeDirective("ngSwipeLeft",-1,"swipeleft"),makeSwipeDirective("ngSwipeRight",1,"swiperight")}((window,window.angular)),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],e):e((t=t||self)["@uirouter/angularjs"]={},t.angular)}(this,function(t,fn){"use strict";var ln=angular,n=fn&&fn.module?fn:ln;function o(t){return function e(){if(arguments.length>=t.length)return t.apply(this,arguments);var r=Array.prototype.slice.call(arguments);return e.bind.apply(e,function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)n[i]=o[a];return n}([this],r))}}function a(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a.apply(null,[].slice.call(arguments).reverse())}var s=function(t){return function(e){return e&&e[t]}},c=o(function(t,e,r){return r&&r[t]===e}),f=function(t){return u.apply(null,t.split(".").map(s))},l=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return!t.apply(null,e)}};function h(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)&&e.apply(null,r)}}function p(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)||e.apply(null,r)}}function g(t){return function(e){return t===e}}var v=function(t){return function(e){return e.reduce(function(e,r){return e&&!!t(r)},!0)}},d=function(t){return function(e){return e.reduce(function(e,r){return e||!!t(r)},!1)}},m=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},y=function(t){return function(){return t}};function w(t,e){return function(r){return r[t].apply(r,e)}}function _(t){return function(e){for(var r=0;r<t.length;r++)if(t[r][0](e))return t[r][1](e)}}function E(t){return null===t}var S=Object.prototype.toString,pn=function(t){return function(e){return typeof e===t}},b=pn("undefined"),R=l(b),C=p(E,b),P=pn("function"),T=pn("number"),k=pn("string"),O=function(t){return null!==t&&"object"==typeof t},x=Array.isArray,j=function(t){return"[object Date]"===S.call(t)},V=function(t){return"[object RegExp]"===S.call(t)};function I(t){if(x(t)&&t.length){var e=t.slice(0,-1),r=t.slice(-1);return!(e.filter(l(k)).length||r.filter(l(P)).length)}return P(t)}function A(t,e){return e.reduce(function(e,r){return e[r]=(n=t+"."+r+"()",function(){throw new Error("No implementation for "+n+". The framework specific code did not implement this method.")}),e;var n},{})}var H=h(O,u(s("then"),P)),D={$q:void 0,$injector:void 0},q=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)n[i]=o[a];return n},N="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||void 0,vn=N.angular||{},F=vn.fromJson||JSON.parse.bind(JSON),L=vn.toJson||JSON.stringify.bind(JSON),M=vn.forEach||function(t,e,r){if(x(t))return t.forEach(e,r);Object.keys(t).forEach(function(r){return e(t[r],r)})},B=Object.assign||Ot,G=vn.equals||function xt(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!=t&&e!=e)return!0;var n=typeof t;if(n!=typeof e||"object"!=n)return!1;var i,o=[t,e];if(v(x)(o))return i=e,(n=t).length===i.length&&Ct(n,i).reduce(function(t,e){return t&&xt(e[0],e[1])},!0);if(v(j)(o))return t.getTime()===e.getTime();if(v(V)(o))return t.toString()===e.toString();if(v(P)(o))return!0;if([P,x,j,V].map(d).reduce(function(t,e){return t||!!e(o)},!1))return!1;var a={};for(var u in t){if(!xt(t[u],e[u]))return!1;a[u]=!0}for(var u in e)if(!a[u])return!1;return!0};function z(t){return t}function W(){}function J(t,e,r,n,i){void 0===i&&(i=!1);function o(e){return t()[e].bind(r())}return(n=n||Object.keys(t())).reduce(function(t,r){var n;return t[r]=i?(n=r,function(){return e[n]=o(n),e[n].apply(null,arguments)}):o(r),t},e)}var Q=function(t,e){return B(Object.create(t),e)},K=o(Y);function Y(t,e){return-1!==t.indexOf(e)}var Z=o(X);function X(t,r){r=t.indexOf(r);return 0<=r&&t.splice(r,1),t}var tt=o(et);function et(t,e){return t.push(e),e}function rt(t){return t.slice().forEach(function(e){"function"==typeof e&&e(),Z(t,e)})}function nt(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=B.apply(void 0,q([{}],e.reverse()));return B(n,at(t||{},Object.keys(n)))}function it(t,e){return B(t,e)}function ot(t,e){var n,r=[];for(n in t.path){if(t.path[n]!==e.path[n])break;r.push(t.path[n])}return r}function at(t,e){var n,r={};for(n in t)-1!==e.indexOf(n)&&(r[n]=t[n]);return r}function ut(t,e){return Object.keys(t).filter(l(K(e))).reduce(function(e,r){return e[r]=t[r],e},{})}function st(t,e){return ht(t,s(e))}function ct(t,e){var r=x(t),n=r?[]:{},i=r?function(t){return n.push(t)}:function(t,e){return n[e]=t};return M(t,function(t,r){e(t,r)&&i(t,r)}),n}function ft(t,e){var r;return M(t,function(t,n){r||e(t,n)&&(r=t)}),r}var lt=ht;function ht(t,e,r){return r=r||(x(t)?[]:{}),M(t,function(t,n){return r[n]=e(t,n)}),r}function pt(t){return Object.keys(t).map(function(e){return t[e]})}function vt(t,e){return t&&e}function dt(t,e){return t||e}var mt=function(t,e){return t.concat(e)},gt=function(t,e){return x(e)?t.concat(e.reduce(gt,[])):yt(t,e)};function yt(t,e){return t.push(e),t}function wt(t,e){return K(t,e)?t:yt(t,e)}function _t(t){return t.reduce(mt,[])}function St(t){return t.reduce(gt,[])}var $t=Rt,bt=Rt;function Rt(t,e){return void 0===e&&(e="assert failure"),function(r){var n=t(r);if(!n)throw new Error(P(e)?e(r):e);return n}}function Et(t){return Object.keys(t).map(function(e){return[e,t[e]]})}function Ct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return[];for(var r=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991),n=[],o=0;o<r;o++)!function(e){switch(t.length){case 1:n.push([t[0][e]]);break;case 2:n.push([t[0][e],t[1][e]]);break;case 3:n.push([t[0][e],t[1][e],t[2][e]]);break;case 4:n.push([t[0][e],t[1][e],t[2][e],t[3][e]]);break;default:n.push(t.map(function(t){return t[e]}))}}(o);return n}function Pt(t,e){var r,n;if(x(e)&&(r=e[0],n=e[1]),!k(r))throw new Error("invalid parameters to applyPairs");return t[r]=n,t}function Tt(t){return t.length&&t[t.length-1]||void 0}function kt(t,e){return e&&Object.keys(e).forEach(function(t){return delete e[t]}),B(e=e||{},t)}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var n=Object.keys(r),i=0;i<n.length;i++)t[n[i]]=r[n[i]]}return t}function Vt(t){return t.catch(function(t){return 0})&&t}function It(t){return Vt(D.$q.reject(t))}var Ht=function(){function t(e){this.text=e,this.glob=e.split(".");e=this.text.split(".").map(function(t){return"**"===t?"(?:|(?:\\.[^.]*)*)":"*"===t?"\\.[^.]*":"\\."+t}).join("");this.regexp=new RegExp("^"+e+"$")}return t.is=function(t){return!!/[!,*]+/.exec(t)},t.fromString=function(e){return t.is(e)?new t(e):null},t.prototype.matches=function(t){return this.regexp.test("."+t)},t}(),At=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this._items=t,this._limit=e,this._evictListeners=[],this.onEvict=tt(this._evictListeners)}return t.prototype.enqueue=function(t){var e=this._items;return e.push(t),this._limit&&e.length>this._limit&&this.evict(),t},t.prototype.evict=function(){var t=this._items.shift();return this._evictListeners.forEach(function(e){return e(t)}),t},t.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(e){e=this._items.indexOf(e);return-1<e&&this._items.splice(e,1)[0]},t.prototype.peekTail=function(){return this._items[this._items.length-1]},t.prototype.peekHead=function(){if(this.size())return this._items[0]},t}();(dn=t.RejectType||(t.RejectType={}))[dn.SUPERSEDED=2]="SUPERSEDED",dn[dn.ABORTED=3]="ABORTED",dn[dn.INVALID=4]="INVALID",dn[dn.IGNORED=5]="IGNORED",dn[dn.ERROR=6]="ERROR";var Dt=0,qt=function(){function e(t,e,r){this.$id=Dt++,this.type=t,this.message=e,this.detail=r}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&m(e)(t._transitionRejection)},e.superseded=function(i,n){i=new e(t.RejectType.SUPERSEDED,"The transition has been superseded by a different transition",i);return n&&n.redirected&&(i.redirected=!0),i},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(r){return new e(t.RejectType.INVALID,"This transition is invalid",r)},e.ignored=function(r){return new e(t.RejectType.IGNORED,"The transition was ignored",r)},e.aborted=function(r){return new e(t.RejectType.ABORTED,"The transition has been aborted",r)},e.errored=function(r){return new e(t.RejectType.ERROR,"The transition errored",r)},e.normalize=function(t){return m(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():zt(e);return"Transition Rejection($id: "+this.$id+" type: "+this.type+", message: "+this.message+", detail: "+e+")"},e.prototype.toPromise=function(){return B(It(this),{_transitionRejection:this})},e}();function Nt(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function Ut(t,e){for(;e.length<t;)e+=" ";return e}function Ft(t){return t.replace(/^([A-Z])/,function(t){return t.toLowerCase()}).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function Lt(i){var n=Mt(i),r=n.match(/^(function [^ ]+\([^)]*\))/),n=r?r[1]:n,i=i.name||"";return i&&n.match(/function \(/)?"function "+i+n.substr(9):n}function Mt(e){e=x(e)?e.slice(-1)[0]:e;return e&&e.toString()||"undefined"}var mn=qt.isRejectionPromise,Gt=_([[b,y("undefined")],[E,y("null")],[H,y("[Promise]")],[mn,function(t){return t._transitionRejection.toString()}],[function(t){return O(t)&&!x(t)&&t.constructor!==Object&&P(t.toString)},function(t){return t.toString()}],[I,Lt],[y(!0),z]]);function zt(t){var e=[];function r(t){if(O(t)){if(-1!==e.indexOf(t))return"[circular ref]";e.push(t)}return Gt(t)}return b(t)?r(t):JSON.stringify(t,function(t,e){return r(e)}).replace(/\\"/g,'"')}function Wt(t){return function(e){if(!e)return["",""];var r=e.indexOf(t);return-1===r?[e,""]:[e.substr(0,r),e.substr(r+1)]}}function Qt(t){return t.replace(/\/[^/]*$/,"")}function Xt(t){return t?t.replace(/^#/,""):""}var Jt=new RegExp("^(?:[a-z]+:)?//[^/]+/"),Kt=Wt("#"),Yt=Wt("?"),Zt=Wt("=");function te(t){var e=new RegExp("("+t+")","g");return function(t){return t.split(e).filter(z)}}function ee(t,e){return k(Tt(t))&&k(e)?t.slice(0,-1).concat(Tt(t)+e):yt(t,e)}var gn={log:W,error:W,table:W},ne="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(t){var e=function(e){return Function.prototype.bind.call(e,t)};return{log:e(t.log),error:e(t.log),table:e(t.log)}}(window.console):gn:console.table&&console.error?console:function(t){var e=t.log.bind(t);return{log:e,error:t.error?t.error.bind(t):e,table:t.table?t.table.bind(t):e}}(console);function ie(t){if(!t)return"ui-view (defunct)";var e=t.creationContext?t.creationContext.name||"(root)":"(none)";return"[ui-view#"+t.id+" "+t.$type+":"+t.fqn+" ("+t.name+"@"+e+")]"}function ae(e){return T(e)?t.Category[e]:t.Category[t.Category[e]]}(Ln=t.Category||(t.Category={}))[Ln.RESOLVE=0]="RESOLVE",Ln[Ln.TRANSITION=1]="TRANSITION",Ln[Ln.HOOK=2]="HOOK",Ln[Ln.UIVIEW=3]="UIVIEW",Ln[Ln.VIEWCONFIG=4]="VIEWCONFIG";function ce(t){return"Transition #"+ue(t)+"-"+se(t)}var ue=f("$id"),se=f("router.$id"),fe=function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,r){var n=this;r.length||(r=Object.keys(t.Category).map(function(t){return parseInt(t,10)}).filter(function(t){return!isNaN(t)}).map(function(e){return t.Category[e]})),r.map(ae).forEach(function(t){return n._enabled[t]=e})},e.prototype.enable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._set(!0,t)},e.prototype.disable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._set(!1,t)},e.prototype.enabled=function(t){return!!this._enabled[ae(t)]},e.prototype.traceTransitionStart=function(e){this.enabled(t.Category.TRANSITION)&&ne.log(ce(e)+": Started -> "+zt(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(t.Category.TRANSITION)&&ne.log(ce(e)+": Ignored <> "+zt(e))},e.prototype.traceHookInvocation=function(a,r,o){var i;this.enabled(t.Category.HOOK)&&(i=f("traceData.hookType")(o)||"internal",o=f("traceData.context.state.name")(o)||f("traceData.context")(o)||"unknown",a=Lt(a.registeredHook.callback),ne.log(ce(r)+": Hook -> "+i+" context: "+o+", "+Nt(200,a)))},e.prototype.traceHookResult=function(e,r,n){this.enabled(t.Category.HOOK)&&ne.log(ce(r)+": <- Hook returned: "+Nt(200,zt(e)))},e.prototype.traceResolvePath=function(e,r,n){this.enabled(t.Category.RESOLVE)&&ne.log(ce(n)+": Resolving "+e+" ("+r+")")},e.prototype.traceResolvableResolved=function(e,r){this.enabled(t.Category.RESOLVE)&&ne.log(ce(r)+": <- Resolved "+e+" to: "+Nt(200,zt(e.data)))},e.prototype.traceError=function(e,r){this.enabled(t.Category.TRANSITION)&&ne.log(ce(r)+": <- Rejected "+zt(r)+", reason: "+e)},e.prototype.traceSuccess=function(e,r){this.enabled(t.Category.TRANSITION)&&ne.log(ce(r)+": <- Success "+zt(r)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,r,n){void 0===n&&(n=""),this.enabled(t.Category.UIVIEW)&&ne.log("ui-view: "+Ut(30,e)+" "+ie(r)+n)},e.prototype.traceUIViewConfigUpdated=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+r+"'")},e.prototype.traceUIViewFill=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+Nt(200,r))},e.prototype.traceViewSync=function(n){var r;this.enabled(t.Category.VIEWCONFIG)&&(r="uiview component fqn",n=n.map(function(o){var a=o.uiView,e=o.viewConfig,o=a&&a.fqn,a=e&&e.viewDecl.$context.name+": ("+e.viewDecl.$name+")";return(e={})[r]=o,e["view config state (view name)"]=a,e}).sort(function(t,e){return(t[r]||"").localeCompare(e[r]||"")}),ne.table(n))},e.prototype.traceViewServiceEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&ne.log("VIEWCONFIG: "+e+" "+function(t){var e=t.viewDecl,r=e.$context.name||"(root)";return"[View#"+t.$id+" from '"+r+"' state]: target ui-view: '"+e.$uiViewName+"@"+e.$uiViewContextAnchor+"'"}(r))},e.prototype.traceViewServiceUIViewEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&ne.log("VIEWCONFIG: "+e+" "+ie(r))},e}(),le=new fe,he=function(){function t(t){this.pattern=/.*/,this.inherit=!0,B(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{ParamType:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new pe(this,t)},t}();function pe(t,e){var r=this;function n(t){return x(t)?t:R(t)?[t]:[]}function i(t,r){return function(o){if(x(o)&&0===o.length)return o;o=ht(n(o),t);return!0===r?0===ct(o,function(t){return!t}).length:function(t){switch(t.length){case 0:return;case 1:return"auto"===e?t[0]:t;default:return t}}(o)}}function o(t){return function(e,r){var i=n(e),o=n(r);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(!t(i[a],o[a]))return!1;return!0}}["encode","decode","equals","$normalize"].forEach(function(e){var n=t[e].bind(t),a="equals"===e?o:i;r[e]=a(n)}),B(this,{dynamic:t.dynamic,name:t.name,pattern:t.pattern,inherit:t.inherit,raw:t.raw,is:i(t.is.bind(t),!0),$arrayMode:e})}var de=Object.prototype.hasOwnProperty;(xn=t.DefType||(t.DefType={}))[xn.PATH=0]="PATH",xn[xn.SEARCH=1]="SEARCH",xn[xn.CONFIG=2]="CONFIG";var ye=function(){function e(e,r,n,m,p){var a=function(u,a,n){return a=!1===n.reloadOnSearch&&a===t.DefType.SEARCH||void 0,a=ft([n.dynamic,a],R),a=R(a)?{dynamic:a}:{},u=function(t){function e(){return t.value}t=function(t){return 0===["value","type","squash","array","dynamic"].filter(de.bind(t||{})).length}(t)?{value:t}:t,e.__cacheable=!0;var r=I(t.value)?t.value:e;return B(t,{$$fn:r})}(n&&n.params&&n.params[u]),B(a,u)}(e,n,p);r=function(e,r,a,i,o){if(e.type&&r&&"string"!==r.name)throw new Error("Param '"+i+"' has two type configurations.");if(e.type&&r&&"string"===r.name&&o.type(e.type))return o.type(e.type);if(r)return r;if(e.type)return e.type instanceof he?e.type:o.type(e.type);a=a===t.DefType.CONFIG?"any":a===t.DefType.PATH?"path":a===t.DefType.SEARCH?"query":"string";return o.type(a)}(a,r,n,e,m.paramTypes);var f=(v={array:n===t.DefType.SEARCH&&"auto"},d=e.match(/\[\]$/)?{array:!0}:{},B(v,d,a).array);r=f?r.$asArray(f,n===t.DefType.SEARCH):r;var l=void 0!==a.value||n===t.DefType.SEARCH,h=R(a.dynamic)?!!a.dynamic:!!r.dynamic,p=R(a.raw)?!!a.raw:!!r.raw,v=function(n,e,r){n=n.squash;if(!e||!1===n)return!1;if(!R(n)||null==n)return r;if(!0===n||k(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}(a,l,m.defaultSquashPolicy()),d=function(o,n){var i=[{from:"",to:l||f?void 0:""},{from:null,to:l||f?void 0:""}],o=x(o.replace)?o.replace:[];k(n)&&o.push({from:n,to:void 0});var a=ht(o,s("from"));return ct(i,function(t){return-1===a.indexOf(t.from)}).concat(o)}(a,v),m=R(a.inherit)?!!a.inherit:!!r.inherit;B(this,{id:e,type:r,location:n,isOptional:l,dynamic:h,raw:p,squash:v,replace:d,inherit:m,array:f,config:a})}return e.values=function(t,e){void 0===e&&(e={});for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];r[o.id]=o.value(e[o.id])}return r},e.changed=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),t.filter(function(t){return!t.type.equals(e[t.id],r[t.id])})},e.equals=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),0===e.changed(t,r,n).length},e.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(vt,!0)},e.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},e.prototype.value=function(t){var e=this;return t=function(t){for(var r=0,n=e.replace;r<n.length;r++){var i=n[r];if(i.from===t)return i.to}return t}(t),b(t)?function(){if(e._defaultValueCache)return e._defaultValueCache.defaultValue;if(!D.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=D.$injector.invoke(e.config.$$fn);if(null!=t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of ParamType ("+e.type.name+")");return e.config.$$fn.__cacheable&&(e._defaultValueCache={defaultValue:t}),t}():this.type.$normalize(t)},e.prototype.isSearch=function(){return this.location===t.DefType.SEARCH},e.prototype.validates=function(r){if((b(r)||null===r)&&this.isOptional)return!0;r=this.type.$normalize(r);if(!this.type.is(r))return!1;r=this.type.encode(r);return!(k(r)&&!this.type.pattern.exec(r))},e.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},e}(),we=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=at(t.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=Q(ht(this.defaultTypes,function(t,e){return new he(B({name:e},t))}),{})}return t.prototype.dispose=function(){this.types={}},t.prototype.type=function(t,e,r){if(!R(e))return this.types[t];if(this.types.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return this.types[t]=new he(B({name:t},e)),r&&(this.typeQueue.push({name:t,def:r}),this.enqueue||this._flushTypeQueue()),this},t.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var t=this.typeQueue.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");B(this.types[t.name],D.$injector.invoke(t.def))}},t}(),Mn=function(t){var r=function(t){return null!=t?t.toString():t},r={encode:r,decode:r,is:m(String),pattern:/.*/,equals:function(t,e){return t==e}};return B({},r,t)};B(we.prototype,{string:Mn({}),path:Mn({pattern:/[^/]*/}),query:Mn({}),hash:Mn({inherit:!1}),int:Mn({decode:function(t){return parseInt(t,10)},is:function(t){return!C(t)&&this.decode(t.toString())===t},pattern:/-?\d+/}),bool:Mn({encode:function(t){return t?1:0},decode:function(t){return 0!==parseInt(t,10)},is:m(Boolean),pattern:/0|1/}),date:Mn({encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;e=this.capture.exec(e);return e?new Date(e[1],e[2]-1,e[3]):void 0},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return["getFullYear","getMonth","getDate"].reduce(function(r,n){return r&&t[n]()===e[n]()},!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:Mn({encode:L,decode:F,is:m(Object),equals:G,pattern:/[^/]*/}),any:Mn({encode:z,decode:z,is:function(){return!0},equals:G})});var _e=function(){function t(t){void 0===t&&(t={}),B(this,t)}return t.prototype.$inherit=function(t,e,r){var n,u,i=ot(e,r),o={},a=[];for(u in i)if(i[u]&&i[u].params&&(n=Object.keys(i[u].params)).length)for(var s in n)0<=a.indexOf(n[s])||(a.push(n[s]),o[n[s]]=this[n[s]]);return B({},o,t)},t}(),Se=function(){function t(n){var r;n instanceof t?(r=n,this.state=r.state,this.paramSchema=r.paramSchema.slice(),this.paramValues=B({},r.paramValues),this.resolvables=r.resolvables.slice(),this.views=r.views&&r.views.slice()):(n=n,this.state=n,this.paramSchema=n.parameters({inherit:!1}),this.paramValues={},this.resolvables=n.resolvables.map(function(t){return t.clone()}))}return t.prototype.clone=function(){return new t(this)},t.prototype.applyRawParams=function(t){return this.paramValues=this.paramSchema.reduce(function(e,r){return Pt(e,[r.id,r.value(t[r.id])])},{}),this},t.prototype.parameter=function(t){return ft(this.paramSchema,c("id",t))},t.prototype.equals=function(t,r){r=this.diff(t,r);return r&&0===r.length},t.prototype.diff=function(t,r){if(this.state!==t.state)return!1;r=r?r(this):this.paramSchema;return ye.changed(r,this.paramValues,t.paramValues)},t.clone=function(t){return t.clone()},t}(),$e=function(){function t(t,e,r,n){this._stateRegistry=t,this._identifier=e,this._identifier=e,this._params=B({},r||{}),this._options=B({},n||{}),this._definition=t.matcher.find(e,this._options.relative)}return t.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},t.prototype.identifier=function(){return this._identifier},t.prototype.params=function(){return this._params},t.prototype.$state=function(){return this._definition},t.prototype.state=function(){return this._definition&&this._definition.self},t.prototype.options=function(){return this._options},t.prototype.exists=function(){return!(!this._definition||!this._definition.self)},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var e=this.options().relative;if(this._definition||!e)return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'";e=e.name||e;return"Could not resolve '"+this.name()+"' from state '"+e+"'"},t.prototype.toString=function(){return"'"+this.name()+"'"+zt(this.params())},t.prototype.withState=function(e){return new t(this._stateRegistry,e,this._params,this._options)},t.prototype.withParams=function(n,r){void 0===r&&(r=!1);n=r?n:B({},this._params,n);return new t(this._stateRegistry,this._identifier,n,this._options)},t.prototype.withOptions=function(n,r){void 0===r&&(r=!1);n=r?n:B({},this._options,n);return new t(this._stateRegistry,this._identifier,this._params,n)},t.isDef=function(t){return t&&t.state&&(k(t.state)||O(t.state)&&k(t.state.name))},t}(),be=function(){function t(){}return t.makeTargetState=function(t,e){var r=Tt(e).state;return new $e(t,r,e.map(s("paramValues")).reduce(it,{}),{})},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new Se(t).applyRawParams(e)})},t.buildToPath=function(e,r){var n=t.buildPath(r);return r.options().inherit?t.inheritParams(e,n,Object.keys(r.params())):n},t.applyViewConfigs=function(e,r,n){r.filter(function(t){return K(n,t.state)}).forEach(function(n){var a=pt(n.state.views||{}),o=t.subPath(r,function(t){return t===n}),a=a.map(function(t){return e.createViewConfig(o,t)});n.views=a.reduce(mt,[])})},t.inheritParams=function(t,e,r){void 0===r&&(r=[]);var n=t.map(function(t){return t.paramSchema}).reduce(mt,[]).filter(function(t){return!t.inherit}).map(s("id"));return e.map(function(e){var l=at(i=B({},e&&e.paramValues),r),i=ut(i,r),f=ut((f=e.state,f=ft(t,c("state",f)),B({},f&&f.paramValues)||{}),n),l=B(i,f,l);return new Se(e.state).applyRawParams(l)})},t.treeChanges=function(e,r,n){for(var i,o,a,u,s,f=Math.min(e.length,r.length),l=0;l<f&&e[l].state!==n&&(i=e[l],o=r[l],i.equals(o,t.nonDynamicParams));)l++;u=(a=e).slice(0,l),s=a.slice(l);var h=u.map(function(n,e){n=n.clone();return n.paramValues=r[e].paramValues,n}),c=r.slice(l);return{from:a,to:h.concat(c),retained:u,retainedWithToParams:h,exiting:s,entering:c}},t.matching=function(t,e,r){var n=!1;return Ct(t,e).reduce(function(t,o){var i=o[0],o=o[1];return(n=n||!i.equals(o,r))?t:t.concat(i)},[])},t.equals=function(e,r,n){return e.length===r.length&&t.matching(e,r,n).length===e.length},t.subPath=function(t,n){n=ft(t,n),n=t.indexOf(n);return-1===n?void 0:t.slice(0,n+1)},t.nonDynamicParams=function(t){return t.state.parameters({inherit:!1}).filter(function(t){return!t.dynamic})},t.paramValues=function(t){return t.reduce(function(t,e){return B(t,e.paramValues)},{})},t}(),Re={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}},Ee={when:"LAZY",async:"WAIT"},Ce=function(){function t(e,r,n,i,o){if(this.resolved=!1,this.promise=void 0,e instanceof t)B(this,e);else if(P(r)){if(C(e))throw new Error("new Resolvable(): token argument is required");if(!P(r))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=e,this.policy=i,this.resolveFn=r,this.deps=n||[],this.data=o,this.resolved=void 0!==o,this.promise=this.resolved?D.$q.when(this.data):void 0}else if(O(e)&&e.token&&(e.hasOwnProperty("resolveFn")||e.hasOwnProperty("data")))return new t(e.token,e.resolveFn,e.deps,e.policy,e.data)}return t.prototype.getPolicy=function(r){var e=this.policy||{},r=r&&r.resolvePolicy||{};return{when:e.when||r.when||Ee.when,async:e.async||r.async||Ee.async}},t.prototype.resolve=function(t,e){var r=this,n=D.$q,u=t.findNode(this),u=u&&u.state,u=this.getPolicy(u).async,u=P(u)?u:z;return this.promise=n.when().then(function(){return n.all(t.getDependencies(r).map(function(r){return r.get(t,e)}))}).then(function(t){return r.resolveFn.apply(null,t)}).then(u).then(function(t){return r.data=t,r.resolved=!0,r.resolveFn=null,le.traceResolvableResolved(r,e),r.data})},t.prototype.get=function(t,e){return this.promise||this.resolve(t,e)},t.prototype.toString=function(){return"Resolvable(token: "+zt(this.token)+", requires: ["+this.deps.map(zt)+"])"},t.prototype.clone=function(){return new t(this)},t.fromData=function(e,r){return new t(e,function(){return r},null,null,r)},t}(),Un=Re.when,Te=[Un.EAGER,Un.LAZY],ke=[Un.EAGER],Oe=function(){function t(t){this._path=t}return t.prototype.getTokens=function(){return this._path.reduce(function(t,e){return t.concat(e.resolvables.map(function(t){return t.token}))},[]).reduce(wt,[])},t.prototype.getResolvable=function(t){return Tt(this._path.map(function(t){return t.resolvables}).reduce(mt,[]).filter(function(e){return e.token===t}))},t.prototype.getPolicy=function(t){var e=this.findNode(t);return t.getPolicy(e.state)},t.prototype.subContext=function(e){return new t(be.subPath(this._path,function(t){return t.state===e}))},t.prototype.addResolvables=function(t,r){var r=ft(this._path,c("state",r)),n=t.map(function(t){return t.token});r.resolvables=r.resolvables.filter(function(t){return-1===n.indexOf(t.token)}).concat(t)},t.prototype.resolvePath=function(o,e){var r=this;void 0===o&&(o="LAZY");var n=(K(Te,o)?o:"LAZY")===Re.when.EAGER?ke:Te;le.traceResolvePath(this._path,o,e);function i(t,e){return function(n){return K(t,r.getPolicy(n)[e])}}o=this._path.reduce(function(t,f){var s=f.resolvables.filter(i(n,"when")),u=s.filter(i(["NOWAIT"],"async")),s=s.filter(l(i(["NOWAIT"],"async"))),c=r.subContext(f.state),f=function(t){return t.get(c,e).then(function(e){return{token:t.token,value:e}})};return u.forEach(f),t.concat(s.map(f))},[]);return D.$q.all(o)},t.prototype.injector=function(){return this._injector||(this._injector=new xe(this))},t.prototype.findNode=function(t){return ft(this._path,function(e){return K(e.resolvables,t)})},t.prototype.getDependencies=function(t){var e=this,r=this.findNode(t),n=(be.subPath(this._path,function(t){return t===r})||this._path).reduce(function(t,e){return t.concat(e.resolvables)},[]).filter(function(e){return e!==t});return t.deps.map(function(t){var r=n.filter(function(e){return e.token===t});if(r.length)return Tt(r);var i=e.injector().getNative(t);if(b(i))throw new Error("Could not find Dependency Injection token: "+zt(t));return new Ce(t,function(){return i},[],i)})},t}(),xe=function(){function t(t){this.context=t,this.native=this.get("Native Injector")||D.$injector}return t.prototype.get=function(t){var e=this.context.getResolvable(t);if(e){if("NOWAIT"===this.context.getPolicy(e).async)return e.get(this.context);if(!e.resolved)throw new Error("Resolvable async .get() not complete:"+zt(e.token));return e.data}return this.getNative(t)},t.prototype.getAsync=function(t){var e=this.context.getResolvable(t);return e?e.get(this.context):D.$q.when(this.native.get(t))},t.prototype.getNative=function(t){return this.native&&this.native.get(t)},t}();function je(t){return t.name}function Ve(t){return t.self.$$state=function(){return t},t.self}function Ie(t){return t.parent&&t.parent.data&&(t.data=t.self.data=Q(t.parent.data,t.data)),t.data}function De(t){return t.parent?t.parent.path.concat(t):[t]}function qe(t){var e=t.parent?B({},t.parent.includes):{};return e[t.name]=!0,e}function Ne(t){function e(t){return t.provide||t.token}var i=_([[s("resolveFn"),function(t){return new Ce(e(t),t.resolveFn,t.deps,t.policy)}],[s("useFactory"),function(t){return new Ce(e(t),t.useFactory,t.deps||t.dependencies,t.policy)}],[s("useClass"),function(t){return new Ce(e(t),function(){return new t.useClass},[],t.policy)}],[s("useValue"),function(t){return new Ce(e(t),function(){return t.useValue},[],t.policy,t.useValue)}],[s("useExisting"),function(t){return new Ce(e(t),z,[t.useExisting],t.policy)}]]),o=_([[u(s("val"),k),function(t){return new Ce(t.token,z,[t.val],t.policy)}],[u(s("val"),x),function(t){return new Ce(t.token,Tt(t.val),t.val.slice(0,-1),t.policy)}],[u(s("val"),P),function(t){return new Ce(t.token,t.val,function(t){var e=D.$injector;return t.$inject||e&&e.annotate(t,e.strictDi)||"deferred"}(t.val),t.policy)}]]),i=_([[m(Ce),function(t){return t}],[function(t){return!(!t.token||!t.resolveFn)},i],[function(t){return!(!t.provide&&!t.token||!(t.useValue||t.useFactory||t.useExisting||t.useClass))},i],[function(t){return!!(t&&t.val&&(k(t.val)||x(t.val)||P(t.val)))},o],[y(!0),function(t){throw new Error("Invalid resolve value: "+zt(t))}]]),o=t.resolve;return(x(o)?o:function(t,e){return Object.keys(t||{}).map(function(r){return{token:r,val:t[r],deps:void 0,policy:e[r]}})}(o,t.resolvePolicy||{})).map(i)}var Le=function(){function t(t,e){this.matcher=t;function i(){return t.find("")}function o(t){return""===t.name}var r,n=this;this.builders={name:[je],self:[Ve],parent:[function(e){return o(e)?null:t.find(n.parentName(e))||i()}],data:[Ie],url:[function(t,e){return function(r){var u=r.self;u&&u.url&&u.name&&u.name.match(/\.\*\*$/)&&(kt(u,a={}),a.url+="{remainder:any}",u=a);var o=r.parent,a=function(t){if(!k(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}}(u.url),u=a?t.compile(a.val,{state:u}):u.url;if(!u)return null;if(!t.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+r+"'");return a&&a.root?u:(o&&o.navigable||e()).url.append(u)}}(e,i)],navigable:[function(t){return function(e){return!t(e)&&e.url?e:e.parent?e.parent.navigable:null}}(o)],params:[(r=e.paramFactory,function(t){var e=t.url&&t.url.parameters({inherit:!1})||[],n=pt(lt(ut(t.params||{},e.map(s("id"))),function(e,n){return r.fromConfig(n,null,t.self)}));return e.concat(n).map(function(t){return[t.id,t]}).reduce(Pt,{})})],views:[],path:[De],includes:[qe],resolvables:[Ne]}}return t.prototype.builder=function(t,e){var r=this.builders,n=r[t]||[];return k(t)&&!R(e)?1<n.length?n:n[0]:k(t)&&P(e)?(r[t]=n,r[t].push(e),function(){return r[t].splice(r[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var i,o,e=this.matcher,r=this.builders,n=this.parentName(t);if(n&&!e.find(n,void 0,!1))return null;for(i in r)r.hasOwnProperty(i)&&(o=r[i].reduce(function(t,e){return function(r){return e(r,t)}},W),t[i]=o(t));return t},t.prototype.parentName=function(t){var e=t.name||"",r=e.split(".");if("**"===r.pop()&&r.pop(),r.length){if(t.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+e+")");return r.join(".")}return t.parent?k(t.parent)?t.parent:t.parent.name:""},t.prototype.name=function(r){var e=r.name;if(-1!==e.indexOf(".")||!r.parent)return e;r=k(r.parent)?r.parent:r.parent.name;return r?r+"."+e:e},t}(),Me=function(){function t(e){return t.create(e||{})}return t.create=function(e){e=t.isStateClass(e)?new e:e;var r=Q(Q(e,t.prototype));return e.$$state=function(){return r},r.self=e,r.__stateObjectCache={nameGlob:Ht.fromString(r.name)},r},t.prototype.is=function(t){return this===t||this.self===t||this.fqn()===t},t.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var t=this.parent.fqn();return t?t+"."+this.name:this.name},t.prototype.root=function(){return this.parent&&this.parent.root()||this},t.prototype.parameters=function(t){return((t=nt(t,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat(pt(this.params)).filter(function(e){return!t.matchingKeys||t.matchingKeys.hasOwnProperty(e.id)})},t.prototype.parameter=function(t,e){return void 0===e&&(e={}),this.url&&this.url.parameter(t,e)||ft(pt(this.params),c("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t.isStateClass=function(t){return P(t)&&!0===t.__uiRouterState},t.isStateDeclaration=function(t){return P(t.$$state)},t.isState=function(t){return O(t.__stateObjectCache)},t}(),Be=function(){function t(t){this._states=t}return t.prototype.isRelative=function(t){return 0===(t=t||"").indexOf(".")||0===t.indexOf("^")},t.prototype.find=function(t,o,a){if(void 0===a&&(a=!0),t||""===t){var n=k(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,o));o=this._states[i];if(o&&(n||!(n||o!==t&&o.self!==t)))return o;if(n&&a){a=pt(this._states).filter(function(t){return t.__stateObjectCache.nameGlob&&t.__stateObjectCache.nameGlob.matches(i)});return 1<a.length&&ne.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",a.map(function(t){return t.name})),a[0]}}},t.prototype.resolvePath=function(t,u){if(!u)throw new Error("No reference point given for path '"+t+"'");for(var r=this.find(u),n=t.split("."),i=n.length,o=0,a=r;o<i;o++)if(""!==n[o]||0!==o){if("^"!==n[o])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+r.name+"'");a=a.parent}else a=r;u=n.slice(o).join(".");return a.name+(a.name&&u?".":"")+u},t}(),Ge=function(){function t(t,e,r,n){this.router=t,this.states=e,this.builder=r,this.listeners=n,this.queue=[]}return t.prototype.dispose=function(){this.queue=[]},t.prototype.register=function(n){var e=this.queue,r=Me.create(n),n=r.name;if(!k(n))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(n)||K(e.map(s("name")),n))throw new Error("State '"+n+"' is already defined");return e.push(r),this.flush(),r},t.prototype.flush=function(){for(var t=this,e=this.queue,r=this.states,n=this.builder,i=[],o=[],a={},u=function(e){return t.states.hasOwnProperty(e)&&t.states[e]},s=function(){i.length&&t.listeners.forEach(function(t){return t("registered",i.map(function(t){return t.self}))})};0<e.length;){var c=e.shift(),f=c.name,l=n.build(c),h=o.indexOf(c);if(l){var d=u(f);if(d&&d.name===f)throw new Error("State '"+f+"' is already defined");d=u(f+".**");d&&this.router.stateRegistry.deregister(d),r[f]=c,this.attachRoute(c),0<=h&&o.splice(h,1),i.push(c)}else{d=a[f];if(a[f]=e.length,0<=h&&d===e.length)return e.push(c),s(),r;h<0&&o.push(c),e.push(c)}}return s(),r},t.prototype.attachRoute=function(t){var e;!t.abstract&&t.url&&(e=this.router.urlService.rules).rule(e.urlRuleFactory.create(t))},t}(),ze=function(){function t(t){this.router=t,this.states={},this.listeners=[],this.matcher=new Be(this.states),this.builder=new Le(this.matcher,t.urlMatcherFactory),this.stateQueue=new Ge(t,this.states,this.builder,this.listeners),this._registerRoot()}return t.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},t.prototype.dispose=function(){var t=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach(function(e){return t.get(e)&&t.deregister(e)})},t.prototype.onStatesChanged=function(t){return this.listeners.push(t),function(){Z(this.listeners)(t)}.bind(this)},t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype._deregisterTree=function(t){var e=this,r=this.get().map(function(t){return t.$$state()}),n=function(t){var e=r.filter(function(e){return-1!==t.indexOf(e.parent)});return 0===e.length?e:e.concat(n(e))},o=n([t]),o=[t].concat(o).reverse();return o.forEach(function(t){var r=e.router.urlService.rules;r.rules().filter(c("state",t)).forEach(function(t){return r.removeRule(t)}),delete e.states[t.name]}),o},t.prototype.deregister=function(t){var e=this.get(t);if(!e)throw new Error("Can't deregister state; not found: "+t);var r=this._deregisterTree(e.$$state());return this.listeners.forEach(function(t){return t("deregistered",r.map(function(t){return t.self}))}),r},t.prototype.get=function(t,n){var r=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return r.states[t].self});n=this.matcher.find(t,n);return n&&n.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}();(In=t.TransitionHookPhase||(t.TransitionHookPhase={}))[In.CREATE=0]="CREATE",In[In.BEFORE=1]="BEFORE",In[In.RUN=2]="RUN",In[In.SUCCESS=3]="SUCCESS",In[In.ERROR=4]="ERROR",(Dn=t.TransitionHookScope||(t.TransitionHookScope={}))[Dn.TRANSITION=0]="TRANSITION",Dn[Dn.STATE=1]="STATE";var We={current:W,transition:null,traceData:{},bind:null},Je=function(){function e(e,r,n,i){var o=this;this.transition=e,this.stateContext=r,this.registeredHook=n,this.options=i,this.isSuperseded=function(){return o.type.hookPhase===t.TransitionHookPhase.RUN&&!o.options.transition.isActive()},this.options=nt(i,We),this.type=n.eventType}return e.chain=function(t,e){return t.reduce(function(t,e){return t.then(function(){return e.invokeHook()})},e||D.$q.when())},e.invokeHooks=function(t,r){for(var n=0;n<t.length;n++){var i=t[n].invokeHook();if(H(i)){var o=t.slice(n+1);return e.chain(o,i).then(r)}}return r()},e.runAllHooks=function(t){t.forEach(function(t){return t.invokeHook()})},e.prototype.logError=function(t){this.transition.router.stateService.defaultErrorHandler()(t)},e.prototype.invokeHook=function(){var t=this,e=this.registeredHook;if(!e._deregistered){var r=this.getNotCurrentRejection();if(r)return r;var n=this.options;le.traceHookInvocation(this,this.transition,n);var i=function(r){return e.eventType.getErrorHandler(t)(r)},o=function(r){return e.eventType.getResultHandler(t)(r)};try{var a=e.callback.call(n.bind,t.transition,t.stateContext);return!this.type.synchronous&&H(a)?a.catch(function(t){return qt.normalize(t).toPromise()}).then(o,i):o(a)}catch(t){return i(qt.normalize(t))}finally{e.invokeLimit&&++e.invokeCount>=e.invokeLimit&&e.deregister()}}},e.prototype.handleHookResult=function(t){var e=this;return this.getNotCurrentRejection()||(H(t)?t.then(function(t){return e.handleHookResult(t)}):(le.traceHookResult(t,this.transition,this.options),!1===t?qt.aborted("Hook aborted transition").toPromise():m($e)(t)?qt.redirected(t).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var t=this.transition.router;return t._disposed?qt.aborted("UIRouter instance #"+t.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?qt.aborted().toPromise():this.isSuperseded()?qt.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var t=this.options,e=this.registeredHook;return(f("traceData.hookType")(t)||"internal")+" context: "+(f("traceData.context.state.name")(t)||f("traceData.context")(t)||"unknown")+", "+Nt(200,Mt(e.callback))},e.HANDLE_RESULT=function(t){return function(e){return t.handleHookResult(e)}},e.LOG_REJECTED_RESULT=function(t){return function(e){H(e)&&e.catch(function(e){return t.logError(qt.normalize(e))})}},e.LOG_ERROR=function(t){return function(e){return t.logError(e)}},e.REJECT_ERROR=function(t){return It},e.THROW_ERROR=function(t){return function(t){throw t}},e}();function Qe(t,e,r){var n=k(e)?[e]:e;return!!(P(n)?n:function(t){for(var e=n,r=0;r<e.length;r++){var i=new Ht(e[r]);if(i&&i.matches(t.name)||!i&&e[r]===t.name)return!0}return!1})(t,r)}var Ke=function(){function e(t,e,r,n,i,o){void 0===o&&(o={}),this.tranSvc=t,this.eventType=e,this.callback=r,this.matchCriteria=n,this.removeHookFromRegistry=i,this.invokeCount=0,this._deregistered=!1,this.priority=o.priority||0,this.bind=o.bind||null,this.invokeLimit=o.invokeLimit}return e.prototype._matchingNodes=function(n,e,r){if(!0===e)return n;n=n.filter(function(t){return Qe(t.state,e,r)});return n.length?n:null},e.prototype._getDefaultMatchCriteria=function(){return lt(this.tranSvc._pluginapi._getPathTypes(),function(){return!0})},e.prototype._getMatchingNodes=function(e,r){var n=this,i=B(this._getDefaultMatchCriteria(),this.matchCriteria);return pt(this.tranSvc._pluginapi._getPathTypes()).reduce(function(o,a){var u=a.scope===t.TransitionHookScope.STATE,c=e[a.name]||[],c=u?c:[Tt(c)];return o[a.name]=n._matchingNodes(c,i[a.name],r),o},{})},e.prototype.matches=function(t,r){r=this._getMatchingNodes(t,r);return pt(r).every(z)?r:null},e.prototype.deregister=function(){this.removeHookFromRegistry(this),this._deregistered=!0},e}();function Ye(t,e,r){var n=(t._registeredHooks=t._registeredHooks||{})[r.name]=[],i=Z(n);function o(t,o,u){void 0===u&&(u={});u=new Ke(e,r,o,t,i,u);return n.push(u),u.deregister.bind(u)}return t[r.name]=o}var Ze=function(){function e(t){this.transition=t}return e.prototype.buildHooksForPhase=function(t){var e=this;return this.transition.router.transitionService._pluginapi._getEvents(t).map(function(t){return e.buildHooks(t)}).reduce(mt,[]).filter(z)},e.prototype.buildHooks=function(e){var r=this.transition,n=r.treeChanges(),i=this.getMatchingHooks(e,n,r);if(!i)return[];var o={transition:r,current:r.options().current};return i.map(function(i){return i.matches(n,r)[e.criteriaMatchPath.name].map(function(n){var s=B({bind:i.bind,traceData:{hookType:e.name,context:n}},o),u=e.criteriaMatchPath.scope===t.TransitionHookScope.STATE?n.state.self:null,s=new Je(r,u,i,s);return{hook:i,node:n,transitionHook:s}})}).reduce(mt,[]).sort(function(t){return void 0===t&&(t=!1),function(e,r){var i=t?-1:1,i=(e.node.state.path.length-r.node.state.path.length)*i;return 0!=i?i:r.hook.priority-e.hook.priority}}(e.reverseSort)).map(function(t){return t.transitionHook})},e.prototype.getMatchingHooks=function(e,r,n){var i=e.hookPhase===t.TransitionHookPhase.CREATE,o=this.transition.router.transitionService;return(i?[o]:[this.transition,o]).map(function(t){return t.getHooks(e.name)}).filter($t(x,"broken event named: "+e.name)).reduce(mt,[]).filter(function(t){return t.matches(r,n)})},e}(),Xe=s("self"),tr=function(){function e(e,a,n){var i=this;if(this._deferred=D.$q.defer(),this.promise=this._deferred.promise,this._registeredHooks={},this._hookBuilder=new Ze(this),this.isActive=function(){return i.router.globals.transition===i},this.router=n,!(this._targetState=a).valid())throw new Error(a.error());this._options=B({current:y(this)},a.options()),this.$id=n.transitionService._transitionCount++;a=be.buildToPath(e,a);this._treeChanges=be.treeChanges(e,a,this._options.reloadState),this.createTransitionHookRegFns();a=this._hookBuilder.buildHooksForPhase(t.TransitionHookPhase.CREATE);Je.invokeHooks(a,function(){return null}),this.applyViewConfigs(n)}return e.prototype.onBefore=function(t,e,r){},e.prototype.onStart=function(t,e,r){},e.prototype.onExit=function(t,e,r){},e.prototype.onRetain=function(t,e,r){},e.prototype.onEnter=function(t,e,r){},e.prototype.onFinish=function(t,e,r){},e.prototype.onSuccess=function(t,e,r){},e.prototype.onError=function(t,e,r){},e.prototype.createTransitionHookRegFns=function(){var e=this;this.router.transitionService._pluginapi._getEvents().filter(function(e){return e.hookPhase!==t.TransitionHookPhase.CREATE}).forEach(function(t){return Ye(e,e.router.transitionService,t)})},e.prototype.getHooks=function(t){return this._registeredHooks[t]},e.prototype.applyViewConfigs=function(t){var e=this._treeChanges.entering.map(function(t){return t.state});be.applyViewConfigs(t.transitionService.$view,this._treeChanges.to,e)},e.prototype.$from=function(){return Tt(this._treeChanges.from).state},e.prototype.$to=function(){return Tt(this._treeChanges.to).state},e.prototype.from=function(){return this.$from().self},e.prototype.to=function(){return this.$to().self},e.prototype.targetState=function(){return this._targetState},e.prototype.is=function(t){return t instanceof e?this.is({to:t.$to().name,from:t.$from().name}):!(t.to&&!Qe(this.$to(),t.to,this)||t.from&&!Qe(this.$from(),t.from,this))},e.prototype.params=function(t){return void 0===t&&(t="to"),Object.freeze(this._treeChanges[t].map(s("paramValues")).reduce(it,{}))},e.prototype.paramsChanged=function(){var t=this.params("from"),e=this.params("to"),r=[].concat(this._treeChanges.to).concat(this._treeChanges.from).map(function(t){return t.paramSchema}).reduce(gt,[]).reduce(wt,[]);return ye.changed(r,t,e).reduce(function(t,r){return t[r.id]=e[r.id],t},{})},e.prototype.injector=function(t,r){void 0===r&&(r="to");r=this._treeChanges[r];return t&&(r=be.subPath(r,function(e){return e.state===t||e.state.name===t})),new Oe(r).injector()},e.prototype.getResolveTokens=function(t){return void 0===t&&(t="to"),new Oe(this._treeChanges[t]).getTokens()},e.prototype.addResolvable=function(t,i){void 0===i&&(i=""),t=m(Ce)(t)?t:new Ce(t);var r="string"==typeof i?i:i.name,n=this._treeChanges.to,i=ft(n,function(t){return t.state.name===r});new Oe(n).addResolvables([t],i.state)},e.prototype.redirectedFrom=function(){return this._options.redirectedFrom||null},e.prototype.originalTransition=function(){var t=this.redirectedFrom();return t&&t.originalTransition()||this},e.prototype.options=function(){return this._options},e.prototype.entering=function(){return ht(this._treeChanges.entering,s("state")).map(Xe)},e.prototype.exiting=function(){return ht(this._treeChanges.exiting,s("state")).map(Xe).reverse()},e.prototype.retained=function(){return ht(this._treeChanges.retained,s("state")).map(Xe)},e.prototype.views=function(r,e){void 0===r&&(r="entering");r=this._treeChanges[r];return(r=e?r.filter(c("state",e)):r).map(s("views")).filter(z).reduce(mt,[])},e.prototype.treeChanges=function(t){return t?this._treeChanges[t]:this._treeChanges},e.prototype.redirect=function(t){for(var e=1,r=this;null!=(r=r.redirectedFrom());)if(20<++e)throw new Error("Too many consecutive Transition redirects (20+)");var a={redirectedFrom:this,source:"redirect"};"url"===this.options().source&&!1!==t.options().location&&(a.location="replace");var s=B({},this.options(),t.options(),a);t=t.withOptions(s,!0);var o,a=this.router.transitionService.create(this._treeChanges.from,t),u=this._treeChanges.entering,s=a._treeChanges.entering;return be.matching(s,u,be.nonDynamicParams).filter(l((o=t.options().reloadState,function(t){return o&&t.state.includes[o.name]}))).forEach(function(t,e){t.resolvables=u[e].resolvables}),a},e.prototype._changedParams=function(){var r=this._treeChanges;if(!(this._options.reload||r.exiting.length||r.entering.length||r.to.length!==r.from.length||Ct(r.to,r.from).map(function(t){return t[0].state!==t[1].state}).reduce(dt,!1))){var e=r.to.map(function(t){return t.paramSchema}),r=[r.to,r.from].map(function(t){return t.map(function(t){return t.paramValues})});return Ct(e,r[0],r[1]).map(function(n){var e=n[0],r=n[1],n=n[2];return ye.changed(e,r,n)}).reduce(mt,[])}},e.prototype.dynamic=function(){var t=this._changedParams();return!!t&&t.map(function(t){return t.dynamic}).reduce(dt,!1)},e.prototype.ignored=function(){return!!this._ignoredReason()},e.prototype._ignoredReason=function(){var i=this.router.globals.transition,e=this._options.reloadState,r=function(t,n){if(t.length!==n.length)return!1;n=be.matching(t,n);return t.length===n.filter(function(t){return!e||!t.state.includes[e.name]}).length},n=this.treeChanges(),i=i&&i.treeChanges();return i&&r(i.to,n.to)&&r(i.exiting,n.exiting)?"SameAsPending":0===n.exiting.length&&0===n.entering.length&&r(n.from,n.to)?"SameAsCurrent":void 0},e.prototype.run=function(){function n(t){return e._hookBuilder.buildHooksForPhase(t)}var e=this,r=Je.runAllHooks,i=n(t.TransitionHookPhase.BEFORE);return Je.invokeHooks(i,function(){var t=e.router.globals;return t.lastStartedTransitionId=e.$id,t.transition=e,t.transitionHistory.enqueue(e),le.traceTransitionStart(e),D.$q.when(void 0)}).then(function(){var e=n(t.TransitionHookPhase.RUN);return Je.invokeHooks(e,function(){return D.$q.when(void 0)})}).then(function(){le.traceSuccess(e.$to(),e),e.success=!0,e._deferred.resolve(e.to()),r(n(t.TransitionHookPhase.SUCCESS))},function(i){le.traceError(i,e),e.success=!1,e._deferred.reject(i),e._error=i,r(n(t.TransitionHookPhase.ERROR))}),this.promise},e.prototype.valid=function(){return!this.error()||void 0!==this.success},e.prototype.abort=function(){b(this.success)&&(this._aborted=!0)},e.prototype.error=function(){var t=this.$to();if(t.self.abstract)return qt.invalid("Cannot transition to abstract state '"+t.name+"'");var o=t.parameters(),r=this.params(),o=o.filter(function(t){return!t.validates(r[t.id])});if(o.length){o=o.map(function(t){return"["+t.id+":"+zt(r[t.id])+"]"}).join(", "),o="The following parameter values are not valid for state '"+t.name+"': "+o;return qt.invalid(o)}return!1===this.success?this._error:void 0},e.prototype.toString=function(){function r(t){return null!==t["#"]&&void 0!==t["#"]?t:ut(t,["#"])}var t=this.from(),e=this.to();return"Transition#"+this.$id+"( '"+(O(t)?t.name:t)+"'"+zt(r(this._treeChanges.from.map(s("paramValues")).reduce(it,{})))+" -> "+(this.valid()?"":"(X) ")+"'"+(O(e)?e.name:e)+"'"+zt(r(this.params()))+" )"},e.diToken=e}();function er(t,e){var r=["",""],n=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return n;switch(e.squash){case!1:r=["(",")"+(e.isOptional?"?":"")];break;case!0:n=n.replace(/\/$/,""),r=["(?:/(",")|/)?"];break;default:r=["("+e.squash+"|",")?"]}return n+r[0]+e.type.pattern.source+r[1]}var fr,rr=te("/"),nr={state:{params:{}},strict:!0,caseInsensitive:!0,decodeParams:!0},ir=function(){function e(t,r,n,i){var o=this;this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=i=nt(i,nr),this.pattern=t;for(var a,u,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=[],p=0,v=function(r){if(!e.nameValidator.test(r))throw new Error("Invalid parameter name '"+r+"' in pattern '"+t+"'");if(ft(o._params,c("id",r)))throw new Error("Duplicate parameter name '"+r+"' in pattern '"+t+"'")},d=function(e,n){var a=e[2]||e[3],i=n?e[4]:e[4]||("*"===e[1]?"[\\s\\S]*":null);return{id:a,regexp:i,segment:t.substring(p,e.index),type:i?r.type(i)||(i=i,Q(r.type(n?"query":"path"),{pattern:new RegExp(i,o.config.caseInsensitive?"i":void 0)})):null}};(a=f.exec(t))&&!(0<=(u=d(a,!1)).segment.indexOf("?"));)v(u.id),this._params.push(n.fromPath(u.id,u.type,i.state)),this._segments.push(u.segment),h.push([u.segment,Tt(this._params)]),p=f.lastIndex;var m=(s=t.substring(p)).indexOf("?");if(0<=m){var g=s.substring(m),s=s.substring(0,m);if(0<g.length)for(p=0;a=l.exec(g);)v((u=d(a,!0)).id),this._params.push(n.fromSearch(u.id,u.type,i.state)),p=f.lastIndex}this._segments.push(s),this._compiled=h.map(function(t){return er.apply(null,t)}).concat(er(s))}return e.encodeDashes=function(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})},e.pathSegmentsAndParams=function(e){return Ct(e._segments,e._params.filter(function(e){return e.location===t.DefType.PATH}).concat(void 0)).reduce(mt,[]).filter(function(t){return""!==t&&R(t)})},e.queryParams=function(e){return e._params.filter(function(e){return e.location===t.DefType.SEARCH})},e.compare=function(i,o){function n(t){return t._cache.weights=t._cache.weights||function(t){return t._cache.segments=t._cache.segments||t._cache.path.map(e.pathSegmentsAndParams).reduce(mt,[]).reduce(ee,[]).map(function(t){return k(t)?rr(t):t}).reduce(mt,[])}(t).map(function(t){return"/"===t?1:k(t)?2:t instanceof ye?3:void 0})}i=n(i),o=n(o);!function(t,e){for(var n=Math.max(t.length,e.length);t.length<n;)t.push(0);for(;e.length<n;)e.push(0)}(i,o);for(var a,s=Ct(i,o),u=0;u<s.length;u++)if(0!=(a=s[u][0]-s[u][1]))return a;return 0},e.prototype.append=function(t){return this._children.push(t),t._cache={path:this._cache.path.concat(t),parent:this,pattern:null},t},e.prototype.isRoot=function(){return this._cache.path[0]===this},e.prototype.toString=function(){return this.pattern},e.prototype._getDecodedParamValue=function(t,e){return R(t)&&(!this.config.decodeParams||e.type.raw||x(t)||(t=decodeURIComponent(t)),t=e.type.decode(t)),e.value(t)},e.prototype.exec=function(v,e,r,n){var i=this;void 0===e&&(e={});var o,a,u,c=(u=function(){return new RegExp(["^",_t(i._cache.path.map(s("_compiled"))).join(""),!1===i.config.strict?"/?":"","$"].join(""),i.config.caseInsensitive?"i":void 0)},((o=this._cache)[a="pattern"]=o[a]||u()).exec(v));if(!c)return null;var f,l,v=this.parameters(),p=v.filter(function(t){return!t.isSearch()}),v=v.filter(function(t){return t.isSearch()}),d=this._cache.path.map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),m={};if(d!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var g=0;g<d;g++){for(var y=p[g],w=c[g+1],_=0;_<y.replace.length;_++)y.replace[_].from===w&&(w=y.replace[_].to);w&&!0===y.array&&(0,l=ht((f=function(t){return t.split("").reverse().join("")})(w).split(/-(?!\\)/),f),w=ht(l,function(t){return t.replace(/\\-/g,"-")}).reverse()),m[y.id]=this._getDecodedParamValue(w,y)}return v.forEach(function(t){for(var r=e[t.id],n=0;n<t.replace.length;n++)t.replace[n].from===r&&(r=t.replace[n].to);m[t.id]=i._getDecodedParamValue(r,t)}),r&&(m["#"]=r),m},e.prototype.parameters=function(t){return void 0===t&&(t={}),!1===t.inherit?this._params:_t(this._cache.path.map(function(t){return t._params}))},e.prototype.parameter=function(t,e){var r=this;void 0===e&&(e={});var n=this._cache.parent;return function(){for(var e=0,n=r._params;e<n.length;e++){var i=n[e];if(i.id===t)return i}}()||!1!==e.inherit&&n&&n.parameter(t,e)||null},e.prototype.validates=function(t){return t=t||{},this.parameters().filter(function(e){return t.hasOwnProperty(e.id)}).map(function(e){return function(t,e){return!t||t.validates(e)}(e,t[e.id])}).reduce(vt,!0)},e.prototype.format=function(t){void 0===t&&(t={});var u=this._cache.path,a=u.map(e.pathSegmentsAndParams).reduce(mt,[]).map(function(t){return k(t)?t:o(t)}),u=u.map(e.queryParams).reduce(mt,[]).map(o);if(a.concat(u).filter(function(t){return!1===t.isValid}).length)return null;function o(e){var r=e.value(t[e.id]),n=e.validates(r),i=e.isDefaultValue(r),o=!!i&&e.squash,a=e.type.encode(r);return{param:e,value:r,isValid:n,isDefaultValue:i,squash:o,encoded:a}}a=a.reduce(function(t,o){if(k(o))return t+o;var n=o.squash,i=o.encoded,o=o.param;return!0===n?t.match(/\/$/)?t.slice(0,-1):t:k(n)?t+n:!1!==n||null==i?t:x(i)?t+ht(i,e.encodeDashes).join("-"):o.raw?t+i:t+encodeURIComponent(i)},""),u=u.map(function(i){var e=i.param,r=i.squash,n=i.encoded,i=i.isDefaultValue;if(!(null==n||i&&!1!==r)&&(x(n)||(n=[n]),0!==n.length))return e.raw||(n=ht(n,encodeURIComponent)),n.map(function(t){return e.id+"="+t})}).filter(z).reduce(mt,[]).join("&");return a+(u?"?"+u:"")+(t["#"]?"#"+t["#"]:"")},e.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,e}(),or=function(){return(or=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},ar=function(){function e(t){this.router=t}return e.prototype.fromConfig=function(e,r,n){return new ye(e,r,t.DefType.CONFIG,this.router.urlService.config,n)},e.prototype.fromPath=function(e,r,n){return new ye(e,r,t.DefType.PATH,this.router.urlService.config,n)},e.prototype.fromSearch=function(e,r,n){return new ye(e,r,t.DefType.SEARCH,this.router.urlService.config,n)},e}(),ur=function(){function t(t){var e=this;this.router=t,this.paramFactory=new ar(this.router),this.UrlMatcher=ir,this.Param=ye,this.caseInsensitive=function(t){return e.router.urlService.config.caseInsensitive(t)},this.defaultSquashPolicy=function(t){return e.router.urlService.config.defaultSquashPolicy(t)},this.strictMode=function(t){return e.router.urlService.config.strictMode(t)},this.type=function(t,r,n){return e.router.urlService.config.type(t,r,n)||e}}return t.prototype.compile=function(t,e){var r=this.router.urlService.config,i=e&&!e.state&&e.params;e=i?or({state:{params:i}},e):e;i={strict:r._isStrictMode,caseInsensitive:r._isCaseInsensitive,decodeParams:r._decodeParams};return new ir(t,r.paramTypes,this.paramFactory,B(i,e))},t.prototype.isMatcher=function(t){if(!O(t))return!1;var e=!0;return M(ir.prototype,function(r,n){P(r)&&(e=e&&R(t[n])&&P(t[n]))}),e},t.prototype.$get=function(){var t=this.router.urlService.config;return t.paramTypes.enqueue=!1,t.paramTypes._flushTypeQueue(),this},t}(),sr=function(){function t(t){this.router=t}return t.prototype.compile=function(t){return this.router.urlMatcherFactory.compile(t)},t.prototype.create=function(a,e){var r=this,n=Me.isState,i=Me.isStateDeclaration,o=_([[k,function(t){return o(r.compile(t))}],[m(ir),function(t){return r.fromUrlMatcher(t,e)}],[p(n,i),function(t){return r.fromState(t,r.router)}],[m(RegExp),function(t){return r.fromRegExp(t,e)}],[P,function(t){return new cr(t,e)}]]),a=o(a);if(!a)throw new Error("invalid 'what' in when()");return a},t.prototype.fromUrlMatcher=function(t,e){var r=e;k(e)&&(e=this.router.urlMatcherFactory.compile(e)),m(ir)(e)&&(r=function(t){return e.format(t)});var n={urlMatcher:t,matchPriority:function(e){var r=t.parameters().filter(function(t){return t.isOptional});return r.length?r.filter(function(t){return e[t.id]}).length/r.length:1e-6},type:"URLMATCHER"};return B(new cr(function(r){r=t.exec(r.path,r.search,r.hash);return t.validates(r)&&r},r),n)},t.prototype.fromState=function(n,e){var r=Me.isStateDeclaration(n)?n.$$state():n,n={state:r,type:"STATE"};return B(this.fromUrlMatcher(r.url,function(t){var n=e.stateService,i=e.globals;n.href(r,t)!==n.href(i.current,i.params)&&n.transitionTo(r,t,{inherit:!0,source:"url"})}),n)},t.prototype.fromRegExp=function(t,e){if(t.global||t.sticky)throw new Error("Rule RegExp must not be global or sticky");var r=k(e)?function(t){return e.replace(/\$(\$|\d{1,2})/,function(e,r){return t["$"===r?0:Number(r)]})}:e,n={regexp:t,type:"REGEXP"};return B(new cr(function(e){return t.exec(e.path)},r),n)},t.isUrlRule=function(t){return t&&["type","match","handler"].every(function(e){return R(t[e])})},t}(),cr=function(t,e){var r=this;this.match=t,this.type="RAW",this.matchPriority=function(t){return 0-r.$id},this.handler=e||z},lr=function(){function t(t){var e=this;this.router=t,this.sync=function(t){return e.router.urlService.sync(t)},this.listen=function(t){return e.router.urlService.listen(t)},this.deferIntercept=function(t){return e.router.urlService.deferIntercept(t)},this.match=function(t){return e.router.urlService.match(t)},this.initial=function(t){return e.router.urlService.rules.initial(t)},this.otherwise=function(t){return e.router.urlService.rules.otherwise(t)},this.removeRule=function(t){return e.router.urlService.rules.removeRule(t)},this.rule=function(t){return e.router.urlService.rules.rule(t)},this.rules=function(){return e.router.urlService.rules.rules()},this.sort=function(t){return e.router.urlService.rules.sort(t)},this.when=function(t,r,n){return e.router.urlService.rules.when(t,r,n)},this.urlRuleFactory=new sr(t)}return t.prototype.update=function(t){var e=this.router.locationService;t?this.location=e.url():e.url()!==this.location&&e.url(this.location,!0)},t.prototype.push=function(t,e,n){n=n&&!!n.replace;this.router.urlService.url(t.format(e||{}),n)},t.prototype.href=function(i,s,a){var n=i.format(s);if(null==n)return null;a=a||{absolute:!1};i=this.router.urlService.config,s=i.html5Mode();if(s||null===n||(n="#"+i.hashPrefix()+n),n=function(t,e,r,n){return"/"===n?t:e?Qt(n)+t:r?n.slice(1)+t:t}(n,s,a.absolute,i.baseHref()),!a.absolute||!n)return n;a=!s&&n?"/":"",s=i.port(),s=80===s||443===s?"":":"+s;return[i.protocol(),"://",i.host(),s,a,n].join("")},Object.defineProperty(t.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),t}(),hr=function(){function t(t){var e=this;this.router=t,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(t){return ft(e._uiViews,function(r){return e.router.$id+"."+r.id===t})},_registeredUIViews:function(){return e._uiViews},_activeViewConfigs:function(){return e._viewConfigs},_onSync:function(t){return e._listeners.push(t),function(){return Z(e._listeners,t)}}}}return t.normalizeUIViewTarget=function(t,i){void 0===i&&(i="");var o=i.split("@"),n=o[0]||"$default",i=k(o[1])?o[1]:"^",o=/^(\^(?:\.\^)*)\.(.*$)/.exec(n);return o&&(i=o[1],n=o[2]),"!"===n.charAt(0)&&(n=n.substr(1),i=""),/^(\^(?:\.\^)*)$/.exec(i)?i=i.split(".").reduce(function(t,e){return t.parent},t).name:"."===i&&(i=t.name),{uiViewName:n,uiViewContextAnchor:i}},t.prototype._rootViewContext=function(t){return this._rootContext=t||this._rootContext},t.prototype._viewConfigFactory=function(t,e){this._viewConfigFactories[t]=e},t.prototype.createViewConfig=function(t,n){var r=this._viewConfigFactories[n.$type];if(!r)throw new Error("ViewService: No view config factory registered for type "+n.$type);n=r(t,n);return x(n)?n:[n]},t.prototype.deactivateViewConfig=function(t){le.traceViewServiceEvent("<- Removing",t),Z(this._viewConfigs,t)},t.prototype.activateViewConfig=function(t){le.traceViewServiceEvent("-> Registering",t),this._viewConfigs.push(t)},t.prototype.sync=function(){var e=this,r=this._uiViews.map(function(t){return[t.fqn,t]}).reduce(Pt,{});function n(t){for(var e=t.viewDecl.$context,r=0;++r&&e.parent;)e=e.parent;return r}var i=o(function(t,e,r,n){return e*(t(r)-t(n))}),a=this._uiViews.sort(i(function(t){var e=function(t){return t&&t.parent?e(t.parent)+1:1};return 1e4*t.fqn.split(".").length+e(t.creationContext)},1)).map(function(o){var a=e._viewConfigs.filter(t.matches(r,o));return 1<a.length&&a.sort(i(n,-1)),{uiView:o,viewConfig:a[0]}}),u=a.map(function(t){return t.viewConfig}),s=this._viewConfigs.filter(function(t){return!K(u,t)}).map(function(t){return{uiView:void 0,viewConfig:t}});a.forEach(function(t){-1!==e._uiViews.indexOf(t.uiView)&&t.uiView.configUpdated(t.viewConfig)});var c=a.concat(s);this._listeners.forEach(function(t){return t(c)}),le.traceViewSync(c)},t.prototype.registerUIView=function(t){le.traceViewServiceUIViewEvent("-> Registering",t);var e=this._uiViews;return e.filter(function(e){return e.fqn===t.fqn&&e.$type===t.$type}).length&&le.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){-1!==e.indexOf(t)?(le.traceViewServiceUIViewEvent("<- Deregistering",t),Z(e)(t)):le.traceViewServiceUIViewEvent("Tried removing non-registered uiView",t)}},t.prototype.available=function(){return this._uiViews.map(s("fqn"))},t.prototype.active=function(){return this._uiViews.filter(s("$config")).map(s("name"))},t.matches=function(t,e){return function(o){if(e.$type!==o.viewDecl.$type)return!1;var n=o.viewDecl,s=n.$uiViewName.split("."),o=e.fqn.split(".");if(!G(s,o.slice(0-s.length)))return!1;s=1-s.length||void 0,s=o.slice(0,s).join("."),s=t[s].creationContext;return n.$uiViewContextAnchor===(s&&s.name)}},t}(),pr=function(){function t(){this.params=new _e,this.lastStartedTransitionId=-1,this.transitionHistory=new At([],1),this.successfulTransitions=new At([],1)}return t.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},t}();function vr(t){if(!(P(t)||k(t)||m($e)(t)||$e.isDef(t)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return P(t)?t:y(t)}fr=function(t,e){var r=function(t,e){return(e.priority||0)-(t.priority||0)}(t,e);return 0!==r||0!==(r=function(t,e){var r={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(r[t.type]||0)-(r[e.type]||0)}(t,e))||0!==(r=function(t,e){return t.urlMatcher&&e.urlMatcher?ir.compare(t.urlMatcher,e.urlMatcher):0}(t,e))?r:function(t,e){var r={STATE:!0,URLMATCHER:!0};return r[t.type]&&r[e.type]?0:(t.$id||0)-(e.$id||0)}(t,e)};var dr=function(){function t(t){this.router=t,this._sortFn=fr,this._rules=[],this._id=0,this.urlRuleFactory=new sr(t)}return t.prototype.dispose=function(t){this._rules=[],delete this._otherwiseFn},t.prototype.initial=function(e){e=vr(e);this.rule(this.urlRuleFactory.create(function(t,e){return 0===e.globals.transitionHistory.size()&&!!/^\/?$/.exec(t.path)},e))},t.prototype.otherwise=function(e){e=vr(e);this._otherwiseFn=this.urlRuleFactory.create(y(!0),e),this._sorted=!1},t.prototype.removeRule=function(t){Z(this._rules,t)},t.prototype.rule=function(t){var e=this;if(!sr.isUrlRule(t))throw new Error("invalid rule");return t.$id=this._id++,t.priority=t.priority||0,this._rules.push(t),this._sorted=!1,function(){return e.removeRule(t)}},t.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},t.prototype.sort=function(t){for(var e=this.stableSort(this._rules,this._sortFn=t||this._sortFn),r=0,n=0;n<e.length;n++)e[n]._group=r,n<e.length-1&&0!==this._sortFn(e[n],e[n+1])&&r++;this._rules=e,this._sorted=!0},t.prototype.ensureSorted=function(){this._sorted||this.sort()},t.prototype.stableSort=function(r,e){r=r.map(function(t,e){return{elem:t,idx:e}});return r.sort(function(t,r){var n=e(t.elem,r.elem);return 0===n?t.idx-r.idx:n}),r.map(function(t){return t.elem})},t.prototype.when=function(t,n,r){n=this.urlRuleFactory.create(t,n);return R(r&&r.priority)&&(n.priority=r.priority),this.rule(n),n},t}(),mr=function(){function t(t){var e=this;this.router=t,this.paramTypes=new we,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return e.paramTypes.dispose()},this.baseHref=function(){return e.router.locationConfig.baseHref()},this.hashPrefix=function(t){return e.router.locationConfig.hashPrefix(t)},this.host=function(){return e.router.locationConfig.host()},this.html5Mode=function(){return e.router.locationConfig.html5Mode()},this.port=function(){return e.router.locationConfig.port()},this.protocol=function(){return e.router.locationConfig.protocol()}}return t.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=R(t)?t:this._isCaseInsensitive},t.prototype.defaultSquashPolicy=function(t){if(R(t)&&!0!==t&&!1!==t&&!k(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=R(t)?t:this._defaultSquashPolicy},t.prototype.strictMode=function(t){return this._isStrictMode=R(t)?t:this._isStrictMode},t.prototype.type=function(t,e,n){n=this.paramTypes.type(t,e,n);return R(e)?this:n},t}(),gr=function(){function t(t){var e=this;this.router=t,this.interceptDeferred=!1,this.rules=new dr(this.router),this.config=new mr(this.router),this.url=function(t,r,n){return e.router.locationService.url(t,r,n)},this.path=function(){return e.router.locationService.path()},this.search=function(){return e.router.locationService.search()},this.hash=function(){return e.router.locationService.hash()},this.onChange=function(t){return e.router.locationService.onChange(t)}}return t.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},t.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},t.prototype.sync=function(i){var r,n,o;i&&i.defaultPrevented||(o=this.router,r=o.urlService,n=o.stateService,i={path:r.path(),search:r.search(),hash:r.hash()},o=this.match(i),_([[k,function(t){return r.url(t,!0)}],[$e.isDef,function(t){return n.go(t.state,t.params,t.options)}],[m($e),function(t){return n.go(t.state(),t.params(),t.options())}]])(o&&o.rule.handler(o.match,i,this.router)))},t.prototype.listen=function(t){var e=this;if(!1!==t)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange(function(t){return e.sync(t)});this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t.prototype.match=function(t){t=B({path:"",search:{},hash:""},t);for(var n,o=this.rules.rules(),a=0;a<o.length&&(!r||r.rule._group===o[a]._group);a++)var u=(u=(n=o[a]).match(t,this.router))&&{match:u,rule:n,weight:n.matchPriority(u)},r=!r||u&&u.weight>r.weight?u:r;return r},t}(),yr=0,wr=A("LocationServices",["url","path","search","hash","onChange"]),_r=A("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),Sr=function(){function t(t,e){void 0===t&&(t=wr),void 0===e&&(e=_r),this.locationService=t,this.locationConfig=e,this.$id=yr++,this._disposed=!1,this._disposables=[],this.trace=le,this.viewService=new hr(this),this.globals=new pr,this.transitionService=new Mr(this),this.urlMatcherFactory=new ur(this),this.urlRouter=new lr(this),this.urlService=new gr(this),this.stateRegistry=new ze(this),this.stateService=new Br(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(t),this.disposable(e)}return t.prototype.disposable=function(t){this._disposables.push(t)},t.prototype.dispose=function(t){var e=this;t&&P(t.dispose)?t.dispose(this):(this._disposed=!0,this._disposables.slice().forEach(function(t){try{"function"==typeof t.dispose&&t.dispose(e),Z(e._disposables,t)}catch(t){}}))},t.prototype.plugin=function(t,r){void 0===r&&(r={});r=new t(this,r);if(!r.name)throw new Error("Required property `name` missing on plugin: "+r);return this._disposables.push(r),this._plugins[r.name]=r},t.prototype.getPlugin=function(t){return t?this._plugins[t]:pt(this._plugins)},t}();function $r(t){t.addResolvable(Ce.fromData(Sr,t.router),""),t.addResolvable(Ce.fromData(tr,t),""),t.addResolvable(Ce.fromData("$transition$",t),""),t.addResolvable(Ce.fromData("$stateParams",t.params()),""),t.entering().forEach(function(e){t.addResolvable(Ce.fromData("$state$",e),e)})}function Rr(e){function r(t){return br(t.token)?Ce.fromData(t.token,null):t}(e=pt(e.treeChanges()).reduce(mt,[]).reduce(wt,[])).forEach(function(t){t.resolvables=t.resolvables.map(r)})}function Er(t){var e=t.to().redirectTo;if(e){var r=t.router.stateService;return P(e)?D.$q.when(e(t)).then(n):n(e)}function n(e){if(e)return e instanceof $e?e:k(e)?r.target(e,t.params(),t.options()):e.state||e.params?r.target(e.state||t.to(),e.params||t.params(),t.options()):void 0}}var br=K(["$transition$",tr]);function Cr(t){return function(e,r){return(0,r.$$state()[t])(e,r)}}function Or(t){return new Oe(t.treeChanges().to).resolvePath("EAGER",t).then(W)}function xr(t,e){return new Oe(t.treeChanges().to).subContext(e.$$state()).resolvePath("LAZY",t).then(W)}function jr(t){return new Oe(t.treeChanges().to).resolvePath("LAZY",t).then(W)}function Vr(r){var e=D.$q;if((r=r.views("entering")).length)return e.all(r.map(function(t){return e.when(t.load())})).then(W)}function Ir(t){var n,e=t.views("entering"),r=t.views("exiting");(e.length||r.length)&&(n=t.router.viewService,r.forEach(function(t){return n.deactivateViewConfig(t)}),e.forEach(function(t){return n.activateViewConfig(t)}),n.sync())}function Hr(t){function r(){e.transition===t&&(e.transition=null)}var e=t.router.globals;t.onSuccess({},function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,kt(t.params(),e.params)},{priority:1e4}),t.promise.then(r,r)}function Ar(n){var i=n.options(),r=n.router.stateService,n=n.router.urlRouter;"url"!==i.source&&i.location&&r.$current.navigable&&(i={replace:"replace"===i.location},n.push(r.$current.navigable.url,r.params,i)),n.update(!0)}function Dr(t){var e=t.router,r=t.entering().filter(function(t){return!!t.$$state().lazyLoad}).map(function(e){return qr(t,e)});return D.$q.all(r).then(function(){if("url"!==t.originalTransition().options().source){var u=t.targetState();return e.stateService.target(u.identifier(),u.params(),u.options())}var a=e.urlService,u=a.match(a.parts()),a=u&&u.rule;if(a&&"STATE"===a.type){a=a.state,u=u.match;return e.stateService.target(a,u,t.options())}e.urlService.sync()})}var Pr=Cr("onExit"),Tr=Cr("onRetain"),kr=Cr("onEnter");function qr(t,e){var r=e.$$state().lazyLoad;return r._promise||(r._promise=D.$q.when(r(t,e)).then(function(e){return e&&Array.isArray(e.states)&&e.states.forEach(function(e){return t.router.stateRegistry.register(e)}),e}).then(function(t){return delete e.lazyLoad,delete e.$$state().lazyLoad,delete r._promise,t},function(t){return delete r._promise,D.$q.reject(t)}))}function Nr(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=Je.HANDLE_RESULT),void 0===a&&(a=Je.REJECT_ERROR),void 0===u&&(u=!1),this.name=t,this.hookPhase=e,this.hookOrder=r,this.criteriaMatchPath=n,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=u}function Ur(r){var e=r._ignoredReason();if(e){le.traceTransitionIgnored(r);r=r.router.globals.transition;return"SameAsCurrent"===e&&r&&r.abort(),qt.ignored().toPromise()}}function Fr(t){if(!t.valid())throw new Error(t.error().toString())}function Kr(t,n){var r=n[0],n=n[1];return t.hasOwnProperty(r)?x(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n,t}function Yr(t){return t.split("&").filter(z).map(Zt).reduce(Kr,{})}var Lr={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},Mr=function(){function e(t){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=t,this.$view=t.viewService,this._deregisterHookFns={},this._pluginapi=J(y(this),{},y(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),t.globals.successfulTransitions.onEvict(Rr)}return e.prototype.onCreate=function(t,e,r){},e.prototype.onBefore=function(t,e,r){},e.prototype.onStart=function(t,e,r){},e.prototype.onExit=function(t,e,r){},e.prototype.onRetain=function(t,e,r){},e.prototype.onEnter=function(t,e,r){},e.prototype.onFinish=function(t,e,r){},e.prototype.onSuccess=function(t,e,r){},e.prototype.onError=function(t,e,r){},e.prototype.dispose=function(t){pt(this._registeredHooks).forEach(function(t){return t.forEach(function(e){e._deregistered=!0,Z(t,e)})})},e.prototype.create=function(t,e){return new tr(t,e,this._router)},e.prototype._defineCoreEvents=function(){var e=t.TransitionHookPhase,r=Je,n=this._criteriaPaths;this._defineEvent("onCreate",e.CREATE,0,n.to,!1,r.LOG_REJECTED_RESULT,r.THROW_ERROR,!0),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0),this._defineEvent("onError",e.ERROR,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0)},e.prototype._defineCorePaths=function(){var e=t.TransitionHookScope.STATE,r=t.TransitionHookScope.TRANSITION;this._definePathType("to",r),this._definePathType("from",r),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(t,e,r,n,i,o,a,s){void 0===i&&(i=!1),void 0===o&&(o=Je.HANDLE_RESULT),void 0===a&&(a=Je.REJECT_ERROR),void 0===s&&(s=!1);s=new Nr(t,e,r,n,i,o,a,s);this._eventTypes.push(s),Ye(this,this,s)},e.prototype._getEvents=function(t){return(R(t)?this._eventTypes.filter(function(e){return e.hookPhase===t}):this._eventTypes.slice()).sort(function(t,e){var r=t.hookPhase-e.hookPhase;return 0==r?t.hookOrder-e.hookOrder:r})},e.prototype._definePathType=function(t,e){this._criteriaPaths[t]={name:t,scope:e}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(t){return this._registeredHooks[t]},e.prototype._registerCoreTransitionHooks=function(){var t=this._deregisterHookFns;t.addCoreResolves=this.onCreate({},$r),t.ignored=function(t){return t.onBefore({},Ur,{priority:-9999})}(this),t.invalid=function(t){return t.onBefore({},Fr,{priority:-1e4})}(this),t.redirectTo=function(t){return t.onStart({to:function(t){return!!t.redirectTo}},Er)}(this),t.onExit=function(t){return t.onExit({exiting:function(t){return!!t.onExit}},Pr)}(this),t.onRetain=function(t){return t.onRetain({retained:function(t){return!!t.onRetain}},Tr)}(this),t.onEnter=function(t){return t.onEnter({entering:function(t){return!!t.onEnter}},kr)}(this),t.eagerResolve=function(t){return t.onStart({},Or,{priority:1e3})}(this),t.lazyResolve=function(t){return t.onEnter({entering:y(!0)},xr,{priority:1e3})}(this),t.resolveAll=function(t){return t.onFinish({},jr,{priority:1e3})}(this),t.loadViews=function(t){return t.onFinish({},Vr)}(this),t.activateViews=function(t){return t.onSuccess({},Ir)}(this),t.updateGlobals=function(t){return t.onCreate({},Hr)}(this),t.updateUrl=function(t){return t.onSuccess({},Ar,{priority:9999})}(this),t.lazyLoad=function(t){return t.onBefore({entering:function(t){return!!t.lazyLoad}},Dr)}(this)},e}(),Br=function(){function e(r){this.router=r,this.invalidCallbacks=[],this._defaultErrorHandler=function(t){t instanceof Error&&t.stack?(console.error(t),console.error(t.stack)):t instanceof qt?(console.error(t.toString()),t.detail&&t.detail.stack&&console.error(t.detail.stack)):console.error(t)};r=Object.keys(e.prototype).filter(l(K(["current","$current","params","transition"])));J(y(e.prototype),this,y(this),r)}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.router.globals.transition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"params",{get:function(){return this.router.globals.params},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this.router.globals.current},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$current",{get:function(){return this.router.globals.$current},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.defaultErrorHandler(W),this.invalidCallbacks=[]},e.prototype._handleInvalidTargetState=function(t,e){function o(){return i.transitionHistory.peekTail()}function c(e){if(e instanceof $e){e=e;return(e=r.target(e.identifier(),e.params(),e.options())).valid()?o()!==a?qt.superseded().toPromise():r.transitionTo(e.identifier(),e.params(),e.options()):qt.invalid(e.error()).toPromise()}}var r=this,n=be.makeTargetState(this.router.stateRegistry,t),i=this.router.globals,a=o(),u=new At(this.invalidCallbacks.slice()),s=new Oe(t).injector();return function t(){var r=u.dequeue();return void 0===r?qt.invalid(e.error()).toPromise():D.$q.when(r(e,n,s)).then(c).then(function(e){return e||t()})}()},e.prototype.onInvalid=function(t){return this.invalidCallbacks.push(t),function(){Z(this.invalidCallbacks)(t)}.bind(this)},e.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:!R(t)||t,inherit:!1,notify:!1})},e.prototype.go=function(t,e,n){n=nt(n,{relative:this.$current,inherit:!0},Lr);return this.transitionTo(t,e,n)},e.prototype.target=function(t,e,r){if(void 0===r&&(r={}),O(r.reload)&&!r.reload.name)throw new Error("Invalid reload state object");var n=this.router.stateRegistry;if(r.reloadState=!0===r.reload?n.root():n.matcher.find(r.reload,r.relative),r.reload&&!r.reloadState)throw new Error("No such reload state '"+(k(r.reload)?r.reload:r.reload.name)+"'");return new $e(this.router.stateRegistry,t,e,r)},e.prototype.getCurrentPath=function(){var e=this.router.globals.successfulTransitions.peekTail();return e?e.treeChanges().to:[new Se(this.router.stateRegistry.root())]},e.prototype.transitionTo=function(h,l,n){var i=this;void 0===l&&(l={}),void 0===n&&(n={});var o=this.router,a=o.globals;n=nt(n,Lr);function u(){return a.transition}n=B(n,{current:u});h=this.target(h,l,n),l=this.getCurrentPath();if(!h.exists())return this._handleInvalidTargetState(l,h);if(!h.valid())return It(h.error());if(!1===n.supercede&&u())return qt.ignored("Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.").toPromise();var f=function(e){return function(r){if(r instanceof qt){var n=o.globals.lastStartedTransitionId<=e.$id;if(r.type===t.RejectType.IGNORED)return n&&o.urlRouter.update(),D.$q.when(a.current);var s=r.detail;if(r.type===t.RejectType.SUPERSEDED&&r.redirected&&s instanceof $e){s=e.redirect(s);return s.run().catch(f(s))}if(r.type===t.RejectType.ABORTED)return n&&o.urlRouter.update(),D.$q.reject(r)}return i.defaultErrorHandler()(r),D.$q.reject(r)}},l=this.router.transitionService.create(l,h),h=l.run().catch(f(l));return Vt(h),B(h,{transition:l})},e.prototype.is=function(t,e,i){i=nt(i,{relative:this.$current});i=this.router.stateRegistry.matcher.find(t,i.relative);if(R(i)){if(this.$current!==i)return!1;if(!e)return!0;i=i.parameters({inherit:!0,matchingKeys:e});return ye.equals(i,ye.values(i,e),this.params)}},e.prototype.includes=function(a,e,o){o=nt(o,{relative:this.$current});var n=k(a)&&Ht.fromString(a);if(n){if(!n.matches(this.$current.name))return!1;a=this.$current.name}a=this.router.stateRegistry.matcher.find(a,o.relative),o=this.$current.includes;if(R(a)){if(!R(o[a.name]))return!1;if(!e)return!0;a=a.parameters({inherit:!0,matchingKeys:e});return ye.equals(a,ye.values(a,e),this.params)}},e.prototype.href=function(i,e,r){r=nt(r,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),e=e||{};i=this.router.stateRegistry.matcher.find(i,r.relative);if(!R(i))return null;r.inherit&&(e=this.params.$inherit(e,this.$current,i));i=i&&r.lossy?i.navigable:i;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,e,{absolute:r.absolute}):null},e.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},e.prototype.get=function(t,e){var r=this.router.stateRegistry;return 0===arguments.length?r.get():r.get(t,e||this.$current)},e.prototype.lazyLoad=function(i,e){var r=this.get(i);if(!r||!r.lazyLoad)throw new Error("Can not lazy load "+i);var n=this.getCurrentPath(),i=be.makeTargetState(this.router.stateRegistry,n);return qr(e=e||this.router.transitionService.create(n,i),r)},e}(),Gr={when:function(t){return new Promise(function(e,r){return e(t)})},reject:function(t){return new Promise(function(e,r){r(t)})},defer:function(){var t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),t},all:function(t){if(x(t))return Promise.all(t);if(O(t)){var e=Object.keys(t).map(function(e){return t[e].then(function(t){return{key:e,val:t}})});return Gr.all(e).then(function(t){return t.reduce(function(t,e){return t[e.key]=e.val,t},{})})}}},zr={},Wr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Jr=/([^\s,]+)/g,Qr={get:function(t){return zr[t]},has:function(t){return null!=Qr.get(t)},invoke:function(t,e,a){var n=B({},zr,a||{}),i=Qr.annotate(t),a=$t(function(t){return n.hasOwnProperty(t)},function(t){return"DI can't find injectable: '"+t+"'"}),a=i.filter(a).map(function(t){return n[t]});return(P(t)?t:t.slice(-1)[0]).apply(e,a)},annotate:function(e){if(!I(e))throw new Error("Not an injectable function: "+e);if(e&&e.$inject)return e.$inject;if(x(e))return e.slice(0,-1);e=e.toString().replace(Wr,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(Jr)||[]}};function Zr(t){var o=function(t){return t||""},i=Kt(t).map(o),n=i[0],i=i[1],o=Yt(n).map(o);return{path:o[0],search:o[1],hash:i,url:t}}function Xr(i){var e=i.path(),r=i.search(),n=i.hash(),i=Object.keys(r).map(function(t){var e=r[t];return(x(e)?e:[e]).map(function(e){return t+"="+e})}).reduce(mt,[]).join("&");return e+(i?"?"+i:"")+(n?"#"+n:"")}function tn(t,e,r,n){return function(i){var o=i.locationService=new r(i),a=i.locationConfig=new n(i,e);return{name:t,service:o,configuration:a,dispose:function(t){t.dispose(o),t.dispose(a)}}}}var en,rn=function(){function t(t,e){var r=this;this.fireAfterUpdate=e,this._listeners=[],this._listener=function(t){return r._listeners.forEach(function(e){return e(t)})},this.hash=function(){return Zr(r._get()).hash},this.path=function(){return Zr(r._get()).path},this.search=function(){return Yr(Zr(r._get()).search)},this._location=N.location,this._history=N.history}return t.prototype.url=function(t,e){return void 0===e&&(e=!0),R(t)&&t!==this._get()&&(this._set(null,null,t,e),this.fireAfterUpdate&&this._listeners.forEach(function(e){return e({url:t})})),Xr(this)},t.prototype.onChange=function(t){var e=this;return this._listeners.push(t),function(){return Z(e._listeners,t)}},t.prototype.dispose=function(t){rt(this._listeners)},t}(),nn=(en=function(t,e){return(en=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}en(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),on=function(t){function e(r){r=t.call(this,r,!1)||this;return N.addEventListener("hashchange",r._listener,!1),r}return nn(e,t),e.prototype._get=function(){return Xt(this._location.hash)},e.prototype._set=function(t,e,r,n){this._location.hash=r},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),N.removeEventListener("hashchange",this._listener)},e}(rn),an=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),un=function(t){function e(e){return t.call(this,e,!0)||this}return an(e,t),e.prototype._get=function(){return this._url},e.prototype._set=function(t,e,r,n){this._url=r},e}(rn),sn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cn=function(t){function e(e){var r=t.call(this,e,!0)||this;return r._config=e.urlService.config,N.addEventListener("popstate",r._listener,!1),r}return sn(e,t),e.prototype._getBasePrefix=function(){return Qt(this._config.baseHref())},e.prototype._get=function(){var a=this._location,e=a.pathname,r=a.hash,n=a.search,n=Yt(n)[1],r=Kt(r)[1],i=this._getBasePrefix(),o=e===this._config.baseHref(),a=e.substr(0,i.length)===i;return(e=o?"/":a?e.substring(i.length):e)+(n?"?"+n:"")+(r?"#"+r:"")},e.prototype._set=function(t,e,a,n){var i=this._getBasePrefix(),o=a&&"/"!==a[0]?"/":"",a=""===a||"/"===a?this._config.baseHref():i+o+a;n?this._history.replaceState(t,e,a):this._history.pushState(t,e,a)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),N.removeEventListener("popstate",this._listener)},e}(rn),fn=function(){var t=this;this.dispose=W,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return t._port},this.protocol=function(){return t._protocol},this.host=function(){return t._host},this.baseHref=function(){return t._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(e){return R(e)?t._hashPrefix=e:t._hashPrefix}},ln=function(){function t(t,e){void 0===e&&(e=!1),this._isHtml5=e,this._baseHref=void 0,this._hashPrefix=""}return t.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},t.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},t.prototype.host=function(){return location.hostname},t.prototype.html5Mode=function(){return this._isHtml5},t.prototype.hashPrefix=function(t){return R(t)?this._hashPrefix=t:this._hashPrefix},t.prototype.baseHref=function(t){return R(t)&&(this._baseHref=t),b(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},t.prototype.getBaseHref=function(){var t=document.getElementsByTagName("base")[0];return t&&t.href?t.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):!this._isHtml5&&location.pathname||"/"},t.prototype.dispose=function(){},t}();function hn(t){return D.$injector=Qr,{name:"vanilla.services",$q:D.$q=Gr,$injector:Qr,dispose:function(){return null}}}var pn=tn("vanilla.hashBangLocation",!1,on,ln),vn=tn("vanilla.pushStateLocation",!0,cn,ln),dn=tn("vanilla.memoryLocation",!1,un,fn),mn=function(){function t(){}return t.prototype.dispose=function(t){},t}(),gn=Object.freeze({__proto__:null,root:N,fromJson:F,toJson:L,forEach:M,extend:B,equals:G,identity:z,noop:W,createProxyFunctions:J,inherit:Q,inArray:K,_inArray:Y,removeFrom:Z,_removeFrom:X,pushTo:tt,_pushTo:et,deregAll:rt,defaults:nt,mergeR:it,ancestors:ot,pick:at,omit:ut,pluck:st,filter:ct,find:ft,mapObj:lt,map:ht,values:pt,allTrueR:vt,anyTrueR:dt,unnestR:mt,flattenR:gt,pushR:yt,uniqR:wt,unnest:_t,flatten:St,assertPredicate:$t,assertMap:bt,assertFn:Rt,pairs:Et,arrayTuples:Ct,applyPairs:Pt,tail:Tt,copy:kt,_extend:Ot,silenceUncaughtInPromise:Vt,silentRejection:It,makeStub:A,services:D,Glob:Ht,curry:o,compose:a,pipe:u,prop:s,propEq:c,parse:f,not:l,and:h,or:p,all:v,any:d,is:m,eq:g,val:y,invoke:w,pattern:_,isUndefined:b,isDefined:R,isNull:E,isNullOrUndefined:C,isFunction:P,isNumber:T,isString:k,isObject:O,isArray:x,isDate:j,isRegExp:V,isInjectable:I,isPromise:H,Queue:At,maxLength:Nt,padString:Ut,kebobString:Ft,functionToString:Lt,fnToString:Mt,stringify:zt,beforeAfterSubstr:Wt,hostRegex:Jt,stripLastPathElement:Qt,splitHash:Kt,splitQuery:Yt,splitEqual:Zt,trimHashVal:Xt,splitOnDelim:te,joinNeighborsR:ee,get Category(){return t.Category},Trace:fe,trace:le,get DefType(){return t.DefType},Param:ye,ParamTypes:we,StateParams:_e,ParamType:he,PathNode:Se,PathUtils:be,resolvePolicies:Re,defaultResolvePolicy:Ee,Resolvable:Ce,NATIVE_INJECTOR_TOKEN:"Native Injector",ResolveContext:Oe,resolvablesBuilder:Ne,StateBuilder:Le,StateObject:Me,StateMatcher:Be,StateQueueManager:Ge,StateRegistry:ze,StateService:Br,TargetState:$e,get TransitionHookPhase(){return t.TransitionHookPhase},get TransitionHookScope(){return t.TransitionHookScope},HookBuilder:Ze,matchState:Qe,RegisteredHook:Ke,makeEvent:Ye,get RejectType(){return t.RejectType},Rejection:qt,Transition:tr,TransitionHook:Je,TransitionEventType:Nr,defaultTransOpts:Lr,TransitionService:Mr,UrlRules:dr,UrlConfig:mr,UrlMatcher:ir,ParamFactory:ar,UrlMatcherFactory:ur,UrlRouter:lr,UrlRuleFactory:sr,BaseUrlRule:cr,UrlService:gr,ViewService:hr,UIRouterGlobals:pr,UIRouter:Sr,$q:Gr,$injector:Qr,BaseLocationServices:rn,HashLocationService:on,MemoryLocationService:un,PushStateLocationService:cn,MemoryLocationConfig:fn,BrowserLocationConfig:ln,keyValsToObjectR:Kr,getParams:Yr,parseUrl:Zr,buildUrl:Xr,locationPluginFactory:tn,servicesPlugin:hn,hashLocationPlugin:pn,pushStateLocationPlugin:vn,memoryLocationPlugin:dn,UIRouterPluginBase:mn});function yn(){var t=null;return function(e,r){return t=t||D.$injector.get("$templateFactory"),[new $n(e,r,t)]}}var wn=function(t,e){return t.reduce(function(t,r){return t||R(e[r])},!1)};function _n(t){if(!t.parent)return{};var e=["component","bindings","componentProvider"],r=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),o=e.concat(r);if(R(t.views)&&wn(o,t))throw new Error("State '"+t.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+o.filter(function(e){return R(t[e])}).join(", "));var i={},o=t.views||{$default:at(t,o)};return M(o,function(n,o){if(o=o||"$default",k(n)&&(n={component:n}),n=B({},n),wn(e,n)&&wn(r,n))throw new Error("Cannot combine: "+e.join("|")+" with: "+r.join("|")+" in stateview: '"+o+"@"+t.name+"'");n.resolveAs=n.resolveAs||"$resolve",n.$type="ng1",n.$context=t,n.$name=o;var a=hr.normalizeUIViewTarget(n.$context,n.$name);n.$uiViewName=a.uiViewName,n.$uiViewContextAnchor=a.uiViewContextAnchor,i[o]=n}),i}function Pn(t){return function(e){var r=e[t],n="onExit"===t?"from":"to";return r?function(o,e){var i=new Oe(o.treeChanges(n)).subContext(e.$$state()),o=B(Bn(i),{$state$:e,$transition$:o});return D.$injector.invoke(r,this,o)}:void 0}}var Sn=0,$n=function(){function t(t,e,r){var n=this;this.path=t,this.viewDecl=e,this.factory=r,this.$id=Sn++,this.loaded=!1,this.getTemplate=function(t,e){return n.component?n.factory.makeComponentTemplate(t,e,n.component,n.viewDecl.bindings):n.template}}return t.prototype.load=function(){var t=this,e=D.$q,i=new Oe(this.path),n=this.path.reduce(function(t,e){return B(t,e.paramValues)},{}),i={template:e.when(this.factory.fromConfig(this.viewDecl,n,i)),controller:e.when(this.getController(i))};return e.all(i).then(function(e){return le.traceViewServiceEvent("Loaded",t),t.controller=e.controller,B(t,e.template),t})},t.prototype.getController=function(t){var n=this.viewDecl.controllerProvider;if(!I(n))return this.viewDecl.controller;var r=D.$injector.annotate(n),n=x(n)?Tt(n):n;return new Ce("",n,r).get(t)},t}(),bn=function(){function t(){var t=this;this._useHttp=n.version.minor<3,this.$get=["$http","$templateCache","$injector",function(e,r,n){return t.$templateRequest=n.has&&n.has("$templateRequest")&&n.get("$templateRequest"),t.$http=e,t.$templateCache=r,t}]}return t.prototype.useHttpService=function(t){this._useHttp=t},t.prototype.fromConfig=function(t,e,r){function n(t){return D.$q.when(t).then(function(t){return{template:t}})}function i(t){return D.$q.when(t).then(function(t){return{component:t}})}return R(t.template)?n(this.fromString(t.template,e)):R(t.templateUrl)?n(this.fromUrl(t.templateUrl,e)):R(t.templateProvider)?n(this.fromProvider(t.templateProvider,e,r)):R(t.component)?i(t.component):R(t.componentProvider)?i(this.fromComponentProvider(t.componentProvider,e,r)):n("<ui-view></ui-view>")},t.prototype.fromString=function(t,e){return P(t)?t(e):t},t.prototype.fromUrl=function(t,e){return P(t)&&(t=t(e)),null==t?null:this._useHttp?this.$http.get(t,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(t){return t.data}):this.$templateRequest(t)},t.prototype.fromProvider=function(i,e,r){var n=D.$injector.annotate(i),i=x(i)?Tt(i):i;return new Ce("",i,n).get(r)},t.prototype.fromComponentProvider=function(i,e,r){var n=D.$injector.annotate(i),i=x(i)?Tt(i):i;return new Ce("",i,n).get(r)},t.prototype.makeComponentTemplate=function(t,e,s,i){i=i||{};function a(e){return e=Ft(e),/^(x|data)-/.exec(e)?"x-"+e:e}var o=3<=n.version.minor?"::":"",u=function(t){var e=D.$injector.get(t+"Directive");if(!e||!e.length)throw new Error("Unable to find component named '"+t+"'");return e.map(Rn).reduce(mt,[])}(s).map(function(c){var h=c.name,l=c.type,s=a(h);if(t.attr(s)&&!i[h])return s+"='"+t.attr(s)+"'";c=i[h]||h;if("@"===l)return s+"='{{"+o+"$resolve."+c+"}}'";if("&"!==l)return s+"='"+o+"$resolve."+c+"'";h=e.getResolvable(c),l=h&&h.data,h=l&&D.$injector.annotate(l)||[];return s+"='$resolve."+c+(x(l)?"["+(l.length-1)+"]":"")+"("+h.join(",")+")'"}).join(" "),s=a(s);return"<"+s+" "+u+"></"+s+">"},t}(),Rn=function(t){return O(t.bindToController)?En(t.bindToController):En(t.scope)},En=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@&])[?]?(.*)/.exec(t[e])]}).filter(function(t){return R(t)&&x(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},Cn=function(){function t(e,r){this.stateRegistry=e,this.stateService=r,J(y(t.prototype),this,y(this))}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return O(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){return this.stateService.onInvalid(t)},t}(),Tn=function(){function t(e){this._urlListeners=[],this.$locationProvider=e;e=y(e);J(e,this,e,["hashPrefix"])}return t.monkeyPatchPathParameterType=function(e){e=e.urlMatcherFactory.type("path");e.encode=function(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t},e.decode=function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t}},t.prototype.dispose=function(){},t.prototype.onChange=function(t){var e=this;return this._urlListeners.push(t),function(){return Z(e._urlListeners)(t)}},t.prototype.html5Mode=function(){var t=this.$locationProvider.html5Mode();return(t=O(t)?t.enabled:t)&&this.$sniffer.history},t.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},t.prototype.url=function(t,e,r){return void 0===e&&(e=!1),R(t)&&this.$location.url(t),e&&this.$location.replace(),r&&this.$location.state(r),this.$location.url()},t.prototype._runtimeServices=function(t,a,r,n,i){var o=this;this.$location=a,this.$sniffer=r,this.$browser=n,this.$window=i,t.$on("$locationChangeSuccess",function(t){return o._urlListeners.forEach(function(e){return e(t)})});a=y(a);J(a,this,a,["replace","path","search","hash"]),J(a,this,a,["port","protocol","host"])},t}(),kn=function(){function t(t){this.router=t}return t.injectableHandler=function(t,e){return function(r){return D.$injector.invoke(e,null,{$match:r,$stateParams:t.globals.params})}},t.prototype.$get=function(){var t=this.router.urlService;return this.router.urlRouter.update(!0),t.interceptDeferred||t.listen(),this.router.urlRouter},t.prototype.rule=function(t){var e=this;if(!P(t))throw new Error("'rule' must be a function");var r=new cr(function(){return t(D.$injector,e.router.locationService)},z);return this.router.urlService.rules.rule(r),this},t.prototype.otherwise=function(t){var e=this,r=this.router.urlService.rules;if(k(t))r.otherwise(t);else{if(!P(t))throw new Error("'rule' must be a string or function");r.otherwise(function(){return t(D.$injector,e.router.locationService)})}return this},t.prototype.when=function(e,r){return(x(r)||P(r))&&(r=t.injectableHandler(this.router,r)),this.router.urlService.rules.when(e,r),this},t.prototype.deferIntercept=function(t){this.router.urlService.deferIntercept(t)},t}();n.module("ui.router.angular1",[]);var Ln=n.module("ui.router.init",["ng"]),xn=n.module("ui.router.util",["ui.router.init"]),Mn=n.module("ui.router.router",["ui.router.util"]),Un=n.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),In=n.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),Hn=(n.module("ui.router.compat",["ui.router"]),null);function An(t){(Hn=this.router=new Sr).stateProvider=new Cn(Hn.stateRegistry,Hn.stateService),Hn.stateRegistry.decorator("views",_n),Hn.stateRegistry.decorator("onExit",Pn("onExit")),Hn.stateRegistry.decorator("onRetain",Pn("onRetain")),Hn.stateRegistry.decorator("onEnter",Pn("onEnter")),Hn.viewService._pluginapi._viewConfigFactory("ng1",yn()),Hn.urlService.config._decodeParams=!1;var e=Hn.locationService=Hn.locationConfig=new Tn(t);function r(t,r,n,i,o,a,u){return e._runtimeServices(o,t,i,r,n),delete Hn.router,delete Hn.$get,Hn}return Tn.monkeyPatchPathParameterType(Hn),((Hn.router=Hn).$get=r).$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],Hn}An.$inject=["$locationProvider"];var Dn=function(t){return["$uiRouterProvider",function(e){var r=e.router[t];return r.$get=function(){return r},r}]};function qn(t,e,r){if(D.$injector=t,D.$q=e,!Object.prototype.hasOwnProperty.call(t,"strictDi"))try{t.invoke(function(t){})}catch(e){t.strictDi=!!/strict mode/.exec(e&&e.toString())}r.stateRegistry.get().map(function(t){return t.$$state().resolvables}).reduce(mt,[]).filter(function(t){return"deferred"===t.deps}).forEach(function(e){return e.deps=t.annotate(e.resolveFn,t.strictDi)})}function Nn(t){t.$watch(function(){le.approximateDigests++})}qn.$inject=["$injector","$q","$uiRouter"],Nn.$inject=["$rootScope"],Ln.provider("$uiRouter",An),Mn.provider("$urlRouter",["$uiRouterProvider",function(t){return t.urlRouterProvider=new kn(t)}]),xn.provider("$urlService",Dn("urlService")),xn.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return Hn.urlMatcherFactory}]),xn.provider("$templateFactory",function(){return new bn}),Un.provider("$stateRegistry",Dn("stateRegistry")),Un.provider("$uiRouterGlobals",Dn("globals")),Un.provider("$transitions",Dn("transitionService")),Un.provider("$state",["$uiRouterProvider",function(){return B(Hn.stateProvider,{$get:function(){return Hn.stateService}})}]),Un.factory("$stateParams",["$uiRouter",function(t){return t.globals.params}]),In.factory("$view",function(){return Hn.viewService}),In.service("$trace",function(){return le}),In.run(Nn),xn.run(["$urlMatcherFactory",function(t){}]),Un.run(["$state",function(t){}]),Mn.run(["$urlRouter",function(t){}]),Ln.run(qn);var Bn=function(t){return t.getTokens().filter(k).map(function(e){var r=t.getResolvable(e);return[e,"NOWAIT"===t.getPolicy(r).async?r.promise:r.data]}).reduce(Pt,{})};function Gn(t){var r=t.match(/^\s*({[^}]*})\s*$/);r&&(t="("+r[1]+")");r=t.replace(/\n/g," ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);if(!r||4!==r.length)throw new Error("Invalid state ref '"+t+"'");return{state:r[1]||null,paramExpr:r[3]||null}}function zn(r){r=r.parent().inheritedData("$uiView"),r=f("$cfg.path")(r);return r?Tt(r).state.name:void 0}function Wn(o,i,r){var n=r.uiState||o.current.name,i=B(function(t,e){return{relative:zn(t)||e.$current,inherit:!0,source:"sref"}}(i,o),r.uiStateOpts||{}),o=o.href(n,r.uiStateParams,i);return{uiState:n,uiStateParams:r.uiStateParams,uiStateOpts:i,href:o}}function Jn(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),r="FORM"===t[0].nodeName;return{attr:r?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!r}}function Qn(t,e,r,n,i){return function(o){var s,c,a=o.which||o.button,u=i();1<a||o.ctrlKey||o.metaKey||o.shiftKey||o.altKey||t.attr("target")||(s=r(function(){t.attr("disabled")||e.go(u.uiState,u.uiStateParams,u.uiStateOpts)}),o.preventDefault(),c=n.isAnchor&&!u.href?1:0,o.preventDefault=function(){c--<=0&&r.cancel(s)})}}function Kn(t,e,r,n){var i;n&&(i=n.events),x(i)||(i=["click"]);for(var o=t.on?"on":"bind",a=0,u=i;a<u.length;a++){var s=u[a];t[o](s,r)}e.$on("$destroy",function(){for(var e=t.off?"off":"unbind",n=0,o=i;n<o.length;n++){var a=o[n];t[e](a,r)}})}function Yn(t){var e=function(e,r,n){return t.is(e,r,n)};return e.$stateful=!0,e}function Zn(t){var e=function(e,r,n){return t.includes(e,r,n)};return e.$stateful=!0,e}function Xn(t,e,r,i,o){var a=f("viewDecl.controllerAs"),u=f("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(i){var s=i.html();return i.empty(),function(i,c){var m=c.data("$uiView");if(!m)return c.html(s),void t(c.contents())(i);var l=m.$cfg||{viewDecl:{},getTemplate:W},g=l.path&&new Oe(l.path);c.html(l.getTemplate(c,g)||s),le.traceUIViewFill(m.$uiView,c.html());var w,_,S,p=t(c.contents()),v=l.controller,d=a(l),m=u(l),g=g&&Bn(g);i[m]=g,v&&(w=e(v,B({},g,{$scope:i,$element:c})),d&&(i[d]=w,i[d][m]=g),c.data("$ngControllerController",w),c.children().data("$ngControllerController",w),ri(o,r,w,i,l)),k(l.component)&&(w=Ft(l.component),_=new RegExp("^(x-|data-)?"+w+"$","i"),S=i.$watch(function(){var t=[].slice.call(c[0].children).filter(function(t){return t&&t.tagName&&_.exec(t.tagName)});return t&&n.element(t).data("$"+l.component+"Controller")},function(t){t&&(ri(o,r,t,i,l),S())})),p(i)}}}}Un=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,v){function l(){return Wn(r,i,f)}var u=Jn(i),s=v[1]||v[0],c=null,f={},v=Gn(o.uiSref);function p(){var t=l();c&&c(),s&&(c=s.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(u.attr,t.href)}f.uiState=v.state,f.uiStateOpts=o.uiSrefOpts?n.$eval(o.uiSrefOpts):{},v.paramExpr&&(n.$watch(v.paramExpr,function(t){f.uiStateParams=B({},t),p()},!0),f.uiStateParams=B({},n.$eval(v.paramExpr))),p(),n.$on("$destroy",t.stateRegistry.onStatesChanged(p)),n.$on("$destroy",t.transitionService.onSuccess({},p)),u.clickable&&(v=Qn(i,r,e,u,l),Kn(i,n,v,f.uiStateOpts))}}}],Mn=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,u){function h(){return Wn(r,i,l)}var s=Jn(i),c=u[1]||u[0],f=null,l={},u=["uiState","uiStateParams","uiStateOpts"],v=u.reduce(function(t,e){return t[e]=W,t},{});function d(){var t=h();f&&f(),c&&(f=c.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(s.attr,t.href)}u.forEach(function(t){l[t]=o[t]?n.$eval(o[t]):null,o.$observe(t,function(e){v[t](),v[t]=n.$watch(e,function(e){l[t]=e,d()},!0)})}),d(),n.$on("$destroy",t.stateRegistry.onStatesChanged(d)),n.$on("$destroy",t.transitionService.onSuccess({},d)),s.clickable&&(u=Qn(i,r,e,s,h),Kn(i,n,u,l.uiStateOpts))}}}],Ln=["$state","$stateParams","$interpolate","$uiRouter",function(t,e,r,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(e,i,o){var u,s,c,f,l=[],a=r(o.uiSrefActiveEq||"",!1)(e);try{u=e.$eval(o.uiSrefActive)}catch(t){}function h(t){t.promise.then(m,W)}function v(t){O(t)&&(l=[],M(t,function(t,r){var n=function(n,r){n=Gn(n);d(n.state,e.$eval(n.paramExpr),r)};k(t)?n(t,r):x(t)&&M(t,function(t){n(t,r)})}))}function d(e,r,n){var o={state:t.get(e,zn(i))||{name:e},params:r,activeClass:n};return l.push(o),function(){Z(l)(o)}}function m(){function r(t){return t.split(/\s/).filter(z)}var s=function(t){return t.map(function(t){return t.activeClass}).map(r).reduce(mt,[])},o=s(l).concat(r(a)).reduce(wt,[]),u=s(l.filter(function(e){return t.includes(e.state.name,e.params)})),s=l.filter(function(e){return t.is(e.state.name,e.params)}).length?r(a):[],c=u.concat(s).reduce(wt,[]),f=o.filter(function(t){return!K(c,t)});e.$evalAsync(function(){c.forEach(function(t){return i.addClass(t)}),f.forEach(function(t){return i.removeClass(t)})})}v(u=u||r(o.uiSrefActive||"",!1)(e)),this.$$addStateInfo=function(t,r){if(!(O(u)&&0<l.length)){r=d(t,r,u);return m(),r}},e.$on("$destroy",(s=n.stateRegistry.onStatesChanged(function(){v(u)}),c=n.transitionService.onStart({},h),f=e.$on("$stateChangeSuccess",m),function(){s(),c(),f()})),n.globals.transition&&h(n.globals.transition),m()}]}}],n.module("ui.router.state").directive("uiSref",Un).directive("uiSrefActive",Ln).directive("uiSrefActiveEq",Ln).directive("uiState",Mn),Yn.$inject=["$state"],Zn.$inject=["$state"],n.module("ui.router.state").filter("isState",Yn).filter("includedByState",Zn),Mn=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,r,i,o){var a={$cfg:{viewDecl:{$context:t._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(s,c,l){return function(s,c,h){var p,v,d,m,g=h.onload||"",y=h.autoscroll,w_enter=function(t,r,i){2<n.version.minor?e.enter(t,null,r).then(i):e.enter(t,null,r,i)},w_leave=function(t,r){2<n.version.minor?e.leave(t).then(r):e.leave(t,r)},_=c.inheritedData("$uiView")||a,S=i(h.uiView||h.name||"")(s)||"$default",$={$type:"ng1",id:u.count++,name:S,fqn:_.$uiView.fqn?_.$uiView.fqn+"."+S:S,config:null,configUpdated:function(t){(!t||t instanceof $n)&&m!==t&&(le.traceUIViewConfigUpdated($,t&&t.viewDecl&&t.viewDecl.$context),E(m=t))},get creationContext(){var t=f("$cfg.viewDecl.$context")(_),e=f("$uiView.creationContext")(_);return t||e}};le.traceUIViewEvent("Linking",$),c.data("$uiView",{$uiView:$}),E();var b=t.registerUIView($);function E(t){var e=s.$new(),n=o.defer(),i=o.defer(),a={$cfg:t,$uiView:$},u={$animEnter:n.promise,$animLeave:i.promise,$$animLeave:i};e.$emit("$viewContentLoading",S),v=l(e,function(t){t.data("$uiViewAnim",u),t.data("$uiView",a),w_enter(t,c,function(){n.resolve(),d&&d.$emit("$viewContentAnimationEnded"),(R(y)&&!y||s.$eval(y))&&r(t)}),function(){var t;p&&(le.traceUIViewEvent("Removing (previous) el",p.data("$uiView")),p.remove(),p=null),d&&(le.traceUIViewEvent("Destroying scope",$),d.$destroy(),d=null),v&&(t=v.data("$uiViewAnim"),le.traceUIViewEvent("Animate out",t),w_leave(v,function(){t.$$animLeave.resolve(),p=null}),p=v,v=null)}()}),(d=e).$emit("$viewContentLoaded",t||m),d.$eval(g)}s.$on("$destroy",function(){le.traceUIViewEvent("Destroying/Unregistering",$),b()})}}};return u}],Xn.$inject=["$compile","$controller","$transitions","$view","$q"];var ti="function"==typeof n.module("ui.router").component,ei=0;function ri(t,e,r,n,f){!P(r.$onInit)||(f.viewDecl.component||f.viewDecl.componentProvider)&&ti||r.$onInit();var u,s,c,o=Tt(f.path).state.self,a={bind:r};P(r.uiOnParamsChanged)&&(u=new Oe(f.path).getResolvable("$transition$").data,n.$on("$destroy",e.onSuccess({},function(t){var e,n,i,s,f,l;t!==u&&-1===t.exiting().indexOf(o)&&(e=t.params("to"),n=t.params("from"),i=function(t){return t.paramSchema},l=t.treeChanges("to").map(i).reduce(mt,[]),s=t.treeChanges("from").map(i).reduce(mt,[]),(l=l.filter(function(t){var r=s.indexOf(t);return-1===r||!s[r].type.equals(e[t.id],n[t.id])})).length&&(f=l.map(function(t){return t.id}),l=ct(e,function(t,e){return-1!==f.indexOf(e)}),r.uiOnParamsChanged(l,t)))},a))),P(r.uiCanExit)&&(s=ei++,c=function(t){return!!t&&(t._uiCanExitIds&&!0===t._uiCanExitIds[s]||c(t.redirectedFrom()))},f={exiting:o.name},n.$on("$destroy",e.onBefore(f,function(e){var n,i=e._uiCanExitIds=e._uiCanExitIds||{};return c(e)||(n=t.when(r.uiCanExit(e))).then(function(t){return i[s]=!1!==t}),n},a)))}n.module("ui.router.state").directive("uiView",Mn),n.module("ui.router.state").directive("uiView",Xn),n.module("ui.router.state").provider("$uiViewScroll",function(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,r){return t?e:function(t){return r(function(){t[0].scrollIntoView()},0,!1)}}]}),t.$injector=Qr,t.$q=Gr,t.BaseLocationServices=rn,t.BaseUrlRule=cr,t.BrowserLocationConfig=ln,t.Glob=Ht,t.HashLocationService=on,t.HookBuilder=Ze,t.MemoryLocationConfig=fn,t.MemoryLocationService=un,t.NATIVE_INJECTOR_TOKEN="Native Injector",t.Ng1ViewConfig=$n,t.Param=ye,t.ParamFactory=ar,t.ParamType=he,t.ParamTypes=we,t.PathNode=Se,t.PathUtils=be,t.PushStateLocationService=cn,t.Queue=At,t.RegisteredHook=Ke,t.Rejection=qt,t.Resolvable=Ce,t.ResolveContext=Oe,t.StateBuilder=Le,t.StateMatcher=Be,t.StateObject=Me,t.StateParams=_e,t.StateProvider=Cn,t.StateQueueManager=Ge,t.StateRegistry=ze,t.StateService=Br,t.TargetState=$e,t.Trace=fe,t.Transition=tr,t.TransitionEventType=Nr,t.TransitionHook=Je,t.TransitionService=Mr,t.UIRouter=Sr,t.UIRouterGlobals=pr,t.UIRouterPluginBase=mn,t.UrlConfig=mr,t.UrlMatcher=ir,t.UrlMatcherFactory=ur,t.UrlRouter=lr,t.UrlRouterProvider=kn,t.UrlRuleFactory=sr,t.UrlRules=dr,t.UrlService=gr,t.ViewService=hr,t._extend=Ot,t._inArray=Y,t._pushTo=et,t._removeFrom=X,t.all=v,t.allTrueR=vt,t.ancestors=ot,t.and=h,t.any=d,t.anyTrueR=dt,t.applyPairs=Pt,t.arrayTuples=Ct,t.assertFn=Rt,t.assertMap=bt,t.assertPredicate=$t,t.beforeAfterSubstr=Wt,t.buildUrl=Xr,t.compose=a,t.copy=kt,t.core=gn,t.createProxyFunctions=J,t.curry=o,t.default="ui.router",t.defaultResolvePolicy=Ee,t.defaultTransOpts=Lr,t.defaults=nt,t.deregAll=rt,t.eq=g,t.equals=G,t.extend=B,t.filter=ct,t.find=ft,t.flatten=St,t.flattenR=gt,t.fnToString=Mt,t.forEach=M,t.fromJson=F,t.functionToString=Lt,t.getLocals=Bn,t.getNg1ViewConfigFactory=yn,t.getParams=Yr,t.hashLocationPlugin=pn,t.hostRegex=Jt,t.identity=z,t.inArray=K,t.inherit=Q,t.invoke=w,t.is=m,t.isArray=x,t.isDate=j,t.isDefined=R,t.isFunction=P,t.isInjectable=I,t.isNull=E,t.isNullOrUndefined=C,t.isNumber=T,t.isObject=O,t.isPromise=H,t.isRegExp=V,t.isString=k,t.isUndefined=b,t.joinNeighborsR=ee,t.kebobString=Ft,t.keyValsToObjectR=Kr,t.locationPluginFactory=tn,t.makeEvent=Ye,t.makeStub=A,t.map=ht,t.mapObj=lt,t.matchState=Qe,t.maxLength=Nt,t.memoryLocationPlugin=dn,t.mergeR=it,t.ng1ViewsBuilder=_n,t.noop=W,t.not=l,t.omit=ut,t.or=p,t.padString=Ut,t.pairs=Et,t.parse=f,t.parseUrl=Zr,t.pattern=_,t.pick=at,t.pipe=u,t.pluck=st,t.prop=s,t.propEq=c,t.pushR=yt,t.pushStateLocationPlugin=vn,t.pushTo=tt,t.removeFrom=Z,t.resolvablesBuilder=Ne,t.resolvePolicies=Re,t.root=N,t.services=D,t.servicesPlugin=hn,t.silenceUncaughtInPromise=Vt,t.silentRejection=It,t.splitEqual=Zt,t.splitHash=Kt,t.splitOnDelim=te,t.splitQuery=Yt,t.stringify=zt,t.stripLastPathElement=Qt,t.tail=Tt,t.toJson=L,t.trace=le,t.trimHashVal=Xt,t.uniqR=wt,t.unnest=_t,t.unnestR=mt,t.val=y,t.values=pt,t.watchDigests=Nn,Object.defineProperty(t,"__esModule",{value:!0})});var app=angular.module("app",["ngRoute","ui.router","ngSanitize"]);app.run(function($rootScope,$location,$stateParams){$rootScope.dark=!1,$rootScope.page=null,$rootScope.page_id=null,$rootScope.page_key=null,$rootScope.loaded=!1,$rootScope.user=null,$rootScope.logged_in=!1,$rootScope.groups=null,$rootScope.groups=null,$rootScope.lists=null,$rootScope.list=null,$rootScope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply()},$rootScope.init=function(){consoleLog("app::init()")},$rootScope.load=function(){post_silent("user/get",{},0,function(user){consoleLog(user),$rootScope.logged_in=!!user,$rootScope.user=user,$rootScope.loadSettings(),!$rootScope.logged_in&&$rootScope.page_key&&"list"==$rootScope.page?$rootScope.guest_access=!0:$rootScope.logged_in?$rootScope.page&&"login"!=$rootScope.page||$rootScope.redirect("lists"):$rootScope.redirect("login"),$rootScope.loaded=!0,$rootScope.applyScope(),$rootScope.logged_in&&$rootScope.setGTagUserID()})},$rootScope.loadSettings=function(){$rootScope.logged_in&&$rootScope.user.settings&&($rootScope.dark=$rootScope.user.settings.dark,$rootScope.settings=$rootScope.user.settings)},$rootScope.enabledNotifs=function(){return!0},$rootScope.setGTagUserID=function(){gtag("set",{user_id:$rootScope.user.id})},$rootScope.toggleLight=function(){$rootScope.dark=!$rootScope.dark,post_silent("settings/light",{state:$rootScope.dark?"off":"on"})},$rootScope.loadList=function(){consoleLog("loadList()"),$rootScope.list.sublists||($rootScope.list=$rootScope.list_data[$rootScope.list.id],$rootScope.applyScope())},$rootScope.levelUp=function(n,post){$rootScope.user.level<n&&($rootScope.user.level=n,post&&post_silent("user/level-up",{level:n}))},$rootScope.setState=function(page,id,key){consoleLog("setState(): "+page+" / "+id),$rootScope.page=page||!1,$rootScope.page_id=id,$rootScope.page_key=key,$rootScope.loaded||$rootScope.load(),setPage()},$rootScope.findByID=function(arr,id){for(var i in arr)if(arr[i].id==id)return arr[i]},$rootScope.isPage=function(p){return p==$rootScope.page},$rootScope.initFocus=function(){isDesktop()&&setTimeout(function(){$("INPUT.autofocus").focus()},100)},$rootScope.messages_active=!1,$rootScope.messages=null,$rootScope.message_n=null,$rootScope.loadMessage=function(messages){$rootScope.messages_active=!0,$rootScope.messages=messages,$rootScope.message_n=-1,$rootScope.prev_onhashchange=window.onhashchange||null,window.onhashchange=function(){var n;"#message"!=window.location.hash.substring(0,"#message".length)?($rootScope.closeMessage(),$rootScope.applyScope()):(n=window.location.hash.substring("#message-".length))==$rootScope.message_n&&$rootScope.messages_active||($rootScope.selectMessage(n),$rootScope.applyScope())},$rootScope.nextMessage()},$rootScope.selectMessage=function(n){n<$rootScope.messages.length?($rootScope.messages_active=!0,$rootScope.message_n=n):location.hash=""},$rootScope.nextMessage=function(){$rootScope.message_n==$rootScope.messages.length-1?location.hash="":($rootScope.message_n++,location.hash="message-"+$rootScope.message_n)},$rootScope.closeMessage=function(){$rootScope.messages_active=!1,$rootScope.prev_onhashchange&&(window.onhashchange=$rootScope.prev_onhashchange)},$rootScope.welcomeMessage=function(){localData("viewed-intro")?$rootScope.loadMessage([["Hey, it’s Hak again, the designer & developer of Priority List ✌️","I see you've already checked out the introduction, so let's dive straight into it!"]]):$rootScope.loadMessage([["Hi, my name’s Hak, the designer & developer of Priority List ✌️","This entire 'Priority List' concept and the algorithms behind it is something I've been using for 10+ years.","However, it's NOT an everyday to-do list app..."],["Priority List combines the power of Eisenhower & Priority Matrix principles into beautifully simple task lists, automatically ordered in terms of priority.","If used correctly, high-stress projects will be a thing of the past."],["Let's dive in..."]]),$rootScope.levelUp(1,!0),$rootScope.applyScope()},$rootScope.mini_notif={},$rootScope.mini_notif.timeout={},$rootScope.mini_notif=function(message){$rootScope.mini_notif.active=!0,$rootScope.mini_notif.message=message,$rootScope.applyScope(),clearTimeout($rootScope.mini_notif.timeout),$rootScope.mini_notif.timeout=setTimeout(function(){$rootScope.mini_notif.active=!1,$rootScope.applyScope()},2e3)},$rootScope.goto=function(url){consoleLog("goto(): "+url),$location.url("/"+url)},$rootScope.redirect=function(url){consoleLog("redirect(): "+url),$location.replace(),$location.url("/"+url)},$rootScope.gotoHome=function(){consoleLog("gotoHome()"),$rootScope.goto("lists")},$rootScope.gotoList=function(id){consoleLog("gotoList(): "+id),$rootScope.goto("list/"+id)},$rootScope.gotoMenu=function(){consoleLog("gotoMenu()"),$rootScope.goto("menu")},$rootScope.gotoSettings=function(){consoleLog("gotoSettings()"),$rootScope.goto("settings")},$rootScope.gotoNotifications=function(){consoleLog("gotoNotifications()"),$rootScope.enabledNotifs()?$rootScope.goto("notifications"):$rootScope.goto("coming-soon")},$rootScope.gotoRoot=function(url){consoleLog("gotoRoot()"),window.location=url},$rootScope.goBack=function(){history.back()},$rootScope.goBackHash=function(){window.location.hash&&history.back()},$rootScope.twoDecimals=function(val){return(val=parseFloat(val)).toFixed(2)},$rootScope.nltobr=function(str){return nltobr(str)},$rootScope.setPage=function(){setPage()},$rootScope.isDesktop=function(){return isDesktop()},$rootScope.isMobile=function(){return isMobile()},$rootScope.init()});var enter_last_processed=0;function enter_key_not_processed(){var now=Date.now(),processed=now-enter_last_processed<1e3;return processed||(enter_last_processed=now),!processed}app.directive("onEnter",function(){return function(scope,element,attrs){element.bind("keydown keypress keyup",function(e){var key=e.which||e.keyCode||0;if(13!==key||e.shiftKey){if(isMobile()&&229==key&&"blurItemInput()"==attrs.onEnter&&$("textarea:focus")){var text=$("textarea:focus").val();if(containsItem(["\n","\r","\r\n"],text[text.length-1])&&enter_key_not_processed()){for(;containsItem(["\n","\r","\r\n"],text[text.length-1]);)text=text.substring(0,text.length-1);$("textarea:focus").val(text),scope.$eval(attrs.onEnter)}}}else e.preventDefault(),enter_key_not_processed()&&scope.$apply(function(){scope.$eval(attrs.onEnter)})})}}),app.directive("elastic",["$timeout",function($timeout){return{restrict:"A",link:function($scope,element){$scope.initialHeight=$scope.initialHeight||element[0].style.height;function resize(){element[0].style.height=$scope.initialHeight,element[0].style.height=element[0].scrollHeight+"px"}element.on("input change",resize),$timeout(resize,0)}}}]);var rightclick_event_fired=0,rightclick_event_target=null;function rightClickEventFired(target){rightclick_event_target=target,rightclick_event_fired=(new Date).getTime()}function hasRightClickEventFired(target){return rightclick_event_target==target&&rightclick_event_fired+510>(new Date).getTime()}var rightclick_touch_start=0,rightclick_touch_target=null,rightclick_touch_end=0,rightclick_touch_fired=0,secureFunction;function rightClickTouchStart(target){rightclick_touch_target=target,rightclick_touch_start=(new Date).getTime(),rightclick_touch_fired=rightclick_touch_end=0}function hasRightClickTouchCompleted(target){return rightclick_touch_target==target&&rightclick_touch_start+500<(new Date).getTime()}function rightClickTouchFired(){rightclick_touch_fired=(new Date).getTime()}function hasRightClickTouchFired(target){return rightclick_touch_target==target&&!!rightclick_touch_fired}function dragObject(e){consoleLog("dragObject()");var elem=e.target,scope=pullScope(elem),is_item=!!elem.getAttribute("data-item-id");scope.logged_in?is_item?scope.dragItem(elem.getAttribute("data-item-id")):scope.dragSublist(elem.getAttribute("data-sublist-id")):(e.preventDefault(),e.stopPropagation())}function endDragObject(scope){scope.preventDefault(),consoleLog("endDragObject()");scope=pullScope(scope.target);scope&&scope.endDragObject()}function allowObjectDrop(scope){scope.preventDefault(),consoleLog("allowObjectDrop()");var column=scope.target,scope=pullScope(column),column=$(column).parents(".column");scope.allowObjectDrop(column.attr("data-sublist-id"))}function resetObjectDrop(e){e.preventDefault(),consoleLog("resetObjectDrop()"),pullScope(e.target).resetObjectDrop()}function dropObject(scope){consoleLog("dropObject()");var column=scope.target,scope=pullScope(column),column=$(column).parents(".column");scope.dropObject(column.attr("data-sublist-id"))}function dateToStr(n){var y=n.toDateString().split(" "),d=y[0],m=y[1],n=y[2],y=y[3];return(y==(new Date).getFullYear()?[d,n,m]:[d,n,m,y]).join(" ")}function setPage(){initTooltips(),setTimeout(function(){},100)}function pullScope(id){return angular.element($(id)).scope()}function applyScope(id){pullScope(id).$apply()}function runAngular(id,query){var scope=pullScope(id);scope.$apply(function(){eval(query)})}function formatPerc(val){return val.toFixed(1)+"%"}function formatNumbersWithCommas(x){return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function pad(n,width){return(n+="").length>=width?n:new Array(width-n.length+1).join("0")+n}function nth(d){if(3<d&&d<21)return"th";switch(d%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}function capitalize(str){return str.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()})}function nltobr(str){return str=(str=(str=(str=str.replace(/</g,"<")).replace(/>r/g,">")).replace(/\r/g,"")).replace(/\n/g,"<br>")}function days_between(differenceMs,date2){differenceMs=date2-differenceMs;return Math.ceil(differenceMs/864e5)}function containsStr(a,b){return-1!==a.indexOf(b)}function containsItem(arr,item){return-1!==arr.indexOf(item)}function moveItem(arr,from,to){return arr.splice(arr.indexOf(to),0,arr.splice(arr.indexOf(from),1)[0]),arr}function removeItem(arr,item){return containsItem(arr,item)?arr.splice(arr.indexOf(item),1):console.error("removeItem(): Item Not Found In Array"),arr}function insertSpace(str,index){return str.length<=index||" "==str[index]?str:str.substr(0,index)+" "+str.substr(index)}function replaceItemByID(arr,old,replacement){for(i=0;i<arr.length;i++)if(arr[i].ID==old.ID)return arr[i]=replacement,arr}function objectSize(obj){return Object.keys(obj).length}function emptyObject(obj){return 0==Object.keys(obj).length}function objectToArray(obj){return Object.values(obj)}function optionalArg(arg,def){return void 0===arg?def:arg}function isset(arg){return void 0!==arg}function avgNums(arr){if(0==arr.length)return 0;var i,sum=0;for(i in arr)sum+=parseFloat(arr[i]);return sum/arr.length}function clone(src){return consoleLog("Cloning:"),consoleLog(src),JSON.parse(JSON.stringify(src))}function setInputFilter(textbox,inputFilter,preFilter){["input","keydown","keyup","mousedown","mouseup","select","contextmenu","drop"].forEach(function(event){textbox.addEventListener(event,function(){var s,e;(preFilter=optionalArg(preFilter,function(v){return v}))(this.value)!=this.value&&(e=preFilter(this.value).length-this.value.length,s=this.selectionStart+e,e=this.selectionEnd+e,this.value=preFilter(this.value),this.setSelectionRange(s,e)),inputFilter(this.value)?(this.oldValue=this.value,this.oldSelectionStart=this.selectionStart,this.oldSelectionEnd=this.selectionEnd):this.hasOwnProperty("oldValue")?(this.value=this.oldValue,this.setSelectionRange(this.oldSelectionStart,this.oldSelectionEnd)):this.value=""})})}function goto(URL){consoleLog("Loading URL: "+URL),window.location.href=URL}function goto_blank(URL){consoleLog("Opening URL: "+URL),window.open(URL,"_blank")}function getHost(){return window.location.protocol+"//"+window.location.host}function isDesktop(){return!isMobile()}function isMobile(){return $(window).outerWidth()<1100||$("body").hasClass("mobile-device")}function initPopups(){initPopupButtons(),$(".secure-click").click(function(){submitSecureFunc()}),initFeedbackPopup(),initPopupLinks(),initTooltips()}function initPopupButtons(){$(".popup .close").unbind("click"),$(".popup .close").click(function(){closePopup($(this).parents(".popup"))}),$(".popup .btn--close").unbind("click"),$(".popup .btn--close").click(function(){closePopup($(this).parents(".popup"))})}function initPopupLinks(){$(".notify-me").unbind(),$(".notify-me").click(function(){return closePopups(),subscribe_popup(),$(".subscribe-name").focus(),!1}),$(".show-faq").unbind(),$(".show-faq").click(function(){return closePopups(),showPopup("faq."+$(this).attr("data-faq")),!1})}function showPopup(c,blur){blur=optionalArg(blur,!0),$(".popup."+c).hasClass("show")||($(".popup."+c).stop().fadeIn(300),$(".popup."+c).addClass("show"),blur&&addPopupBlur(),initPopupButtons(),initPopupLinks(),"undefined"!=typeof initMobilePopup&&initMobilePopup())}function closePopup(p){p.removeClass("show"),p.stop().fadeOut(200),removePopupBlur()}function closePopups(){$(".popup").removeClass("show"),$(".popup").stop().fadeOut(200),removePopupBlur();var video=document.getElementById("video-iframe");video&&(video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),ga("send","event","Video","pause"))}function addPopupBlur(){$("body").addClass("popup-open")}function removePopupBlur(){0==$(".popup.show:not(.no-blur)").length&&($("body").removeClass("popup-open").addClass("popup-close"),setTimeout(function(){$("body").removeClass("popup-close")},250))}function alert_popup(title,msg,func){$(".popup.message .title").html(title),$(".popup.message .text").html(msg),showPopup("message"),$(".popup.message .close").unbind(),$(".popup.message .close").click(function(){closePopup($(".popup.message")),func&&func()})}function error_popup(msg,func){$(".popup.error .text").html(msg),showPopup("error"),$(".popup.error .close").unbind(),$(".popup.error .close").click(function(){closePopup($(".popup.error")),func&&func()})}function confirm_popup(msg,func){$(".popup.confirm .text").html(msg),initConfirm(func),showPopup("confirm")}function confirm_popup_secured(msg,func){$(".popup.confirm .text").html(msg),initConfirm(func,!0),showPopup("confirm")}function feedback_popup(){showPopup("feedback")}function subscribe_popup(){showPopup("subscribe")}function loading_popup(blur){blur=optionalArg(blur,!0),$(".popup.loader").removeClass("complete"),showPopup("loader",blur)}function loaded_popup(){$(".popup.loader").addClass("complete")}function loader_close(){closePopup($(".popup.loader"))}function initFeedbackPopup(){$(".feedback-btn").click(function(){return feedback_popup(),$(".feedback-msg").focus(),!1}),$(".feedback.popup .submit.btn").click(function(){submitFeedback()})}function submitFeedback(){if(""==$(".feedback.popup TEXTAREA.message").val())return error_popup("Please enter a message"),!1;post("contact/send",{Name:"<?php echo userData('FirstName'); ?>",Email:"<?php echo userData('Email'); ?>",Message:"(Feedback) "+$(".feedback.popup TEXTAREA.feedback-msg").val()},function(d){closePopups(),$(".feedback.popup TEXTAREA.feedback-msg").val(""),alert_popup("Thank You","Thanks for getting in touch, we'll get on it right away.")})}function initConfirm(func,secure){$(".confirm-yes").unbind(),$(".confirm-yes").click(function(){closePopups(),secure?secureClick(func):func()})}function secureClick(secureFunc){secureFunction=secureFunc,showPopup("secure"),$(".secure-pass").focus()}function submitSecureFunc(){""!=$("INPUT.secure-pass").val()?(closePopups(),secureFunction($("INPUT.secure-pass").val()),$("INPUT.secure-pass").val("")):$(".secure-pass").focus()}function getTimezone(y,m,ZONE){ZONE=new Date(parseInt(y),parseInt(m)-1,parseInt(ZONE)).getTimezoneOffset();return(ZONE<0?"+":"-")+pad(parseInt(Math.abs(ZONE/60)),2)+pad(Math.abs(ZONE%60),2)}app.directive("ngLeftClick",function(){return function(scope,element,attrs){element.bind("click",function(e){consoleLog("click"),consoleLog(rightclick_touch_fired),hasRightClickTouchFired(element[0])||scope.$apply(function(){scope.$eval(attrs.ngLeftClick)})})}}),app.directive("ngRightClick",function(){return function(scope,element,attrs){element.bind("contextmenu",function(e){consoleLog("contextmenu"),e.preventDefault(),hasRightClickTouchCompleted(element[0])||(rightClickEventFired(element[0]),scope.$apply(function(){scope.$eval(attrs.ngRightClick)}))}),element.bind(isMobile()?"touchstart":"mousedown",function(e){consoleLog(isMobile()?"touchstart":"mousedown"),rightClickTouchStart(element[0]),function loop(){hasRightClickTouchCompleted(element[0])?hasRightClickEventFired(element[0])||(rightClickTouchFired(),scope.$apply(function(){scope.$eval(attrs.ngRightClick)})):rightclick_touch_end||setTimeout(loop,1)}()}),element.bind(isMobile()?"touchend touchcancel touchmove":"mouseup mousemove",function(e){consoleLog(isMobile()?"touchend":"mouseup"),rightclick_touch_end=(new Date).getTime()})}}),app.controller("account",function($scope,$rootScope,$stateParams){$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){$scope.account=clone($rootScope.user)},$scope.save=function(){var account=$scope.account,user=$rootScope.user;account.firstname!=user.firstname||account.lastname!=user.lastname||account.username!=user.username?post("user/update",{firstname:account.firstname,lastname:account.lastname,username:account.username},function(data){$rootScope.user=data,closePopups(),$rootScope.goBack(),$rootScope.applyScope()}):$rootScope.goBack()},$scope.init()}),app.controller("faqs",function($scope,$rootScope,$stateParams){$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("faqs::init()"),$rootScope.faqs||post_silent("faqs/pull",{},0,function(data){$rootScope.faqs=data,$scope.applyScope()})},$scope.showing=null,$scope.show=function(id){$scope.showing=$scope.showing!=id?id:null},$scope.init()}),app.controller("list",function($scope,$rootScope,$stateParams){$scope.loaded_data=!1,$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("list::init()"),$scope.load(),window.onhashchange=function(){"#subtasks"!=window.location.hash&&"#item-editor"!=window.location.hash&&$scope.closeSubitems(),"#item-editor"!=window.location.hash&&"#sublist-editor"!=window.location.hash&&$scope.closeItem(),"#sublist-editor"!=window.location.hash&&"#reorder-sublist"!=window.location.hash&&$scope.closeSublist(),"#reorder-sublist"!=window.location.hash&&$scope.closeSublistReorder(),"#share-manager"!=window.location.hash&&$scope.closeShare(),"#notes"!=window.location.hash&&$scope.closeNotes()}},$scope.load=function(){consoleLog("list::load()"),$rootScope.page_id?$scope.loadList():setTimeout(function(){$scope.load()},10)},$scope.loadList=function(){post_silent("list/pull",{id:$rootScope.page_id,key:$rootScope.page_key},0,function(data){$rootScope.list=data,$scope.completeLoad()},!0)},$scope.completeLoad=function(){$scope.loaded_data=!0,$scope.applyScope(),$scope.liveList(),consoleLog("list->loaded")},$scope.list_reload=null,$scope.liveList=function(){consoleLog("list->liveList()"),clearTimeout($scope.list_reload);var interval=$scope.topUrgentScore();interval?(consoleLog("list->liveList: Active"),$scope.list_reload=setTimeout(function(){$(".view.list").length&&$scope.loadList()},60*interval*1e3)):consoleLog("list->liveList: NOT Active")},$scope.topUrgentScore=function(){var i,quickest=0;for(i in $rootScope.list.sublists)for(var j in $rootScope.list.sublists[i].items){var item=$rootScope.list.sublists[i].items[j],mins=$scope.tMinutes(item.score_t);item.deadline&&2!=item.state&&(!quickest||mins<quickest)&&(quickest=item.score_u?mins:60)}return quickest},$scope.toggleFocus=function(){$rootScope.list.focus=!$rootScope.list.focus,$scope.show_more=[],$scope.show_ticked=[],$rootScope.list.focus?post_silent("list/focus",{id:$rootScope.list.id}):post_silent("list/unfocus",{id:$rootScope.list.id}),$rootScope.mini_notif("Focus Mode: <b>"+($rootScope.list.focus?"On":"Off")+"</b>")},$scope.show_more=[],$scope.showMore=function(sublist){containsItem($scope.show_more,sublist.id)?removeItem($scope.show_more,sublist.id):$scope.show_more.push(sublist.id)},$scope.showingMore=function(sublist){return containsItem($scope.show_more,sublist.id)},$scope.show_ticked=[],$scope.showTicked=function(sublist){containsItem($scope.show_ticked,sublist.id)?removeItem($scope.show_ticked,sublist.id):$scope.show_ticked.push(sublist.id)},$scope.showingTicked=function(sublist){return containsItem($scope.show_ticked,sublist.id)},$scope.getItems=function(items){if($rootScope.list.focus){_items=[];for(i in items)3==items[i].state&&_items.push(items[i]);for(i in items)1==items[i].state&&_items.push(items[i])}else{var i,_items=[];for(i in items)2!=items[i].state&&_items.push(items[i]);for(i in items)items[i].ticked_now&&2==items[i].state&&_items.push(items[i]);for(i in items)items[i].ticked_now||2!=items[i].state||_items.push(items[i])}return $scope.processItemDependencies(_items)},$scope.processItemDependencies=function(items){var _items=[];for(i in items)delete items[i].is_dependent,delete items[i].first_dependent,delete items[i].last_dependent,delete items[i].has_dependents,delete items[i].dependents;for(i in items){if(2!=items[i].state){var j,dependents=[];for(j in items)2==items[j].state||items[j].dependency_id!=items[i].id||items[j].has_dependents&&containsItem(items[j].dependents,items[i])||(items[j].is_dependent=!0,dependents.push(items[j]));dependents.length&&(dependents[0].first_dependent=!0,dependents[dependents.length-1].last_dependent=!0,items[i].has_dependents=!0,items[i].dependents=dependents)}_items.push(items[i])}var i,__items=[];for(i in _items)_items[i].is_dependent||(__items.push(_items[i]),_items[i].has_dependents&&(__items=__items.concat($scope.recurseDependencies(_items[i].id,_items[i].dependents))));return __items},$scope.recurseDependencies=function(parent_id,items){var i,_items=[];for(i in items)items[i].id!=parent_id&&(_items.push(items[i]),items[i].has_dependents&&(_items=_items.concat($scope.recurseDependencies(parent_id,items[i].dependents))));return _items},$scope.getAllDependents=function(items,item_id){return $scope.getAllDependents_recurse(items,item_id,!1)},$scope.getAllDependents_recurse=function(items,item_id,parent_id){var i,_items=[];for(i in items)2==items[i].state||items[i].dependency_id!=item_id||parent_id&&items[i].id==parent_id||(_items.push(items[i]),_items=_items.concat($scope.getAllDependents_recurse(items,items[i].id,parent_id||item_id)));return _items},$scope.tickedNow=function(sublist){var i,items=sublist.items,n=0;for(i in items)items[i].ticked_now&&2==items[i].state&&n++;return n},$scope.selected_item=null,$scope.selected_sublist_id=null,$scope.addItem=function(){$scope.openItem({id:0,sublist_id:$scope.defaultSublist(),name:"",score_i:5,score_t:5,critical:0})},$scope.addItemToSublist=function(sublist,e){e&&e.stopPropagation(),$scope.selected_sublist_id=sublist.id,$scope.addItem(),$scope.selected_sublist_id=null},$scope.openItem=function(item,sublist){sublist&&(item.sublist_id=sublist.id),location.hash="item-editor",$scope.selected_item=clone(item),$scope.updateTValue(),$scope.updateIValue(),$scope.selected_item.has_dependency=!!item.dependency_id},$scope.closeItem=function(){$scope.selected_item=null,closePopups()},$scope.toggleUrgency=function(){$scope.selected_item.deadline?delete $scope.selected_item.deadline:$scope.selected_item.deadline={}},$scope.selectTime=function(time){$scope.selected_item.deadline.time=time},$scope.sublistLabel=function(){if($scope.selected_item.sublist_id)for(var i in $rootScope.list.sublists)if($rootScope.list.sublists[i].id==$scope.selected_item.sublist_id)return""==$rootScope.list.sublists[i].name?"General":$rootScope.list.sublists[i].name;return"Select Sublist"},$scope.selectSublist=function(id){$scope.selected_sublist_id=id,$scope.selected_item.sublist_id=id},$scope.defaultSublist=function(){if($scope.selected_sublist_id)return $scope.selected_sublist_id;if(1==$rootScope.list.sublists.length)return $rootScope.list.sublists[0].id;if(isMobile()){var open_sublists=0;for(i in $rootScope.list.sublists)$rootScope.list.sublists[i].show&&open_sublists++;if(1==open_sublists)for(var i in $rootScope.list.sublists)if($rootScope.list.sublists[i].show)return $rootScope.list.sublists[i].id}return 0},$scope.dependencyLabel=function(){if($scope.selected_item.dependency_id){var dependency=$scope.getItemFromSublist($scope.selected_item.dependency_id,$scope.getSublist($scope.selected_item.sublist_id));if(dependency)return dependency.name}return"This task is dependent on..."},$scope.selectDependency=function(id){$scope.selected_item.dependency_id=id},$scope.toggleDependency=function(){$scope.selected_item.has_dependency=!$scope.selected_item.has_dependency},$scope.toggleSublist=function(s){s.show=!s.show,s.show?post_silent("sublist/show",{id:s.id}):post_silent("sublist/hide",{id:s.id}),containsItem($scope.show_more,s.id)&&removeItem($scope.show_more,s.id),containsItem($scope.show_ticked,s.id)&&removeItem($scope.show_ticked,s.id)},$scope.saveItem=function(){var item=$scope.selected_item;item.id?post("item/update",{id:item.id,sublist_id:item.sublist_id,name:item.name,score_i:item.score_i,score_t:item.score_t,d_date:item.deadline&&item.deadline.date?item.deadline.date:null,d_time:item.deadline&&item.deadline.time?item.deadline.time:null,d_zone:$scope.getTimezone(item),dependency_id:item.has_dependency&&item.dependency_id?item.dependency_id:null,subitem:$rootScope.selected_subitems?1:0},function(data){$rootScope.selected_subitems?$scope.subitems().updateSublist(data):($rootScope.list=data,$scope.liveList()),$scope.goBackHash(),$scope.closeItem(),$scope.applyScope()},!1):post("item/add",{sublist_id:item.sublist_id,name:item.name,score_i:item.score_i,score_t:item.score_t,d_date:item.deadline&&item.deadline.date?item.deadline.date:null,d_time:item.deadline&&item.deadline.time?item.deadline.time:null,d_zone:$scope.getTimezone(item),dependency_id:item.has_dependency&&item.dependency_id?item.dependency_id:null},function(data){$rootScope.selected_subitems?($rootScope.selected_subitems.total++,$scope.subitems().updateSublist(data)):($rootScope.levelUp(3),$scope.updateSublist(data),$scope.liveList(),$rootScope.list.total++),$scope.goBackHash(),$scope.closeItem(),$scope.applyScope()},!1)},$scope.moveItem=function(item,sublist){post_silent("item/move",{id:item.id,sublist_id:sublist.id},0,function(data){$scope.updateSublist(data),$scope.liveList(),$scope.applyScope()})},$scope.updateSublist=function(sublist){for(var i in $rootScope.list.sublists)$rootScope.list.sublists[i].id==sublist.id&&($rootScope.list.sublists[i]=sublist)},$scope.tick=function(sublist,item){2!=item.state?(item.ticked_now=!0,item.state=2,sublist.ticked++,$rootScope.selected_subitems?$rootScope.selected_subitems.ticked++:$rootScope.list.ticked++,item.score_u&&8<item.score_u&&(sublist.urgent--,$rootScope.selected_subitems||$rootScope.list.urgent--),post_silent("item/tick",{id:item.id},0,function(){(item.dependency_id||$rootScope.selected_subitems)&&$scope.loadList()})):(item.state=1,sublist.ticked--,$rootScope.selected_subitems?$rootScope.selected_subitems.ticked--:$rootScope.list.ticked--,item.score_u&&8<item.score_u&&(sublist.urgent||(sublist.urgent=0),sublist.urgent++,$rootScope.selected_subitems||$rootScope.list.urgent++),post_silent("item/untick",{id:item.id},0,function(){(item.dependency_id||$rootScope.selected_subitems)&&$scope.loadList()})),$scope.liveList()},$scope.mark=function(sublist,item){item.anim_updated=!0,setTimeout(function(){item.anim_updated=!1},600),2==item.state&&(sublist.ticked--,$rootScope.selected_subitems?$rootScope.selected_subitems.ticked--:$rootScope.list.ticked--,item.score_u&&8<item.score_u&&(sublist.urgent||(sublist.urgent=0),sublist.urgent++,$rootScope.selected_subitems||$rootScope.list.urgent++)),3!=item.state?(item.state=3,post_silent("item/mark",{id:item.id})):(item.state=1,post_silent("item/unmark",{id:item.id})),$scope.liveList()},$scope.isItemInputFocus=function(){return isMobile()&&!!$(".item textarea:focus").length},$scope.blurItemInput=function(){$("textarea:focus").blur()},$scope.checkItemName=function(sublist,item){""==item.name?$scope.deleteItem(sublist,item):$scope.updateItemName(item)},$scope.updateItemName=function(item){item.prev_name!=item.name&&post_silent("item/update-name",{id:item.id,name:item.name})},$scope.deleteItem=function(sublist,item){post_silent("item/delete",{id:(item=$scope.getItemFromSublist(item.id,sublist)).id},0,function(){(item.dependency_id||$rootScope.selected_subitems)&&$scope.loadList()}),removeItem(sublist.items,item),sublist.total--,$rootScope.selected_subitems?$rootScope.selected_subitems.total--:$rootScope.list.total--,2==item.state&&(sublist.ticked--,$rootScope.selected_subitems?$rootScope.selected_subitems.ticked--:$rootScope.list.ticked--),item.score_u&&8<item.score_u&&(sublist.urgent--,$rootScope.selected_subitems||$rootScope.list.urgent--),$scope.liveList(),$scope.closeItem()},$scope.deleteItem_confirm=function(item){var sublist=$rootScope.selected_subitems?$scope.subitems().sublist:$scope.getItemSublist(item.id);confirm_popup("You wish to DELETE this task?",function(){$scope.deleteItem(sublist,item),$scope.applyScope()})},$scope.getSublist=function(id){if($rootScope.selected_subitems&&$scope.subitems().sublist.id==id)return $scope.subitems().sublist;for(var i in $rootScope.list.sublists)if($rootScope.list.sublists[i].id==id)return $rootScope.list.sublists[i]},$scope.getItem=function(id){for(var i in $rootScope.list.sublists)for(var j in $rootScope.list.sublists[i].items)if($rootScope.list.sublists[i].items[j].id==id)return $rootScope.list.sublists[i].items[j]},$scope.getItemFromSublist=function(id,sublist){for(var i in sublist.items)if(sublist.items[i].id==id)return sublist.items[i]},$scope.getItemSublist=function(id){for(var i in $rootScope.list.sublists)for(var j in $rootScope.list.sublists[i].items)if($rootScope.list.sublists[i].items[j].id==id)return $rootScope.list.sublists[i]},$scope.getDependencyOptions=function(item_id,sublist_id){var sublists=$rootScope.list.sublists;$rootScope.selected_subitems&&(sublists=[$scope.subitems().sublist]);var i,items=[];for(i in sublists)if(sublists[i].id==sublist_id)for(var j in sublists[i].items)item_id!=sublists[i].items[j].id&&2!=sublists[i].items[j].state&&items.push(sublists[i].items[j]);return items},$rootScope.selected_subitems=!1,$scope.openSubitems=function(item){location.hash="subtasks",$rootScope.selected_subitems=item},$scope.closeSubitems=function(){$rootScope.selected_subitems=!1},$scope.subitems=function(){return pullScope(".subview.subitems")},$scope.reorder_sublist=!1,$scope.reorderSublist=function(){location.hash="reorder-sublist",$scope.reorder_sublist=!0},$scope.closeSublistReorder=function(){var sublist,original;$scope.reorder_sublist&&(sublist=$scope.selected_sublist,original=$scope.getSublist(sublist.id),sublist.name==original.name&&($scope.goBackHash(),$scope.closeSublist())),$scope.reorder_sublist=!1},$scope.reorderItemBefore=function(s){var i,before=!0;for(i in $scope.list.sublists){var curr_id=$scope.list.sublists[i].id;if(curr_id==s.id)return before;before=before&&curr_id!=$scope.selected_sublist.id}return before},$scope.reorderItemAfter=function(s){var i,after=!1;for(i in $scope.list.sublists){var curr_id=$scope.list.sublists[i].id;if(curr_id==s.id)return after;after=after||curr_id==$scope.selected_sublist.id}return after},$scope.processSublistReorder=function(target){var sublist=$scope.getSublist($scope.selected_sublist.id);$scope.moveSublist(sublist,target),$scope.goBackHash(),$scope.closeSublistReorder(),$scope.applyScope()},$scope.selected_sublist=null,$scope.addSublist=function(){$scope.openSublist({id:0,list_id:$rootScope.list.id,name:""})},$scope.openSublist=function(sublist,e){e&&e.stopPropagation(),location.hash="sublist-editor",$scope.selected_sublist=clone(sublist)},$scope.closeSublist=function(){$scope.selected_sublist=null,closePopups()},$scope.saveSublist=function(){var sublist=$scope.selected_sublist;sublist.id?post("sublist/update",{id:sublist.id,name:sublist.name},function(data){$scope.updateList(data),$scope.goBackHash(),$scope.closeSublist(),$scope.applyScope()},!1):post("sublist/add",{list_id:sublist.list_id,name:sublist.name},function(data){$scope.updateList(data),$scope.goBackHash(),$scope.closeSublist(),$scope.applyScope()},!1)},$scope.deleteSublist=function(sublist){confirm_popup("You wish to DELETE the '"+(sublist=$scope.getSublist(sublist.id)).name+"' sublist?",function(){post_silent("sublist/delete",{id:sublist.id}),removeItem($rootScope.list.sublists,sublist),$scope.closeSublist(),$scope.applyScope()})},$scope.updateList=function(list){var new_sublist=$rootScope.list.sublists.length!=list.sublists.length;if($rootScope.list=list,new_sublist){var i,new_sublist_id=0;for(i in list.sublists)list.sublists[i].id>new_sublist_id&&(new_sublist_id=list.sublists[i].id);$scope.selected_item?$scope.selectSublist(new_sublist_id):$scope.selected_sublist_id=new_sublist_id}},$scope.sublistTotalCategory=function(sublist){var i,ticked=sublist.ticked,remaining=sublist.total-sublist.ticked,marked=0,urgent=0;for(i in sublist.items){var item=sublist.items[i];3==item.state&&marked++,2!=item.state&&item.score_u&&8<item.score_u&&urgent++}return urgent?"urgent":marked?"marked":ticked&&0==remaining?"completed":"remaining"},$scope.sublistTotalTime=function(sublist){var c=$scope.sublistTotalCategory(sublist),items=[];if("urgent"==c)for(var i in sublist.items)2!=sublist.items[i].state&&sublist.items[i].score_u&&8<sublist.items[i].score_u&&items.push(sublist.items[i]);if("marked"==c)for(var i in sublist.items)3==sublist.items[i].state&&items.push(sublist.items[i]);if("completed"==c)for(var i in sublist.items)2==sublist.items[i].state&&items.push(sublist.items[i]);if("remaining"==c)for(var i in sublist.items)1==sublist.items[i].state&&items.push(sublist.items[i]);return $scope.totalDuration(items)},$scope.totalDuration=function(items){if(1==items.length)return(parts=$scope.tValue(items[0].score_t).split(" "))[0]+" <i>"+capitalize(parts[1])+"</i>";var m=0;for(i in items)m+=$scope.tMinutes(items[i].score_t);var h=Math.floor(m/60),d=Math.floor(h/24),w=Math.floor(d/7),mt=Math.floor(w/4);m-=60*h,h-=24*d,d-=7*w;var parts,i,ps=[];for(i in parts=[mt,w-=4*mt,d,h,m])parts[i]&&ps.push(parts[i]);var pn=ps.length,worded="";return mt&&(worded+=mt+"<i>"+(1<pn?"M ":" Month"+(1==mt?" ":"s "))+"</i>"),w&&(worded+=w+"<i>"+(1<pn?"W ":" Week"+(1==w?" ":"s "))+"</i>"),d&&(worded+=d+"<i>"+(1<pn?"D ":" Day"+(1==d?" ":"s "))+"</i>"),h&&(worded+=h+"<i>"+(1<pn?"H ":" Hour"+(1==h?" ":"s "))+"</i>"),!mt&&m&&(worded+=m+"<i>"+(1<pn?"M ":" Min"+(1==m?" ":"s "))+"</i>"),worded?worded.trim():0},$scope.updateIValue=function(){$scope.selected_item.score_i_value=$scope.iValues($scope.selected_item.score_i)},$scope.showIValues=function(){return!!$scope.selected_item.id||5!=$scope.selected_item.score_i||$scope.selected_item.edited_i_score},$scope.iValues=function(n){switch(5!=n&&($scope.selected_item.edited_i_score=!0),n){case 0:return"Completely Unnecessary";case 1:return"Potentially Not Needed";case 2:return"Can Wait";case 3:return"Tiny Impact";case 4:return"Low Importance";case 5:return"Neutral";case 6:return"Fairly Important";case 7:return"Must-Do";case 8:return"Really Important";case 9:return"Extremely Important";case 10:return"Critical"}},$scope.updateTValue=function(){$scope.selected_item.score_t_value=$scope.tValues($scope.selected_item.score_t)},$scope.showTValues=function(){return!!$scope.selected_item.id||5!=$scope.selected_item.score_t||$scope.selected_item.edited_t_score},$scope.tValues=function(n){return 5!=n&&($scope.selected_item.edited_t_score=!0),$scope.tValue(n)},$scope.tValue=function(n){switch(n){case 0:return"1+ weeks";case 1:return"4-6 days";case 2:return"2-3 days";case 3:return"1 day";case 4:return"4-6 hours";case 5:return"2-3 hours";case 6:return"1 hour";case 7:return"30 mins";case 8:return"15 mins";case 9:return"5 mins";case 10:return"1 min"}},$scope.tMinutes=function(n){switch(n){case 0:return 10080;case 1:return 8640;case 2:return 2880;case 3:return 1440;case 4:return 360;case 5:return 180;case 6:return 60;case 7:return 30;case 8:return 15;case 9:return 5;case 10:return 1}},$scope.uValue=function(weeks){var months=$scope.getTimezone(weeks),weeks_r=new Date(weeks.deadline.date+"T00:00:00"+months),days=new Date;days.setDate(days.getDate()-1);var months_r=new Date,months=new Date;months.setDate(months.getDate()+1);weeks=!!weeks.deadline.time&&"00:00"!=weeks.deadline.time?" at "+weeks.deadline.time:"";if(date_deadline=dateToStr(weeks_r),date_yesterday=dateToStr(days),date_today=dateToStr(months_r),date_tomorrow=dateToStr(months),date_deadline==date_yesterday)return"Yesterday"+weeks;if(date_deadline==date_today)return"Today"+weeks;if(date_deadline==date_tomorrow)return"Tomorrow"+weeks;days=days_between(months_r,weeks_r),months=days/7/4,weeks=days/7,months_r=0<months?Math.floor(months):Math.ceil(months),weeks_r=0<weeks?Math.floor(weeks):Math.ceil(weeks);return 0<Math.abs(months_r)?$scope.uValueWorded(months_r,"Month",Math.abs(months_r)<Math.abs(months)?"+":""):0<Math.abs(weeks_r)?$scope.uValueWorded(weeks_r,"Week",Math.abs(weeks_r)<Math.abs(weeks)?"+":""):$scope.uValueWorded(days,"Day")},$scope.uValueWorded=function(n,str,offset){return offset=offset||"",(0<=n?"In ":"")+Math.abs(n)+offset+" "+str+(1!=Math.abs(n)?"s":"")+(n<0?" Ago":"")},$scope.deadlineLabel=function(){if($scope.selected_item.deadline&&$scope.selected_item.deadline.date){var tomorrow=$scope.getTimezone($scope.selected_item),date=new Date($scope.selected_item.deadline.date+"T00:00:00"+tomorrow),yesterday=new Date;yesterday.setDate(yesterday.getDate()-1);var today=new Date,tomorrow=new Date;return tomorrow.setDate(tomorrow.getDate()+1),date=dateToStr(date),yesterday=dateToStr(yesterday),today=dateToStr(today),tomorrow=dateToStr(tomorrow),date==yesterday?"Yesterday":date==today?"Today":date==tomorrow?"Tomorrow":date}return"Select Deadline"},$scope.initDatePicker=function(){$(".editor .urgency INPUT").datepicker({showAnim:"",dateFormat:"yy-mm-dd",firstDay:1}),$(".editor .urgency INPUT").focus(function(){$(this).blur()})},$scope.getTimezone=function(d){if(d.deadline&&d.deadline.date){d=d.deadline.date.split("-");return getTimezone(d[0],d[1],d[2])}return null},$scope.show_share=!1,$scope.share=function(){location.hash="share-manager",$scope.show_share=!0},$scope.closeShare=function(){$scope.show_share=!1},$scope.show_notes=!1,$scope.edit_notes=!1,$rootScope.list_notes="",$scope.showNotes=function(){location.hash="notes",$scope.show_notes=!0,$scope.edit_notes=!1,$scope.linkifyNotes()},$scope.linkifyNotes=function(){setTimeout(function(){$(".list-notes .textbox P").linkify({target:"_blank"})},10)},$scope.editNotes=function(){$scope.edit_notes=!0,$rootScope.list_notes=clone($rootScope.list.notes),setTimeout(function(){$(".list-notes TEXTAREA").focus(),$(".list-notes TEXTAREA")[0].setSelectionRange(0,0),$(".list-notes .textbox TEXTAREA").scrollTop(0)},10)},$scope.saveNotes=function(){$rootScope.list.notes!=$rootScope.list_notes&&($rootScope.list.notes=$rootScope.list_notes,post_silent("list/notes",{id:$rootScope.list.id,notes:$rootScope.list.notes})),$scope.cancelNotes()},$scope.cancelNotes=function(){$scope.show_notes&&($scope.edit_notes&&$rootScope.list.notes!=$rootScope.list_notes?confirm_popup("Cancel edits? You'll lose any unsaved changes.",function(){$rootScope.list_notes=$rootScope.list.notes,$scope.edit_notes=!1,$scope.applyScope(),$scope.linkifyNotes(),setTimeout(function(){$(".list-notes .textbox P").scrollTop(0)},10)}):($scope.edit_notes=!1,$scope.linkifyNotes(),setTimeout(function(){$(".list-notes .textbox P").scrollTop(0)},10)))},$scope.closeNotes=function(){$scope.show_notes&&($scope.edit_notes&&$rootScope.list.notes!=$rootScope.list_notes?(location.hash="notes",setTimeout(function(){confirm_popup("Close notes? You'll lose any unsaved changes.",function(){$rootScope.list_notes=$rootScope.list.notes,$scope.show_notes=!1,$scope.goBackHash(),$scope.applyScope()})},10)):$scope.show_notes=!1)},$scope.scrollDrag=!1,$scope.captureScrollDrag=function(){var slider,draggers;isDesktop()&&(slider=document.querySelector(".sublists.multi-column"),draggers=document.querySelectorAll(".sublists.multi-column .scroll-dragger"),$scope.slider_is_down=!1,$scope.slider_start_x,$scope.slider_scroll_left,draggers.forEach(function(dragger){dragger.classList.contains("tracking-scroll")||(dragger.classList.add("tracking-scroll"),dragger.addEventListener("mousedown",function(e){$scope.slider_is_down=!0,$scope.slider_start_x=e.pageX-slider.offsetLeft,$scope.slider_scroll_left=slider.scrollLeft}),dragger.addEventListener("mouseleave",function(){}),dragger.addEventListener("mouseup",function(){$scope.slider_is_down=!1,setTimeout(function(){$scope.scrollDrag=!1},10)}),dragger.addEventListener("mousemove",function(walk){$scope.slider_is_down&&(walk.preventDefault(),walk=walk.pageX-slider.offsetLeft-$scope.slider_start_x,slider.scrollLeft=$scope.slider_scroll_left-walk,$scope.scrollDrag=!0)}))}))},$scope.allowObjectDrop=function(sublist_id){$scope.dragged_item?$scope.allowItemDrop(sublist_id):$scope.allowSublistDrop(sublist_id)},$scope.resetObjectDrop=function(){$scope.dragged_item_target=null,$scope.dragged_sublist_target=null,$scope.applyScope()},$scope.endDragObject=function(){$scope.dragged_item=null,$scope.dragged_item_target=null,$scope.dragged_sublist=null,$scope.dragged_sublist_target=null,clearInterval($scope.dragscroller),$("TEXTAREA:focus").blur(),$scope.applyScope()},$scope.dropObject=function(sublist_id){$scope.dragged_item?$scope.dropItem(sublist_id):$scope.dropSublist(sublist_id)},$scope.dragged_sublist=null,$scope.dragged_sublist_target=null,$scope.dragSublist=function(sublist_id){$scope.setAutoScroll(),$scope.dragged_sublist=$scope.getSublist(sublist_id)},$scope.allowSublistDrop=function(sublist_id){$scope.dragged_sublist_target=sublist_id,$scope.applyScope()},$scope.dropSublist=function(target){var sublist=$scope.dragged_sublist,target=$scope.getSublist(target);console.log(sublist),console.log(target),sublist.id!=target.id&&$scope.moveSublist(sublist,target),$scope.endDragObject()},$scope.moveSublist=function(sublist,target){moveItem($rootScope.list.sublists,sublist,target);var ids=[];for(i in $rootScope.list.sublists)ids.push($rootScope.list.sublists[i].id);post_silent("sublist/reorder",{id:$rootScope.list.id,ids:ids.join(",")})},$scope.dragged_item=null,$scope.dragged_item_target=null,$scope.dragItem=function(item_id){$scope.setAutoScroll(),$scope.dragged_item=$scope.getItem(item_id)},$scope.allowItemDrop=function(sublist_id){$scope.dragged_item_target=sublist_id,$scope.applyScope()},$scope.dropItem=function(new_sublist){var item=$scope.dragged_item,old_sublist=$scope.getItemSublist(item.id),new_sublist=$scope.getSublist(new_sublist);if(console.log(old_sublist),console.log(new_sublist),new_sublist.id!=old_sublist.id){var i,items=[item];for(i in items=items.concat($scope.getAllDependents(old_sublist.items,item.id)))removeItem(old_sublist.items,items[i]),old_sublist.total--,2==items[i].state&&old_sublist.ticked--,items[i].score_u&&8<items[i].score_u&&old_sublist.urgent--;new_sublist.updating=!0,$scope.moveItem(item,new_sublist)}$scope.endDragObject()},$scope.setAutoScroll=function(){var slider=document.querySelector(".sublists.multi-column");slider.classList.contains("tracking-drag")||(slider.classList.add("tracking-drag"),slider.addEventListener("drag",function(x){var walk;($scope.dragged_item||$scope.dragged_sublist)&&(x.preventDefault(),walk=0,(x=x.pageX)<120&&(walk=-1),x>$(slider).outerWidth()-120&&(walk=1),x<60&&(walk=-4),x>$(slider).outerWidth()-60&&(walk=4),0==walk&&clearInterval($scope.dragscroller),walk!=$scope.dragscroll_walk&&($scope.dragscroll_walk=walk,clearInterval($scope.dragscroller),$scope.dragscroller=setInterval(function(){$scope.dragscroll()},5)))}))},$scope.dragscroll_walk=0,$scope.dragscroll=function(){var slider=document.querySelector(".sublists.multi-column");slider.scrollLeft=slider.scrollLeft+$scope.dragscroll_walk,console.log("scrolling")},$scope.init()}),app.controller("lists",function($scope,$rootScope,$stateParams){$scope.loaded_data=!1,$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("lists::init()"),$scope.loadData(),window.onhashchange=function(){"#editor"!=window.location.hash&&$scope.closeList()}},$scope.load_data=[{api:"groups/pull",loaded:!1,v:"groups"},{api:"notifications/count",loaded:!1,v:"notif_counts"}],$scope.loadData=function(){for(var i in $rootScope.groups=null,$rootScope.group=null,$rootScope.lists=null,$scope.load_data)$scope.loadDataPoint(i)},$scope.loadDataPoint=function(i){var post=$scope.load_data[i];post_silent(post.api,{},0,function(data){$rootScope[post.v]=data,$scope.load_data[i].loaded=!0,$scope.completeLoad()})},$scope.completeLoad=function(){for(var i in $scope.load_data)if(!$scope.load_data[i].loaded)return;$scope.parseData(),$scope.loaded_data=!0,$scope.applyScope(),consoleLog("lists->loaded"),$rootScope.user.level<1&&$rootScope.welcomeMessage()},$scope.parseData=function(){$rootScope.list=null,$rootScope.groups.length&&($rootScope.group=$rootScope.groups[0]),$rootScope.group.lists.length&&($rootScope.lists=$rootScope.group.lists)},$scope.selected_list=null,$scope.addList=function(){$scope.openList({id:0,group_id:$rootScope.group.id,name:""})},$scope.openList=function(list,e){e&&e.stopPropagation(),e&&e.preventDefault(),location.hash="editor",$scope.selected_list=clone(list)},$scope.closeList=function(){$scope.selected_list=null,closePopups()},$scope.saveList=function(){var list=$scope.selected_list;list.id?post("list/update",{id:list.id,name:list.name},function(data){$scope.updateList(list),$scope.goBackHash(),$scope.closeList(),$scope.applyScope()},!1):post("list/add",{group_id:list.group_id,name:list.name},function(data){$rootScope.levelUp(2),$scope.updateGroups(data),$scope.goBackHash(),$scope.closeList(),$scope.applyScope()},!1)},$scope.deleteList=function(list){confirm_popup("You wish to DELETE the '"+list.name+"' priority list?",function(){for(var i in post_silent("list/delete",{id:list.id}),$rootScope.group.lists)$rootScope.group.lists[i].id==list.id&&removeItem($rootScope.group.lists,$rootScope.group.lists[i]);0==$rootScope.group.lists&&($rootScope.group.lists=null),$rootScope.lists=$rootScope.group.lists,$scope.closeList(),$scope.applyScope()})},$scope.removeAccess=function(list,e){e&&e.stopPropagation(),e&&e.preventDefault(),confirm_popup("You wish to remove your access to this priority list?",function(){for(var i in post_silent("access/remove",{id:list.id,user_id:$rootScope.user.id}),$rootScope.group.lists)$rootScope.group.lists[i].id==list.id&&removeItem($rootScope.group.lists,$rootScope.group.lists[i]);0==$rootScope.group.lists&&($rootScope.group.lists=null),$rootScope.lists=$rootScope.group.lists,$scope.closeList(),$scope.applyScope()})},$scope.starList=function(list,e){e&&e.stopPropagation(),e&&e.preventDefault(),list.starred?post_silent("list/unstar",{id:list.id}):post_silent("list/star",{id:list.id}),list.starred=!list.starred},$scope.updateList=function(list){for(var i in $rootScope.lists)$rootScope.lists[i].id==list.id&&($rootScope.lists[i]=list)},$scope.updateGroups=function(groups){if($rootScope.groups=groups,$rootScope.group)for(var i in $rootScope.groups)$rootScope.groups[i].id==$rootScope.group.id&&($rootScope.group=$rootScope.groups[i]);else $rootScope.group=$rootScope.groups[0];$rootScope.group.lists.length&&($rootScope.lists=$rootScope.group.lists)},$scope.init()}),app.controller("login",function($scope,$rootScope,$stateParams){$scope.code="",$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("login::init()")},$scope.login=function(){$rootScope.email?post("user/login",{email:$rootScope.email},function(data){data&&data.signup?$rootScope.goto("signup"):$rootScope.goto("verify"),$scope.applyScope()},!1):error_popup("Email Required")},$scope.signup=function(){"signup"==$rootScope.page?$rootScope.name.split(" ").length<2?error_popup("Please Enter Your Full Name"):($rootScope.goto("username"),$scope.applyScope()):"username"==$rootScope.page&&post("user/signup",{email:$rootScope.email,name:$rootScope.name,username:$rootScope.username,zone:ZONE},function(data){$rootScope.goto("verify"),$scope.applyScope()},!1)},$scope.focus=function(n){$("INPUT.code").focus(),$scope.code=$scope.code.substr(0,n-1)},$scope.blur=function(){$("INPUT.code").blur()},$scope.setFocus=function(){$scope.in_focus=!0},$scope.setBlur=function(){$scope.in_focus=!1},$scope.class=function(n){return $scope.in_focus&&$scope.code.length+1==n?"selected":$scope.value(n)?"filled":"empty"},$scope.value=function(n){return $scope.code.length<n?"":$scope.code.substr(n-1,1)},$scope.onChange=function(){$scope.format(),$scope.isComplete()&&$scope.execute()},$scope.format=function(){$scope.code=$scope.code.toUpperCase()},$scope.isComplete=function(){return 6==$scope.code.length},$scope.execute=function(){$scope.blur(),$scope.search()},$scope.search=function(){setTimeout(function(){var code=$scope.code;$scope.reset(),post("user/verify",{email:$rootScope.email,code:code},function(user){user.rkey&&postReactNativeMessage("rkey",user.rkey);user=user.user;consoleLog(user),$rootScope.logged_in=!0,$rootScope.user=user,$rootScope.loadSettings(),$rootScope.setGTagUserID(),$rootScope.goto("lists"),$scope.applyScope(),closePopups()})},300)},$scope.reset=function(){$scope.code="",$scope.applyScope()}}),app.controller("logout",function($scope,$rootScope,$stateParams){$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("logout::init()"),$scope.logout()},$scope.logout=function(){post("user/logout",{},function(){$rootScope.user=null,$rootScope.goto("login"),$scope.applyScope()},!1)},$scope.init()}),app.controller("menu",function($scope,$rootScope,$stateParams){$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.logout=function(){confirm_popup("Are you sure you want to logout?",function(){$rootScope.goto("logout"),$rootScope.applyScope()})}}),app.controller("notifications",function($scope,$rootScope,$stateParams){$scope.loaded_data=!1,$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.load=function(){post_silent("notifications/all",{},0,function(data){$rootScope.notifications=data.all,$rootScope.deadlines=data.deadlines,$scope.completeLoad()},!0)},$scope.completeLoad=function(){$scope.loaded_data=!0,$scope.applyScope(),consoleLog("notifications->loaded")},$scope.open=function(notif,e){post_silent("notifications/open",{id:notif.id})},$scope.clear=function(notif,e){e&&e.stopPropagation(),e&&e.preventDefault(),post_silent("notifications/clear",{id:notif.id}),removeItem($rootScope.notifications,notif)},$scope.clearAll=function(){confirm_popup("Are you sure you want to clear all notifications?",function(){post_silent("notifications/clear-all"),$rootScope.notifications=[],$rootScope.applyScope()})},$scope.load()}),app.controller("reel",function($scope,$rootScope,$stateParams){$scope.guide,$scope.max,$scope.time,$scope.times,$scope.n=1,$scope.guides={intro:{max:17,time:7,times:{3:2}},controls:{max:11,time:7,times:{3:10,8:10,9:10,10:10}},uses:{max:7,time:45,times:{1:10,6:15}}},$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("reel::init()"),$scope.guide=$rootScope.page_id,$scope.max=$scope.guides[$scope.guide].max,$scope.time=$scope.guides[$scope.guide].time,$scope.times=$scope.guides[$scope.guide].times,"intro"==$scope.guide&&localData("viewed-intro",!0),$scope.play()},$rootScope.reel_player,$scope.play=function(){$scope.setTime(),clearTimeout($rootScope.reel_player),$scope.n<=$scope.max&&($rootScope.reel_player=setTimeout(function(){$(".view.reel").length&&$scope.n<=$scope.max&&($scope.right(),$scope.applyScope())},1e3*$scope.time))},$scope.setTime=function(){$scope.n==$scope.max?$scope.time=3:$scope.times[$scope.n]?$scope.time=$scope.times[$scope.n]:$scope.time=$scope.guides[$scope.guide].time},$scope.left=function(){1<$scope.n&&$scope.n--,$scope.play()},$scope.right=function(){$scope.n<$scope.max?($scope.n++,$scope.play()):$scope.n==$scope.max&&(clearTimeout($rootScope.reel_player),$scope.goBack())}}),app.controller("select-option",function($scope,$rootScope){$scope.show_options=!1,$scope.show=function(){$scope.show_options=!0},$scope.hide=function(){$scope.show_options=!1},$scope.toggle=function(){$scope.show_options=!$scope.show_options,setTimeout(function(){$(".time .options")&&$(".time .options").scrollTop(900)},10)}}),app.controller("settings",function($scope,$rootScope,$stateParams){$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.toggleNotification=function(str){var v="notif_"+str;$rootScope.settings[v]=!$rootScope.settings[v],post_silent("settings/notif",{notif:str,value:$rootScope.settings[v]?"1":"0"})}}),app.controller("share-manager",function($scope,$rootScope,$stateParams){$scope.loaded_data=!1,$scope.access={},$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("share::init()"),$scope.load()},$scope.load=function(){consoleLog("share::load()"),$rootScope.access=null,post_silent("access/pull",{id:$rootScope.list.id},0,function(data){$scope.access=data,$scope.loaded_data=!0,$scope.applyScope(),consoleLog("share->loaded")})},$scope.accessLabel=function(user){switch(user.access){case 1:return"Editor";case 2:return"Viewer"}},$scope.updateAccess=function(user,access){user.access!=access&&(user.access=access,post_silent("access/update",{id:$rootScope.list.id,user_id:user.id,access:access}))},$scope.removeAccess=function(user){$rootScope.user.id!=user.id?confirm_popup("You wish to REMOVE this user's access to this priority list?",function(){removeItem($scope.access.users,user),post_silent("access/remove",{id:$rootScope.list.id,user_id:user.id}),$scope.applyScope()}):confirm_popup("You wish to remove YOUR access to this priority list?",function(){post("access/remove",{id:$rootScope.list.id,user_id:user.id},function(data){loading_popup(),window.location.href="/"},!1)})},$rootScope.access_email="",$scope.addUser=function(){$rootScope.access_email?post("access/add",{id:$rootScope.list.id,email:$rootScope.access_email},function(data){$rootScope.access_email="",$scope.access=data,$scope.applyScope()},!1):error_popup("Email Required")},$scope.toggleShare=function(){$scope.access.public=!$scope.access.public,$scope.access.public?post_silent("access/public",{id:$rootScope.list.id}):post_silent("access/private",{id:$rootScope.list.id})},$scope.copy=function(copyText){copyText=document.getElementById(copyText);copyText.select(),copyText.setSelectionRange(0,99999),navigator.clipboard.writeText(copyText.value),alert_popup("Copied","Link Copied To Clipboard")},$scope.init()}),app.controller("subitems",function($scope,$rootScope,$stateParams){$scope.loaded_data=!1,$scope.sublist={},$scope.applyScope=function(){$rootScope.$$phase||$rootScope.$apply(),$scope.$$phase||$scope.$apply()},$scope.init=function(){consoleLog("subitems::init()"),$scope.load()},$scope.load=function(){consoleLog("subitems::load()"),$rootScope.selected_subitems.total||($rootScope.selected_subitems.total=0,$rootScope.selected_subitems.ticked=0),post_silent("subitems/pull",{id:$rootScope.selected_subitems.id,key:$rootScope.page_key},0,function(data){$scope.sublist=data,$scope.loaded_data=!0,$scope.applyScope(),consoleLog("subitems->loaded")})},$scope.updateSublist=function(sublist){$scope.sublist=sublist},$scope.init()}),app.config(function($stateProvider,$urlRouterProvider,$locationProvider){$locationProvider.html5Mode(!0),$urlRouterProvider.otherwise(""),$stateProvider.state("app",{url:"",template:"<div ui-view></div>"}).state("app.page",{url:"/:page",template:"",controller:function($rootScope,$stateParams){$rootScope.setState($stateParams.page,null)}}).state("app.pageid",{url:"/:page/:id",template:"",controller:function($rootScope,$stateParams){$rootScope.setState($stateParams.page,$stateParams.id)}}).state("app.guest",{url:"/:page/:id/:key",template:"",controller:function($rootScope,$stateParams){$rootScope.setState($stateParams.page,$stateParams.id,$stateParams.key)}})}),$(function(){setPage()}),window.onresize=function(){pullScope("#App").applyScope()},function(){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};!function(exports){function inherits(parent,child){var p,props=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},extended=Object.create(parent.prototype);for(p in props)extended[p]=props[p];return(extended.constructor=child).prototype=extended,child}var defaults={defaultProtocol:"http",events:null,format:noop,formatHref:noop,nl2br:!1,tagName:"a",target:function(href,type){return"url"===type?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function Options(opts){opts=opts||{},this.defaultProtocol=(opts.hasOwnProperty("defaultProtocol")?opts:defaults).defaultProtocol,this.events=(opts.hasOwnProperty("events")?opts:defaults).events,this.format=(opts.hasOwnProperty("format")?opts:defaults).format,this.formatHref=(opts.hasOwnProperty("formatHref")?opts:defaults).formatHref,this.nl2br=(opts.hasOwnProperty("nl2br")?opts:defaults).nl2br,this.tagName=(opts.hasOwnProperty("tagName")?opts:defaults).tagName,this.target=(opts.hasOwnProperty("target")?opts:defaults).target,this.validate=(opts.hasOwnProperty("validate")?opts:defaults).validate,this.ignoreTags=[],this.attributes=opts.attributes||opts.linkAttributes||defaults.attributes,this.className=opts.hasOwnProperty("className")?opts.className:opts.linkClass||defaults.className;for(var ignoredTags=(opts.hasOwnProperty("ignoreTags")?opts:defaults).ignoreTags,i=0;i<ignoredTags.length;i++)this.ignoreTags.push(ignoredTags[i].toUpperCase())}function noop(val){return val}Options.prototype={resolve:function(token){var href=token.toHref(this.defaultProtocol);return{formatted:this.get("format",token.toString(),token),formattedHref:this.get("formatHref",href,token),tagName:this.get("tagName",href,token),className:this.get("className",href,token),target:this.get("target",href,token),events:this.getObject("events",href,token),attributes:this.getObject("attributes",href,token)}},check:function(token){return this.get("validate",token.toString(),token)},get:function(key,operator,token){var optionValue=void 0,option=this[key];if(!option)return option;switch(void 0===option?"undefined":_typeof(option)){case"function":return option(operator,token.type);case"object":return"function"==typeof(optionValue=option.hasOwnProperty(token.type)?option[token.type]:defaults[key])?optionValue(operator,token.type):optionValue}return option},getObject:function(option,operator,token){option=this[option];return"function"==typeof option?option(operator,token.type):option}};var options=Object.freeze({defaults:defaults,Options:Options,contains:function(arr,value){for(var i=0;i<arr.length;i++)if(arr[i]===value)return!0;return!1}});function createStateClass(){return function(tClass){this.j=[],this.T=tClass||null}}(S_URL=createStateClass()).prototype={defaultTransition:!1,on:function(symbol,state){if(symbol instanceof Array){for(var i=0;i<symbol.length;i++)this.j.push([symbol[i],state]);return this}return this.j.push([symbol,state]),this},next:function(item){for(var i=0;i<this.j.length;i++){var state=this.j[i],symbol=state[0],state=state[1];if(this.test(item,symbol))return state}return this.defaultTransition},accepts:function(){return!!this.T},test:function(item,symbol){return item===symbol},emit:function(){return this.T}};var CharacterState=inherits(S_URL,createStateClass(),{test:function(character,charOrRegExp){return character===charOrRegExp||charOrRegExp instanceof RegExp&&charOrRegExp.test(character)}}),TokenState=inherits(S_URL,createStateClass(),{jump:function(token,state){var tClass=1<arguments.length&&void 0!==state?state:null,state=this.next(new token(""));return state===this.defaultTransition?(state=new this.constructor(tClass),this.on(token,state)):tClass&&(state.T=tClass),state},test:function(token,tokenClass){return token instanceof tokenClass}});function stateify(str,start,endToken,defaultToken){for(var i=0,len=str.length,state=start,newStates=[],nextState=void 0;i<len&&(nextState=state.next(str[i]));)state=nextState,i++;if(len<=i)return[];for(;i<len-1;)nextState=new CharacterState(defaultToken),newStates.push(nextState),state.on(str[i],nextState),state=nextState,i++;return nextState=new CharacterState(endToken),newStates.push(nextState),state.on(str[len-1],nextState),newStates}function createTokenClass(){return function(value){value&&(this.v=value)}}var TextToken=createTokenClass();function inheritsToken(value){return inherits(TextToken,createTokenClass(),value?{v:value}:{})}TextToken.prototype={toString:function(){return this.v+""}};var DOMAIN=inheritsToken(),AT=inheritsToken("@"),COLON=inheritsToken(":"),DOT=inheritsToken("."),qsNonAccepting=inheritsToken(),LOCALHOST=inheritsToken(),NL=inheritsToken("\n"),NUM=inheritsToken(),PLUS=inheritsToken("+"),POUND=inheritsToken("#"),PROTOCOL=inheritsToken(),MAILTO=inheritsToken("mailto:"),QUERY=inheritsToken("?"),SLASH=inheritsToken("/"),UNDERSCORE=inheritsToken("_"),SYM=inheritsToken(),TLD=inheritsToken(),S_URL_NON_ACCEPTING=inheritsToken(),OPENBRACE=inheritsToken("{"),OPENBRACKET=inheritsToken("["),OPENANGLEBRACKET=inheritsToken("<"),OPENPAREN=inheritsToken("("),CLOSEBRACE=inheritsToken("}"),CLOSEBRACKET=inheritsToken("]"),CLOSEANGLEBRACKET=inheritsToken(">"),CLOSEPAREN=inheritsToken(")"),localpartAccepting=inheritsToken("&"),S_MAILTO_EMAIL=Object.freeze({Base:TextToken,DOMAIN:DOMAIN,AT:AT,COLON:COLON,DOT:DOT,PUNCTUATION:qsNonAccepting,LOCALHOST:LOCALHOST,NL:NL,NUM:NUM,PLUS:PLUS,POUND:POUND,QUERY:QUERY,PROTOCOL:PROTOCOL,MAILTO:MAILTO,SLASH:SLASH,UNDERSCORE:UNDERSCORE,SYM:SYM,TLD:TLD,WS:S_URL_NON_ACCEPTING,OPENBRACE:OPENBRACE,OPENBRACKET:OPENBRACKET,OPENANGLEBRACKET:OPENANGLEBRACKET,OPENPAREN:OPENPAREN,CLOSEBRACE:CLOSEBRACE,CLOSEBRACKET:CLOSEBRACKET,CLOSEANGLEBRACKET:CLOSEANGLEBRACKET,CLOSEPAREN:CLOSEPAREN,AMPERSAND:localpartAccepting}),tlds="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),S_EMAIL_COLON="0123456789".split(""),ALPHANUM="0123456789abcdefghijklmnopqrstuvwxyz".split(""),S_URL_OPENBRACE=[" ","\f","\r","\t","\v"," "," ",""],domainStates=[],S_START=(qsAccepting=function(tokenClass){return new CharacterState(tokenClass)})(),S_EMAIL=qsAccepting(NUM),S_DOMAIN=qsAccepting(DOMAIN),S_DOMAIN_HYPHEN=qsAccepting(),S_URL_OPENBRACKET=qsAccepting(S_URL_NON_ACCEPTING);S_START.on("@",qsAccepting(AT)).on(".",qsAccepting(DOT)).on("+",qsAccepting(PLUS)).on("#",qsAccepting(POUND)).on("?",qsAccepting(QUERY)).on("/",qsAccepting(SLASH)).on("_",qsAccepting(UNDERSCORE)).on(":",qsAccepting(COLON)).on("{",qsAccepting(OPENBRACE)).on("[",qsAccepting(OPENBRACKET)).on("<",qsAccepting(OPENANGLEBRACKET)).on("(",qsAccepting(OPENPAREN)).on("}",qsAccepting(CLOSEBRACE)).on("]",qsAccepting(CLOSEBRACKET)).on(">",qsAccepting(CLOSEANGLEBRACKET)).on(")",qsAccepting(CLOSEPAREN)).on("&",qsAccepting(localpartAccepting)).on([",",";","!",'"',"'"],qsAccepting(qsNonAccepting)),S_START.on("\n",qsAccepting(NL)).on(S_URL_OPENBRACE,S_URL_OPENBRACKET),S_URL_OPENBRACKET.on(S_URL_OPENBRACE,S_URL_OPENBRACKET);for(var i=0;i<tlds.length;i++){var newStates=stateify(tlds[i],S_START,TLD,DOMAIN);domainStates.push.apply(domainStates,newStates)}var S_URL_OPENANGLEBRACKET=stateify("file",S_START,DOMAIN,DOMAIN),S_URL_OPENPAREN=stateify("ftp",S_START,DOMAIN,DOMAIN),S_URL_OPENBRACE_Q=stateify("http",S_START,DOMAIN,DOMAIN),S_URL_OPENBRACKET_Q=stateify("mailto",S_START,DOMAIN,DOMAIN);domainStates.push.apply(domainStates,S_URL_OPENANGLEBRACKET),domainStates.push.apply(domainStates,S_URL_OPENPAREN),domainStates.push.apply(domainStates,S_URL_OPENBRACE_Q),domainStates.push.apply(domainStates,S_URL_OPENBRACKET_Q);var S_URL_OPENBRACE_SYMS=S_URL_OPENANGLEBRACKET.pop(),S_URL_OPENANGLEBRACKET_Q=S_URL_OPENPAREN.pop(),S_URL_OPENPAREN_Q=S_URL_OPENBRACE_Q.pop(),S_URL_OPENPAREN_SYMS=S_URL_OPENBRACKET_Q.pop(),S_URL_OPENBRACKET_SYMS=qsAccepting(DOMAIN),S_URL_OPENANGLEBRACKET_SYMS=qsAccepting(PROTOCOL),S_EMAIL_DOMAIN=qsAccepting(MAILTO);S_URL_OPENANGLEBRACKET_Q.on("s",S_URL_OPENBRACKET_SYMS).on(":",S_URL_OPENANGLEBRACKET_SYMS),S_URL_OPENPAREN_Q.on("s",S_URL_OPENBRACKET_SYMS).on(":",S_URL_OPENANGLEBRACKET_SYMS),domainStates.push(S_URL_OPENBRACKET_SYMS),S_URL_OPENBRACE_SYMS.on(":",S_URL_OPENANGLEBRACKET_SYMS),S_URL_OPENBRACKET_SYMS.on(":",S_URL_OPENANGLEBRACKET_SYMS),S_URL_OPENPAREN_SYMS.on(":",S_EMAIL_DOMAIN);var S_EMAIL_DOMAIN_DOT=stateify("localhost",S_START,LOCALHOST,DOMAIN);domainStates.push.apply(domainStates,S_EMAIL_DOMAIN_DOT),S_START.on(S_EMAIL_COLON,S_EMAIL),S_EMAIL.on("-",S_DOMAIN_HYPHEN).on(S_EMAIL_COLON,S_EMAIL).on(ALPHANUM,S_DOMAIN),S_DOMAIN.on("-",S_DOMAIN_HYPHEN).on(ALPHANUM,S_DOMAIN);for(var _i=0;_i<domainStates.length;_i++)domainStates[_i].on("-",S_DOMAIN_HYPHEN).on(ALPHANUM,S_DOMAIN);S_DOMAIN_HYPHEN.on("-",S_DOMAIN_HYPHEN).on(S_EMAIL_COLON,S_DOMAIN).on(ALPHANUM,S_DOMAIN),S_START.defaultTransition=qsAccepting(SYM);var run=function(str){for(var lowerStr=str.replace(/[A-Z]/g,function(c){return c.toLowerCase()}),len=str.length,tokens=[],cursor=0;cursor<len;){for(var TOKEN,state=S_START,nextState=null,tokenLength=0,latestAccepting=null,sinceAccepts=-1;cursor<len&&(nextState=state.next(lowerStr[cursor]));)(state=nextState).accepts()?(sinceAccepts=0,latestAccepting=state):0<=sinceAccepts&&sinceAccepts++,tokenLength++,cursor++;sinceAccepts<0||(cursor-=sinceAccepts,tokenLength-=sinceAccepts,TOKEN=latestAccepting.emit(),tokens.push(new TOKEN(str.substr(cursor-tokenLength,tokenLength))))}return tokens},scanner=Object.freeze({State:CharacterState,TOKENS:S_MAILTO_EMAIL,run:run,start:S_START});(S_MAILTO_EMAIL_NON_ACCEPTING=createTokenClass()).prototype={type:"token",isLink:!1,toString:function(){for(var result=[],_i2=0;_i2<this.v.length;_i2++)result.push(this.v[_i2].toString());return result.join("")},toHref:function(){return this.toString()},toObject:function(protocol){protocol=0<arguments.length&&void 0!==protocol?protocol:"http";return{type:this.type,value:this.toString(),href:this.toHref(protocol)}}};var S_LOCALPART_DOT=inherits(S_MAILTO_EMAIL_NON_ACCEPTING,createTokenClass(),{type:"email",isLink:!0}),S_LOCALPART_AT=inherits(S_MAILTO_EMAIL_NON_ACCEPTING,createTokenClass(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),TEXT=inherits(S_MAILTO_EMAIL_NON_ACCEPTING,createTokenClass(),{type:"text"}),S_NL=inherits(S_MAILTO_EMAIL_NON_ACCEPTING,createTokenClass(),{type:"nl"}),S_LOCALPART=inherits(S_MAILTO_EMAIL_NON_ACCEPTING,createTokenClass(),{type:"url",isLink:!0,toHref:function(protocol){for(var token,protocol=0<arguments.length&&void 0!==protocol?protocol:"http",hasProtocol=!1,hasSlashSlash=!1,tokens=this.v,result=[],i=0;tokens[i]instanceof PROTOCOL;)hasProtocol=!0,result.push(tokens[i].toString().toLowerCase()),i++;for(;tokens[i]instanceof SLASH;)hasSlashSlash=!0,result.push(tokens[i].toString()),i++;for(;(token=tokens[i])instanceof DOMAIN||token instanceof TLD;)result.push(tokens[i].toString().toLowerCase()),i++;for(;i<tokens.length;i++)result.push(tokens[i].toString());return result=result.join(""),hasProtocol||hasSlashSlash||(result=protocol+"://"+result),result},hasProtocol:function(){return this.v[0]instanceof PROTOCOL}}),parser=Object.freeze({Base:S_MAILTO_EMAIL_NON_ACCEPTING,MAILTOEMAIL:S_LOCALPART_DOT,EMAIL:S_LOCALPART_AT,NL:S_NL,TEXT:TEXT,URL:S_LOCALPART}),makeState$1=function(tokenClass){return new TokenState(tokenClass)},S_START$1=makeState$1(),S_PROTOCOL=makeState$1(),S_MAILTO$1=makeState$1(),S_PROTOCOL_SLASH=makeState$1(),S_PROTOCOL_SLASH_SLASH=makeState$1(),S_DOMAIN$1=makeState$1(),S_DOMAIN_DOT=makeState$1(),S_TLD=makeState$1(S_LOCALPART),S_TLD_COLON=makeState$1(),S_TLD_PORT=makeState$1(S_LOCALPART),S_URL=makeState$1(S_LOCALPART),S_URL_NON_ACCEPTING=makeState$1(),S_URL_OPENBRACE=makeState$1(),S_URL_OPENBRACKET=makeState$1(),S_URL_OPENANGLEBRACKET=makeState$1(),S_URL_OPENPAREN=makeState$1(),S_URL_OPENBRACE_Q=makeState$1(S_LOCALPART),S_URL_OPENBRACKET_Q=makeState$1(S_LOCALPART),S_URL_OPENANGLEBRACKET_Q=makeState$1(S_LOCALPART),S_URL_OPENPAREN_Q=makeState$1(S_LOCALPART),S_URL_OPENBRACE_SYMS=makeState$1(),S_URL_OPENBRACKET_SYMS=makeState$1(),S_URL_OPENANGLEBRACKET_SYMS=makeState$1(),S_URL_OPENPAREN_SYMS=makeState$1(),S_EMAIL_DOMAIN=makeState$1(),S_EMAIL_DOMAIN_DOT=makeState$1(),S_EMAIL=makeState$1(S_LOCALPART_AT),S_EMAIL_COLON=makeState$1(),qsAccepting=makeState$1(S_LOCALPART_AT),S_MAILTO_EMAIL=makeState$1(S_LOCALPART_DOT),S_MAILTO_EMAIL_NON_ACCEPTING=makeState$1(),S_LOCALPART=makeState$1(),S_LOCALPART_AT=makeState$1(),S_LOCALPART_DOT=makeState$1(),S_NL=makeState$1(S_NL);S_START$1.on(NL,S_NL).on(PROTOCOL,S_PROTOCOL).on(MAILTO,S_MAILTO$1).on(SLASH,S_PROTOCOL_SLASH),S_PROTOCOL.on(SLASH,S_PROTOCOL_SLASH),S_PROTOCOL_SLASH.on(SLASH,S_PROTOCOL_SLASH_SLASH),S_START$1.on(TLD,S_DOMAIN$1).on(DOMAIN,S_DOMAIN$1).on(LOCALHOST,S_TLD).on(NUM,S_DOMAIN$1),S_PROTOCOL_SLASH_SLASH.on(TLD,S_URL).on(DOMAIN,S_URL).on(NUM,S_URL).on(LOCALHOST,S_URL),S_DOMAIN$1.on(DOT,S_DOMAIN_DOT),S_EMAIL_DOMAIN.on(DOT,S_EMAIL_DOMAIN_DOT),S_DOMAIN_DOT.on(TLD,S_TLD).on(DOMAIN,S_DOMAIN$1).on(NUM,S_DOMAIN$1).on(LOCALHOST,S_DOMAIN$1),S_EMAIL_DOMAIN_DOT.on(TLD,S_EMAIL).on(DOMAIN,S_EMAIL_DOMAIN).on(NUM,S_EMAIL_DOMAIN).on(LOCALHOST,S_EMAIL_DOMAIN),S_TLD.on(DOT,S_DOMAIN_DOT),S_EMAIL.on(DOT,S_EMAIL_DOMAIN_DOT),S_TLD.on(COLON,S_TLD_COLON).on(SLASH,S_URL),S_TLD_COLON.on(NUM,S_TLD_PORT),S_TLD_PORT.on(SLASH,S_URL),S_EMAIL.on(COLON,S_EMAIL_COLON),S_EMAIL_COLON.on(NUM,qsAccepting),qsAccepting=[DOMAIN,AT,LOCALHOST,NUM,PLUS,POUND,PROTOCOL,SLASH,TLD,UNDERSCORE,SYM,localpartAccepting],qsNonAccepting=[COLON,DOT,QUERY,qsNonAccepting,CLOSEBRACE,CLOSEBRACKET,CLOSEANGLEBRACKET,CLOSEPAREN,OPENBRACE,OPENBRACKET,OPENANGLEBRACKET,OPENPAREN],S_URL.on(OPENBRACE,S_URL_OPENBRACE).on(OPENBRACKET,S_URL_OPENBRACKET).on(OPENANGLEBRACKET,S_URL_OPENANGLEBRACKET).on(OPENPAREN,S_URL_OPENPAREN),S_URL_NON_ACCEPTING.on(OPENBRACE,S_URL_OPENBRACE).on(OPENBRACKET,S_URL_OPENBRACKET).on(OPENANGLEBRACKET,S_URL_OPENANGLEBRACKET).on(OPENPAREN,S_URL_OPENPAREN),S_URL_OPENBRACE.on(CLOSEBRACE,S_URL),S_URL_OPENBRACKET.on(CLOSEBRACKET,S_URL),S_URL_OPENANGLEBRACKET.on(CLOSEANGLEBRACKET,S_URL),S_URL_OPENPAREN.on(CLOSEPAREN,S_URL),S_URL_OPENBRACE_Q.on(CLOSEBRACE,S_URL),S_URL_OPENBRACKET_Q.on(CLOSEBRACKET,S_URL),S_URL_OPENANGLEBRACKET_Q.on(CLOSEANGLEBRACKET,S_URL),S_URL_OPENPAREN_Q.on(CLOSEPAREN,S_URL),S_URL_OPENBRACE_SYMS.on(CLOSEBRACE,S_URL),S_URL_OPENBRACKET_SYMS.on(CLOSEBRACKET,S_URL),S_URL_OPENANGLEBRACKET_SYMS.on(CLOSEANGLEBRACKET,S_URL),S_URL_OPENPAREN_SYMS.on(CLOSEPAREN,S_URL),S_URL_OPENBRACE.on(qsAccepting,S_URL_OPENBRACE_Q),S_URL_OPENBRACKET.on(qsAccepting,S_URL_OPENBRACKET_Q),S_URL_OPENANGLEBRACKET.on(qsAccepting,S_URL_OPENANGLEBRACKET_Q),S_URL_OPENPAREN.on(qsAccepting,S_URL_OPENPAREN_Q),S_URL_OPENBRACE.on(qsNonAccepting,S_URL_OPENBRACE_SYMS),S_URL_OPENBRACKET.on(qsNonAccepting,S_URL_OPENBRACKET_SYMS),S_URL_OPENANGLEBRACKET.on(qsNonAccepting,S_URL_OPENANGLEBRACKET_SYMS),S_URL_OPENPAREN.on(qsNonAccepting,S_URL_OPENPAREN_SYMS),S_URL_OPENBRACE_Q.on(qsAccepting,S_URL_OPENBRACE_Q),S_URL_OPENBRACKET_Q.on(qsAccepting,S_URL_OPENBRACKET_Q),S_URL_OPENANGLEBRACKET_Q.on(qsAccepting,S_URL_OPENANGLEBRACKET_Q),S_URL_OPENPAREN_Q.on(qsAccepting,S_URL_OPENPAREN_Q),S_URL_OPENBRACE_Q.on(qsNonAccepting,S_URL_OPENBRACE_Q),S_URL_OPENBRACKET_Q.on(qsNonAccepting,S_URL_OPENBRACKET_Q),S_URL_OPENANGLEBRACKET_Q.on(qsNonAccepting,S_URL_OPENANGLEBRACKET_Q),S_URL_OPENPAREN_Q.on(qsNonAccepting,S_URL_OPENPAREN_Q),S_URL_OPENBRACE_SYMS.on(qsAccepting,S_URL_OPENBRACE_Q),S_URL_OPENBRACKET_SYMS.on(qsAccepting,S_URL_OPENBRACKET_Q),S_URL_OPENANGLEBRACKET_SYMS.on(qsAccepting,S_URL_OPENANGLEBRACKET_Q),S_URL_OPENPAREN_SYMS.on(qsAccepting,S_URL_OPENPAREN_Q),S_URL_OPENBRACE_SYMS.on(qsNonAccepting,S_URL_OPENBRACE_SYMS),S_URL_OPENBRACKET_SYMS.on(qsNonAccepting,S_URL_OPENBRACKET_SYMS),S_URL_OPENANGLEBRACKET_SYMS.on(qsNonAccepting,S_URL_OPENANGLEBRACKET_SYMS),S_URL_OPENPAREN_SYMS.on(qsNonAccepting,S_URL_OPENPAREN_SYMS),S_URL.on(qsAccepting,S_URL),S_URL_NON_ACCEPTING.on(qsAccepting,S_URL),S_URL.on(qsNonAccepting,S_URL_NON_ACCEPTING),S_URL_NON_ACCEPTING.on(qsNonAccepting,S_URL_NON_ACCEPTING),S_MAILTO$1.on(TLD,S_MAILTO_EMAIL).on(DOMAIN,S_MAILTO_EMAIL).on(NUM,S_MAILTO_EMAIL).on(LOCALHOST,S_MAILTO_EMAIL),S_MAILTO_EMAIL.on(qsAccepting,S_MAILTO_EMAIL).on(qsNonAccepting,S_MAILTO_EMAIL_NON_ACCEPTING),S_MAILTO_EMAIL_NON_ACCEPTING.on(qsAccepting,S_MAILTO_EMAIL).on(qsNonAccepting,S_MAILTO_EMAIL_NON_ACCEPTING),localpartAccepting=[DOMAIN,NUM,PLUS,POUND,QUERY,UNDERSCORE,SYM,localpartAccepting,TLD],S_DOMAIN$1.on(localpartAccepting,S_LOCALPART).on(AT,S_LOCALPART_AT),S_TLD.on(localpartAccepting,S_LOCALPART).on(AT,S_LOCALPART_AT),S_DOMAIN_DOT.on(localpartAccepting,S_LOCALPART),S_LOCALPART.on(localpartAccepting,S_LOCALPART).on(AT,S_LOCALPART_AT).on(DOT,S_LOCALPART_DOT),S_LOCALPART_DOT.on(localpartAccepting,S_LOCALPART),S_LOCALPART_AT.on(TLD,S_EMAIL_DOMAIN).on(DOMAIN,S_EMAIL_DOMAIN).on(LOCALHOST,S_EMAIL);var run$1=function(tokens){for(var len=tokens.length,cursor=0,multis=[],textTokens=[];cursor<len;){for(var state=S_START$1,secondState=null,nextState=null,multiLength=0,latestAccepting=null,sinceAccepts=-1;cursor<len&&!(secondState=state.next(tokens[cursor]));)textTokens.push(tokens[cursor++]);for(;cursor<len&&(nextState=secondState||state.next(tokens[cursor]));)secondState=null,(state=nextState).accepts()?(sinceAccepts=0,latestAccepting=state):0<=sinceAccepts&&sinceAccepts++,cursor++,multiLength++;if(sinceAccepts<0)for(var _i3=cursor-multiLength;_i3<cursor;_i3++)textTokens.push(tokens[_i3]);else{0<textTokens.length&&(multis.push(new TEXT(textTokens)),textTokens=[]),cursor-=sinceAccepts,multiLength-=sinceAccepts;var MULTI=latestAccepting.emit();multis.push(new MULTI(tokens.slice(cursor-multiLength,cursor)))}}return 0<textTokens.length&&multis.push(new TEXT(textTokens)),multis},parser=Object.freeze({State:TokenState,TOKENS:parser,run:run$1,start:S_START$1});Array.isArray||(Array.isArray=function(arg){return"[object Array]"===Object.prototype.toString.call(arg)});var tokenize=function(str){return run$1(run(str))};exports.find=function(str,argument_1){for(var type=1<arguments.length&&void 0!==argument_1?argument_1:null,tokens=tokenize(str),filtered=[],i=0;i<tokens.length;i++){var token=tokens[i];!token.isLink||type&&token.type!==type||filtered.push(token.toObject())}return filtered},exports.inherits=inherits,exports.options=options,exports.parser=parser,exports.scanner=scanner,exports.test=function(tokens,type){type=1<arguments.length&&void 0!==type?type:null,tokens=tokenize(tokens);return 1===tokens.length&&tokens[0].isLink&&(!type||tokens[0].type===type)},exports.tokenize=tokenize}(self.linkify=self.linkify||{})}(),function(window,linkifyJquery,$){linkifyJquery=function(linkify){"use strict";var tokenize=linkify.tokenize,options=linkify.options,Options=options.Options,TEXT_TOKEN=linkify.parser.TOKENS.TEXT,HTML_NODE=1,TXT_NODE=3;function linkifyElementHelper(element,opts,doc){if(!element||element.nodeType!==HTML_NODE)throw new Error("Cannot linkify "+element+" - Invalid DOM Node type");var ignoreTags=opts.ignoreTags;if("A"===element.tagName||options.contains(ignoreTags,element.tagName))return element;for(var childElement=element.firstChild;childElement;){var str,tokens,nodes;switch(childElement.nodeType){case HTML_NODE:linkifyElementHelper(childElement,opts,doc);break;case TXT_NODE:if(str=childElement.nodeValue,0===(tokens=tokenize(str)).length||1===tokens.length&&tokens[0]instanceof TEXT_TOKEN)break;(function(parent,newChildren){var lastNewChild=newChildren[newChildren.length-1];parent.replaceChild(lastNewChild,childElement);for(var i=newChildren.length-2;0<=i;i--)parent.insertBefore(newChildren[i],lastNewChild),lastNewChild=newChildren[i]})(element,nodes=function(tokens,opts,doc){for(var _ref,result=[],_iterator=tokens,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{if((_i=_iterator.next()).done)break;_ref=_i.value}var token=_ref;if("nl"===token.type&&opts.nl2br)result.push(doc.createElement("br"));else if(token.isLink&&opts.check(token)){var _opts$resolve=opts.resolve(token),formatted=_opts$resolve.formatted,formattedHref=_opts$resolve.formattedHref,tagName=_opts$resolve.tagName,className=_opts$resolve.className,target=_opts$resolve.target,events=_opts$resolve.events,attributes=_opts$resolve.attributes,link=doc.createElement(tagName);if(link.setAttribute("href",formattedHref),className&&link.setAttribute("class",className),target&&link.setAttribute("target",target),attributes)for(var attr in attributes)link.setAttribute(attr,attributes[attr]);if(events)for(var event in events)link.addEventListener?link.addEventListener(event,events[event]):link.attachEvent&&link.attachEvent("on"+event,events[event]);link.appendChild(doc.createTextNode(formatted)),result.push(link)}else result.push(doc.createTextNode(token.toString()))}return result}(tokens,opts,doc)),childElement=nodes[nodes.length-1]}childElement=childElement.nextSibling}return element}function linkifyElement(element,opts){var doc=2<arguments.length&&void 0!==arguments[2]&&arguments[2];try{doc=doc||document||window&&window.document||global&&global.document}catch(e){}if(!doc)throw new Error("Cannot find document implementation. If you are in a non-browser environment like Node.js, pass the document implementation as the third argument to linkifyElement.");return linkifyElementHelper(element,opts=new Options(opts),doc)}linkifyElement.helper=linkifyElementHelper,linkifyElement.normalize=function(opts){return new Options(opts)};try{window.linkifyElement=linkifyElement}catch(e){}return function($){var doc=1<arguments.length&&void 0!==arguments[1]&&arguments[1];$.fn=$.fn||{};try{doc=doc||document||window&&window.document||global&&global.document}catch(e){}if(!doc)throw new Error("Cannot find document implementation. If you are in a non-browser environment like Node.js, pass the document implementation as the second argument to linkify/jquery");"function"!=typeof $.fn.linkify&&($.fn.linkify=function(opts){return opts=linkifyElement.normalize(opts),this.each(function(){linkifyElement.helper(this,opts,doc)})},$(doc).ready(function(){$("[data-linkify]").each(function(){var $this=$(this),data=$this.data(),target=data.linkify,options=data.linkifyNlbr,options={nl2br:!!options&&0!==options&&"false"!==options};"linkifyAttributes"in data&&(options.attributes=data.linkifyAttributes),"linkifyDefaultProtocol"in data&&(options.defaultProtocol=data.linkifyDefaultProtocol),"linkifyEvents"in data&&(options.events=data.linkifyEvents),"linkifyFormat"in data&&(options.format=data.linkifyFormat),"linkifyFormatHref"in data&&(options.formatHref=data.linkifyFormatHref),"linkifyTagname"in data&&(options.tagName=data.linkifyTagname),"linkifyTarget"in data&&(options.target=data.linkifyTarget),"linkifyValidate"in data&&(options.validate=data.linkifyValidate),"linkifyIgnoreTags"in data&&(options.ignoreTags=data.linkifyIgnoreTags),"linkifyClassName"in data?options.className=data.linkifyClassName:"linkifyLinkclass"in data&&(options.className=data.linkifyLinkclass),options=linkifyElement.normalize(options),("this"===target?$this:$this.find(target)).linkify(options)})}))}}(linkifyJquery),"function"!=typeof $.fn.linkify&&linkifyJquery($)}(window,linkify,jQuery),$(function(){initPopups()});var ZONE=getTimezone((new Date).getFullYear(),1,1);function formData(form){var data={};return $(".form."+form+" INPUT,.form."+form+" TEXTAREA,.form."+form+" SELECT").each(function(){$(this)[0].hasAttribute("data-key")&&(data[$(this).attr("data-key")]=$(this).val())}),data}function post(db,data,onComplete,tick){postTo("/api/"+db,data,onComplete,tick)}function postTo(db,data,onComplete,tick){var showTick=!0;void 0!==tick&&(showTick=!1);var loader="no-loader"!=tick;loader&&loading_popup(),consoleLog("posting to "+db+"..."),consoleLog(data),$.ajax({type:"POST",url:db,data:data,dataType:"text",complete:function(){consoleLog("..."+db+" posted.")},success:function(data){var d=getJSON(data);consoleLog(d),"success"==d.result?(showTick?(loaded_popup(),setTimeout(function(){onComplete(d.data)},1100)):(loader&&loader_close(),onComplete(d.data)),showTick=!0):"error"!=d.result?(loader&&loader_close(),error_popup("An unknown error occurred, please try again."),console.error("SERVER ERROR: "+data)):(loader&&loader_close(),error_popup(d.errorType))},error:function(error){loader&&loader_close(),error_popup("An unknown error occurred, please try again."),console.error("CLIENT ERROR: Could not connect to the server. "+error.responseText)}})}function post_silent(db,data,attempt,onComplete,reset){void 0!==attempt&&(attempt=0),void 0===onComplete&&(onComplete=blank),void 0===reset&&(reset=!1),consoleLog("posting..."),consoleLog(data),$.ajax({type:"POST",url:"/api/"+db,data:data,dataType:"text",complete:function(){consoleLog("...posted.")},success:function(d){d=getJSON(d);consoleLog(d),"success"==d.result?onComplete(d.data):(console.error("ERROR: "+d.errorType),reset&&(window.location.href="/"))},error:function(error){attempt<3&&setTimeout(function(){post_silent(db,data,attempt++,onComplete)},500),console.error("ERROR: JS - "+error.responseText)}})}function post_one(db,data){postTo_one("/api/"+db,data)}function postTo_one(db,data){consoleLog(data),$.ajax({type:"POST",url:db,data:data,dataType:"text"})}function blank(){}function post_raw(url,data,onComplete){consoleLog("posting..."),$.ajax({type:"POST",url:url,data:data,dataType:"text",complete:function(){consoleLog("...posted.")},success:function(data){consoleLog(getJSON(data)),onComplete(getJSON(data))},error:function(error){console.error("ERROR: Could not connect to the server. "+error.responseText)}})}var logged_refferer=!1;function logReferrer(){is_store&&!logged_refferer&&document.referrer&&document.referrer.indexOf("https://prioritylist.app")}function consoleLog(msg){"undefined"!=typeof DEV&&DEV&&console.log(msg)}function getJSON(str){try{JSON.parse(str)}catch(e){return{}}return $.parseJSON(str)}function localData(key,val){if("undefined"!=typeof Storage){if(!val)return JSON.parse(localStorage.getItem(key));localStorage.setItem(key,JSON.stringify(val))}}function sessionData(key,val){if("undefined"!=typeof Storage){if(!val&&!1!==val&&0!==val)return JSON.parse(sessionStorage.getItem(key));sessionStorage.setItem(key,JSON.stringify(val))}}function decodeHTML(str){var textArea=document.createElement("textarea");textArea.innerHTML=str;str=textArea.value;return textArea.remove(),str}function postReactNativeMessage(key,value){var json={};json[key]=value;json=JSON.stringify(json);window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(json)}function initTooltips(){hideTooltip(),$("[data-t]:not(.btn)").unbind("hover"),$("[data-t]").hover(function(){offset=!$(this).hasClass("default-t")&&$(this).parents("table").length?9:0;var text=$(this).attr("data-t");$(".tooltip").html(text),showTooltip($(this).offset().left+$(this).outerWidth()/2,$(this).offset().top-$(window).scrollTop(),offset)},function(){hideTooltip()})}function showTooltip(x,y,offset){$(".tooltip").show(),$(".tooltip__arrow").show(),y-=7,$(".tooltip__arrow").css({top:y+offset,left:x});var t_width=$(".tooltip").outerWidth(),s_width=$(window).outerWidth();(x-=t_width/2)<0&&(x=5),s_width<x+t_width&&(x=s_width-t_width-5),$(".tooltip").css({top:y+offset-$(".tooltip").outerHeight(),left:x})}function hideTooltip(){$(".tooltip").hide(),$(".tooltip__arrow").hide()}var IMG_UPLOAD_N=0;$(document).on("change","INPUT.js-image-upload",function(e){e.preventDefault();var Files=this.files,ID=$(this).attr("data-id"),ImageType=$(this).attr("data-img"),PromoID=$(this).attr("data-promo-id"),s3_folder=$(this).attr("data-s3_folder");$.each(Files,function(file,obj){function progressHandlingFunction(perc){perc.lengthComputable&&(perc=Math.round(perc.loaded/perc.total*100),runAngular("#"+ID,"scope.setPercentage("+perc+")"),consoleLog(perc))}var form_data,CURR_IMAGE;CURR_IMAGE=++IMG_UPLOAD_N,1e7<(file=Files[form_data=file]).size?alert("Image '"+file.name+"' is too large. Please keep images under 10MB."):((form_data=new FormData).append("file",file),s3_folder&&form_data.append("s3_folder",s3_folder),$.ajax({url:"/api/image/upload"+(ImageType?"?img="+ImageType:""),contentType:!1,data:form_data,type:"POST",xhr:function(){var myXhr=$.ajaxSettings.xhr();return myXhr.upload&&myXhr.upload.addEventListener("progress",progressHandlingFunction,!1),myXhr},cache:!1,processData:!1,success:function(url_small){var code,url,d=url_small;consoleLog(d),"success"==d.result?(code=d.data.code,url=d.data.url,url_small=d.data.url_small,runAngular("#"+ID,PromoID?"scope.loaded("+PromoID+",'"+code+"','"+url+"','"+url_small+"')":"scope.loaded('"+code+"','"+url+"','"+url_small+"')")):"error"!=d.result?error_popup("An unknown error occurred, please try again."):error_popup(d.errorType)},error:function(error){error_popup("An unknown error occurred, please try again."),console.error("ERROR: Could not connect to the server. "+error.responseText)},complete:function(){$(".image.i"+CURR_IMAGE).parent().remove()}}),runAngular("#"+ID,PromoID?"scope.initLoading("+PromoID+")":"scope.initLoading()"))}),$("INPUT.js-image-upload").val("")});
#server-side pseudocode
╔══════════════════════════════════════════════════════════════════════╗
║ TASK-PRIORITY SERVICE — Reference Architecture (pseudo-code v4.0) ║
╚══════════════════════════════════════════════════════════════════════╝
Purpose: ingest raw tasks ➜ compute composite priority ➜ persist
➜ return dependency-aware, state-bucketed, tenant-scoped list
===========================================================================
───────────────────────────────────────────────────────────────────────────
SECTION 0 · HIGH-LEVEL COMPONENTS
───────────────────────────────────────────────────────────────────────────
• ConfigRegistry……………… per-tenant tunables (weights, urgency curve, bonuses)
• PriorityEngine……………… pure functions turning TaskRaw → TaskScored
• GraphSorter………………… topological sort driven by dynamic priority
• StatePostProcessor……… buckets (MARKED, ACTIVE, DONE) + dependency flatten
• SchedulerDaemon…………… periodic urgency refresh
• API Layer………………… REST / gRPC facade, multi-tenant auth, pagination
• AuditLog……………………… append-only trail of score changes for ML / rollback
===========================================================================
SECTION 1 · DATA MODELS
===========================================================================
enum TaskState { ACTIVE, MARKED, TICKED } # UI terms
enum TenantWeightProfile { DEFAULT, HIGH_URGENCY, QUICK_WINS } # example
class TaskRaw {
uuid id
uuid tenant_id
string title
int score_i # 0–10 (importance)
int score_t # 0–10 (quick-win scale; 10 = 1 min)
datetime? deadline_at # null → “someday”
int? risk_level # 0–10 optional pillar
uuid? dependency_id
TaskState state
datetime created_at
datetime updated_at
}
class TaskScored extends TaskRaw {
# normalised pillars (0–1)
float n_i, n_t, n_u, n_r
float priority # computed scalar
int rank # 1-based ordering inside tenant scope
datetime scored_at # when this priority was computed
}
===========================================================================
SECTION 2 · CONFIG REGISTRY (multitenant, hot-reloadable)
===========================================================================
ConfigRegistry.get_profile(tenant_id) returns object {
WEIGHTS : { importance, urgency, quick_win, risk } # ∑ = 1.0
URGENCY_DECAY_RATE # λ (minutes-¹) for exp curve
URGENCY_MAX_CEILING # raw max before normalisation (e.g., 10)
BONUS_MARKED # numeric bump
PENALTY_OVERDUE_DAY # per-day penalty once overdue
}
===========================================================================
SECTION 3 · UTILITY HELPERS
===========================================================================
func clamp(x, lo, hi) → float
func minutes_between(a, b) → int
func exp_decay(minutes, λ, max) → float # returns 0..max
===========================================================================
SECTION 4 · CORE PRIORITY ENGINE
===========================================================================
function compute_priority_batch(tasks : [TaskRaw], now : datetime, cfg):
# ❶ Batch min–max for i & r keeps sliders comparable inside tenant.
min_i, max_i = minmax(t.score_i for t in tasks)
min_r, max_r = minmax(t.risk_level ?? 0 for t in tasks)
scored = []
foreach t in tasks:
n_i = (t.score_i - min_i)/(max_i - min_i) unless max_i==min_i -> 0.0
n_t = t.score_t / 10.0 # quick-win scale already 0-1
# urgency pillar
if t.deadline_at == null:
raw_u = 0
else:
mins_left = max(minutes_between(now, t.deadline_at), 0)
raw_u = exp_decay(mins_left, cfg.URGENCY_DECAY_RATE,
cfg.URGENCY_MAX_CEILING)
n_u = raw_u / cfg.URGENCY_MAX_CEILING
# risk pillar (optional)
r_val = t.risk_level ?? (min_r+max_r)/2
n_r = (r_val - min_r)/(max_r - min_r) unless max_r==min_r -> 0.0
# ❷ base weighted sum
p = (cfg.WEIGHTS.importance * n_i +
cfg.WEIGHTS.urgency * n_u +
cfg.WEIGHTS.quick_win * n_t +
cfg.WEIGHTS.risk * n_r)
# ❸ bonuses & penalties (state aware)
if t.state == MARKED:
p += cfg.BONUS_MARKED
overdue_days = days_between(t.deadline_at, now) if t.deadline_at && now>t.deadline_at else 0
p -= overdue_days * cfg.PENALTY_OVERDUE_DAY
scored.push(TaskScored(**t, n_i, n_t, n_u, n_r, priority=p,
scored_at=now))
return scored
===========================================================================
SECTION 5 · GRAPH SORTER (dependency-aware topological sort)
===========================================================================
function topo_sort_with_priority(tasks_scored):
# build adjacency + indegree
edges, indeg, id2task = {}, {}, {}
foreach s in tasks_scored:
edges[s.id] = []
indeg[s.id] = 0
id2task[s.id] = s
foreach s in tasks_scored:
if s.dependency_id && s.dependency_id in id2task:
edges[s.dependency_id].append(s.id)
indeg[s.id] += 1
# priority queue seeded with indeg==0
pq = MaxHeap(compare = λ a,b: a.priority < b.priority)
foreach id, d in indeg:
if d==0: pq.push(id2task[id])
ordered = []
while !pq.empty():
cur = pq.pop()
ordered.push(cur)
foreach child_id in edges[cur.id]:
indeg[child_id]-=1
if indeg[child_id]==0: pq.push(id2task[child_id])
if ordered.length != tasks_scored.length:
raise CircularDependencyError(tenant_id)
return ordered # dependency-respecting, priority-driven list
===========================================================================
SECTION 6 · STATE POST-PROCESSOR
===========================================================================
function bucket_and_flatten(ordered):
marked = [t for t in ordered if t.state==MARKED]
active = [t for t in ordered if t.state==ACTIVE]
done = [t for t in ordered if t.state==TICKED]
return marked + active + done
===========================================================================
SECTION 7 · PERSIST & RANK
===========================================================================
function assign_ranks_persist(tasks_bucketed):
db.begin_transaction()
for idx, s in enumerate(tasks_bucketed):
s.rank = idx+1
DB.update("tasks", s.id,
{ priority: s.priority,
rank: s.rank,
scored_at: s.scored_at })
AuditLog.append(s.tenant_id, s.id, s.priority, s.scored_at)
db.commit()
return tasks_bucketed
===========================================================================
SECTION 8 · SCHEDULER DAEMON
===========================================================================
cron “*/5 * * * *” # every 5 minutes
for tenant in DB.distinct("tasks","tenant_id"):
cfg = ConfigRegistry.get_profile(tenant)
now = utc_now()
raw = DB.query("SELECT * FROM tasks WHERE tenant_id=? AND state!=TICKED", tenant)
scored = compute_priority_batch(raw, now, cfg)
ordered = topo_sort_with_priority(scored)
final = bucket_and_flatten(ordered)
assign_ranks_persist(final)
===========================================================================
SECTION 9 · API ENDPOINT
===========================================================================
GET /v1/tenants/{tid}/tasks?limit=100&offset=0&force_recalc=bool
----------------------------------------------------------------
auth.verify(tid) # multi-tenant guard
if force_recalc:
run_pipeline_immediately(tid)
result = DB.query(
"SELECT * FROM tasks WHERE tenant_id=? ORDER BY rank LIMIT ? OFFSET ?",
tid, limit, offset)
return JSON(result)
===========================================================================
SECTION 10 · CIRCULAR DEPENDENCY HANDLER
===========================================================================
on CircularDependencyError(tid):
# Flag the offending tasks for UI display
DB.update("tasks", WHERE tenant_id=tid AND id IN cycle_nodes,
{ blocked_reason: "CIRCULAR_DEPENDENCY" })
AlertService.notify_admin(tid, "Circular dependency detected in task set")
===========================================================================
NOTES & EXTENSION HOOKS
===========================================================================
• Weight profiles can be A/B tested per tenant (`TenantWeightProfile`).
• AuditLog enables ML retro-analysis: pair(actual completion times, priority) for future tuning.
• Risk pillar optional—just set WEIGHTS.risk=0 to disable.
• `BONUS_STALE_TASK`, `CONTEXT_MATCH_SCORE`, etc., plug into compute_priority_batch easily.
• Through feature flags, urgency curve can swap exp_decay for logistic or piecewise mapping.
• GraphSorter keeps algorithmic complexity ≈ O(V + E log V).
╔══════════════════════════════════════════════════════════════════════╗
║ END OF SPECIMEN ║
╚══════════════════════════════════════════════════════════════════════╝