diff --git a/.gitignore b/.gitignore
index 7a1537b..5a4f061 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,42 @@
-.idea
-node_modules
+
+# Created by https://www.toptal.com/developers/gitignore/api/macos,vuejs
+# Edit at https://www.toptal.com/developers/gitignore?templates=macos,vuejs
+
+### macOS ###
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+### Vuejs ###
+# Recommended template: Node.gitignore
+
+node_modules/
+dist/
+npm-debug.log
+yarn-error.log
+
+# End of https://www.toptal.com/developers/gitignore/api/macos,vuejs
\ No newline at end of file
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 0000000..cdd6736
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,22 @@
+module.exports = {
+ printWidth: 120,
+ tabWidth: 2,
+ useTabs: false,
+ semi: true,
+ singleQuote: true,
+ quoteProps: "as-needed",
+ jsxSingleQuote: false,
+ trailingComma: "all",
+ bracketSpacing: true,
+ jsxBracketSameLine: true,
+ arrowParens: "avoid",
+ rangeStart: 0,
+ rangeEnd: Infinity,
+ requirePragma: false,
+ insertPragma: false,
+ proseWrap: "preserve",
+ htmlWhitespaceSensitivity: "css",
+ vueIndentScriptAndStyle: false,
+ endOfLine: "lf",
+ embeddedLanguageFormatting: "auto",
+};
diff --git a/README.md b/README.md
index 2cf1eb9..2aa8361 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,26 @@
-# N年前写的年会抽奖程序
+# 网上看到一个不错的年会抽奖程序改良版
-[demo](https://fouber.github.io/lottery/)
+## 使用和改动须知
+1. 需要成员需要提前替换,可以按照`member.js`文件中的格式来填入
+2. 这个抽奖小程序使用的是本地`localStorage`来存储,刷新后之前抽奖数据会保留,需要重置后数据才会清空
+3. 如果需要替换下面的按钮名字和值,替换`index.html`中的`btns`变量即可,具体可以看代码
+## 抽奖流程
-## 抽奖流程:
+> 滚动鼠标滚轮,可以放大或缩小球体
-1. 选择当次要抽奖的人数(30、10、5、2、1)
-2. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数)
-3. 点击『停!』按钮,生成抽奖结果
-4. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中
+1. 用浏览器打开文件夹中的`index.html`文件
+2. 选择当次要抽奖的人数
+3. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数)
+4. 点击『停!』按钮,生成抽奖结果
+5. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中
-PS:滚动鼠标滚轮,可以放大或缩小球体
\ No newline at end of file
+## 小工具
+
+如果你只有名字,需要生成`member.js`中的格式,可以在浏览器控制台按照以下方式生成:
+
+```JavaScript
+arr = ['张三', '李四', '王五', '赵二'];
+copy(arr.map((e,i)=>{return {phone:`No.${i+1}`, name:e}}))
+```
diff --git a/css/main.css b/css/main.css
new file mode 100644
index 0000000..ab7bfe1
--- /dev/null
+++ b/css/main.css
@@ -0,0 +1,248 @@
+body,
+html {
+ width: 100%;
+ height: 100%;
+}
+
+.wall {
+ background-image: url(../img/icon-wall.jpg);
+ overflow: hidden;
+ background-color: #121936;
+ background-size: 100% 100%;
+ background-position: center center;
+ background-repeat: no-repeat;
+ line-height: 0;
+}
+
+.result {
+ position: absolute;
+ height: 320px;
+ width: 100%;
+ left: 0;
+ top: 50%;
+ margin-top: -160px;
+ text-align: center;
+ padding: 10px;
+ display: none;
+}
+
+.winnerRecords {
+ position: absolute;
+ height: 320px;
+ width: 100%;
+ left: 0;
+ top: 50%;
+ margin-top: -160px;
+ text-align: center;
+ padding: 10px;
+ display: none;
+ overflow-y: auto;
+}
+
+.winnerRecords::-webkit-scrollbar {
+ width: 6px;
+ height: 100%;
+}
+.winnerRecords::-webkit-scrollbar-thumb {
+ width: 4px;
+ height: 60px;
+ background-color: #ccc;
+ border-radius: 3px;
+}
+.winnerRecords::-webkit-scrollbar-track {
+ border-radius: 10px;
+ background-color: rgba(255, 255, 255, 0.5);
+}
+
+.winnerRecord {
+ display: block;
+ font-size: 25px;
+ width: 100%;
+ background: #fff;
+ line-height: 30px;
+ color: #000;
+ margin: 5px;
+ border-radius: 10px;
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
+ padding: 10px 10px;
+ margin: 10px auto 10px auto;
+ text-align: left;
+}
+
+.result span {
+ display: inline-block;
+ font-size: 25px;
+ width: 150px;
+ background: #fff;
+ line-height: 30px;
+ color: #000;
+ margin: 5px;
+ border-radius: 10px;
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
+ padding: 10px 0;
+}
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit;
+ font: inherit;
+ margin: 0;
+ border: none;
+}
+
+button {
+ overflow: visible;
+}
+
+button,
+select {
+ text-transform: none;
+}
+
+button,
+html input[type='button'],
+input[type='reset'],
+input[type='submit'] {
+ -webkit-appearance: button;
+ cursor: pointer;
+}
+
+.pure-button {
+ display: inline-block;
+ zoom: 1;
+ line-height: normal;
+ white-space: nowrap;
+ vertical-align: middle;
+ text-align: center;
+ cursor: pointer;
+ -webkit-user-drag: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.pure-button {
+ font-family: inherit;
+ font-size: 100%;
+ padding: 0.5em 1em;
+ color: #444;
+ color: rgba(0, 0, 0, 0.8);
+ border: 0 rgba(0, 0, 0, 0);
+ background-color: #e6e6e6;
+ text-decoration: none;
+ border-radius: 2px;
+}
+
+.pure-button:focus {
+ outline: 0;
+}
+
+.pure-button-hover,
+.pure-button:hover,
+.pure-button:focus {
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);
+ background-image: -webkit-gradient(
+ linear,
+ 0 0,
+ 0 100%,
+ from(transparent),
+ color-stop(40%, rgba(0, 0, 0, 0.05)),
+ to(rgba(0, 0, 0, 0.1))
+ );
+ background-image: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
+ background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.05) 0, rgba(0, 0, 0, 0.1));
+ background-image: -o-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
+ background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1));
+}
+
+.button-success,
+.button-error,
+.button-warning,
+.button-secondary {
+ color: white;
+ border-radius: 4px;
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
+}
+
+.button-success {
+ background: rgb(28, 184, 65);
+}
+
+.button-error {
+ background: rgb(202, 60, 60);
+}
+
+.button-warning {
+ background: rgb(223, 117, 20);
+}
+
+.button-secondary {
+ background: rgb(66, 184, 221);
+}
+
+.tools {
+ position: absolute;
+ bottom: 20px;
+ right: 20px;
+ text-align: center;
+}
+
+.tools .pure-button {
+ display: inline-block;
+ margin: 5px;
+ padding: 10px 0;
+ text-align: center;
+ width: 100px;
+}
+
+.mask {
+ -webkit-filter: blur(5px);
+ filter: blur(5px);
+}
+
+#main {
+ -webkit-transition: all 1s;
+ transition: all 1s;
+}
+
+.result-btn {
+ position: absolute;
+ margin: 20px 25px 0 0;
+ right: 0px;
+}
+
+.member {
+ color: #fff;
+}
+
+.winner {
+ color: #ff0;
+}
+
+.anouncement {
+ color: #fff;
+}
+
+input {
+ outline-style: none;
+ border: 1px solid #ccc;
+ border-radius: 3px;
+ padding: 10px 14px;
+ width: 100px;
+ font-size: 14px;
+ font-weight: 700;
+}
+
+input:focus {
+ border-color: #66afe9;
+ outline: 0;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
+}
diff --git a/css/reset.css b/css/reset.css
index bb9d34f..b59d4bf 100644
--- a/css/reset.css
+++ b/css/reset.css
@@ -3,55 +3,95 @@
cursor: pointer;
}
-body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre,
-form, fieldset, input, textarea, p, blockquote, th, td {
- padding: 0;
- margin: 0;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- word-wrap: break-word;
- word-break: break-all;
+body,
+div,
+dl,
+dt,
+dd,
+ul,
+ol,
+li,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+pre,
+form,
+fieldset,
+input,
+textarea,
+p,
+blockquote,
+th,
+td {
+ padding: 0;
+ margin: 0;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ word-wrap: break-word;
+ word-break: break-all;
}
table {
- border-collapse: collapse;
- border-spacing: 0;
+ border-collapse: collapse;
+ border-spacing: 0;
}
-fieldset, img {
- border: 0;
+fieldset,
+img {
+ border: 0;
}
-address, caption, cite, code, dfn, em, strong, th, var {
- font-weight: normal;
- font-style: normal;
+address,
+caption,
+cite,
+code,
+dfn,
+em,
+strong,
+th,
+var {
+ font-weight: normal;
+ font-style: normal;
}
-ol, ul {
- list-style: none;
+ol,
+ul {
+ list-style: none;
}
-caption, th {
- text-align: left;
+caption,
+th {
+ text-align: left;
}
-h1, h2, h3, h4, h5, h6, i {
- font-weight: normal;
- font-style: normal;
- font-size: 100%;
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+i {
+ font-weight: normal;
+ font-style: normal;
+ font-size: 100%;
}
-q:before, q:after {
- content:'';
+q:before,
+q:after {
+ content: '';
}
-abbr, acronym {
- border: 0;
+abbr,
+acronym {
+ border: 0;
}
body {
- font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun;
- color: #333;
- line-height: 22px;
- font-size: 16px;
-}
\ No newline at end of file
+ font-family: 'Hiragino Sans GB', 'DroidSansFallback', 'Microsoft YaHei', '微软雅黑', arial, simsun;
+ color: #333;
+ line-height: 22px;
+ font-size: 16px;
+}
diff --git a/css/wall.css b/css/wall.css
deleted file mode 100644
index 0ce63f4..0000000
--- a/css/wall.css
+++ /dev/null
@@ -1,140 +0,0 @@
-html, body {width: 100%; height: 100%;}
-.wall {width: 100%; height: 100%;
- background-image: url(../img/icon-wall.jpg);
- overflow: hidden;
- background-color: #121936;
- background-size: 100% 100% ;
- background-position: center center;
- background-repeat: no-repeat;}
-.photos-wall {width:100%; height:100%;}
-.messages {width: 30%; float: left; position: relative; top: 52px; left: 0}
-
-
-/*照片墙*/
-.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;}
-.wall .photo-title {
- position: absolute;
- top: -280px; left: 50%;
- background: url(../img/title.png) no-repeat 0 0;
- background-size: 100% auto;
- width: 800px; height: 350px;
- margin-left: -350px;
-}
-/*
-.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0;
- background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/
-.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;}
-.wall .photo {position: absolute;}
-.wall .photo .photo-inner{position: relative; width:100%;height: 100%;}
-.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;}
-.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/}
-.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/}
-.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;}
-.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;}
-@-webkit-keyframes show_photo{
- 0% {opacity:0;-webkit-transform:scale(0, 0);}
- 100% { opacity:1;-webkit-transform:scale(1, 1);}
-}
-@-webkit-keyframes hide_photo{
- 0% {opacity:1;}
- 100% { opacity:0;}
-}
-/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/
-/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/
-/*.wall .photo .photo-inner .show{opacity: 1;}*/
-/*.wall .photo .photo-inner .hide{opacity: 0;}*/
-
-.wall .photo img {
- width: 100%; height: 100%;
- box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8);
-}
-
-.wall .pos-0 {top:10px; left:0;width:65px; height:65px;}
-.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;}
-.wall .pos-2 {top:0; left:145px;width:100px;height:100px;}
-.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;}
-.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;}
-.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;}
-.wall .pos-6{top:15px; left:520px;width:65px;height:65px;}
-.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;}
-
-.wall .pos-8{top:105px; left:40px;width:80px;height:80px;}
-.wall .pos-9{top:105px; left:125px;width:80px;height:80px;}
-.wall .pos-10{top:105px; left:210px;width:110px;height:110px;}
-.wall .pos-11{top:160px; left:325px;width:85px;height:85px;}
-.wall .pos-12{top:160px; left:415px;width:80px;height:80px;}
-.wall .pos-13{top:160px; left:500px;width:100px;height:100px;}
-.wall .pos-14{top:85px; left:520px;width:70px;height:70px;}
-
-.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;}
-
-.wall .pos-16{top:190px; left:30px;width:70px;height:70px;}
-.wall .pos-17{top:190px; left:105px;width:100px;height:100px;}
-
-.wall .pos-18{top:220px; left:210px;width:110px;height:110px;}
-
-.wall .pos-19{top:250px; left:325px;width:85px;height:85px;}
-.wall .pos-20{top:245px; left:415px;width:75px;height:75px;}
-.wall .pos-21{top:265px; left:500px;width:85px;height:85px;}
-.wall .pos-22{top:70px; left:595px;width:85px;height:85px;}
-.wall .pos-23{top:160px; left:605px;width:75px;height:75px;}
-.wall .pos-24{top:240px; left:605px;width:65px;height:65px;}
-.wall .pos-25{top:310px; left:650px;width:60px;height:60px;}
-.wall .pos-26{top:265px; left:37px;width:65px;height:65px;}
-.wall .pos-27{
- top: 15px;
-left: 685px;
-width: 65px;
-height: 65px;}
-.wall .pos-28{top: -67px;
-left: 685px;
-width: 75px;
-height: 75px;}
-
-
-
-.wall .pos-29{top: 103px;
-left: -44px;
-width: 75px;
-height: 75px;}
-.wall .pos-30{top: -45px;
-left: -81px;
-width: 75px;
-height: 75px;}
-
-.wall .pos-31 {
-top: 295px;
-left: 105px;
-width: 60px;
-height: 60px;
-}
-
-.wall .pos-32 {
-top: 240px;
-left: 675px;
-width: 65px;
-height: 65px;
-}
-
-.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;}
-/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/
-/*.wall .message { margin: 25px 35px 25px 10px;}*/
-.wall .message {margin: 25px 35px 25px 50px;}
-.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;}
-
-.wall .message{height: auto;overflow: hidden;opacity: 1;}
-.wall .message.newMsg {-webkit-animation: change_height .7s linear;}
- @-webkit-keyframes change_height{
- 0% {opacity:0;height: 0;}
- 100% { opacity:1;height:32px;}
- }
-
-.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;}
-
-.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;}
-
-#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;}
-#qrcode img{width:100%;}
-#qrcode {background: white; padding: 5px;}
-
-.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;}
\ No newline at end of file
diff --git a/index.html b/index.html
index e92b760..2b05c93 100755
--- a/index.html
+++ b/index.html
@@ -1,272 +1,44 @@
+
-
+
年会抽奖小程序
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/allMembers.js b/js/allMembers.js
new file mode 100644
index 0000000..c4e5133
--- /dev/null
+++ b/js/allMembers.js
@@ -0,0 +1,134 @@
+var allMembers = [
+ {
+ phone: 'No.1',
+ name: '骆晶明',
+ },
+ {
+ phone: 'No.2',
+ name: '高菲菲',
+ },
+ {
+ phone: 'No.3',
+ name: '康琪',
+ },
+ {
+ phone: 'No.4',
+ name: '李静',
+ },
+ {
+ phone: 'No.5',
+ name: '刘静',
+ },
+ {
+ phone: 'No.6',
+ name: '陈静',
+ },
+ {
+ phone: 'No.7',
+ name: '夏美玲',
+ },
+ {
+ phone: 'No.8',
+ name: '宋亚萍',
+ },
+ {
+ phone: 'No.9',
+ name: '冯秀娟',
+ },
+ {
+ phone: 'No.10',
+ name: '唐晨',
+ },
+ {
+ phone: 'No.11',
+ name: '邱敏欣',
+ },
+ {
+ phone: 'No.12',
+ name: '杨云',
+ },
+ {
+ phone: 'No.13',
+ name: '王青',
+ },
+ {
+ phone: 'No.14',
+ name: '王馨悦',
+ },
+ {
+ phone: 'No.15',
+ name: '芦丹',
+ },
+ {
+ phone: 'No.16',
+ name: '李静雯',
+ },
+ {
+ phone: 'No.17',
+ name: '徐亭亭',
+ },
+ {
+ phone: 'No.18',
+ name: '杜祝英',
+ },
+ {
+ phone: 'No.19',
+ name: '董旭冉',
+ },
+ {
+ phone: 'No.20',
+ name: '杨露',
+ },
+ {
+ phone: 'No.21',
+ name: '孟瑞雪',
+ },
+ {
+ phone: 'No.22',
+ name: '孙金玥',
+ },
+ {
+ phone: 'No.23',
+ name: '刘素素',
+ },
+ {
+ phone: 'No.24',
+ name: '钟国伟',
+ },
+ {
+ phone: 'No.25',
+ name: '杨喆',
+ },
+ {
+ phone: 'No.26',
+ name: '王瑶',
+ },
+ {
+ phone: 'No.27',
+ name: '张莹',
+ },
+ {
+ phone: 'No.28',
+ name: '郭瑞',
+ },
+ {
+ phone: 'No.29',
+ name: '白力丞',
+ },
+ {
+ phone: 'No.30',
+ name: '胡学艺',
+ },
+ {
+ phone: 'No.31',
+ name: '韩月宾',
+ },
+ {
+ phone: 'No.32',
+ name: '朱洁',
+ },
+ {
+ phone: 'No.33',
+ name: '鲁萍',
+ },
+];
diff --git a/js/index.js b/js/index.js
new file mode 100644
index 0000000..8bbae18
--- /dev/null
+++ b/js/index.js
@@ -0,0 +1,242 @@
+const KEY = '_lottery_winner';
+const RECORD_KEY = '_lottery_winner_record';
+let winnerMap = new Map();
+let winRecords = [];
+
+function loadStorage() {
+ try {
+ let result = localStorage.getItem(KEY);
+ let record = localStorage.getItem(RECORD_KEY);
+
+ if (result && record) {
+ winnerMap = new Map(JSON.parse(result));
+ winRecords = JSON.parse(record);
+ } else {
+ winnerMap.clear();
+ winRecords = [];
+ }
+ } catch (e) {
+ console.error('读取数据异常', e);
+ }
+}
+
+function clearStorage() {
+ localStorage.clear(KEY);
+ localStorage.clear(RECORD_KEY);
+}
+
+function setStorage() {
+ localStorage.setItem(KEY, JSON.stringify(Array.from(winnerMap.entries())));
+ localStorage.setItem(RECORD_KEY, JSON.stringify(winRecords));
+}
+
+function addWinners(winners) {
+ winRecords.push({ time: Date.now(), winners });
+ winners.forEach(winner => {
+ winnerMap.set(getKey(winner), true);
+ });
+}
+
+function initTagCanvas() {
+ TagCanvas.Start('memberCanvas', '', {
+ textColour: null,
+ initial: speed(),
+ dragControl: 1,
+ textHeight: 14,
+ });
+}
+
+function speed() {
+ return [0.1 * Math.random() + 0.01, -(0.1 * Math.random() + 0.01)];
+}
+
+function speedUp() {
+ TagCanvas.SetSpeed('memberCanvas', speed());
+}
+
+function speedDown() {
+ TagCanvas.SetSpeed('memberCanvas', [5, 1]);
+}
+
+function reloadTagCanvas() {
+ TagCanvas.Reload('memberCanvas');
+}
+
+function getKey(item) {
+ return item.name + '-' + item.phone;
+}
+
+function updateCanvasInnerHTML() {
+ const html = [''];
+ allMembers.forEach(item => {
+ let className = winnerMap.has(getKey(item)) ? 'winner' : 'member';
+
+ html.push(`- ${item.name}
`);
+ });
+ html.push('
');
+ document.getElementById('memberCanvas').innerHTML = html.join('');
+}
+
+function getRandomMembers(members, selectedNumber) {
+ if (members.length <= selectedNumber) {
+ return [...members];
+ }
+
+ let currentSelectedMembers = [];
+
+ while (currentSelectedMembers.length < selectedNumber) {
+ let random = Math.floor(Math.random() * members.length);
+ let randomMember = members[random];
+ if (
+ currentSelectedMembers.findIndex(element => {
+ return element.name === randomMember.name;
+ }) === -1
+ ) {
+ currentSelectedMembers.push(randomMember);
+ }
+ }
+
+ return currentSelectedMembers;
+}
+
+function isWinner(member) {
+ return winnerMap.has(getKey(member));
+}
+
+function createWinnerHTML(winners) {
+ return winners.reduce((prev, next) => {
+ return `${prev}${next.phone}-${next.name}`;
+ }, '');
+}
+
+function createWinnerRecordsHTML() {
+ if (winRecords.length === 0) {
+ return `无记录!
`;
+ }
+
+ return winRecords.reduce((prev, next) => {
+ let winnersHTML = next.winners.map(winner => {
+ return `${winner.phone}-${winner.name}`;
+ });
+
+ return `${prev}${new Date(
+ next.time,
+ ).toLocaleString()}: ${winnersHTML.join(',')}
`;
+ }, '');
+}
+
+function hideWinnersMask() {
+ document.querySelector('#result').style.display = 'none';
+ document.querySelector('#main').classList.remove('mask');
+}
+
+function showWinnersMask() {
+ document.querySelector('#main').classList.add('mask');
+}
+
+function hideWinnerRecords() {
+ let $winnerRecords = document.querySelector('#winnerRecords');
+ if ($winnerRecords.style.display !== ' none') {
+ $winnerRecords.innerHTML = '';
+ $winnerRecords.style.display = 'none';
+ }
+}
+
+function lottery(number) {
+ let notSelectedMembers = allMembers.filter(member => !isWinner(member));
+ let newWinners = getRandomMembers(notSelectedMembers, number);
+
+ addWinners(newWinners);
+ setStorage();
+
+ return newWinners;
+}
+
+function initVue() {
+ new Vue({
+ el: '#container',
+ data: {
+ selected: 3,
+ running: false,
+ btns: [
+ { name: '三等奖(3)人', value: 3 },
+ { name: '二等奖(2)人', value: 2 },
+ { name: '一等奖(1)人', value: 1 },
+ ],
+ },
+ mounted() {
+ updateCanvasInnerHTML();
+ initTagCanvas();
+ },
+ methods: {
+ reset: function () {
+ if (confirm('确定要重置么?所有之前的抽奖历史将被清除!')) {
+ hideWinnerRecords();
+ hideWinnersMask();
+
+ clearStorage();
+ loadStorage();
+ updateCanvasInnerHTML();
+ reloadTagCanvas();
+ }
+ },
+
+ loadStorageInfo() {
+ // if(confirm('是否需要读取之前的缓存记录?')) {
+
+ // }
+ loadStorage();
+ updateCanvasInnerHTML();
+ reloadTagCanvas();
+ },
+ showWinnerRecords() {
+ let $winnerRecords = document.querySelector('#winnerRecords');
+ if ($winnerRecords.style.display !== 'block') {
+ $winnerRecords.innerHTML = createWinnerRecordsHTML();
+ $winnerRecords.style.display = 'block';
+ }
+ },
+ onClick: function (num) {
+ hideWinnersMask();
+
+ this.selected = num;
+ },
+ toggle: function () {
+ hideWinnerRecords();
+ if (this.running) {
+ let $result = document.querySelector('#result');
+
+ speedUp();
+ if (allMembers.length === winnerMap.size) {
+ $result.style.display = 'block';
+ $result.innerHTML = '已抽完';
+ return;
+ }
+ let winners = lottery(this.selected);
+
+ $result.style.display = 'block';
+ $result.innerHTML = createWinnerHTML(winners);
+ updateCanvasInnerHTML();
+ reloadTagCanvas();
+ setTimeout(() => {
+ showWinnersMask();
+ }, 300);
+ } else {
+ hideWinnersMask();
+ speedDown();
+ }
+ this.running = !this.running;
+ },
+ },
+ });
+}
+
+function init() {
+ let canvas = document.querySelector('#memberCanvas');
+ canvas.width = document.body.offsetWidth;
+ canvas.height = document.body.offsetHeight;
+
+ initVue();
+}
+
+init();
diff --git a/js/member.js b/js/member.js
deleted file mode 100644
index ca2ea09..0000000
--- a/js/member.js
+++ /dev/null
@@ -1,1202 +0,0 @@
-var member = [
- {
- "phone": "No.2038",
- "name": "星野冥一"
- },
- {
- "phone": "No.0282",
- "name": "Mr.Q"
- },
- {
- "phone": "No.3392",
- "name": "一般人类"
- },
- {
- "phone": "No.8080",
- "name": "萝莉捕捉者"
- },
- {
- "phone": "No.3855",
- "name": "四代猫愿"
- },
- {
- "phone": "No.6389",
- "name": "人形大魔王"
- },
- {
- "phone": "No.4440",
- "name": "痴言心醉"
- },
- {
- "phone": "No.3170",
- "name": "渣瓜一隻"
- },
- {
- "phone": "No.1688",
- "name": "住之江圭太"
- },
- {
- "phone": "No.0018",
- "name": "九条鱼卡"
- },
- {
- "phone": "No.0318",
- "name": "nightor"
- },
- {
- "phone": "No.7712",
- "name": "井下落石"
- },
- {
- "phone": "No.6561",
- "name": "埃尔o妮娅"
- },
- {
- "phone": "No.1260",
- "name": "Sapha"
- },
- {
- "phone": "No.6280",
- "name": "西行寺蓝蓝路"
- },
- {
- "phone": "No.8517",
- "name": "堀江由衣"
- },
- {
- "phone": "No.2335",
- "name": "十万巫女"
- },
- {
- "phone": "No.2681",
- "name": "Halu"
- },
- {
- "phone": "No.4024",
- "name": "lupin"
- },
- {
- "phone": "No.0463",
- "name": "太阳主宰"
- },
- {
- "phone": "No.2423",
- "name": "alkd"
- },
- {
- "phone": "No.5357",
- "name": "Allenz"
- },
- {
- "phone": "No.8751",
- "name": "达也的背影"
- },
- {
- "phone": "No.0737",
- "name": "神隐少女"
- },
- {
- "phone": "No.5959",
- "name": "尐疯寳児不尐了"
- },
- {
- "phone": "No.8909",
- "name": "⌒袶醽之子↓"
- },
- {
- "phone": "No.8441",
- "name": "我家的二喵"
- },
- {
- "phone": "No.1746",
- "name": "维他酱酱"
- },
- {
- "phone": "No.2856",
- "name": "dodo"
- },
- {
- "phone": "No.6703",
- "name": "米哟哟的咧"
- },
- {
- "phone": "No.9092",
- "name": "一根呆毛"
- },
- {
- "phone": "No.3539",
- "name": "Nadia"
- },
- {
- "phone": "No.7180",
- "name": "hunter"
- },
- {
- "phone": "No.3679",
- "name": "名将FG"
- },
- {
- "phone": "No.5131",
- "name": "线性近似"
- },
- {
- "phone": "No.4146",
- "name": "LOCKOFF"
- },
- {
- "phone": "No.2812",
- "name": "jessie"
- },
- {
- "phone": "No.6918",
- "name": "unoo"
- },
- {
- "phone": "No.3776",
- "name": "上升气流君"
- },
- {
- "phone": "No.9873",
- "name": "匿名希望"
- },
- {
- "phone": "No.1240",
- "name": "下载好慢"
- },
- {
- "phone": "No.4839",
- "name": "敢来一炮么"
- },
- {
- "phone": "No.0832",
- "name": "高町奈叶"
- },
- {
- "phone": "No.5205",
- "name": "我来打酱油"
- },
- {
- "phone": "No.4787",
- "name": "JackDee"
- },
- {
- "phone": "No.2957",
- "name": "加藤雪冬"
- },
- {
- "phone": "No.1294",
- "name": "轻抿一口菊花茶"
- },
- {
- "phone": "No.2104",
- "name": "捕猎Xloli"
- },
- {
- "phone": "No.3113",
- "name": "南山有瓜"
- },
- {
- "phone": "No.8897",
- "name": "きょうし"
- },
- {
- "phone": "No.1823",
- "name": "50cent"
- },
- {
- "phone": "No.4174",
- "name": "菊花交出来"
- },
- {
- "phone": "No.2189",
- "name": "Fire小殳"
- },
- {
- "phone": "No.1691",
- "name": "漆黑の斗狼"
- },
- {
- "phone": "No.9511",
- "name": "远野志贵"
- },
- {
- "phone": "No.1513",
- "name": "12週期新月"
- },
- {
- "phone": "No.1881",
- "name": "狂气的月的兔"
- },
- {
- "phone": "No.8433",
- "name": "田村ゆかり"
- },
- {
- "phone": "No.4468",
- "name": "右代宫战人"
- },
- {
- "phone": "No.2172",
- "name": "藤原妹紅"
- },
- {
- "phone": "No.1038",
- "name": "萌萌自由"
- },
- {
- "phone": "No.8794",
- "name": "八宝五圆杀"
- },
- {
- "phone": "No.0869",
- "name": "Raryooh"
- },
- {
- "phone": "No.6173",
- "name": "3y3s"
- },
- {
- "phone": "No.0857",
- "name": "长门有妻"
- },
- {
- "phone": "No.3128",
- "name": "装满酱油的好船"
- },
- {
- "phone": "No.9433",
- "name": "超魔理沙"
- },
- {
- "phone": "No.5573",
- "name": "灯灯灯等"
- },
- {
- "phone": "No.6059",
- "name": "回lao家结婚"
- },
- {
- "phone": "No.9924",
- "name": "奥妮克西娅"
- },
- {
- "phone": "No.7851",
- "name": "道羝王者"
- },
- {
- "phone": "No.3350",
- "name": "加納佳代子"
- },
- {
- "phone": "No.0520",
- "name": "K - MAID"
- },
- {
- "phone": "No.2617",
- "name": "山寨荼荼丸1"
- },
- {
- "phone": "No.7819",
- "name": "墙角渣渣颓废子"
- },
- {
- "phone": "No.1714",
- "name": "心理医生"
- },
- {
- "phone": "No.8236",
- "name": "加纳佳代子"
- },
- {
- "phone": "No.8025",
- "name": "库里艾拉"
- },
- {
- "phone": "No.9004",
- "name": "手只是装饰"
- },
- {
- "phone": "No.9650",
- "name": "秋庭里香酱"
- },
- {
- "phone": "No.0829",
- "name": "彼方和歌"
- },
- {
- "phone": "No.2356",
- "name": "里世界的我"
- },
- {
- "phone": "No.2219",
- "name": "七夜栗琦不姓朱"
- },
- {
- "phone": "No.5832",
- "name": "玄岚法師"
- },
- {
- "phone": "No.1550",
- "name": "staya"
- },
- {
- "phone": "No.5450",
- "name": "露露緹娅"
- },
- {
- "phone": "No.9498",
- "name": "朝仓音姬"
- },
- {
- "phone": "No.6912",
- "name": "东方橘君"
- },
- {
- "phone": "No.1414",
- "name": "幻月之舞"
- },
- {
- "phone": "No.9994",
- "name": "六月沐夏w"
- },
- {
- "phone": "No.8350",
- "name": "推倒不管埋"
- },
- {
- "phone": "No.2392",
- "name": "约修亚布莱特"
- },
- {
- "phone": "No.1506",
- "name": "白钟莎罗"
- },
- {
- "phone": "No.4702",
- "name": "翻滚吧贡丸"
- },
- {
- "phone": "No.7014",
- "name": "安布雷拉"
- },
- {
- "phone": "No.9099",
- "name": "钉宫病重症患"
- },
- {
- "phone": "No.4343",
- "name": "摘花五十铃"
- },
- {
- "phone": "No.6606",
- "name": "阿SAM"
- },
- {
- "phone": "No.5478",
- "name": "qoyozy"
- },
- {
- "phone": "No.2292",
- "name": "沙漠孤魂"
- },
- {
- "phone": "No.2879",
- "name": "WSDS"
- },
- {
- "phone": "No.6300",
- "name": "刀子子刀"
- },
- {
- "phone": "No.6392",
- "name": "CNo15"
- },
- {
- "phone": "No.8092",
- "name": "地狱の天使"
- },
- {
- "phone": "No.0647",
- "name": "幻月陇睨"
- },
- {
- "phone": "No.1289",
- "name": "家具全毁"
- },
- {
- "phone": "No.9142",
- "name": "fishal"
- },
- {
- "phone": "No.0853",
- "name": "Miku的内裤"
- },
- {
- "phone": "No.6973",
- "name": "铃仙因番"
- },
- {
- "phone": "No.3898",
- "name": "╲PAD长╱"
- },
- {
- "phone": "No.9806",
- "name": "呼噜leon"
- },
- {
- "phone": "No.8117",
- "name": "CCAV"
- },
- {
- "phone": "No.8835",
- "name": "xxmu317"
- },
- {
- "phone": "No.6238",
- "name": "水無灯里"
- },
- {
- "phone": "No.3758",
- "name": "高达试作1号机"
- },
- {
- "phone": "No.8718",
- "name": "蓬莱山の辉夜"
- },
- {
- "phone": "No.3226",
- "name": "久保帶人"
- },
- {
- "phone": "No.0577",
- "name": "山那边的饼子"
- },
- {
- "phone": "No.9028",
- "name": "木下秀吉"
- },
- {
- "phone": "No.5881",
- "name": "アルファルド"
- },
- {
- "phone": "No.3443",
- "name": "normal"
- },
- {
- "phone": "No.3541",
- "name": "ORZlag"
- },
- {
- "phone": "No.8875",
- "name": "传说中的废材"
- },
- {
- "phone": "No.7828",
- "name": "搞基按次收费"
- },
- {
- "phone": "No.8828",
- "name": "御坂妹妹"
- },
- {
- "phone": "No.6552",
- "name": "蓬莱山輝夜"
- },
- {
- "phone": "No.6784",
- "name": "白龙跃居紫玉星"
- },
- {
- "phone": "No.5513",
- "name": "达玛婆婆"
- },
- {
- "phone": "No.7891",
- "name": "我可不敢和你争"
- },
- {
- "phone": "No.7607",
- "name": "伊吹风子"
- },
- {
- "phone": "No.9754",
- "name": "亲爱的翠翠"
- },
- {
- "phone": "No.0933",
- "name": "クオリア"
- },
- {
- "phone": "No.1989",
- "name": "深水阳菜"
- },
- {
- "phone": "No.3730",
- "name": "骑车的牛"
- },
- {
- "phone": "No.7281",
- "name": "karma"
- },
- {
- "phone": "No.2933",
- "name": "元首的笔"
- },
- {
- "phone": "No.7132",
- "name": "瞌睡の默默"
- },
- {
- "phone": "No.3869",
- "name": "灰过灰过"
- },
- {
- "phone": "No.6211",
- "name": "水无灯里"
- },
- {
- "phone": "No.2067",
- "name": "川添珠姬"
- },
- {
- "phone": "No.7349",
- "name": "水桥帕露西"
- },
- {
- "phone": "No.0828",
- "name": "Loki"
- },
- {
- "phone": "No.3081",
- "name": "不识院苍月"
- },
- {
- "phone": "No.6784",
- "name": "空闲蝙蝠"
- },
- {
- "phone": "No.6257",
- "name": "愉悦的小蛇君"
- },
- {
- "phone": "No.4402",
- "name": "月光下的追忆"
- },
- {
- "phone": "No.1745",
- "name": "mono"
- },
- {
- "phone": "No.7825",
- "name": "ritz"
- },
- {
- "phone": "No.7509",
- "name": "狂暴四倍速"
- },
- {
- "phone": "No.9798",
- "name": "绯鵺之森"
- },
- {
- "phone": "No.4168",
- "name": "井上美羽"
- },
- {
- "phone": "No.2310",
- "name": "人形大魔王V"
- },
- {
- "phone": "No.8251",
- "name": "坂上斗真"
- },
- {
- "phone": "No.3271",
- "name": "真目斗真"
- },
- {
- "phone": "No.5871",
- "name": "我才不是触手"
- },
- {
- "phone": "No.2562",
- "name": "云雀恭弥"
- },
- {
- "phone": "No.1477",
- "name": "中禅寺远子"
- },
- {
- "phone": "No.1566",
- "name": "惡魔の禮讚"
- },
- {
- "phone": "No.7651",
- "name": "reno"
- },
- {
- "phone": "No.1979",
- "name": "八九寺真宵"
- },
- {
- "phone": "No.0749",
- "name": "睡意朦胧"
- },
- {
- "phone": "No.3888",
- "name": "峰岛由宇"
- },
- {
- "phone": "No.6929",
- "name": "终于整得号了"
- },
- {
- "phone": "No.4990",
- "name": "猥琐神教教徒"
- },
- {
- "phone": "No.5406",
- "name": "玻璃渣渣"
- },
- {
- "phone": "No.8348",
- "name": "dio的世界"
- },
- {
- "phone": "No.3779",
- "name": "洩矢诹访子"
- },
- {
- "phone": "No.6907",
- "name": "冰蓝若幻"
- },
- {
- "phone": "No.3014",
- "name": "鵺野鸣介"
- },
- {
- "phone": "No.3244",
- "name": "村纱水蜜"
- },
- {
- "phone": "No.6815",
- "name": "D..猫殿"
- },
- {
- "phone": "No.6466",
- "name": "河城荷取"
- },
- {
- "phone": "No.4002",
- "name": "月光下的八雲紫"
- },
- {
- "phone": "No.9101",
- "name": "御坂御坂"
- },
- {
- "phone": "No.3374",
- "name": "火焰猫燐"
- },
- {
- "phone": "No.1151",
- "name": "云居一轮"
- },
- {
- "phone": "No.0128",
- "name": "日野あかね"
- },
- {
- "phone": "No.3955",
- "name": "存在感↓"
- },
- {
- "phone": "No.3178",
- "name": "纱 亚美丶"
- },
- {
- "phone": "No.0023",
- "name": "十六夜咲夜℡"
- },
- {
- "phone": "No.9882",
- "name": "金坷垃直销"
- },
- {
- "phone": "No.8628",
- "name": "羽桐柠檬"
- },
- {
- "phone": "No.4824",
- "name": "石之纷如"
- },
- {
- "phone": "No.2931",
- "name": "聖地大哥"
- },
- {
- "phone": "No.7093",
- "name": "admin "
- },
- {
- "phone": "No.5541",
- "name": "佐天泪子"
- },
- {
- "phone": "No.4469",
- "name": "池田由纪"
- },
- {
- "phone": "No.6416",
- "name": "三千院风"
- },
- {
- "phone": "No.1934",
- "name": "轻闭双眼"
- },
- {
- "phone": "No.9001",
- "name": "小狐仙仙"
- },
- {
- "phone": "No.8177",
- "name": "阿道夫希特勒"
- },
- {
- "phone": "No.4009",
- "name": "高岭爱花"
- },
- {
- "phone": "No.0536",
- "name": "snoopy"
- },
- {
- "phone": "No.6819",
- "name": "Maiニャン"
- },
- {
- "phone": "No.9980",
- "name": "怜情惜缘"
- },
- {
- "phone": "No.1778",
- "name": "柾木天地"
- },
- {
- "phone": "No.8285",
- "name": "混乱与雄伟大臣"
- },
- {
- "phone": "No.7089",
- "name": "茵蒂克丝"
- },
- {
- "phone": "No.4694",
- "name": "哈曼卡恩"
- },
- {
- "phone": "No.7697",
- "name": "┼六夜咲夜"
- },
- {
- "phone": "No.4458",
- "name": "一方通行"
- },
- {
- "phone": "No.0593",
- "name": "forluna"
- },
- {
- "phone": "No.6579",
- "name": "红颜晕墨色"
- },
- {
- "phone": "No.0276",
- "name": "絕望先生"
- },
- {
- "phone": "No.2417",
- "name": "我是伪的人"
- },
- {
- "phone": "No.1831",
- "name": "藍沢ヒカル"
- },
- {
- "phone": "No.4487",
- "name": "我爱吃黄瓜"
- },
- {
- "phone": "No.5587",
- "name": "毅丝不挂"
- },
- {
- "phone": "No.7726",
- "name": "无聊至极"
- },
- {
- "phone": "No.7721",
- "name": "哎哟射你"
- },
- {
- "phone": "No.8680",
- "name": "琴吹七濑"
- },
- {
- "phone": "No.5445",
- "name": "欧泥酱~"
- },
- {
- "phone": "No.7369",
- "name": "枫の雨菡"
- },
- {
- "phone": "No.5991",
- "name": "望尘莫及"
- },
- {
- "phone": "No.6437",
- "name": "新的沙包"
- },
- {
- "phone": "No.8579",
- "name": "崩坏の狸猫"
- },
- {
- "phone": "No.7952",
- "name": "伪の琪露诺"
- },
- {
- "phone": "No.0675",
- "name": "戏言跟班"
- },
- {
- "phone": "No.2894",
- "name": "七転八倒"
- },
- {
- "phone": "No.2213",
- "name": "米娜·柴佩西"
- },
- {
- "phone": "No.2686",
- "name": "в.α.d"
- },
- {
- "phone": "No.6736",
- "name": "佐佐玛利亚"
- },
- {
- "phone": "No.1785",
- "name": "CCAV - H"
- },
- {
- "phone": "No.8544",
- "name": "咕噜噜XD"
- },
- {
- "phone": "No.5730",
- "name": "siriusY"
- },
- {
- "phone": "No.7852",
- "name": ".@.@."
- },
- {
- "phone": "No.2050",
- "name": "生女当如泉此方"
- },
- {
- "phone": "No.2505",
- "name": "鞠部有羽"
- },
- {
- "phone": "No.7396",
- "name": "Skaka - 冰"
- },
- {
- "phone": "No.1046",
- "name": "泷月まなつ"
- },
- {
- "phone": "No.0039",
- "name": "天草十三"
- },
- {
- "phone": "No.7358",
- "name": "八城十八"
- },
- {
- "phone": "No.0815",
- "name": "ee.zsy"
- },
- {
- "phone": "No.0088",
- "name": "ユリ.妖"
- },
- {
- "phone": "No.9780",
- "name": "夢の雪緣"
- },
- {
- "phone": "No.8224",
- "name": "光电総菊"
- },
- {
- "phone": "No.5922",
- "name": "夕阳月梦"
- },
- {
- "phone": "No.3149",
- "name": "lj之成"
- },
- {
- "phone": "No.9229",
- "name": "发奋涂墙不能"
- },
- {
- "phone": "No.4397",
- "name": "莪悩殘孒"
- },
- {
- "phone": "No.6519",
- "name": "人间失格"
- },
- {
- "phone": "No.1967",
- "name": "姬路瑞希"
- },
- {
- "phone": "No.2663",
- "name": "亞特蘭斯蒂"
- },
- {
- "phone": "No.9624",
- "name": "上条当妈"
- },
- {
- "phone": "No.2978",
- "name": "油焖罐头"
- },
- {
- "phone": "No.8795",
- "name": "┿六夜咲夜"
- },
- {
- "phone": "No.9272",
- "name": "pjj007"
- },
- {
- "phone": "No.9188",
- "name": "风灵の礼赞"
- },
- {
- "phone": "No.8639",
- "name": "傻逼同化中心"
- },
- {
- "phone": "No.7784",
- "name": "托奇老师"
- },
- {
- "phone": "No.5276",
- "name": "竜骑士07"
- },
- {
- "phone": "No.5482",
- "name": "木之本小可"
- },
- {
- "phone": "No.7228",
- "name": "因幡てゐ"
- },
- {
- "phone": "No.8435",
- "name": "ばくまる"
- },
- {
- "phone": "No.3811",
- "name": "蛋疼超人"
- },
- {
- "phone": "No.0339",
- "name": "火星上的F91"
- },
- {
- "phone": "No.2985",
- "name": "木下優子"
- },
- {
- "phone": "No.6558",
- "name": "上条 - 当麻"
- },
- {
- "phone": "No.4008",
- "name": "小五兄贵"
- },
- {
- "phone": "No.3978",
- "name": "linhxl"
- },
- {
- "phone": "No.9703",
- "name": "LINK"
- },
- {
- "phone": "No.6287",
- "name": "花生闲人"
- },
- {
- "phone": "No.0376",
- "name": "nono"
- },
- {
- "phone": "No.6635",
- "name": "allen"
- },
- {
- "phone": "No.2273",
- "name": "藤原兄肛"
- },
- {
- "phone": "No.9176",
- "name": "岛田美波"
- },
- {
- "phone": "No.6679",
- "name": "ZUN伞"
- },
- {
- "phone": "No.8407",
- "name": "我就是这么绅士"
- },
- {
- "phone": "No.1396",
- "name": "嘎嘎i狼"
- },
- {
- "phone": "No.2657",
- "name": "夏亚.阿兹纳布"
- },
- {
- "phone": "No.1602",
- "name": "TMCP123"
- },
- {
- "phone": "No.4119",
- "name": "纯情286"
- },
- {
- "phone": "No.4504",
- "name": "操蛇之神"
- },
- {
- "phone": "No.0869",
- "name": "铃仙·优昙华院"
- },
- {
- "phone": "No.7883",
- "name": "咆哮的由希"
- },
- {
- "phone": "No.2114",
- "name": "亡者王者"
- },
- {
- "phone": "No.3214",
- "name": "放开那个流氓"
- },
- {
- "phone": "No.2161",
- "name": "╂六夜咲夜"
- },
- {
- "phone": "No.2487",
- "name": "Elifaus"
- },
- {
- "phone": "No.0947",
- "name": "二小姐の玩具"
- },
- {
- "phone": "No.3867",
- "name": "吾妻玲二"
- },
- {
- "phone": "No.6884",
- "name": "逆袭の阿姆罗"
- },
- {
- "phone": "No.9884",
- "name": "给爷平滑"
- },
- {
- "phone": "No.3538",
- "name": "yyuhz"
- },
- {
- "phone": "No.6602",
- "name": "炉心熔解"
- },
- {
- "phone": "No.5757",
- "name": "风见幽香"
- },
- {
- "phone": "No.4833",
- "name": "拉尔夏娅"
- },
- {
- "phone": "No.6726",
- "name": "犯罪高手"
- },
- {
- "phone": "No.4343",
- "name": "华丽de没落"
- },
- {
- "phone": "No.4652",
- "name": "ViNO"
- },
- {
- "phone": "No.9206",
- "name": "狂图看天"
- },
- {
- "phone": "No.7008",
- "name": "圈圈外加叉叉"
- },
- {
- "phone": "No.1657",
- "name": "湛蓝之炎"
- },
- {
- "phone": "No.2802",
- "name": "迷茫的虫"
- },
- {
- "phone": "No.8920",
- "name": "欺霜胜雪"
- },
- {
- "phone": "No.1822",
- "name": "北方丈助"
- },
- {
- "phone": "No.9032",
- "name": "「沙耶の唄」"
- },
- {
- "phone": "No.5723",
- "name": "adfs88"
- },
- {
- "phone": "No.6327",
- "name": "cyc123"
- },
- {
- "phone": "No.5311",
- "name": "サリアの歌"
- }
-]
\ No newline at end of file
diff --git a/js/tagcanvas.js b/js/tagcanvas.js
deleted file mode 100644
index 24523e6..0000000
--- a/js/tagcanvas.js
+++ /dev/null
@@ -1,2102 +0,0 @@
-/**
- * Copyright (C) 2010-2015 Graham Breach
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-/**
- * TagCanvas 2.7
- * For more information, please contact
- */
-(function(){
-"use strict";
-var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max,
- min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow,
- hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = {
- 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,",
- 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,",
- b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,",
- e:"238,", E:"238,", f:"255,", F:"255,"
- }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto,
- doc = document, ocanvas, handlers = {};
-for(i = 0; i < 256; ++i) {
- j = i.toString(16);
- if(i < 16)
- j = '0' + j;
- hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ',';
-}
-function Defined(d) {
- return typeof d != 'undefined';
-}
-function IsObject(o) {
- return typeof o == 'object' && o != null;
-}
-function Clamp(v, mn, mx) {
- return isNaN(v) ? mx : min(mx, max(mn, v));
-}
-function Nop() {
- return false;
-}
-function TimeNow() {
- return new Date().valueOf();
-}
-function SortList(l, f) {
- var nl = [], tl = l.length, i;
- for(i = 0; i < tl; ++i)
- nl.push(l[i]);
- nl.sort(f);
- return nl;
-}
-function Shuffle(a) {
- var i = a.length-1, t, p;
- while(i) {
- p = ~~(Math.random()*i);
- t = a[i];
- a[i] = a[p];
- a[p] = t;
- --i;
- }
-}
-function Vector(x, y, z) {
- this.x = x;
- this.y = y;
- this.z = z;
-}
-Vproto = Vector.prototype;
-Vproto.length = function() {
- return sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
-};
-Vproto.dot = function(v) {
- return this.x * v.x + this.y * v.y + this.z * v.z;
-};
-Vproto.cross = function(v) {
- var x = this.y * v.z - this.z * v.y,
- y = this.z * v.x - this.x * v.z,
- z = this.x * v.y - this.y * v.x;
- return new Vector(x, y, z);
-};
-Vproto.angle = function(v) {
- var dot = this.dot(v), ac;
- if(dot == 0)
- return Math.PI / 2.0;
- ac = dot / (this.length() * v.length());
- if(ac >= 1)
- return 0;
- if(ac <= -1)
- return Math.PI;
- return Math.acos(ac);
-};
-Vproto.unit = function() {
- var l = this.length();
- return new Vector(this.x / l, this.y / l, this.z / l);
-};
-function MakeVector(lg, lt) {
- lt = lt * Math.PI / 180;
- lg = lg * Math.PI / 180;
- var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt);
- return new Vector(x, y, z);
-}
-function Matrix(a) {
- this[1] = {1: a[0], 2: a[1], 3: a[2]};
- this[2] = {1: a[3], 2: a[4], 3: a[5]};
- this[3] = {1: a[6], 2: a[7], 3: a[8]};
-}
-Mproto = Matrix.prototype;
-Matrix.Identity = function() {
- return new Matrix([1,0,0, 0,1,0, 0,0,1]);
-};
-Matrix.Rotation = function(angle, u) {
- var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa;
- return new Matrix([
- cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina,
- u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina,
- u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos
- ]);
-}
-Mproto.mul = function(m) {
- var a = [], i, j, mmatrix = (m.xform ? 1 : 0);
- for(i = 1; i <= 3; ++i)
- for(j = 1; j <= 3; ++j) {
- if(mmatrix)
- a.push(this[i][1] * m[1][j] +
- this[i][2] * m[2][j] +
- this[i][3] * m[3][j]);
- else
- a.push(this[i][j] * m);
- }
- return new Matrix(a);
-};
-Mproto.xform = function(p) {
- var a = {}, x = p.x, y = p.y, z = p.z;
- a.x = x * this[1][1] + y * this[2][1] + z * this[3][1];
- a.y = x * this[1][2] + y * this[2][2] + z * this[3][2];
- a.z = x * this[1][3] + y * this[2][3] + z * this[3][3];
- return a;
-};
-function PointsOnSphere(n,xr,yr,zr) {
- var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n;
- for(i = 0; i < n; ++i) {
- y = i * off - 1 + (off / 2);
- r = sqrt(1 - y*y);
- phi = i * inc;
- pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]);
- }
- return pts;
-}
-function Cylinder(n,o,xr,yr,zr) {
- var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l;
- for(i = 0; i < n; ++i) {
- j = i * off - 1 + (off / 2);
- phi = i * inc;
- k = cos(phi);
- l = sin(phi);
- pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]);
- }
- return pts;
-}
-function Ring(o, n, xr, yr, zr, j) {
- var phi, pts = [], inc = Math.PI * 2 / n, i, k, l;
- for(i = 0; i < n; ++i) {
- phi = i * inc;
- k = cos(phi);
- l = sin(phi);
- pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]);
- }
- return pts;
-}
-function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) }
-function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) }
-function PointsOnRingV(n, xr, yr, zr, offset) {
- offset = isNaN(offset) ? 0 : offset * 1;
- return Ring(0, n, xr, yr, zr, offset);
-}
-function PointsOnRingH(n, xr, yr, zr, offset) {
- offset = isNaN(offset) ? 0 : offset * 1;
- return Ring(1, n, xr, yr, zr, offset);
-}
-function CentreImage(t) {
- var i = new Image;
- i.onload = function() {
- var dx = i.width / 2, dy = i.height / 2;
- t.centreFunc = function(c, w, h, cx, cy) {
- c.setTransform(1, 0, 0, 1, 0, 0);
- c.globalAlpha = 1;
- c.drawImage(i, cx - dx, cy - dy);
- };
- };
- i.src = t.centreImage;
-}
-function SetAlpha(c,a) {
- var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')';
- if(c[0] === '#') {
- if(!hexlookup3[c])
- if(c.length === 4)
- hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]];
- else
- hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)];
- d = hexlookup3[c] + ae;
- } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') {
- d = (c.replace('(','a(').replace(')', ',' + ae));
- } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') {
- p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')');
- a *= parseFloat(c.substring(p1,p2));
- d = c.substr(0,p1) + a.toPrecision(3) + ')';
- }
- return d;
-}
-function NewCanvas(w,h) {
- // if using excanvas, give up now
- if(window.G_vmlCanvasManager)
- return null;
- var c = doc.createElement('canvas');
- c.width = w;
- c.height = h;
- return c;
-}
-// I think all browsers pass this test now...
-function ShadowAlphaBroken() {
- var cv = NewCanvas(3,3), c, i;
- if(!cv)
- return false;
- c = cv.getContext('2d');
- c.strokeStyle = '#000';
- c.shadowColor = '#fff';
- c.shadowBlur = 3;
- c.globalAlpha = 0;
- c.strokeRect(2,2,2,2);
- c.globalAlpha = 1;
- i = c.getImageData(2,2,1,1);
- cv = null;
- return (i.data[0] > 0);
-}
-function SetGradient(c, l, o, g) {
- var gd = c.createLinearGradient(0, 0, l, 0), i;
- for(i in g)
- gd.addColorStop(1 - i, g[i]);
- c.fillStyle = gd;
- c.fillRect(0, o, l, 1);
-}
-function FindGradientColour(tc, p, r) {
- var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d;
- if(tc.gCanvas) {
- c = tc.gCanvas.getContext('2d');
- h = tc.gCanvas.height;
- } else {
- if(IsObject(gl[0]))
- h = gl.length;
- else
- gl = [gl];
- tc.gCanvas = cv = NewCanvas(l, h);
- if(!cv)
- return null;
- c = cv.getContext('2d');
- for(i = 0; i < h; ++i)
- SetGradient(c, l, i, gl[i]);
- }
- r = max(min(r || 0, h - 1), 0);
- d = c.getImageData(~~((l - 1) * p), r, 1, 1).data;
- return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')';
-}
-function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour,
- shadowBlur, shadowOffsets, maxWidth, widths, align) {
- var xo = padx + (shadowBlur || 0) +
- (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0),
- yo = pady + (shadowBlur || 0) +
- (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc;
- ctxt.font = font;
- ctxt.textBaseline = 'top';
- ctxt.fillStyle = colour;
- shadowColour && (ctxt.shadowColor = shadowColour);
- shadowBlur && (ctxt.shadowBlur = shadowBlur);
- shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0],
- ctxt.shadowOffsetY = shadowOffsets[1]);
- for(i = 0; i < strings.length; ++i) {
- xc = 0;
- if(widths) {
- if('right' == align) {
- xc = maxWidth - widths[i];
- } else if('centre' == align) {
- xc = (maxWidth - widths[i]) / 2;
- }
- }
- ctxt.fillText(strings[i], xo + xc, yo);
- yo += parseInt(font);
- }
-}
-function RRect(c, x, y, w, h, r, s) {
- if(r) {
- c.beginPath();
- c.moveTo(x, y + h - r);
- c.arcTo(x, y, x + r, y, r);
- c.arcTo(x + w, y, x + w, y + r, r);
- c.arcTo(x + w, y + h, x + w - r, y + h, r);
- c.arcTo(x, y + h, x, y + h - r, r);
- c.closePath();
- c[s ? 'stroke' : 'fill']();
- } else {
- c[s ? 'strokeRect' : 'fillRect'](x, y, w, h);
- }
-}
-function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign,
- scale) {
- this.strings = strings;
- this.font = font;
- this.width = w;
- this.height = h;
- this.maxWidth = maxWidth;
- this.stringWidths = stringWidths;
- this.align = align;
- this.valign = valign;
- this.scale = scale;
-}
-TCVproto = TextCanvas.prototype;
-TCVproto.SetImage = function(image, w, h, position, padding, align, valign,
- scale) {
- this.image = image;
- this.iwidth = w * this.scale;
- this.iheight = h * this.scale;
- this.ipos = position;
- this.ipad = padding * this.scale;
- this.iscale = scale;
- this.ialign = align;
- this.ivalign = valign;
-};
-TCVproto.Align = function(size, space, a) {
- var pos = 0;
- if(a == 'right' || a == 'bottom')
- pos = space - size;
- else if(a != 'left' && a != 'top')
- pos = (space - size) / 2;
- return pos;
-};
-TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness,
- shadowColour, shadowBlur, shadowOffsets, padding, radius) {
- var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih,
- sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc;
- padding = max(padding, sox + shadowBlur, soy + shadowBlur);
- x1 = 2 * (padding + bgOutlineThickness);
- y1 = 2 * (padding + bgOutlineThickness);
- cw = this.width + x1;
- ch = this.height + y1;
- offx = offy = padding + bgOutlineThickness;
-
- if(this.image) {
- ix = iy = padding + bgOutlineThickness;
- iw = this.iwidth;
- ih = this.iheight;
- if(this.ipos == 'top' || this.ipos == 'bottom') {
- if(iw < this.width)
- ix += this.Align(iw, this.width, this.ialign);
- else
- offx += this.Align(this.width, iw, this.align);
- if(this.ipos == 'top')
- offy += ih + this.ipad;
- else
- iy += this.height + this.ipad;
- cw = max(cw, iw + x1);
- ch += ih + this.ipad;
- } else {
- if(ih < this.height)
- iy += this.Align(ih, this.height, this.ivalign);
- else
- offy += this.Align(this.height, ih, this.valign);
- if(this.ipos == 'right')
- ix += this.width + this.ipad;
- else
- offx += iw + this.ipad;
- cw += iw + this.ipad;
- ch = max(ch, ih + y1);
- }
- }
-
- cv = NewCanvas(cw, ch);
- if(!cv)
- return null;
- x1 = y1 = bgOutlineThickness / 2;
- x2 = cw - bgOutlineThickness;
- y2 = ch - bgOutlineThickness;
- c = cv.getContext('2d');
- if(bgColour) {
- c.fillStyle = bgColour;
- RRect(c, x1, y1, x2, y2, radius);
- }
- if(bgOutlineThickness) {
- c.strokeStyle = bgOutline;
- c.lineWidth = bgOutlineThickness;
- RRect(c, x1, y1, x2, y2, radius, true);
- }
- if(shadowBlur || sox || soy) {
- // use a transparent canvas to draw on
- shadowcv = NewCanvas(cw, ch);
- if(shadowcv) {
- shadowc = c;
- c = shadowcv.getContext('2d');
- }
- }
-
- // don't use TextSet shadow support because it adds space for shadow
- TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [],
- this.maxWidth, this.stringWidths, this.align);
-
- if(this.image)
- c.drawImage(this.image, ix, iy, iw, ih);
-
- if(shadowc) {
- // draw the text and image with the added shadow
- c = shadowc;
- shadowColour && (c.shadowColor = shadowColour);
- shadowBlur && (c.shadowBlur = shadowBlur);
- c.shadowOffsetX = shadowOffsets[0];
- c.shadowOffsetY = shadowOffsets[1];
- c.drawImage(shadowcv, 0, 0);
- }
- return cv;
-};
-function ExpandImage(i, w, h) {
- var cv = NewCanvas(w, h), c;
- if(!cv)
- return null;
- c = cv.getContext('2d');
- c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2);
- return cv;
-}
-function ScaleImage(i, w, h) {
- var cv = NewCanvas(w, h), c;
- if(!cv)
- return null;
- c = cv.getContext('2d');
- c.drawImage(i, 0, 0, w, h);
- return cv;
-}
-function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour,
- padding, radius, ofill) {
- var cw = w + ((2 * padding) + othickness) * scale,
- ch = h + ((2 * padding) + othickness) * scale,
- cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc;
- if(!cv)
- return null;
- othickness *= scale;
- radius *= scale;
- x1 = y1 = othickness / 2;
- x2 = cw - othickness;
- y2 = ch - othickness;
- padding = (padding * scale) + x1; // add space for outline
- c = cv.getContext('2d');
- if(colour) {
- c.fillStyle = colour;
- RRect(c, x1, y1, x2, y2, radius);
- }
- if(othickness) {
- c.strokeStyle = ocolour;
- c.lineWidth = othickness;
- RRect(c, x1, y1, x2, y2, radius, true);
- }
-
- if(ofill) {
- // use compositing to colour in the image and border
- ocanvas = NewCanvas(cw, ch);
- cc = ocanvas.getContext('2d');
- cc.drawImage(i, padding, padding, w, h);
- cc.globalCompositeOperation = 'source-in';
- cc.fillStyle = ocolour;
- cc.fillRect(0, 0, cw, ch);
- cc.globalCompositeOperation = 'destination-over';
- cc.drawImage(cv, 0, 0);
- cc.globalCompositeOperation = 'source-over';
- c.drawImage(ocanvas, 0, 0);
- } else {
- c.drawImage(i, padding, padding, i.width, i.height);
- }
- return {image: cv, width: cw / scale, height: ch / scale};
-}
-/**
- * Creates a new canvas containing the image and its shadow
- * Returns an object containing the image and its dimensions at z=0
- */
-function AddShadowToImage(i, w, h, scale, sc, sb, so) {
- var sw = abs(so[0]), sh = abs(so[1]),
- cw = w + (sw > sb ? sw + sb : sb * 2) * scale,
- ch = h + (sh > sb ? sh + sb : sb * 2) * scale,
- xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)),
- yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c;
- cv = NewCanvas(cw, ch);
- if(!cv)
- return null;
- c = cv.getContext('2d');
- sc && (c.shadowColor = sc);
- sb && (c.shadowBlur = sb * scale);
- so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale);
- c.drawImage(i, xo, yo, w, h);
- return {image: cv, width: cw / scale, height: ch / scale};
-}
-function FindTextBoundingBox(s,f,ht) {
- var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length),
- cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex;
- if(!cv)
- return null;
- c = cv.getContext('2d');
- c.fillStyle = '#000';
- c.fillRect(0,0,w,h);
- TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre')
-
- idata = c.getImageData(0,0,w,h);
- w1 = idata.width; h1 = idata.height;
- ex = {
- min: { x: w1, y: h1 },
- max: { x: -1, y: -1 }
- };
- for(y = 0; y < h1; ++y) {
- for(x = 0; x < w1; ++x) {
- i = (y * w1 + x) * 4;
- if(idata.data[i+1] > 0) {
- if(x < ex.min.x) ex.min.x = x;
- if(x > ex.max.x) ex.max.x = x;
- if(y < ex.min.y) ex.min.y = y;
- if(y > ex.max.y) ex.max.y = y;
- }
- }
- }
- // device pixels might not be css pixels
- if(w1 != w) {
- ex.min.x *= (w / w1);
- ex.max.x *= (w / w1);
- }
- if(h1 != h) {
- ex.min.y *= (w / h1);
- ex.max.y *= (w / h1);
- }
-
- cv = null;
- return ex;
-}
-function FixFont(f) {
- return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'";
-}
-function AddHandler(h,f,e) {
- e = e || doc;
- if(e.addEventListener)
- e.addEventListener(h,f,false);
- else
- e.attachEvent('on' + h, f);
-}
-function RemoveHandler(h,f,e) {
- e = e || doc;
- if(e.removeEventListener)
- e.removeEventListener(h, f);
- else
- e.detachEvent('on' + h, f);
-}
-function AddImage(i, o, t, tc) {
- var s = tc.imageScale, mscale, ic, bc, oc, iw, ih;
- // image not loaded, wait for image onload
- if(!o.complete)
- return AddHandler('load',function() { AddImage(i,o,t,tc); }, o);
- if(!i.complete)
- return AddHandler('load',function() { AddImage(i,o,t,tc); }, i);
-
- // Yes, this does look like nonsense, but it makes sure that both the
- // width and height are actually set and not just calculated. This is
- // required to keep proportional sizes when the images are hidden, so
- // the images can be used again for another cloud.
- o.width = o.width;
- o.height = o.height;
-
- if(s) {
- i.width = o.width * s;
- i.height = o.height * s;
- }
- // the standard width of the image, with imageScale applied
- t.iw = i.width;
- t.ih = i.height;
- if(tc.txtOpt) {
- ic = i;
- mscale = tc.zoomMax * tc.txtScale;
- iw = t.iw * mscale;
- ih = t.ih * mscale;
- if(iw < o.naturalWidth || ih < o.naturalHeight) {
- ic = ScaleImage(i, iw, ih);
- if(ic)
- t.fimage = ic;
- } else {
- iw = t.iw;
- ih = t.ih;
- mscale = 1;
- }
- if(!t.HasText()) {
- if(tc.shadow) {
- ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur,
- tc.shadowOffset);
- if(ic) {
- t.fimage = ic.image;
- t.w = ic.width;
- t.h = ic.height;
- }
- }
- if(tc.bgColour || tc.bgOutlineThickness) {
- bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') :
- tc.bgColour;
- oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') :
- (tc.bgOutline || tc.textColour);
- iw = t.fimage.width;
- ih = t.fimage.height;
- if(tc.outlineMethod == 'colour') {
- // create the outline version first, using the current image state
- ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc,
- tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1);
- if(ic)
- t.oimage = ic.image;
- }
- ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc,
- tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius);
- if(ic) {
- t.fimage = ic.image;
- t.w = ic.width;
- t.h = ic.height;
- }
- }
- if(tc.outlineMethod == 'size') {
- if(tc.outlineIncrease > 0) {
- t.iw += 2 * tc.outlineIncrease;
- t.ih += 2 * tc.outlineIncrease;
- iw = mscale * t.iw;
- ih = mscale * t.ih;
- ic = ScaleImage(t.fimage, iw, ih);
- t.oimage = ic;
- t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height);
- } else {
- iw = mscale * (t.iw + (2 * tc.outlineIncrease));
- ih = mscale * (t.ih + (2 * tc.outlineIncrease));
- ic = ScaleImage(t.fimage, iw, ih);
- t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height);
- }
- }
- }
- }
- t.Init();
-}
-function GetProperty(e,p) {
- var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()});
- return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) ||
- (e.currentStyle && e.currentStyle[pc]);
-}
-function FindWeight(a, wFrom, tHeight) {
- var w = 1, p;
- if(wFrom) {
- w = 1 * (a.getAttribute(wFrom) || tHeight);
- } else if(p = GetProperty(a,'font-size')) {
- w = (p.indexOf('px') > -1 && p.replace('px','') * 1) ||
- (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) ||
- p * 3.3;
- }
- return w;
-}
-function EventToCanvasId(e) {
- return e.target && Defined(e.target.id) ? e.target.id :
- e.srcElement.parentNode.id;
-}
-function EventXY(e, c) {
- var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width,
- ymul = parseInt(GetProperty(c, 'height')) / c.height;
- if(Defined(e.offsetX)) {
- xy = {x: e.offsetX, y: e.offsetY};
- } else {
- p = AbsPos(c.id);
- if(Defined(e.changedTouches))
- e = e.changedTouches[0];
- if(e.pageX)
- xy = {x: e.pageX - p.x, y: e.pageY - p.y};
- }
- if(xy && xmul && ymul) {
- xy.x /= xmul;
- xy.y /= ymul;
- }
- return xy;
-}
-function MouseOut(e) {
- var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id];
- if(tc) {
- tc.mx = tc.my = -1;
- tc.UnFreeze();
- tc.EndDrag();
- }
-}
-function MouseMove(e) {
- return;
- var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e);
- for(i in t.tc) {
- tc = t.tc[i];
- if(tc.tttimer) {
- clearTimeout(tc.tttimer);
- tc.tttimer = null;
- }
- }
- if(tg && t.tc[tg]) {
- tc = t.tc[tg];
- if(p = EventXY(e, tc.canvas)) {
- tc.mx = p.x;
- tc.my = p.y;
- tc.Drag(e, p);
- }
- tc.drawn = 0;
- }
-}
-function MouseDown(e) {
- var t = TagCanvas, cb = doc.addEventListener ? 0 : 1,
- tg = EventToCanvasId(e);
- if(tg && e.button == cb && t.tc[tg]) {
- t.tc[tg].BeginDrag(e);
- }
-}
-function MouseUp(e) {
- var t = TagCanvas, cb = doc.addEventListener ? 0 : 1,
- tg = EventToCanvasId(e), tc;
- if(tg && e.button == cb && t.tc[tg]) {
- tc = t.tc[tg];
- MouseMove(e);
- if(!tc.EndDrag() && !tc.touchState)
- tc.Clicked(e);
- }
-}
-function TouchDown(e) {
- var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p;
- if(tc && e.changedTouches) {
- if(e.touches.length == 1 && tc.touchState == 0) {
- tc.touchState = 1;
- tc.BeginDrag(e);
- if(p = EventXY(e, tc.canvas)) {
- tc.mx = p.x;
- tc.my = p.y;
- tc.drawn = 0;
- }
- } else if(e.targetTouches.length == 2 && tc.pinchZoom) {
- tc.touchState = 3;
- tc.EndDrag();
- tc.BeginPinch(e);
- } else {
- tc.EndDrag();
- tc.EndPinch();
- tc.touchState = 0;
- }
- }
-}
-function TouchUp(e) {
- var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]);
- if(tc && e.changedTouches) {
- switch(tc.touchState) {
- case 1:
- tc.Draw();
- tc.Clicked();
- break;
- case 2:
- tc.EndDrag();
- break;
- case 3:
- tc.EndPinch();
- }
- tc.touchState = 0;
- }
-}
-function TouchMove(e) {
- var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e);
- for(i in t.tc) {
- tc = t.tc[i];
- if(tc.tttimer) {
- clearTimeout(tc.tttimer);
- tc.tttimer = null;
- }
- }
- tc = (tg && t.tc[tg]);
- if(tc && e.changedTouches && tc.touchState) {
- switch(tc.touchState) {
- case 1:
- case 2:
- if(p = EventXY(e, tc.canvas)) {
- tc.mx = p.x;
- tc.my = p.y;
- if(tc.Drag(e, p))
- tc.touchState = 2;
- }
- break;
- case 3:
- tc.Pinch(e);
- }
- tc.drawn = 0;
- }
-}
-function MouseWheel(e) {
- var t = TagCanvas, tg = EventToCanvasId(e);
- if(tg && t.tc[tg]) {
- e.cancelBubble = true;
- e.returnValue = false;
- e.preventDefault && e.preventDefault();
- t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0);
- }
-}
-function DrawCanvas() {
- DrawCanvasRAF(TimeNow());
-}
-function DrawCanvasRAF(t) {
- var tc = TagCanvas.tc, i;
- TagCanvas.NextFrame(TagCanvas.interval);
- t = t || TimeNow();
- for(i in tc)
- tc[i].Draw(t);
-}
-function AbsPos(id) {
- var e = doc.getElementById(id), r = e.getBoundingClientRect(),
- dd = doc.documentElement, b = doc.body, w = window,
- xs = w.pageXOffset || dd.scrollLeft,
- ys = w.pageYOffset || dd.scrollTop,
- xo = dd.clientLeft || b.clientLeft,
- yo = dd.clientTop || b.clientTop;
- return { x: r.left + xs - xo, y: r.top + ys - yo };
-}
-function Project(tc,p1,sx,sy) {
- var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z);
- return {
- x: p1.x * m * sx,
- y: p1.y * m * sy,
- z: p1.z,
- w: (tc.z1 - p1.z) / tc.z2
- };
-}
-/**
- * @constructor
- * for recursively splitting tag contents on
tags
- */
-function TextSplitter(e) {
- this.e = e;
- this.br = 0;
- this.line = [];
- this.text = [];
- this.original = e.innerText || e.textContent;
-}
-TSproto = TextSplitter.prototype;
-TSproto.Empty = function() {
- for(var i = 0; i < this.text.length; ++i)
- if(this.text[i].length)
- return false;
- return true;
-};
-TSproto.Lines = function(e) {
- var r = e ? 1 : 0, cn, cl, i;
- e = e || this.e;
- cn = e.childNodes;
- cl = cn.length;
-
- for(i = 0; i < cl; ++i) {
- if(cn[i].nodeName == 'BR') {
- this.text.push(this.line.join(' '));
- this.br = 1;
- } else if(cn[i].nodeType == 3) {
- if(this.br) {
- this.line = [cn[i].nodeValue];
- this.br = 0;
- } else {
- this.line.push(cn[i].nodeValue);
- }
- } else {
- this.Lines(cn[i]);
- }
- }
- r || this.br || this.text.push(this.line.join(' '));
- return this.text;
-};
-TSproto.SplitWidth = function(w, c, f, h) {
- var i, j, words, text = [];
- c.font = h + 'px ' + f;
- for(i = 0; i < this.text.length; ++i) {
- words = this.text[i].split(/\s+/);
- this.line = [words[0]];
- for(j = 1; j < words.length; ++j) {
- if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) {
- text.push(this.line.join(' '));
- this.line = [words[j]];
- } else {
- this.line.push(words[j]);
- }
- }
- text.push(this.line.join(' '));
- }
- return this.text = text;
-};
-/**
- * @constructor
- */
-function Outline(tc,t) {
- this.ts = TimeNow();
- this.tc = tc;
- this.tag = t;
- this.x = this.y = this.w = this.h = this.sc = 1;
- this.z = 0;
- this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ?
- this.DrawPulsate : this.DrawSimple;
- this.radius = tc.outlineRadius | 0;
- this.SetMethod(tc.outlineMethod);
-}
-Oproto = Outline.prototype;
-Oproto.SetMethod = function(om) {
- var methods = {
- block: ['PreDraw','DrawBlock'],
- colour: ['PreDraw','DrawColour'],
- outline: ['PostDraw','DrawOutline'],
- classic: ['LastDraw','DrawOutline'],
- size: ['PreDraw','DrawColour'],
- none: ['LastDraw']
- }, funcs = methods[om] || methods.outline;
- if(om == 'none') {
- this.Draw = function() { return 1; }
- } else {
- this.drawFunc = this[funcs[1]];
- }
- this[funcs[0]] = this.Draw;
-};
-Oproto.Update = function(x,y,w,h,sc,z,xo,yo) {
- var o = this.tc.outlineOffset, o2 = 2 * o;
- this.x = sc * x + xo - o;
- this.y = sc * y + yo - o;
- this.w = sc * w + o2;
- this.h = sc * h + o2;
- this.sc = sc; // used to determine frontmost
- this.z = z;
-};
-Oproto.DrawOutline = function(c,x,y,w,h,colour) {
- c.strokeStyle = colour;
- RRect(c, x, y, w, h, this.radius, true);
-};
-Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) {
- if(tag.oimage) {
- tag.alpha = 1;
- tag.Draw(c, x1, y1, tag.oimage);
- return 1;
- }
- return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1);
-};
-Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) {
- var normal = tag.colour;
- tag.colour = colour;
- tag.alpha = 1;
- tag.Draw(c,x1,y1);
- tag.colour = normal;
- return 1;
-};
-Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) {
- var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0),
- fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc;
- if(ocanvas)
- ocanvas.width = fw, ocanvas.height = fh;
- else
- ocanvas = NewCanvas(fw, fh);
- if(!ocanvas)
- return this.SetMethod('outline'); // if using IE and images, give up!
- cc = ocanvas.getContext('2d');
-
- cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh);
- c.clearRect(fx,fy,fw,fh);
- tag.alpha = 1;
- tag.Draw(c,x1,y1);
- c.setTransform(1,0,0,1,0,0);
- c.save();
- c.beginPath();
- c.rect(fx,fy,fw,fh);
- c.clip();
- c.globalCompositeOperation = 'source-in';
- c.fillStyle = colour;
- c.fillRect(fx,fy,fw,fh);
- c.restore();
- c.globalCompositeOperation = 'destination-over';
- c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh);
- c.globalCompositeOperation = 'source-over';
- return 1;
-};
-Oproto.DrawBlock = function(c,x,y,w,h,colour) {
- c.fillStyle = colour;
- RRect(c, x, y, w, h, this.radius);
-};
-Oproto.DrawSimple = function(c, tag, x1, y1) {
- var t = this.tc;
- c.setTransform(1,0,0,1,0,0);
- c.strokeStyle = t.outlineColour;
- c.lineWidth = t.outlineThickness;
- c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0;
- c.globalAlpha = 1;
- return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1);
-};
-Oproto.DrawPulsate = function(c, tag, x1, y1) {
- var diff = TimeNow() - this.ts, t = this.tc;
- c.setTransform(1,0,0,1,0,0);
- c.strokeStyle = t.outlineColour;
- c.lineWidth = t.outlineThickness;
- c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0;
- c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) *
- (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2)));
- return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1);
-};
-Oproto.Active = function(c,x,y) {
- return (x >= this.x && y >= this.y &&
- x <= this.x + this.w && y <= this.y + this.h);
-};
-Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop;
-/**
- * @constructor
- */
-function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness,
- font, padding, original) {
- this.tc = tc;
- this.image = null;
- this.text = text;
- this.text_original = original;
- this.line_widths = [];
- this.title = a.title || null;
- this.a = a;
- this.position = new Vector(v[0], v[1], v[2]);
- this.x = this.y = this.z = 0;
- this.w = w;
- this.h = h;
- this.colour = col || tc.textColour;
- this.bgColour = bcol || tc.bgColour;
- this.bgRadius = bradius | 0;
- this.bgOutline = boutline || this.colour;
- this.bgOutlineThickness = bothickness | 0;
- this.textFont = font || tc.textFont;
- this.padding = padding | 0;
- this.sc = this.alpha = 1;
- this.weighted = !tc.weight;
-}
-Tproto = Tag.prototype;
-Tproto.Init = function(e) {
- var tc = this.tc;
- this.outline = new Outline(tc,this);
- this.textHeight = tc.textHeight;
- if(this.HasText()) {
- this.Measure(tc.ctxt,tc);
- } else {
- this.w = this.iw;
- this.h = this.ih;
- }
-
- this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed;
- this.SetDraw(tc);
-};
-Tproto.Draw = Nop;
-Tproto.HasText = function() {
- return this.text && this.text[0].length > 0;
-};
-Tproto.EqualTo = function(e) {
- var i = e.getElementsByTagName('img');
- if(this.a.href != e.href)
- return 0;
- if(i.length)
- return this.image.src == i[0].src;
- return (e.innerText || e.textContent) == this.text_original;
-};
-Tproto.SetImage = function(i) {
- this.image = this.fimage = i;
-};
-Tproto.SetDraw = function(t) {
- this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText;
- t.noSelect && (this.CheckActive = Nop);
-};
-Tproto.MeasureText = function(c) {
- var i, l = this.text.length, w = 0, wl;
- for(i = 0; i < l; ++i) {
- this.line_widths[i] = wl = c.measureText(this.text[i]).width;
- w = max(w, wl);
- }
- return w;
-};
-Tproto.Measure = function(c,t) {
- var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight),
- s, th, f, soff, cw, twidth, theight, img, tcv;
- // add the gap at the top to the height to make equal gap at bottom
- theight = extents ? extents.max.y + extents.min.y : this.textHeight;
- c.font = this.font = this.textHeight + 'px ' + this.textFont;
- twidth = this.MeasureText(c);
- if(t.txtOpt) {
- s = t.txtScale;
- th = s * this.textHeight;
- f = th + 'px ' + this.textFont;
- soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]];
- c.font = f;
- cw = this.MeasureText(c);
- tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw,
- this.line_widths, t.textAlign, t.textVAlign, s);
-
- if(this.image)
- tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding,
- t.imageAlign, t.imageVAlign, t.imageScale);
-
- img = tcv.Create(this.colour, this.bgColour, this.bgOutline,
- s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff,
- s * this.padding, s * this.bgRadius);
-
- // add outline image using highlight colour
- if(t.outlineMethod == 'colour') {
- this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour,
- s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff,
- s * this.padding, s * this.bgRadius);
-
- } else if(t.outlineMethod == 'size') {
- extents = FindTextBoundingBox(this.text, this.textFont,
- this.textHeight + t.outlineIncrease);
- th = extents.max.y + extents.min.y;
- f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont;
- c.font = f;
- cw = this.MeasureText(c);
-
- tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw,
- this.line_widths, t.textAlign, t.textVAlign, s);
- if(this.image)
- tcv.SetImage(this.image, this.iw + t.outlineIncrease,
- this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding,
- t.imageAlign, t.imageVAlign, t.imageScale);
-
- this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline,
- s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff,
- s * this.padding, s * this.bgRadius);
-
- if(t.outlineIncrease > 0)
- img = ExpandImage(img, this.oimage.width, this.oimage.height);
- else
- this.oimage = ExpandImage(this.oimage, img.width, img.height);
- }
- if(img) {
- this.fimage = img;
- twidth = this.fimage.width / s;
- theight = this.fimage.height / s;
- }
- this.SetDraw(t);
- t.txtOpt = !!this.fimage;
- }
- this.h = theight;
- this.w = twidth;
-};
-Tproto.SetFont = function(f, c, bc, boc) {
- this.textFont = f;
- this.colour = c;
- this.bgColour = bc;
- this.bgOutline = boc;
- this.Measure(this.tc.ctxt, this.tc);
-};
-Tproto.SetWeight = function(w) {
- var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length;
- if(!this.HasText())
- return;
- this.weighted = true;
- for(s = 0; s < wl; ++s) {
- m = modes[s] || 'size';
- if('both' == m) {
- this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s],
- tc.max_weight[s], s);
- this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s],
- tc.max_weight[s], s);
- } else {
- this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s);
- }
- }
- this.Measure(tc.ctxt, tc);
-};
-Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) {
- w = isNaN(w) ? 1 : w;
- var nweight = (w - wmin) / (wmax - wmin);
- if('colour' == m)
- this.colour = FindGradientColour(t, nweight, wnum);
- else if('bgcolour' == m)
- this.bgColour = FindGradientColour(t, nweight, wnum);
- else if('bgoutline' == m)
- this.bgOutline = FindGradientColour(t, nweight, wnum);
- else if('size' == m) {
- if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) {
- this.textHeight = t.weightSize *
- (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight);
- } else {
- // min textHeight of 1
- this.textHeight = max(1, w * t.weightSize);
- }
- }
-};
-Tproto.SetShadowColourFixed = function(c,s,a) {
- c.shadowColor = s;
-};
-Tproto.SetShadowColourAlpha = function(c,s,a) {
- c.shadowColor = SetAlpha(s, a);
-};
-Tproto.DrawText = function(c,xoff,yoff) {
- var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl;
- c.globalAlpha = this.alpha;
- c.fillStyle = this.colour;
- t.shadow && this.SetShadowColour(c,t.shadow,this.alpha);
- c.font = this.font;
- x += xoff / s;
- y += (yoff / s) - (this.h / 2);
- for(i = 0; i < this.text.length; ++i) {
- xl = x;
- if('right' == t.textAlign) {
- xl += this.w / 2 - this.line_widths[i];
- } else if('centre' == t.textAlign) {
- xl -= this.line_widths[i] / 2;
- } else {
- xl -= this.w / 2;
- }
- c.setTransform(s, 0, 0, s, s * xl, s * y);
- c.fillText(this.text[i], 0, 0);
- y += this.textHeight;
- }
-};
-Tproto.DrawImage = function(c,xoff,yoff,im) {
- var x = this.x, y = this.y, s = this.sc,
- i = im || this.fimage, w = this.w, h = this.h, a = this.alpha,
- shadow = this.shadow;
- c.globalAlpha = a;
- shadow && this.SetShadowColour(c,shadow,a);
- x += (xoff / s) - (w / 2);
- y += (yoff / s) - (h / 2);
- c.setTransform(s, 0, 0, s, s * x, s * y);
- c.drawImage(i, 0, 0, w, h);
-};
-Tproto.DrawImageIE = function(c,xoff,yoff) {
- var i = this.fimage, s = this.sc,
- w = i.width = this.w*s, h = i.height = this.h * s,
- x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2);
- c.setTransform(1,0,0,1,0,0);
- c.globalAlpha = this.alpha;
- c.drawImage(i, x, y);
-};
-Tproto.Calc = function(m,a) {
- var pp, t = this.tc, mnb = t.minBrightness,
- mxb = t.maxBrightness, r = t.max_radius;
- pp = m.xform(this.position);
- this.xformed = pp;
- pp = Project(t, pp, t.stretchX, t.stretchY);
- this.x = pp.x;
- this.y = pp.y;
- this.z = pp.z;
- this.sc = pp.w;
- this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1);
-};
-Tproto.UpdateActive = function(c, xoff, yoff) {
- var o = this.outline, w = this.w, h = this.h,
- x = this.x - w/2, y = this.y - h/2;
- o.Update(x, y, w, h, this.sc, this.z, xoff, yoff);
- return o;
-};
-Tproto.CheckActive = function(c,xoff,yoff) {
- var t = this.tc, o = this.UpdateActive(c, xoff, yoff);
- return o.Active(c, t.mx, t.my) ? o : null;
-};
-Tproto.Clicked = function(e) {
- var a = this.a, t = a.target, h = a.href, evt;
- if(t != '' && t != '_self') {
- if(self.frames[t]) {
- self.frames[t].document.location = h;
- } else{
- try {
- if(top.frames[t]) {
- top.frames[t].document.location = h;
- return;
- }
- } catch(err) {
- // different domain/port/protocol?
- }
- window.open(h, t);
- }
- return;
- }
- if(doc.createEvent) {
- evt = doc.createEvent('MouseEvents');
- evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null);
- if(!a.dispatchEvent(evt))
- return;
- } else if(a.fireEvent) {
- if(!a.fireEvent('onclick'))
- return;
- }
- doc.location = h;
-};
-/**
- * @constructor
- */
-function TagCanvas(cid,lctr,opt) {
- var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf;
-
- if(!c) throw 0;
- if(Defined(window.G_vmlCanvasManager)) {
- c = window.G_vmlCanvasManager.initElement(c);
- this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]);
- }
- if(c && (!c.getContext || !c.getContext('2d').fillText)) {
- p = doc.createElement('DIV');
- for(i = 0; i < cp.length; ++i)
- p[cp[i]] = c[cp[i]];
- c.parentNode.insertBefore(p,c);
- c.parentNode.removeChild(c);
- throw 0;
- }
- for(i in TagCanvas.options)
- this[i] = opt && Defined(opt[i]) ? opt[i] :
- (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]);
-
- this.canvas = c;
- this.ctxt = c.getContext('2d');
- this.z1 = 250 / max(this.depth, 0.001);
- this.z2 = this.z1 / this.zoom;
- this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas
- this.max_radius = 100;
- this.max_weight = [];
- this.min_weight = [];
- this.textFont = this.textFont && FixFont(this.textFont);
- this.textHeight *= 1;
- this.pulsateTo = Clamp(this.pulsateTo, 0, 1);
- this.minBrightness = Clamp(this.minBrightness, 0, 1);
- this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1);
- this.ctxt.textBaseline = 'top';
- this.lx = (this.lock + '').indexOf('x') + 1;
- this.ly = (this.lock + '').indexOf('y') + 1;
- this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0;
- this.fixedAlpha = 1;
- this.source = lctr || cid;
- this.repeatTags = min(64, ~~this.repeatTags);
- this.minTags = min(200, ~~this.minTags);
- if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length))
- this.repeatTags = ceil(this.minTags / i) - 1;
- this.transform = Matrix.Identity();
- this.startTime = this.time = TimeNow();
- this.mx = this.my = -1;
- this.centreImage && CentreImage(this);
- this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition;
- this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ?
- TagCanvas[this.animTiming] : TagCanvas.Smooth);
- if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) {
- // let the browser translate "red" into "#ff0000"
- this.ctxt.shadowColor = this.shadow;
- this.shadow = this.ctxt.shadowColor;
- this.shadowAlpha = ShadowAlphaBroken();
- } else {
- delete this.shadow;
- }
- this.Load();
- if(lctr && this.hideTags) {
- (function(t) {
- if(TagCanvas.loaded)
- t.HideTags();
- else
- AddHandler('load', function() { t.HideTags(); }, window);
- })(this);
- }
-
- this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0;
- this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0;
- if(this.tooltip) {
- this.ctitle = c.title;
- c.title = '';
- if(this.tooltip == 'native') {
- this.Tooltip = this.TooltipNative;
- } else {
- this.Tooltip = this.TooltipDiv;
- if(!this.ttdiv) {
- this.ttdiv = doc.createElement('div');
- this.ttdiv.className = this.tooltipClass;
- this.ttdiv.style.position = 'absolute';
- this.ttdiv.style.zIndex = c.style.zIndex + 1;
- AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv);
- doc.body.appendChild(this.ttdiv);
- }
- }
- } else {
- this.Tooltip = this.TooltipNone;
- }
- if(!this.noMouse && !handlers[cid]) {
- handlers[cid] = [
- ['mousemove', MouseMove],
- ['mouseout', MouseOut],
- ['mouseup', MouseUp],
- ['touchstart', TouchDown],
- ['touchend', TouchUp],
- ['touchcancel', TouchUp],
- ['touchmove', TouchMove]
- ];
- if(this.dragControl) {
- handlers[cid].push(['mousedown', MouseDown]);
- handlers[cid].push(['selectstart', Nop]);
- }
- if(this.wheelZoom) {
- handlers[cid].push(['mousewheel', MouseWheel]);
- handlers[cid].push(['DOMMouseScroll', MouseWheel]);
- }
- for(i = 0; i < handlers[cid].length; ++i)
- AddHandler(handlers[cid][i][0], handlers[cid][i][1], c);
- }
- if(!TagCanvas.started) {
- raf = window.requestAnimationFrame = window.requestAnimationFrame ||
- window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
- window.msRequestAnimationFrame;
- TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF :
- TagCanvas.NextFrameTimeout;
- TagCanvas.interval = this.interval;
- TagCanvas.NextFrame(this.interval);
- TagCanvas.started = 1;
- }
-}
-TCproto = TagCanvas.prototype;
-TCproto.SourceElements = function() {
- if(doc.querySelectorAll)
- return doc.querySelectorAll('#' + this.source);
- return [doc.getElementById(this.source)];
-};
-TCproto.HideTags = function() {
- var el = this.SourceElements(), i;
- for(i = 0; i < el.length; ++i)
- el[i].style.display = 'none';
-};
-TCproto.GetTags = function() {
- var el = this.SourceElements(), etl, tl = [], i, j, k;
- for(k = 0; k <= this.repeatTags; ++k) {
- for(i = 0; i < el.length; ++i) {
- etl = el[i].getElementsByTagName('a');
- for(j = 0; j < etl.length; ++j) {
- tl.push(etl[j]);
- }
- }
- }
- return tl;
-};
-TCproto.Message = function(text) {
- var tl = [], i, p, tc = text.split(''), a, t, x, z;
- for(i = 0; i < tc.length; ++i) {
- if(tc[i] != ' ') {
- p = i - tc.length / 2;
- a = doc.createElement('A');
- a.href = '#';
- a.innerText = tc[i];
- x = 100 * sin(p / 9);
- z = -100 * cos(p / 9);
- t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0,
- 'monospace', 2, tc[i]);
- t.Init();
- tl.push(t);
- }
- }
- return tl;
-};
-TCproto.CreateTag = function(e) {
- var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0];
- if('text' != this.imageMode) {
- im = e.getElementsByTagName('img');
- if(im.length) {
- i = new Image;
- i.src = im[0].src;
-
- if(!this.imageMode) {
- t = new Tag(this, "", e, p, 0, 0);
- t.SetImage(i);
- //t.Init();
- AddImage(i, im[0], t, this);
- return t;
- }
- }
- }
- if('image' != this.imageMode) {
- ts = new TextSplitter(e);
- txt = ts.Lines();
- if(!ts.Empty()) {
- font = this.textFont || FixFont(GetProperty(e,'font-family'));
- if(this.splitWidth)
- txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight);
-
- bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') :
- this.bgColour;
- boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline;
- } else {
- ts = null;
- }
- }
- if(ts || i) {
- t = new Tag(this, txt, e, p, 2, this.textHeight + 2,
- this.textColour || GetProperty(e,'color'), bc, this.bgRadius,
- boc, this.bgOutlineThickness, font, this.padding, ts && ts.original);
- if(i) {
- t.SetImage(i);
- AddImage(i, im[0], t, this);
- } else {
- t.Init();
- }
- return t;
- }
-};
-TCproto.UpdateTag = function(t, a) {
- var colour = this.textColour || GetProperty(a, 'color'),
- font = this.textFont || FixFont(GetProperty(a, 'font-family')),
- bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') :
- this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') :
- this.bgOutline;
- t.a = a;
- t.title = a.title;
- if(t.colour != colour || t.textFont != font || t.bgColour != bc ||
- t.bgOutline != boc)
- t.SetFont(font, colour, bc, boc);
-};
-TCproto.Weight = function(tl) {
- var ll = tl.length, w, i, s, weights = [], valid,
- wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null],
- wl = wfrom.length;
- for(i = 0; i < ll; ++i) {
- weights[i] = [];
- for(s = 0; s < wl; ++s) {
- w = FindWeight(tl[i].a, wfrom[s], this.textHeight);
- if(!this.max_weight[s] || w > this.max_weight[s])
- this.max_weight[s] = w;
- if(!this.min_weight[s] || w < this.min_weight[s])
- this.min_weight[s] = w;
- weights[i][s] = w;
- }
- }
- for(s = 0; s < wl; ++s) {
- if(this.max_weight[s] > this.min_weight[s])
- valid = 1;
- }
- if(valid) {
- for(i = 0; i < ll; ++i) {
- tl[i].SetWeight(weights[i]);
- }
- }
-};
-TCproto.Load = function() {
- var tl = this.GetTags(), taglist = [], shape, t,
- shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = {
- sphere: PointsOnSphere,
- vcylinder: PointsOnCylinderV,
- hcylinder: PointsOnCylinderH,
- vring: PointsOnRingV,
- hring: PointsOnRingH
- };
-
- if(tl.length) {
- tagmap.length = tl.length;
- for(i = 0; i < tl.length; ++i)
- tagmap[i] = i;
- this.shuffleTags && Shuffle(tagmap);
- rx = 100 * this.radiusX;
- ry = 100 * this.radiusY;
- rz = 100 * this.radiusZ;
- this.max_radius = max(rx, max(ry, rz));
-
- for(i = 0; i < tl.length; ++i) {
- t = this.CreateTag(tl[tagmap[i]]);
- if(t)
- taglist.push(t);
- }
- this.weight && this.Weight(taglist, true);
-
- if(this.shapeArgs) {
- this.shapeArgs[0] = taglist.length;
- } else {
- shapeArgs = this.shape.toString().split(/[(),]/);
- shape = shapeArgs.shift();
- if(typeof window[shape] === 'function')
- this.shape = window[shape];
- else
- this.shape = pfuncs[shape] || pfuncs.sphere;
- this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs);
- }
- vl = this.shape.apply(this, this.shapeArgs);
- this.listLength = taglist.length;
- for(i = 0; i < taglist.length; ++i)
- taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]);
- }
- if(this.noTagsMessage && !taglist.length)
- taglist = this.Message('No tags');
- this.taglist = taglist;
-};
-TCproto.Update = function() {
- var tl = this.GetTags(), newlist = [],
- taglist = this.taglist, found,
- added = [], removed = [], vl, ol, nl, i, j;
-
- if(!this.shapeArgs)
- return this.Load();
-
- if(tl.length) {
- nl = this.listLength = tl.length;
- ol = taglist.length;
-
- // copy existing list, populate "removed"
- for(i = 0; i < ol; ++i) {
- newlist.push(taglist[i]);
- removed.push(i);
- }
-
- // find added and removed tags
- for(i = 0; i < nl; ++i) {
- for(j = 0, found = 0; j < ol; ++j) {
- if(taglist[j].EqualTo(tl[i])) {
- this.UpdateTag(newlist[j], tl[i]);
- found = removed[j] = -1;
- }
- }
- if(!found)
- added.push(i);
- }
-
- // clean out found tags from removed list
- for(i = 0, j = 0; i < ol; ++i) {
- if(removed[j] == -1)
- removed.splice(j,1);
- else
- ++j;
- }
-
- // insert new tags in gaps where old tags removed
- if(removed.length) {
- Shuffle(removed);
- while(removed.length && added.length) {
- i = removed.shift();
- j = added.shift();
- newlist[i] = this.CreateTag(tl[j]);
- }
-
- // remove any more (in reverse order)
- removed.sort(function(a,b) {return a-b});
- while(removed.length) {
- newlist.splice(removed.pop(), 1);
- }
- }
-
- // add any extra tags
- j = newlist.length / (added.length + 1);
- i = 0;
- while(added.length) {
- newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()]));
- }
-
- // assign correct positions to tags
- this.shapeArgs[0] = nl = newlist.length;
- vl = this.shape.apply(this, this.shapeArgs);
- for(i = 0; i < nl; ++i)
- newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]);
-
- // reweight tags
- this.weight && this.Weight(newlist);
- }
- this.taglist = newlist;
-};
-TCproto.SetShadow = function(c) {
- c.shadowBlur = this.shadowBlur;
- c.shadowOffsetX = this.shadowOffset[0];
- c.shadowOffsetY = this.shadowOffset[1];
-};
-TCproto.Draw = function(t) {
- if(this.paused)
- return;
- var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0,
- tdelta = (t - this.time) * TagCanvas.interval / 1000,
- x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt,
- active, a, i, aindex = -1, tl = this.taglist, l = tl.length,
- frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed;
- this.time = t;
- if(this.frozen && this.drawn)
- return this.Animate(cw,ch,tdelta);
- fixed = this.AnimateFixed();
- c.setTransform(1,0,0,1,0,0);
- for(i = 0; i < l; ++i)
- tl[i].Calc(this.transform, this.fixedAlpha);
- tl = SortList(tl, function(a,b) {return b.z-a.z});
-
- if(fixed && this.fixedAnim.active) {
- active = this.fixedAnim.tag.UpdateActive(c, x, y);
- } else {
- this.active = null;
- for(i = 0; i < l; ++i) {
- a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y);
- if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) {
- active = a;
- aindex = i;
- active.tag = this.taglist[i];
- max_sc = a.sc;
- }
- }
- this.active = active;
- }
-
- this.txtOpt || (this.shadow && this.SetShadow(c));
- c.clearRect(0,0,cw,ch);
- for(i = 0; i < l; ++i) {
- if(!centreDrawn && tl[i].z <= 0) {
- // run the centreFunc if the next tag is at the front
- try { this.centreFunc(c, cw, ch, x, y); }
- catch(e) {
- alert(e);
- // don't run it again
- this.centreFunc = Nop;
- }
- centreDrawn = true;
- }
-
- if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y)))
- tl[i].Draw(c, x, y);
- active && active.tag == tl[i] && active.PostDraw(c);
- }
- if(this.freezeActive && active) {
- this.Freeze();
- } else {
- this.UnFreeze();
- this.drawn = (l == this.listLength);
- }
- if(this.fixedCallback) {
- this.fixedCallback(this,this.fixedCallbackTag);
- this.fixedCallback = null;
- }
- fixed || this.Animate(cw, ch, tdelta);
- active && active.LastDraw(c);
- cv.style.cursor = active ? this.activeCursor : '';
- this.Tooltip(active,this.taglist[aindex]);
-};
-TCproto.TooltipNone = function() { };
-TCproto.TooltipNative = function(active,tag) {
- if(active)
- this.canvas.title = tag && tag.title ? tag.title : '';
- else
- this.canvas.title = this.ctitle;
-};
-TCproto.SetTTDiv = function(title, tag) {
- var tc = this, s = tc.ttdiv.style;
- if(title != tc.ttdiv.innerHTML)
- s.display = 'none';
- tc.ttdiv.innerHTML = title;
- tag && (tag.title = tc.ttdiv.innerHTML);
- if(s.display == 'none' && ! tc.tttimer) {
- tc.tttimer = setTimeout(function() {
- var p = AbsPos(tc.canvas.id);
- s.display = 'block';
- s.left = p.x + tc.mx + 'px';
- s.top = p.y + tc.my + 24 + 'px';
- tc.tttimer = null;
- }, tc.tooltipDelay);
- }
-};
-TCproto.TooltipDiv = function(active,tag) {
- if(active && tag && tag.title) {
- this.SetTTDiv(tag.title, tag);
- } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) {
- this.SetTTDiv(this.ctitle);
- } else {
- this.ttdiv.style.display = 'none';
- }
-};
-TCproto.Transform = function(tc, p, y) {
- if(p || y) {
- var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y),
- ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]),
- pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]);
- tc.transform = tc.transform.mul(ym.mul(pm));
- }
-};
-TCproto.AnimateFixed = function() {
- var fa, t1, angle, m, d;
- if(this.fadeIn) {
- t1 = TimeNow() - this.startTime;
- if(t1 >= this.fadeIn) {
- this.fadeIn = 0;
- this.fixedAlpha = 1;
- } else {
- this.fixedAlpha = t1 / this.fadeIn;
- }
- }
- if(this.fixedAnim) {
- if(!this.fixedAnim.transform)
- this.fixedAnim.transform = this.transform;
- fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle,
- m, d = this.animTiming(fa.t, t1);
- this.transform = fa.transform;
- if(t1 >= fa.t) {
- this.fixedCallbackTag = fa.tag;
- this.fixedCallback = fa.cb;
- this.fixedAnim = this.yaw = this.pitch = 0;
- } else {
- angle *= d;
- }
- m = Matrix.Rotation(angle, fa.axis);
- this.transform = this.transform.mul(m);
- return (this.fixedAnim != 0);
- }
- return false;
-};
-TCproto.AnimatePosition = function(w, h, t) {
- var tc = this, x = tc.mx, y = tc.my, s, r;
- if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) {
- s = tc.maxSpeed, r = tc.reverse ? -1 : 1;
- tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t);
- tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t);
- tc.initial = null;
- } else if(!tc.initial) {
- if(tc.frozen && !tc.freezeDecel)
- tc.yaw = tc.pitch = 0;
- else
- tc.Decel(tc);
- }
- this.Transform(tc, tc.pitch, tc.yaw);
-};
-TCproto.AnimateDrag = function(w, h, t) {
- var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom;
- if(tc.dx || tc.dy) {
- tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX);
- tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY);
- tc.dx = tc.dy = 0;
- tc.initial = null;
- } else if(!tc.initial) {
- tc.Decel(tc);
- }
- this.Transform(tc, tc.pitch, tc.yaw);
-};
-TCproto.Freeze = function() {
- if(!this.frozen) {
- this.preFreeze = [this.yaw, this.pitch];
- this.frozen = 1;
- this.drawn = 0;
- }
-};
-TCproto.UnFreeze = function() {
- if(this.frozen) {
- this.yaw = this.preFreeze[0];
- this.pitch = this.preFreeze[1];
- this.frozen = 0;
- }
-};
-TCproto.Decel = function(tc) {
- var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch);
- if(!tc.lx && ay > s)
- tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0;
- if(!tc.ly && ap > s)
- tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0;
-};
-TCproto.Zoom = function(r) {
- this.z2 = this.z1 * (1/r);
- this.drawn = 0;
-};
-TCproto.Clicked = function(e) {
- var a = this.active;
- try {
- if(a && a.tag)
- if(this.clickToFront === false || this.clickToFront === null)
- a.tag.Clicked(e);
- else
- this.TagToFront(a.tag, this.clickToFront, function() {
- a.tag.Clicked(e);
- }, true);
- } catch(ex) {
- }
-};
-TCproto.Wheel = function(i) {
- var z = this.zoom + this.zoomStep * (i ? 1 : -1);
- this.zoom = min(this.zoomMax,max(this.zoomMin,z));
- this.Zoom(this.zoom);
-};
-TCproto.BeginDrag = function(e) {
- this.down = EventXY(e, this.canvas);
- e.cancelBubble = true;
- e.returnValue = false;
- e.preventDefault && e.preventDefault();
-};
-TCproto.Drag = function(e, p) {
- if(this.dragControl && this.down) {
- var t2 = this.dragThreshold * this.dragThreshold,
- dx = p.x - this.down.x, dy = p.y - this.down.y;
- if(this.dragging || dx * dx + dy * dy > t2) {
- this.dx = dx;
- this.dy = dy;
- this.dragging = 1;
- this.down = p;
- }
- }
- return this.dragging;
-};
-TCproto.EndDrag = function() {
- var res = this.dragging;
- this.dragging = this.down = null;
- return res;
-};
-function PinchDistance(e) {
- var t1 = e.targetTouches[0], t2 = e.targetTouches[1];
- return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2));
-}
-TCproto.BeginPinch = function(e) {
- this.pinched = [PinchDistance(e), this.zoom];
- e.preventDefault && e.preventDefault();
-};
-TCproto.Pinch = function(e) {
- var z, d, p = this.pinched;
- if(!p)
- return;
- d = PinchDistance(e);
- z = p[1] * d / p[0];
- this.zoom = min(this.zoomMax,max(this.zoomMin,z));
- this.Zoom(this.zoom);
-};
-TCproto.EndPinch = function(e) {
- this.pinched = null;
-};
-TCproto.Pause = function() { this.paused = true; };
-TCproto.Resume = function() { this.paused = false; };
-TCproto.SetSpeed = function(i) {
- this.initial = i;
- this.yaw = i[0] * this.maxSpeed;
- this.pitch = i[1] * this.maxSpeed;
-};
-TCproto.FindTag = function(t) {
- if(!Defined(t))
- return null;
- Defined(t.index) && (t = t.index);
- if(!IsObject(t))
- return this.taglist[t];
- var srch, tgt, i;
- if(Defined(t.id))
- srch = 'id', tgt = t.id;
- else if(Defined(t.text))
- srch = 'innerText', tgt = t.text;
-
- for(i = 0; i < this.taglist.length; ++i)
- if(this.taglist[i].a[srch] == tgt)
- return this.taglist[i];
-};
-TCproto.RotateTag = function(tag, lt, lg, time, callback, active) {
- var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z),
- v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit();
- if(angle == 0) {
- this.fixedCallbackTag = tag;
- this.fixedCallback = callback;
- } else {
- this.fixedAnim = {
- angle: -angle,
- axis: u,
- t: time,
- t0: TimeNow(),
- cb: callback,
- tag: tag,
- active: active
- };
- }
-};
-TCproto.TagToFront = function(tag, time, callback, active) {
- this.RotateTag(tag, 0, 0, time, callback, active);
-};
-TagCanvas.Start = function(id,l,o) {
- TagCanvas.Delete(id);
- TagCanvas.tc[id] = new TagCanvas(id,l,o);
-};
-function tccall(f,id) {
- TagCanvas.tc[id] && TagCanvas.tc[id][f]();
-}
-TagCanvas.Linear = function(t, t0) { return t0 / t; }
-TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; }
-TagCanvas.Pause = function(id) { tccall('Pause',id); };
-TagCanvas.Resume = function(id) { tccall('Resume',id); };
-TagCanvas.Reload = function(id) { tccall('Load',id); };
-TagCanvas.Update = function(id) { tccall('Update',id); };
-TagCanvas.SetSpeed = function(id, speed) {
- if(IsObject(speed) && TagCanvas.tc[id] &&
- !isNaN(speed[0]) && !isNaN(speed[1])) {
- TagCanvas.tc[id].SetSpeed(speed);
- return true;
- }
- return false;
-};
-TagCanvas.TagToFront = function(id, options) {
- if(!IsObject(options))
- return false;
- options.lat = options.lng = 0;
- return TagCanvas.RotateTag(id, options);
-};
-TagCanvas.RotateTag = function(id, options) {
- if(IsObject(options) && TagCanvas.tc[id]) {
- if(isNaN(options.time))
- options.time = 500;
- var tt = TagCanvas.tc[id].FindTag(options);
- if(tt) {
- TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng,
- options.time, options.callback, options.active);
- return true;
- }
- }
- return false;
-};
-TagCanvas.Delete = function(id) {
- var i, c;
- if(handlers[id]) {
- c = doc.getElementById(id);
- if(c) {
- for(i = 0; i < handlers[id].length; ++i)
- RemoveHandler(handlers[id][i][0], handlers[id][i][1], c);
- }
- }
- delete handlers[id];
- delete TagCanvas.tc[id];
-};
-TagCanvas.NextFrameRAF = function() {
- requestAnimationFrame(DrawCanvasRAF);
-};
-TagCanvas.NextFrameTimeout = function(iv) {
- setTimeout(DrawCanvas, iv);
-};
-TagCanvas.tc = {};
-TagCanvas.options = {
-z1: 20000,
-z2: 20000,
-z0: 0.0002,
-freezeActive: false,
-freezeDecel: false,
-activeCursor: 'pointer',
-pulsateTo: 1,
-pulsateTime: 3,
-reverse: false,
-depth: 0.5,
-maxSpeed: 0.05,
-minSpeed: 0,
-decel: 0.95,
-interval: 20,
-minBrightness: 0.1,
-maxBrightness: 1,
-outlineColour: '#ffff99',
-outlineThickness: 2,
-outlineOffset: 5,
-outlineMethod: 'outline',
-outlineRadius: 0,
-textColour: '#ff99ff',
-textHeight: 15,
-textFont: 'Helvetica, Arial, sans-serif',
-shadow: '#000',
-shadowBlur: 0,
-shadowOffset: [0,0],
-initial: null,
-hideTags: true,
-zoom: 1,
-weight: false,
-weightMode: 'size',
-weightFrom: null,
-weightSize: 1,
-weightSizeMin: null,
-weightSizeMax: null,
-weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'},
-txtOpt: true,
-txtScale: 2,
-frontSelect: false,
-wheelZoom: true,
-zoomMin: 0.3,
-zoomMax: 3,
-zoomStep: 0.05,
-shape: 'sphere',
-lock: null,
-tooltip: null,
-tooltipDelay: 300,
-tooltipClass: 'tctooltip',
-radiusX: 1,
-radiusY: 1,
-radiusZ: 1,
-stretchX: 1,
-stretchY: 1,
-offsetX: 0,
-offsetY: 0,
-shuffleTags: false,
-noSelect: false,
-noMouse: false,
-imageScale: 1,
-paused: false,
-dragControl: false,
-dragThreshold: 4,
-centreFunc: Nop,
-splitWidth: 0,
-animTiming: 'Smooth',
-clickToFront: false,
-fadeIn: 0,
-padding: 0,
-bgColour: null,
-bgRadius: 0,
-bgOutline: null,
-bgOutlineThickness: 0,
-outlineIncrease: 4,
-textAlign: 'centre',
-textVAlign: 'middle',
-imageMode: null,
-imagePosition: null,
-imagePadding: 2,
-imageAlign: 'centre',
-imageVAlign: 'middle',
-noTagsMessage: true,
-centreImage: null,
-pinchZoom: false,
-repeatTags: 0,
-minTags: 0
-};
-for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i];
-window.TagCanvas = TagCanvas;
-// set a flag for when the window has loaded
-AddHandler('load',function(){TagCanvas.loaded=1},window);
-})();
diff --git a/js/tagcanvas.min.js b/js/tagcanvas.min.js
new file mode 100644
index 0000000..61b9384
--- /dev/null
+++ b/js/tagcanvas.min.js
@@ -0,0 +1,21 @@
+/**
+ * Copyright (C) 2010-2021 Graham Breach
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+/**
+ * TagCanvas 2.11
+ * For more information, please contact
+ */
+(function(){"use strict";var r,C,p=Math.abs,o=Math.sin,l=Math.cos,g=Math.max,h=Math.min,af=Math.ceil,E=Math.sqrt,w=Math.pow,I={},D={},R={0:"0,",1:"17,",2:"34,",3:"51,",4:"68,",5:"85,",6:"102,",7:"119,",8:"136,",9:"153,",a:"170,",A:"170,",b:"187,",B:"187,",c:"204,",C:"204,",d:"221,",D:"221,",e:"238,",E:"238,",f:"255,",F:"255,"},f,d,b,T,z,F,M,c=document,v,e,P,j={};for(r=0;r<256;++r)C=r.toString(16),r<16&&(C='0'+C),D[C]=D[C.toUpperCase()]=r.toString()+',';function n(a){return typeof a!='undefined'}function B(a){return typeof a=='object'&&a!=null}function G(a,c,b){return isNaN(a)?b:h(b,g(c,a))}function x(){return!1}function q(){return(new Date).valueOf()}function ak(c,d){var b=[],e=c.length,a;for(a=0;a=1)?0:a<=-1?Math.PI:Math.acos(a)},z.unit=function(){var a=this.length();return new s(this.x/a,this.y/a,this.z/a)};function ay(b,a){a=a*Math.PI/180,b=b*Math.PI/180;var c=o(b)*l(a),d=-o(a),e=-l(b)*l(a);return new s(c,d,e)}function m(a){this[1]={1:a[0],2:a[1],3:a[2]},this[2]={1:a[3],2:a[4],3:a[5]},this[3]={1:a[6],2:a[7],3:a[8]}}T=m.prototype,m.Identity=function(){return new m([1,0,0,0,1,0,0,0,1])},m.Rotation=function(e,a){var c=o(e),d=l(e),b=1-d;return new m([d+w(a.x,2)*b,a.x*a.y*b-a.z*c,a.x*a.z*b+a.y*c,a.y*a.x*b+a.z*c,d+w(a.y,2)*b,a.y*a.z*b-a.x*c,a.z*a.x*b-a.y*c,a.z*a.y*b+a.x*c,d+w(a.z,2)*b])},T.mul=function(c){var d=[],a,b,e=c.xform?1:0;for(a=1;a<=3;++a)for(b=1;b<=3;++b)e?d.push(this[a][1]*c[1][b]+this[a][2]*c[2][b]+this[a][3]*c[3][b]):d.push(this[a][b]*c);return new m(d)},T.xform=function(b){var a={},c=b.x,d=b.y,e=b.z;return a.x=c*this[1][1]+d*this[2][1]+e*this[3][1],a.y=c*this[1][2]+d*this[2][2]+e*this[3][2],a.z=c*this[1][3]+d*this[2][3]+e*this[3][3],a};function aB(g,j,k,m,f){var a,b,c,d,e=[],h=2/g,i;i=Math.PI*(3-E(5)+(parseFloat(f)?parseFloat(f):0));for(a=0;a0)}function aC(a,c,f,d){var e=a.createLinearGradient(0,0,c,0),b;for(b in d)e.addColorStop(1-b,d[b]);a.fillStyle=e,a.fillRect(0,f,c,1)}function L(a,m,j){var l=1024,d=1,e=a.weightGradient,i,f,b,c;if(a.gCanvas)f=a.gCanvas.getContext('2d'),d=a.gCanvas.height;else{if(B(e[0])?d=e.length:e=[e],a.gCanvas=i=k(l,d),!i)return null;f=i.getContext('2d');for(b=0;b0?b=i*b/100:b=b*j,a=e.getContext('2d'),a.globalCompositeOperation='source-over',a.fillStyle='#fff',b>=i/2?(b=h(c,d)/2,a.beginPath(),a.moveTo(c/2,d/2),a.arc(c/2,d/2,b,0,2*Math.PI,!1),a.fill(),a.closePath()):(b=h(c/2,d/2,b),y(a,0,0,c,d,b,!0),a.fill()),a.globalCompositeOperation='source-in',a.drawImage(l,0,0,c,d),e)}function ao(q,m,i,b,h,a,c){var g=p(c[0]),f=p(c[1]),j=m+(g>a?g+a:a*2)*b,l=i+(f>a?f+a:a*2)*b,n=b*((a||0)+(c[0]<0?g:0)),o=b*((a||0)+(c[1]<0?f:0)),e,d;return e=k(j,l),!e?null:(d=e.getContext('2d'),h&&(d.shadowColor=h),a&&(d.shadowBlur=a*b),c&&(d.shadowOffsetX=c[0]*b,d.shadowOffsetY=c[1]*b),d.drawImage(q,n,o,m,i),{image:e,width:j/b,height:l/b})}function ae(m,o,l){var c=parseInt(m.toString().length*l),h=parseInt(l*2*m.length),j=k(c,h),g,i,e,f,b,d,n,a;if(!j)return null;g=j.getContext('2d'),g.fillStyle='#000',g.fillRect(0,0,c,h),Y(g,l+'px '+o,'#fff',m,0,0,0,0,[],'centre'),i=g.getImageData(0,0,c,h),e=i.width,f=i.height,a={min:{x:e,y:f},max:{x:-1,y:-1}};for(d=0;d0&&(ba.max.x&&(a.max.x=b),da.max.y&&(a.max.y=d));return e!=c&&(a.min.x*=c/e,a.max.x*=c/e),f!=h&&(a.min.y*=c/f,a.max.y*=c/f),j=null,a}function Q(a){return"'"+a.replace(/(\'|\")/g,'').replace(/\s*,\s*/g,"', '")+"'"}function t(b,d,a){a=a||c,a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent('on'+b,d)}function am(b,d,a){a=a||c,a.removeEventListener?a.removeEventListener(b,d):a.detachEvent('on'+b,d)}function A(g,e,j,a,b){var l=b.imageScale,h,c,k,m,f,d;if(!e.complete)return t('load',function(){A(g,e,j,a,b)},e);if(!g.complete)return t('load',function(){A(g,e,j,a,b)},g);if(j&&!j.complete)return t('load',function(){A(g,e,j,a,b)},j);e.width=e.width,e.height=e.height,l&&(g.width=e.width*l,g.height=e.height*l),a.iw=g.width,a.ih=g.height,b.txtOpt&&(c=g,h=b.zoomMax*b.txtScale,f=a.iw*h,d=a.ih*h,f0?(a.iw+=2*b.outlineIncrease,a.ih+=2*b.outlineIncrease,f=h*a.iw,d=h*a.ih,c=S(a.fimage,f,d),a.oimage=c,a.fimage=H(a.fimage,a.oimage.width,a.oimage.height)):(f=h*(a.iw+2*b.outlineIncrease),d=h*(a.ih+2*b.outlineIncrease),c=S(a.fimage,f,d),a.oimage=H(c,a.fimage.width,a.fimage.height))))),a.alt=j,a.Init()}function i(a,d){var b=c.defaultView,e=d.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()});return b&&b.getComputedStyle&&b.getComputedStyle(a,null).getPropertyValue(d)||a.currentStyle&&a.currentStyle[e]}function aj(c,d,e){var b=1,a;return d?b=1*(c.getAttribute(d)||e):(a=i(c,'font-size'))&&(b=a.indexOf('px')>-1&&a.replace('px','')*1||a.indexOf('pt')>-1&&a.replace('pt','')*1.25||a*3.3),b}function u(a){return a.target&&n(a.target.id)?a.target.id:a.srcElement.parentNode.id}function K(a,c){var b,d,e=parseInt(i(c,'width'))/c.width,f=parseInt(i(c,'height'))/c.height;return n(a.offsetX)?b={x:a.offsetX,y:a.offsetY}:(d=X(c.id),n(a.changedTouches)&&(a=a.changedTouches[0]),a.pageX&&(b={x:a.pageX-d.x,y:a.pageY-d.y})),b&&e&&f&&(b.x/=e,b.y/=f),b}function an(c){var d=c.target||c.fromElement.parentNode,b=a.tc[d.id];b&&(b.mx=b.my=-1,b.UnFreeze(),b.EndDrag())}function ad(e){var g,c=a,b,d,f=u(e);for(g in c.tc)b=c.tc[g],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);f&&c.tc[f]&&(b=c.tc[f],(d=K(e,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(e,d)),b.drawn=0)}function ap(b){var e=a,f=c.addEventListener?0:1,d=u(b);d&&b.button==f&&e.tc[d]&&e.tc[d].BeginDrag(b)}function aq(b){var f=a,g=c.addEventListener?0:1,e=u(b),d;e&&b.button==g&&f.tc[e]&&(d=f.tc[e],ad(b),!d.EndDrag()&&!d.touchState&&d.Clicked(b))}function ar(c){var e=u(c),b=e&&a.tc[e],d;b&&c.changedTouches&&(c.touches.length==1&&b.touchState==0?(b.touchState=1,b.BeginDrag(c),(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.drawn=0)):c.targetTouches.length==2&&b.pinchZoom?(b.touchState=3,b.EndDrag(),b.BeginPinch(c)):(b.EndDrag(),b.EndPinch(),b.touchState=0))}function ac(c){var d=u(c),b=d&&a.tc[d];if(b&&c.changedTouches){switch(b.touchState){case 1:b.Draw(),b.Clicked();break;break;case 2:b.EndDrag();break;case 3:b.EndPinch()}b.touchState=0}}function au(c){var f,e=a,b,d,g=u(c);for(f in e.tc)b=e.tc[f],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);if(b=g&&e.tc[g],b&&c.changedTouches&&b.touchState){switch(b.touchState){case 1:case 2:(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(c,d)&&(b.touchState=2));break;case 3:b.Pinch(c)}b.drawn=0}}function ab(b){var d=a,c=u(b);c&&d.tc[c]&&(b.cancelBubble=!0,b.returnValue=!1,b.preventDefault&&b.preventDefault(),d.tc[c].Wheel((b.wheelDelta||b.detail)>0))}function aw(d){var c,b=a;clearTimeout(b.scrollTimer);for(c in b.tc)b.tc[c].Pause();b.scrollTimer=setTimeout(function(){var b,c=a;for(b in c.tc)c.tc[b].Resume()},b.scrollPause)}function al(){Z(q())}function Z(b){var c=a.tc,d;a.NextFrame(a.interval),b=b||q();for(d in c)c[d].Draw(b)}function az(){requestAnimationFrame(Z)}function aA(a){setTimeout(al,a)}function X(f){var g=c.getElementById(f),b=g.getBoundingClientRect(),a=c.documentElement,d=c.body,e=window,h=e.pageXOffset||a.scrollLeft,i=e.pageYOffset||a.scrollTop,j=a.clientLeft||d.clientLeft,k=a.clientTop||d.clientTop;return{x:b.left+h-j,y:b.top+i-k}}function aI(a,b,d,e){var c=a.radius*a.z1/(a.z1+a.z2+b.z);return{x:b.x*c*d,y:b.y*c*e,z:b.z,w:(a.z1-b.z)/a.z2}}function V(a){this.e=a,this.br=0,this.line=[],this.text=[],this.original=a.innerText||a.textContent}F=V.prototype,F.Empty=function(){for(var a=0;ah?(d.push(this.line.join(' ')),this.line=[a[b]]):this.line.push(a[b]);d.push(this.line.join(' '))}return this.text=d};function _(a,b){this.ts=null,this.tc=a,this.tag=b,this.x=this.y=this.w=this.h=this.sc=1,this.z=0,this.pulse=1,this.pulsate=a.pulsateTo<1,this.colour=a.outlineColour,this.adash=~~a.outlineDash,this.agap=~~a.outlineDashSpace||this.adash,this.aspeed=a.outlineDashSpeed*1,this.colour=='tag'?this.colour=i(b.a,'color'):this.colour=='tagbg'&&(this.colour=i(b.a,'background-color')),this.Draw=this.pulsate?this.DrawPulsate:this.DrawSimple,this.radius=a.outlineRadius|0,this.SetMethod(a.outlineMethod,a.altImage)}f=_.prototype,f.SetMethod=function(a,d){var b={block:['PreDraw','DrawBlock'],colour:['PreDraw','DrawColour'],outline:['PostDraw','DrawOutline'],classic:['LastDraw','DrawOutline'],size:['PreDraw','DrawSize'],none:['LastDraw']},c=b[a]||b.outline;a=='none'?this.Draw=function(){return 1}:this.drawFunc=this[c[1]],this[c[0]]=this.Draw,d&&(this.RealPreDraw=this.PreDraw,this.PreDraw=this.DrawAlt)},f.Update=function(d,e,i,j,a,f,g,h){var b=this.tc.outlineOffset,c=2*b;this.x=a*d+g-b,this.y=a*e+h-b,this.w=a*i+c,this.h=a*j+c,this.sc=a,this.z=f},f.Ants=function(k){if(!this.adash)return;var b=this.adash,c=this.agap,a=this.aspeed,j=b+c,h=0,g=b,f=c,i=0,d=0,e;a&&(d=p(a)*(q()-this.ts)/50,a<0&&(d=864e4-d),a=~~d%j),a?(b>=a?(h=b-a,g=a):(f=j-a,i=c-f),e=[h,f,g,i]):e=[b,c],k.setLineDash(e)},f.DrawOutline=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.strokeStyle=f,this.Ants(a),y(a,d,e,b,c,g,!0)},f.DrawSize=function(i,n,m,l,k,j,a,h,g){var f=a.w,e=a.h,c,b,d;return this.pulsate?(a.image?d=(a.image.height+this.tc.outlineIncrease)/a.image.height:d=a.oscale,b=a.fimage||a.image,c=1+(d-1)*(1-this.pulse),a.h*=c,a.w*=c):b=a.oimage,a.alpha=1,a.Draw(i,h,g,b),a.h=e,a.w=f,1},f.DrawColour=function(d,h,i,e,f,g,a,b,c){return a.oimage?(this.pulse<1?(a.alpha=1-w(this.pulse,2),a.Draw(d,b,c,a.fimage),a.alpha=this.pulse):a.alpha=1,a.Draw(d,b,c,a.oimage),1):this[a.image?'DrawColourImage':'DrawColourText'](d,h,i,e,f,g,a,b,c)},f.DrawColourText=function(f,h,i,j,g,e,a,b,c){var d=a.colour;return a.colour=e,a.alpha=1,a.Draw(f,b,c),a.colour=d,1},f.DrawColourImage=function(a,q,p,o,n,m,i,r,l){var f=a.canvas,e=~~g(q,0),d=~~g(p,0),c=h(f.width-e,o)+.5|0,b=h(f.height-d,n)+.5|0,j;return v?(v.width=c,v.height=b):v=k(c,b),!v?this.SetMethod('outline'):(j=v.getContext('2d'),j.drawImage(f,e,d,c,b,0,0,c,b),a.clearRect(e,d,c,b),this.pulsate?i.alpha=1-w(this.pulse,2):i.alpha=1,i.Draw(a,r,l),a.setTransform(1,0,0,1,0,0),a.save(),a.beginPath(),a.rect(e,d,c,b),a.clip(),a.globalCompositeOperation='source-in',a.fillStyle=m,a.fillRect(e,d,c,b),a.restore(),a.globalAlpha=1,a.globalCompositeOperation='destination-over',a.drawImage(v,0,0,c,b,e,d,c,b),a.globalCompositeOperation='source-over',1)},f.DrawAlt=function(b,a,c,d,f,g){var e=this.RealPreDraw(b,a,c,d,f,g);return a.alt&&(a.DrawImage(b,c,d,a.alt),e=1),e},f.DrawBlock=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.fillStyle=f,y(a,d,e,b,c,g)},f.DrawSimple=function(a,b,c,d,e,f){var g=this.tc;return a.setTransform(1,0,0,1,0,0),a.strokeStyle=this.colour,a.lineWidth=g.outlineThickness,a.shadowBlur=a.shadowOffsetX=a.shadowOffsetY=0,a.globalAlpha=f?e:1,this.drawFunc(a,this.x,this.y,this.w,this.h,this.colour,b,c,d)},f.DrawPulsate=function(h,d,e,f){var g=q()-this.ts,c=this.tc,b=c.pulsateTo+(1-c.pulsateTo)*(.5+l(2*Math.PI*g/(1e3*c.pulsateTime))/2);return this.pulse=b=a.Smooth(1,b),this.DrawSimple(h,d,e,f,b,1)},f.Active=function(d,a,b){var c=a>=this.x&&b>=this.y&&a<=this.x+this.w&&b<=this.y+this.h;return c?this.ts=this.ts||q():this.ts=null,c},f.PreDraw=f.PostDraw=f.LastDraw=x;function J(a,h,c,b,e,f,g,d,i,j,k,l,m,n){this.tc=a,this.image=null,this.text=h,this.text_original=n,this.line_widths=[],this.title=c.title||null,this.a=c,this.position=new s(b[0],b[1],b[2]),this.x=this.y=this.z=0,this.w=e,this.h=f,this.colour=g||a.textColour,this.bgColour=d||a.bgColour,this.bgRadius=i|0,this.bgOutline=j||this.colour,this.bgOutlineThickness=k|0,this.textFont=l||a.textFont,this.padding=m|0,this.sc=this.alpha=1,this.weighted=!a.weight,this.outline=new _(a,this),this.audio=null}d=J.prototype,d.Init=function(b){var a=this.tc;this.textHeight=a.textHeight,this.HasText()?this.Measure(a.ctxt,a):(this.w=this.iw,this.h=this.ih),this.SetShadowColour=a.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed,this.SetDraw(a)},d.Draw=x,d.HasText=function(){return this.text&&this.text[0].length>0},d.EqualTo=function(a){var b=a.getElementsByTagName('img');return this.a.href!=a.href?0:b.length?this.image.src==b[0].src:(a.innerText||a.textContent)==this.text_original},d.SetImage=function(a){this.image=this.fimage=a},d.SetAudio=function(a){this.audio=a,this.audio.load()},d.SetDraw=function(a){this.Draw=this.fimage?a.ie>7?this.DrawImageIE:this.DrawImage:this.DrawText,a.noSelect&&(this.CheckActive=x)},d.MeasureText=function(d){var a,e=this.text.length,b=0,c;for(a=0;a0?c=H(c,this.oimage.width,this.oimage.height):this.oimage=H(this.oimage,c.width,c.height)),c&&(this.fimage=c,l=this.fimage.width/b,j=this.fimage.height/b),this.SetDraw(a),a.txtOpt=!!this.fimage),this.h=j,this.w=l},d.SetFont=function(a,b,c,d){this.textFont=a,this.colour=b,this.bgColour=c,this.bgOutline=d,this.Measure(this.tc.ctxt,this.tc)},d.SetWeight=function(c){var b=this.tc,e=b.weightMode.split(/[, ]/),d,a,f=c.length;if(!this.HasText())return;this.weighted=!0;for(a=0;a0&&a.weightSizeMax>a.weightSizeMin?this.textHeight=a.weightSize*(a.weightSizeMin+(a.weightSizeMax-a.weightSizeMin)*c):this.textHeight=g(1,b*a.weightSize))},d.SetShadowColourFixed=function(a,b,c){a.shadowColor=b},d.SetShadowColourAlpha=function(a,b,c){a.shadowColor=aE(b,c)},d.DrawText=function(a,h,i){var e=this.tc,g=this.x,f=this.y,c=this.sc,b,d;a.globalAlpha=this.alpha,a.fillStyle=this.colour,e.shadow&&this.SetShadowColour(a,e.shadow,this.alpha),a.font=this.font,g+=h/c,f+=i/c-this.h/2;for(b=0;b{this.stopped?this.audio.pause():this.playing=1}),1}};function a(f,o,k){var d,i,b=c.getElementById(f),l=['id','class','innerHTML'];if(!b)throw 0;if(n(window.G_vmlCanvasManager)&&(b=window.G_vmlCanvasManager.initElement(b),this.ie=parseFloat(navigator.appVersion.split('MSIE')[1])),b&&(!b.getContext||!b.getContext('2d').fillText)){i=c.createElement('DIV');for(d=0;d0?a.scrollPause=~~this.scrollPause:this.scrollPause=0,this.minTags>0&&this.repeatTags<1&&(d=this.GetTags().length)&&(this.repeatTags=af(this.minTags/d)-1),this.transform=m.Identity(),this.startTime=this.time=q(),this.mx=this.my=-1,this.centreImage&&av(this),this.Animate=this.dragControl?this.AnimateDrag:this.AnimatePosition,this.animTiming=typeof a[this.animTiming]=='function'?a[this.animTiming]:a.Smooth,this.shadowBlur||this.shadowOffset[0]||this.shadowOffset[1]?(this.ctxt.shadowColor=this.shadow,this.shadow=this.ctxt.shadowColor,this.shadowAlpha=aD()):delete this.shadow,this.activeAudio===!1?e='off':this.activeAudio&&this.LoadAudio(),this.Load(),o&&this.hideTags&&function(b){a.loaded?b.HideTags():t('load',function(){b.HideTags()},window)}(this),this.yaw=this.initial?this.initial[0]*this.maxSpeed:0,this.pitch=this.initial?this.initial[1]*this.maxSpeed:0,this.tooltip?(this.ctitle=b.title,b.title='',this.tooltip=='native'?this.Tooltip=this.TooltipNative:(this.Tooltip=this.TooltipDiv,this.ttdiv||(this.ttdiv=c.createElement('div'),this.ttdiv.className=this.tooltipClass,this.ttdiv.style.position='absolute',this.ttdiv.style.zIndex=b.style.zIndex+1,t('mouseover',function(a){a.target.style.display='none'},this.ttdiv),c.body.appendChild(this.ttdiv)))):this.Tooltip=this.TooltipNone,!this.noMouse&&!j[f]){j[f]=[['mousemove',ad],['mouseout',an],['mouseup',aq],['touchstart',ar],['touchend',ac],['touchcancel',ac],['touchmove',au]],this.dragControl&&(j[f].push(['mousedown',ap]),j[f].push(['selectstart',x])),this.wheelZoom&&(j[f].push(['mousewheel',ab]),j[f].push(['DOMMouseScroll',ab])),this.scrollPause&&j[f].push(['scroll',aw,window]);for(d=0;dthis.max_weight[a])&&(this.max_weight[a]=c),(!this.min_weight[a]||cthis.min_weight[a]&&(g=1);if(g)for(b=0;b=d&&this.my>=e)return!0},b.ToggleAudio=function(){var a=this.audioOff||e&&e.state==='suspended';a||this.currentAudio&&this.currentAudio.StopAudio(),this.audioOff=!a},b.Draw=function(s){if(this.paused)return;var l=this.canvas,i=l.width,j=l.height,q=0,p=(s-this.time)*a.interval/1e3,h=i/2+this.offsetX,g=j/2+this.offsetY,d=this.ctxt,b,f,c,o=-1,e=this.taglist,k=e.length,t=this.active&&this.active.tag,m='',u=this.frontSelect,r=this.centreFunc==x,n;if(this.time=s,this.frozen&&this.drawn)return this.Animate(i,j,p);n=this.AnimateFixed(),d.setTransform(1,0,0,1,0,0);for(c=0;c=0&&this.my>=0&&this.taglist[c].CheckActive(d,h,g),f&&f.sc>q&&(!u||f.z<=0)&&(b=f,o=c,b.tag=this.taglist[c],q=f.sc);this.active=b}this.txtOpt||this.shadow&&this.SetShadow(d),d.clearRect(0,0,i,j);for(c=0;c=this.fadeIn?(this.fadeIn=0,this.fixedAlpha=1):this.fixedAlpha=b/this.fadeIn),this.fixedAnim)&&(this.fixedAnim.transform||(this.fixedAnim.transform=this.transform),a=this.fixedAnim,b=q()-a.t0,c=a.angle,d,e=this.animTiming(a.t,b),this.transform=a.transform,b>=a.t?(this.fixedCallbackTag=a.tag,this.fixedCallback=a.cb,this.fixedAnim=this.yaw=this.pitch=0):c*=e,d=m.Rotation(c,a.axis),this.transform=this.transform.mul(d),this.fixedAnim!=0)},b.AnimatePosition=function(g,h,f){var a=this,d=a.mx,e=a.my,b,c;!a.frozen&&d>=0&&e>=0&&db&&(a.yaw=c>a.z0?a.yaw*a.decel:0),!a.ly&&d>b&&(a.pitch=d>a.z0?a.pitch*a.decel:0)},b.Zoom=function(a){this.z2=this.z1*(1/a),this.drawn=0},b.Clicked=function(b){if(this.CheckAudioIcon()){this.ToggleAudio();return}var a=this.active;try{a&&a.tag&&(this.clickToFront===!1||this.clickToFront===null?a.tag.Clicked(b):this.TagToFront(a.tag,this.clickToFront,function(){a.tag.Clicked(b)},!0))}catch(a){}},b.Wheel=function(a){var b=this.zoom+this.zoomStep*(a?1:-1);this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.BeginDrag=function(a){this.down=K(a,this.canvas),a.cancelBubble=!0,a.returnValue=!1,a.preventDefault&&a.preventDefault()},b.Drag=function(e,a){if(this.dragControl&&this.down){var d=this.dragThreshold*this.dragThreshold,b=a.x-this.down.x,c=a.y-this.down.y;(this.dragging||b*b+c*c>d)&&(this.dx=b,this.dy=c,this.dragging=1,this.down=a)}return this.dragging},b.EndDrag=function(){var a=this.dragging;return this.dragging=this.down=null,a};function ah(a){var b=a.targetTouches[0],c=a.targetTouches[1];return E(w(c.pageX-b.pageX,2)+w(c.pageY-b.pageY,2))}b.BeginPinch=function(a){this.pinched=[ah(a),this.zoom],a.preventDefault&&a.preventDefault()},b.Pinch=function(d){var b,c,a=this.pinched;if(!a)return;c=ah(d),b=a[1]*c/a[0],this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.EndPinch=function(a){this.pinched=null},b.Pause=function(){this.paused=!0},b.Resume=function(){this.paused=!1},b.SetSpeed=function(a){this.initial=a,this.yaw=a[0]*this.maxSpeed,this.pitch=a[1]*this.maxSpeed},b.FindTag=function(a){if(!n(a))return null;if(n(a.index)&&(a=a.index),!B(a))return this.taglist[a];var c,d,b;n(a.id)?(c='id',d=a.id):n(a.text)&&(c='innerText',d=a.text);for(b=0;b=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&","
":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'',Ca.innerHTML.indexOf("
")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un});
\ No newline at end of file
diff --git a/js/vue.min.js b/js/vue.min.js
new file mode 100644
index 0000000..d998ff7
--- /dev/null
+++ b/js/vue.min.js
@@ -0,0 +1,6 @@
+/*!
+ * Vue.js v2.6.14
+ * (c) 2014-2021 Evan You
+ * Released under the MIT License.
+ */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!V&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Re(String,i.type);(c<0||s0&&(ct((u=e(u,(a||"")+"_"+c))[0])&&ct(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?ct(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):ct(u)&&ct(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function ct(e){return n(e)&&n(e.text)&&!1===e.isComment}function ut(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=vt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:st(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!pt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function ht(e,t){return function(){return e[t]}}function mt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;idocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}function ln(){var e,t;for(sn=cn(),on=!0,en.sort(function(e,t){return e.id-t.id}),an=0;anan&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,Qe(ln))}}(this)},pn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Be(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},pn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},pn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},pn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:S,set:S};function vn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}function hn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Ie(o,t,n,e);xe(r,o,a),o in e||vn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return He(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&vn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new pn(e,a||S,S,mn)),i in e||yn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function On(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Sn(n,o,r,i)}}}function Sn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=$n++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De(wn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Wt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=lt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Ht(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Ht(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Qt(n,"beforeCreate"),function(e){var t=ut(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),hn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Qt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(Cn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return bn(this,e,t,n);(n=n||{}).user=!0;var r=new pn(this,e,t,n);if(n.immediate){var i='callback for immediate watcher "'+r.expression+'"';le(),Be(t,this,[r.value],this,i),fe()}return function(){r.teardown()}}}(Cn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Sn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Sn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",function(t){On(e,function(e){return An(t,e)})}),this.$watch("exclude",function(t){On(e,function(e){return!An(t,e)})})},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=kn(n),i=this.include,o=this.exclude;if(i&&(!r||!An(i,r))||o&&r&&An(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Qe,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),xn(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(Cn),Object.defineProperty(Cn.prototype,"$isServer",{get:te}),Object.defineProperty(Cn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cn,"FunctionalRenderContext",{value:Et}),Cn.version="2.6.14";var En=p("style,class"),jn=p("input,textarea,option,select,progress"),Dn=function(e,t,n){return"value"===n&&jn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Ln=p("contenteditable,draggable,spellcheck"),In=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Bn(t)||"false"===t?"false":"contenteditable"===e&&In(t)?t:"true"},Fn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Pn="http://www.w3.org/1999/xlink",Rn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Hn=function(e){return Rn(e)?e.slice(6,e.length):""},Bn=function(e){return null==e||!1===e};function Un(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Vn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Vn(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Kn(t));return""}(t.staticClass,t.class)}function Vn(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?mr(e,t,n):Fn(t)?Bn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ln(t)?e.setAttribute(t,Mn(t,n)):Rn(t)?Bn(n)?e.removeAttributeNS(Pn,Hn(t)):e.setAttributeNS(Pn,t,n):mr(e,t,n)}function mr(e,t,n){if(Bn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var yr={create:vr,update:vr};function gr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Un(r),c=i._transitionClasses;n(c)&&(s=zn(s,Kn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var _r,br,$r,wr,Cr,xr,kr={create:gr,update:gr},Ar=/[\w).+\-_$\]]/;function Or(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&Ar.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,wr),key:'"'+e.slice(wr+1)+'"'}:{exp:e,key:null};br=e,wr=Cr=xr=0;for(;!zr();)Kr($r=Vr())?qr($r):91===$r&&Jr($r);return{exp:e.slice(0,Cr),key:e.slice(Cr+1,xr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Vr(){return br.charCodeAt(++wr)}function zr(){return wr>=_r}function Kr(e){return 34===e||39===e}function Jr(e){var t=1;for(Cr=wr;!zr();)if(Kr(e=Vr()))qr(e);else if(91===e&&t++,93===e&&t--,0===t){xr=wr;break}}function qr(e){for(var t=e;!zr()&&(e=Vr())!==t;);}var Wr,Zr="__r",Gr="__c";function Xr(e,t,n){var r=Wr;return function i(){null!==t.apply(null,arguments)&&ei(e,i,n,r)}}var Yr=Ke&&!(X&&Number(X[1])<=53);function Qr(e,t,n,r){if(Yr){var i=sn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Wr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Wr=r.elm,function(e){if(n(e[Zr])){var t=q?"change":"input";e[t]=[].concat(e[Zr],e[t]||[]),delete e[Zr]}n(e[Gr])&&(e.change=[].concat(e[Gr],e.change||[]),delete e[Gr])}(i),it(i,o,Qr,ei,Xr,r.context),Wr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);oi(a,u)&&(a.value=u)}else if("innerHTML"===i&&Wn(a.tagName)&&t(a.innerHTML)){(ni=ni||document.createElement("div")).innerHTML="";for(var l=ni.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ai={create:ii,update:ii},si=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ci(e){var t=ui(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ui(e){return Array.isArray(e)?O(e):"string"==typeof e?si(e):e}var li,fi=/^--/,pi=/\s*!important$/,di=function(e,t,n){if(fi.test(t))e.style.setProperty(t,n);else if(pi.test(n))e.style.setProperty(C(t),n.replace(pi,""),"important");else{var r=hi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(gi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function bi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(gi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function $i(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,wi(e.name||"v")),A(t,e),t}return"string"==typeof e?wi(e):void 0}}var wi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ci=V&&!W,xi="transition",ki="animation",Ai="transition",Oi="transitionend",Si="animation",Ti="animationend";Ci&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ai="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Si="WebkitAnimation",Ti="webkitAnimationEnd"));var Ni=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ni(function(){Ni(e)})}function ji(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),_i(e,t))}function Di(e,t){e._transitionClasses&&h(e._transitionClasses,t),bi(e,t)}function Li(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===xi?Oi:Ti,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=xi,l=a,f=o.length):t===ki?u>0&&(n=ki,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?xi:ki:null)?n===xi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===xi&&Ii.test(r[Ai+"Property"])}}function Fi(e,t){for(;e.length1}function Vi(e,t){!0!==t.data.show&&Ri(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(E(Zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Wi(e,t){return t.every(function(t){return!E(t,e)})}function Zi(e){return"_value"in e?e._value:e.value}function Gi(e){e.target.composing=!0}function Xi(e){e.target.composing&&(e.target.composing=!1,Yi(e.target,"input"))}function Yi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Qi(e){return!e.componentInstance||e.data&&e.data.transition?e:Qi(e.componentInstance._vnode)}var eo={model:Ki,show:{bind:function(e,t,n){var r=t.value,i=(n=Qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ri(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Qi(n)).data&&n.data.transition?(n.data.show=!0,r?Ri(n,function(){e.style.display=e.__vOriginalDisplay}):Hi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},to={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function no(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?no(zt(t.children)):e}function ro(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function io(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var oo=function(e){return e.tag||pt(e)},ao=function(e){return"show"===e.name},so={name:"transition",props:to,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(oo)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=no(o);if(!a)return o;if(this._leaving)return io(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=ro(this),u=this._vnode,l=no(u);if(a.data.directives&&a.data.directives.some(ao)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!pt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,ot(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),io(e,o);if("in-out"===r){if(pt(a))return u;var p,d=function(){p()};ot(c,"afterEnter",d),ot(c,"enterCancelled",d),ot(f,"delayLeave",function(e){p=e})}}return o}}},co=A({tag:String,moveClass:String},to);function uo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function lo(e){e.data.newPos=e.elm.getBoundingClientRect()}function fo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete co.mode;var po={Transition:so,TransitionGroup:{props:co,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=ro(this),s=0;s-1?Xn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Xn[e]=/HTMLUnknownElement/.test(t.toString())},A(Cn.options.directives,eo),A(Cn.options.components,po),Cn.prototype.__patch__=V?zi:S,Cn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new pn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&V?Qn(e):void 0,t)},V&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",Cn)},0);var vo=/\{\{((?:.|\r?\n)+?)\}\}/g,ho=/[-.*+?^${}()|[\]\/\\]/g,mo=g(function(e){var t=e[0].replace(ho,"\\$&"),n=e[1].replace(ho,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var yo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Pr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var go,_o={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Pr(e,"style");n&&(e.staticStyle=JSON.stringify(si(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(go=go||document.createElement("div")).innerHTML=e,go.textContent},$o=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),wo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Co=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),xo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ao="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Oo="((?:"+Ao+"\\:)?"+Ao+")",So=new RegExp("^<"+Oo),To=/^\s*(\/?)>/,No=new RegExp("^<\\/"+Oo+"[^>]*>"),Eo=/^]+>/i,jo=/^",""":'"',"&":"&","
":"\n"," ":"\t","'":"'"},Fo=/&(?:lt|gt|quot|amp|#39);/g,Po=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Ro=p("pre,textarea",!0),Ho=function(e,t){return e&&Ro(e)&&"\n"===t[0]};function Bo(e,t){var n=t?Po:Fo;return e.replace(n,function(e){return Mo[e]})}var Uo,Vo,zo,Ko,Jo,qo,Wo,Zo,Go=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Yo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ea=/^\(|\)$/g,ta=/^\[.*\]$/,na=/:(.*)$/,ra=/^:|^\.|^v-bind:/,ia=/\.[^.\]]+(?=[^\]]*$)/g,oa=/^v-slot(:|$)|^#/,aa=/[\r\n]/,sa=/[ \f\t\r\n]+/g,ca=g(bo),ua="_empty_";function la(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ya(t),rawAttrsMap:{},parent:n,children:[]}}function fa(e,t){Uo=t.warn||Tr,qo=t.isPreTag||T,Wo=t.mustUseProp||T,Zo=t.getTagNamespace||T;t.isReservedTag;zo=Nr(t.modules,"transformNode"),Ko=Nr(t.modules,"preTransformNode"),Jo=Nr(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=pa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&va(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&va(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),qo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Lo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Ho(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(jo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Do.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(No);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ho(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(No.test($)||So.test($)||jo.test($)||Do.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(So);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(To))&&(r=e.match(ko)||e.match(xo));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&Co(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Uo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Zo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Or(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ur(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ur(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ur(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Ur(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Zr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Ur(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Br(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:$o,mustUseProp:Dn,canBeLeftOpenTag:wo,isReservedTag:Zn,getTagNamespace:Gn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}($a)},ka=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function Aa(e,t){e&&(wa=ka(t.staticKeys||""),Ca=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!Ca(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(wa)))}(t);if(1===t.type){if(!Ca(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Sa=/\([^)]*?\);*$/,Ta=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Na={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},ja=function(e){return"if("+e+")return null;"},Da={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ja("$event.target !== $event.currentTarget"),ctrl:ja("!$event.ctrlKey"),shift:ja("!$event.shiftKey"),alt:ja("!$event.altKey"),meta:ja("!$event.metaKey"),left:ja("'button' in $event && $event.button !== 0"),middle:ja("'button' in $event && $event.button !== 1"),right:ja("'button' in $event && $event.button !== 2")};function La(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ia(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ia(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ia(e)}).join(",")+"]";var t=Ta.test(e.value),n=Oa.test(e.value),r=Ta.test(e.value.replace(Sa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Da[s])o+=Da[s],Na[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=ja(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Na[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Fa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Pa=function(e){this.options=e,this.warn=e.warn||Tr,this.transforms=Nr(e.modules,"transformCode"),this.dataGenFns=Nr(e.modules,"genData"),this.directives=A(A({},Fa),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ra(e,t){var n=new Pa(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ha(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ha(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ba(e,t);if(e.once&&!e.onceProcessed)return Ua(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Va(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Wa(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?Xa((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Wa(t,n,!0);return"_c("+e+","+Ka(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ka(e,t));var i=e.inlineTemplate?null:Wa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Ra(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Xa(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ja(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ja))}function qa(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Va(e,t,qa,"null");if(e.for&&!e.forProcessed)return za(e,t,qa);var r=e.slotScope===ua?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Wa(e,t)||"undefined")+":undefined":Wa(e,t)||"undefined":Ha(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Wa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ha)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r':'',ns.innerHTML.indexOf("
")>0}var as=!!V&&os(!1),ss=!!V&&os(!0),cs=g(function(e){var t=Qn(e);return t&&t.innerHTML}),us=Cn.prototype.$mount;return Cn.prototype.$mount=function(e,t){if((e=e&&Qn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=cs(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=is(r,{outputSourceRange:!1,shouldDecodeNewlines:as,shouldDecodeNewlinesForHref:ss,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return us.call(this,e,t)},Cn.compile=is,Cn});
\ No newline at end of file
diff --git a/js/zepto.js b/js/zepto.js
deleted file mode 100644
index 3b450a8..0000000
--- a/js/zepto.js
+++ /dev/null
@@ -1,1909 +0,0 @@
-/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */
-
-var Zepto = (function() {
- var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter,
- document = window.document,
- elementDisplay = {}, classCache = {},
- cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },
- fragmentRE = /^\s*<(\w+|!)[^>]*>/,
- singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
- rootNodeRE = /^(?:body|html)$/i,
- capitalRE = /([A-Z])/g,
-
- // special attributes that should be get/set via method calls
- methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],
-
- adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],
- table = document.createElement('table'),
- tableRow = document.createElement('tr'),
- containers = {
- 'tr': document.createElement('tbody'),
- 'tbody': table, 'thead': table, 'tfoot': table,
- 'td': tableRow, 'th': tableRow,
- '*': document.createElement('div')
- },
- readyRE = /complete|loaded|interactive/,
- classSelectorRE = /^\.([\w-]+)$/,
- idSelectorRE = /^#([\w-]*)$/,
- simpleSelectorRE = /^[\w-]*$/,
- class2type = {},
- toString = class2type.toString,
- zepto = {},
- camelize, uniq,
- tempParent = document.createElement('div'),
- propMap = {
- 'tabindex': 'tabIndex',
- 'readonly': 'readOnly',
- 'for': 'htmlFor',
- 'class': 'className',
- 'maxlength': 'maxLength',
- 'cellspacing': 'cellSpacing',
- 'cellpadding': 'cellPadding',
- 'rowspan': 'rowSpan',
- 'colspan': 'colSpan',
- 'usemap': 'useMap',
- 'frameborder': 'frameBorder',
- 'contenteditable': 'contentEditable'
- }
-
- zepto.matches = function(element, selector) {
- if (!selector || !element || element.nodeType !== 1) return false
- var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector ||
- element.oMatchesSelector || element.matchesSelector
- if (matchesSelector) return matchesSelector.call(element, selector)
- // fall back to performing a selector:
- var match, parent = element.parentNode, temp = !parent
- if (temp) (parent = tempParent).appendChild(element)
- match = ~zepto.qsa(parent, selector).indexOf(element)
- temp && tempParent.removeChild(element)
- return match
- }
-
- function type(obj) {
- return obj == null ? String(obj) :
- class2type[toString.call(obj)] || "object"
- }
-
- function isFunction(value) { return type(value) == "function" }
- function isWindow(obj) { return obj != null && obj == obj.window }
- function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }
- function isObject(obj) { return type(obj) == "object" }
- function isPlainObject(obj) {
- return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype
- }
- function isArray(value) { return value instanceof Array }
- function likeArray(obj) { return typeof obj.length == 'number' }
-
- function compact(array) { return filter.call(array, function(item){ return item != null }) }
- function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }
- camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
- function dasherize(str) {
- return str.replace(/::/g, '/')
- .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
- .replace(/([a-z\d])([A-Z])/g, '$1_$2')
- .replace(/_/g, '-')
- .toLowerCase()
- }
- uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }
-
- function classRE(name) {
- return name in classCache ?
- classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)'))
- }
-
- function maybeAddPx(name, value) {
- return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value
- }
-
- function defaultDisplay(nodeName) {
- var element, display
- if (!elementDisplay[nodeName]) {
- element = document.createElement(nodeName)
- document.body.appendChild(element)
- display = getComputedStyle(element, '').getPropertyValue("display")
- element.parentNode.removeChild(element)
- display == "none" && (display = "block")
- elementDisplay[nodeName] = display
- }
- return elementDisplay[nodeName]
- }
-
- function children(element) {
- return 'children' in element ?
- slice.call(element.children) :
- $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })
- }
-
- // `$.zepto.fragment` takes a html string and an optional tag name
- // to generate DOM nodes nodes from the given html string.
- // The generated DOM nodes are returned as an array.
- // This function can be overriden in plugins for example to make
- // it compatible with browsers that don't support the DOM fully.
- zepto.fragment = function(html, name, properties) {
- var dom, nodes, container
-
- // A special case optimization for a single tag
- if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))
-
- if (!dom) {
- if (html.replace) html = html.replace(tagExpanderRE, "<$1>$2>")
- if (name === undefined) name = fragmentRE.test(html) && RegExp.$1
- if (!(name in containers)) name = '*'
-
- container = containers[name]
- container.innerHTML = '' + html
- dom = $.each(slice.call(container.childNodes), function(){
- container.removeChild(this)
- })
- }
-
- if (isPlainObject(properties)) {
- nodes = $(dom)
- $.each(properties, function(key, value) {
- if (methodAttributes.indexOf(key) > -1) nodes[key](value)
- else nodes.attr(key, value)
- })
- }
-
- return dom
- }
-
- // `$.zepto.Z` swaps out the prototype of the given `dom` array
- // of nodes with `$.fn` and thus supplying all the Zepto functions
- // to the array. Note that `__proto__` is not supported on Internet
- // Explorer. This method can be overriden in plugins.
- zepto.Z = function(dom, selector) {
- dom = dom || []
- dom.__proto__ = $.fn
- dom.selector = selector || ''
- return dom
- }
-
- // `$.zepto.isZ` should return `true` if the given object is a Zepto
- // collection. This method can be overriden in plugins.
- zepto.isZ = function(object) {
- return object instanceof zepto.Z
- }
-
- // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and
- // takes a CSS selector and an optional context (and handles various
- // special cases).
- // This method can be overriden in plugins.
- zepto.init = function(selector, context) {
- var dom
- // If nothing given, return an empty Zepto collection
- if (!selector) return zepto.Z()
- // Optimize for string selectors
- else if (typeof selector == 'string') {
- selector = selector.trim()
- // If it's a html fragment, create nodes from it
- // Note: In both Chrome 21 and Firefox 15, DOM error 12
- // is thrown if the fragment doesn't begin with <
- if (selector[0] == '<' && fragmentRE.test(selector))
- dom = zepto.fragment(selector, RegExp.$1, context), selector = null
- // If there's a context, create a collection on that context first, and select
- // nodes from there
- else if (context !== undefined) return $(context).find(selector)
- // If it's a CSS selector, use it to select nodes.
- else dom = zepto.qsa(document, selector)
- }
- // If a function is given, call it when the DOM is ready
- else if (isFunction(selector)) return $(document).ready(selector)
- // If a Zepto collection is given, just return it
- else if (zepto.isZ(selector)) return selector
- else {
- // normalize array if an array of nodes is given
- if (isArray(selector)) dom = compact(selector)
- // Wrap DOM nodes.
- else if (isObject(selector))
- dom = [selector], selector = null
- // If it's a html fragment, create nodes from it
- else if (fragmentRE.test(selector))
- dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null
- // If there's a context, create a collection on that context first, and select
- // nodes from there
- else if (context !== undefined) return $(context).find(selector)
- // And last but no least, if it's a CSS selector, use it to select nodes.
- else dom = zepto.qsa(document, selector)
- }
- // create a new Zepto collection from the nodes found
- return zepto.Z(dom, selector)
- }
-
- // `$` will be the base `Zepto` object. When calling this
- // function just call `$.zepto.init, which makes the implementation
- // details of selecting nodes and creating Zepto collections
- // patchable in plugins.
- $ = function(selector, context){
- return zepto.init(selector, context)
- }
-
- function extend(target, source, deep) {
- for (key in source)
- if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
- if (isPlainObject(source[key]) && !isPlainObject(target[key]))
- target[key] = {}
- if (isArray(source[key]) && !isArray(target[key]))
- target[key] = []
- extend(target[key], source[key], deep)
- }
- else if (source[key] !== undefined) target[key] = source[key]
- }
-
- // Copy all but undefined properties from one or more
- // objects to the `target` object.
- $.extend = function(target){
- var deep, args = slice.call(arguments, 1)
- if (typeof target == 'boolean') {
- deep = target
- target = args.shift()
- }
- args.forEach(function(arg){ extend(target, arg, deep) })
- return target
- }
-
- // `$.zepto.qsa` is Zepto's CSS selector implementation which
- // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.
- // This method can be overriden in plugins.
- zepto.qsa = function(element, selector){
- var found,
- maybeID = selector[0] == '#',
- maybeClass = !maybeID && selector[0] == '.',
- nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked
- isSimple = simpleSelectorRE.test(nameOnly)
- return (isDocument(element) && isSimple && maybeID) ?
- ( (found = element.getElementById(nameOnly)) ? [found] : [] ) :
- (element.nodeType !== 1 && element.nodeType !== 9) ? [] :
- slice.call(
- isSimple && !maybeID ?
- maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class
- element.getElementsByTagName(selector) : // Or a tag
- element.querySelectorAll(selector) // Or it's not simple, and we need to query all
- )
- }
-
- function filtered(nodes, selector) {
- return selector == null ? $(nodes) : $(nodes).filter(selector)
- }
-
- $.contains = function(parent, node) {
- return parent !== node && parent.contains(node)
- }
-
- function funcArg(context, arg, idx, payload) {
- return isFunction(arg) ? arg.call(context, idx, payload) : arg
- }
-
- function setAttribute(node, name, value) {
- value == null ? node.removeAttribute(name) : node.setAttribute(name, value)
- }
-
- // access className property while respecting SVGAnimatedString
- function className(node, value){
- var klass = node.className,
- svg = klass && klass.baseVal !== undefined
-
- if (value === undefined) return svg ? klass.baseVal : klass
- svg ? (klass.baseVal = value) : (node.className = value)
- }
-
- // "true" => true
- // "false" => false
- // "null" => null
- // "42" => 42
- // "42.5" => 42.5
- // "08" => "08"
- // JSON => parse if valid
- // String => self
- function deserializeValue(value) {
- var num
- try {
- return value ?
- value == "true" ||
- ( value == "false" ? false :
- value == "null" ? null :
- !/^0/.test(value) && !isNaN(num = Number(value)) ? num :
- /^[\[\{]/.test(value) ? $.parseJSON(value) :
- value )
- : value
- } catch(e) {
- return value
- }
- }
-
- $.type = type
- $.isFunction = isFunction
- $.isWindow = isWindow
- $.isArray = isArray
- $.isPlainObject = isPlainObject
-
- $.isEmptyObject = function(obj) {
- var name
- for (name in obj) return false
- return true
- }
-
- $.inArray = function(elem, array, i){
- return emptyArray.indexOf.call(array, elem, i)
- }
-
- $.camelCase = camelize
- $.trim = function(str) {
- return str == null ? "" : String.prototype.trim.call(str)
- }
-
- // plugin compatibility
- $.uuid = 0
- $.support = { }
- $.expr = { }
-
- $.map = function(elements, callback){
- var value, values = [], i, key
- if (likeArray(elements))
- for (i = 0; i < elements.length; i++) {
- value = callback(elements[i], i)
- if (value != null) values.push(value)
- }
- else
- for (key in elements) {
- value = callback(elements[key], key)
- if (value != null) values.push(value)
- }
- return flatten(values)
- }
-
- $.each = function(elements, callback){
- var i, key
- if (likeArray(elements)) {
- for (i = 0; i < elements.length; i++)
- if (callback.call(elements[i], i, elements[i]) === false) return elements
- } else {
- for (key in elements)
- if (callback.call(elements[key], key, elements[key]) === false) return elements
- }
-
- return elements
- }
-
- $.grep = function(elements, callback){
- return filter.call(elements, callback)
- }
-
- if (window.JSON) $.parseJSON = JSON.parse
-
- // Populate the class2type map
- $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase()
- })
-
- // Define methods that will be available on all
- // Zepto collections
- $.fn = {
- // Because a collection acts like an array
- // copy over these useful array functions.
- forEach: emptyArray.forEach,
- reduce: emptyArray.reduce,
- push: emptyArray.push,
- sort: emptyArray.sort,
- indexOf: emptyArray.indexOf,
- concat: emptyArray.concat,
-
- // `map` and `slice` in the jQuery API work differently
- // from their array counterparts
- map: function(fn){
- return $($.map(this, function(el, i){ return fn.call(el, i, el) }))
- },
- slice: function(){
- return $(slice.apply(this, arguments))
- },
-
- ready: function(callback){
- // need to check if document.body exists for IE as that browser reports
- // document ready when it hasn't yet created the body element
- if (readyRE.test(document.readyState) && document.body) callback($)
- else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)
- return this
- },
- get: function(idx){
- return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]
- },
- toArray: function(){ return this.get() },
- size: function(){
- return this.length
- },
- remove: function(){
- return this.each(function(){
- if (this.parentNode != null)
- this.parentNode.removeChild(this)
- })
- },
- each: function(callback){
- emptyArray.every.call(this, function(el, idx){
- return callback.call(el, idx, el) !== false
- })
- return this
- },
- filter: function(selector){
- if (isFunction(selector)) return this.not(this.not(selector))
- return $(filter.call(this, function(element){
- return zepto.matches(element, selector)
- }))
- },
- add: function(selector,context){
- return $(uniq(this.concat($(selector,context))))
- },
- is: function(selector){
- return this.length > 0 && zepto.matches(this[0], selector)
- },
- not: function(selector){
- var nodes=[]
- if (isFunction(selector) && selector.call !== undefined)
- this.each(function(idx){
- if (!selector.call(this,idx)) nodes.push(this)
- })
- else {
- var excludes = typeof selector == 'string' ? this.filter(selector) :
- (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)
- this.forEach(function(el){
- if (excludes.indexOf(el) < 0) nodes.push(el)
- })
- }
- return $(nodes)
- },
- has: function(selector){
- return this.filter(function(){
- return isObject(selector) ?
- $.contains(this, selector) :
- $(this).find(selector).size()
- })
- },
- eq: function(idx){
- return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)
- },
- first: function(){
- var el = this[0]
- return el && !isObject(el) ? el : $(el)
- },
- last: function(){
- var el = this[this.length - 1]
- return el && !isObject(el) ? el : $(el)
- },
- find: function(selector){
- var result, $this = this
- if (typeof selector == 'object')
- result = $(selector).filter(function(){
- var node = this
- return emptyArray.some.call($this, function(parent){
- return $.contains(parent, node)
- })
- })
- else if (this.length == 1) result = $(zepto.qsa(this[0], selector))
- else result = this.map(function(){ return zepto.qsa(this, selector) })
- return result
- },
- closest: function(selector, context){
- var node = this[0], collection = false
- if (typeof selector == 'object') collection = $(selector)
- while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))
- node = node !== context && !isDocument(node) && node.parentNode
- return $(node)
- },
- parents: function(selector){
- var ancestors = [], nodes = this
- while (nodes.length > 0)
- nodes = $.map(nodes, function(node){
- if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {
- ancestors.push(node)
- return node
- }
- })
- return filtered(ancestors, selector)
- },
- parent: function(selector){
- return filtered(uniq(this.pluck('parentNode')), selector)
- },
- children: function(selector){
- return filtered(this.map(function(){ return children(this) }), selector)
- },
- contents: function() {
- return this.map(function() { return slice.call(this.childNodes) })
- },
- siblings: function(selector){
- return filtered(this.map(function(i, el){
- return filter.call(children(el.parentNode), function(child){ return child!==el })
- }), selector)
- },
- empty: function(){
- return this.each(function(){ this.innerHTML = '' })
- },
- // `pluck` is borrowed from Prototype.js
- pluck: function(property){
- return $.map(this, function(el){ return el[property] })
- },
- show: function(){
- return this.each(function(){
- this.style.display == "none" && (this.style.display = '')
- if (getComputedStyle(this, '').getPropertyValue("display") == "none")
- this.style.display = defaultDisplay(this.nodeName)
- })
- },
- replaceWith: function(newContent){
- return this.before(newContent).remove()
- },
- wrap: function(structure){
- var func = isFunction(structure)
- if (this[0] && !func)
- var dom = $(structure).get(0),
- clone = dom.parentNode || this.length > 1
-
- return this.each(function(index){
- $(this).wrapAll(
- func ? structure.call(this, index) :
- clone ? dom.cloneNode(true) : dom
- )
- })
- },
- wrapAll: function(structure){
- if (this[0]) {
- $(this[0]).before(structure = $(structure))
- var children
- // drill down to the inmost element
- while ((children = structure.children()).length) structure = children.first()
- $(structure).append(this)
- }
- return this
- },
- wrapInner: function(structure){
- var func = isFunction(structure)
- return this.each(function(index){
- var self = $(this), contents = self.contents(),
- dom = func ? structure.call(this, index) : structure
- contents.length ? contents.wrapAll(dom) : self.append(dom)
- })
- },
- unwrap: function(){
- this.parent().each(function(){
- $(this).replaceWith($(this).children())
- })
- return this
- },
- clone: function(){
- return this.map(function(){ return this.cloneNode(true) })
- },
- hide: function(){
- return this.css("display", "none")
- },
- toggle: function(setting){
- return this.each(function(){
- var el = $(this)
- ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide()
- })
- },
- prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },
- next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },
- html: function(html){
- return arguments.length === 0 ?
- (this.length > 0 ? this[0].innerHTML : null) :
- this.each(function(idx){
- var originHtml = this.innerHTML
- $(this).empty().append( funcArg(this, html, idx, originHtml) )
- })
- },
- text: function(text){
- return arguments.length === 0 ?
- (this.length > 0 ? this[0].textContent : null) :
- this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text })
- },
- attr: function(name, value){
- var result
- return (typeof name == 'string' && value === undefined) ?
- (this.length == 0 || this[0].nodeType !== 1 ? undefined :
- (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() :
- (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result
- ) :
- this.each(function(idx){
- if (this.nodeType !== 1) return
- if (isObject(name)) for (key in name) setAttribute(this, key, name[key])
- else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))
- })
- },
- removeAttr: function(name){
- return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) })
- },
- prop: function(name, value){
- name = propMap[name] || name
- return (value === undefined) ?
- (this[0] && this[0][name]) :
- this.each(function(idx){
- this[name] = funcArg(this, value, idx, this[name])
- })
- },
- data: function(name, value){
- var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value)
- return data !== null ? deserializeValue(data) : undefined
- },
- val: function(value){
- return arguments.length === 0 ?
- (this[0] && (this[0].multiple ?
- $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :
- this[0].value)
- ) :
- this.each(function(idx){
- this.value = funcArg(this, value, idx, this.value)
- })
- },
- offset: function(coordinates){
- if (coordinates) return this.each(function(index){
- var $this = $(this),
- coords = funcArg(this, coordinates, index, $this.offset()),
- parentOffset = $this.offsetParent().offset(),
- props = {
- top: coords.top - parentOffset.top,
- left: coords.left - parentOffset.left
- }
-
- if ($this.css('position') == 'static') props['position'] = 'relative'
- $this.css(props)
- })
- if (this.length==0) return null
- var obj = this[0].getBoundingClientRect()
- return {
- left: obj.left + window.pageXOffset,
- top: obj.top + window.pageYOffset,
- width: Math.round(obj.width),
- height: Math.round(obj.height)
- }
- },
- css: function(property, value){
- if (arguments.length < 2) {
- var element = this[0], computedStyle = getComputedStyle(element, '')
- if(!element) return
- if (typeof property == 'string')
- return element.style[camelize(property)] || computedStyle.getPropertyValue(property)
- else if (isArray(property)) {
- var props = {}
- $.each(isArray(property) ? property: [property], function(_, prop){
- props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))
- })
- return props
- }
- }
-
- var css = ''
- if (type(property) == 'string') {
- if (!value && value !== 0)
- this.each(function(){ this.style.removeProperty(dasherize(property)) })
- else
- css = dasherize(property) + ":" + maybeAddPx(property, value)
- } else {
- for (key in property)
- if (!property[key] && property[key] !== 0)
- this.each(function(){ this.style.removeProperty(dasherize(key)) })
- else
- css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'
- }
-
- return this.each(function(){ this.style.cssText += ';' + css })
- },
- index: function(element){
- return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])
- },
- hasClass: function(name){
- if (!name) return false
- return emptyArray.some.call(this, function(el){
- return this.test(className(el))
- }, classRE(name))
- },
- addClass: function(name){
- if (!name) return this
- return this.each(function(idx){
- classList = []
- var cls = className(this), newName = funcArg(this, name, idx, cls)
- newName.split(/\s+/g).forEach(function(klass){
- if (!$(this).hasClass(klass)) classList.push(klass)
- }, this)
- classList.length && className(this, cls + (cls ? " " : "") + classList.join(" "))
- })
- },
- removeClass: function(name){
- return this.each(function(idx){
- if (name === undefined) return className(this, '')
- classList = className(this)
- funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){
- classList = classList.replace(classRE(klass), " ")
- })
- className(this, classList.trim())
- })
- },
- toggleClass: function(name, when){
- if (!name) return this
- return this.each(function(idx){
- var $this = $(this), names = funcArg(this, name, idx, className(this))
- names.split(/\s+/g).forEach(function(klass){
- (when === undefined ? !$this.hasClass(klass) : when) ?
- $this.addClass(klass) : $this.removeClass(klass)
- })
- })
- },
- scrollTop: function(value){
- if (!this.length) return
- var hasScrollTop = 'scrollTop' in this[0]
- if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset
- return this.each(hasScrollTop ?
- function(){ this.scrollTop = value } :
- function(){ this.scrollTo(this.scrollX, value) })
- },
- scrollLeft: function(value){
- if (!this.length) return
- var hasScrollLeft = 'scrollLeft' in this[0]
- if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset
- return this.each(hasScrollLeft ?
- function(){ this.scrollLeft = value } :
- function(){ this.scrollTo(value, this.scrollY) })
- },
- position: function() {
- if (!this.length) return
-
- var elem = this[0],
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
- // Get correct offsets
- offset = this.offset(),
- parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( $(elem).css('margin-top') ) || 0
- offset.left -= parseFloat( $(elem).css('margin-left') ) || 0
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0
- parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- }
- },
- offsetParent: function() {
- return this.map(function(){
- var parent = this.offsetParent || document.body
- while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static")
- parent = parent.offsetParent
- return parent
- })
- }
- }
-
- // for now
- $.fn.detach = $.fn.remove
-
- // Generate the `width` and `height` functions
- ;['width', 'height'].forEach(function(dimension){
- var dimensionProperty =
- dimension.replace(/./, function(m){ return m[0].toUpperCase() })
-
- $.fn[dimension] = function(value){
- var offset, el = this[0]
- if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :
- isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :
- (offset = this.offset()) && offset[dimension]
- else return this.each(function(idx){
- el = $(this)
- el.css(dimension, funcArg(this, value, idx, el[dimension]()))
- })
- }
- })
-
- function traverseNode(node, fun) {
- fun(node)
- for (var key in node.childNodes) traverseNode(node.childNodes[key], fun)
- }
-
- // Generate the `after`, `prepend`, `before`, `append`,
- // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.
- adjacencyOperators.forEach(function(operator, operatorIndex) {
- var inside = operatorIndex % 2 //=> prepend, append
-
- $.fn[operator] = function(){
- // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings
- var argType, nodes = $.map(arguments, function(arg) {
- argType = type(arg)
- return argType == "object" || argType == "array" || arg == null ?
- arg : zepto.fragment(arg)
- }),
- parent, copyByClone = this.length > 1
- if (nodes.length < 1) return this
-
- return this.each(function(_, target){
- parent = inside ? target : target.parentNode
-
- // convert all methods to a "before" operation
- target = operatorIndex == 0 ? target.nextSibling :
- operatorIndex == 1 ? target.firstChild :
- operatorIndex == 2 ? target :
- null
-
- nodes.forEach(function(node){
- if (copyByClone) node = node.cloneNode(true)
- else if (!parent) return $(node).remove()
-
- traverseNode(parent.insertBefore(node, target), function(el){
- if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&
- (!el.type || el.type === 'text/javascript') && !el.src)
- window['eval'].call(window, el.innerHTML)
- })
- })
- })
- }
-
- // after => insertAfter
- // prepend => prependTo
- // before => insertBefore
- // append => appendTo
- $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){
- $(html)[operator](this)
- return this
- }
- })
-
- zepto.Z.prototype = $.fn
-
- // Export internal API functions in the `$.zepto` namespace
- zepto.uniq = uniq
- zepto.deserializeValue = deserializeValue
- $.zepto = zepto
-
- return $
-})()
-
-window.Zepto = Zepto
-window.$ === undefined && (window.$ = Zepto)
-
-;(function($){
- var jsonpID = 0,
- document = window.document,
- key,
- name,
- rscript = /
-
-