omi/dist/omi.art.min.js

8 lines
50 KiB
JavaScript

/*!
* Omi v1.7.4 By dntzhang
* Github: https://github.com/AlloyTeam/omi
* MIT Licensed.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(2),s=r(a),u=n(5),c=r(u),l=n(10),d=r(l);o["default"].template=function(e,t){return s["default"].compile(e)(t)},o["default"].artTemplate=s["default"],o["default"].Store=d["default"],o["default"].Component=c["default"],window.Omi?e.exports=window.Omi:(window.Omi=o["default"],e.exports=o["default"])},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s={};s.instances={},s._instanceId=0,s.getInstanceId=function(){return s._instanceId++},s.customTags=[],s.mapping={},s.STYLEPREFIX="omi_style_",s.STYLESCOPEDPREFIX="omi_scoped_",s.style={},s.componentConstructor={},"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,s=t||0;s=s>=0?s:a+s;var u=n?n:a;if(n<0&&(u=a+n),i=u-s,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(s+r);else for(r=0;r<i;r++)o[r]=this[s+r];return o}}}();var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();s.create=function(e,t,a){var c=t,l=s.Component;return arguments.length>2&&(c=a,l=t),s.componentConstructor[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),u(a,o(c)),a}(l),s.customTags.push(e),s.componentConstructor[e]},s.createStore=function(e){var t=function(t){function a(t,i){return n(this,a),this.data=t,e.methods.install&&e.methods.install.call(this),r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),u(a,o(e.methods)),a}(s.Store);return new t(e.data,!0)},s.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},s.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},s.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},s.getClassFromString=function(e){if(e.indexOf(".")!==-1){for(var t=e.split("."),n=t.length,r=window[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return s.componentConstructor[e]},s.makeHTML=function(e,t){s.componentConstructor[e]=t,s.componentConstructor[e.toLowerCase()]=t,s.customTags.push(e,e.toLowerCase()),document.documentMode<9&&document.createElement(e.toLowerCase())},s.tag=s.makeHTML,s.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,"boolean"==typeof n?e._omi_increment=n:n&&(e._omi_increment=n.increment,n.store&&(n.store instanceof s.Store?e.$store=n.store:e.$store=s.createStore(n.store)),e._omi_autoStoreToData=n.autoStoreToData),e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e._execInstalledHandlers(),e},s.get=function(e){return s.mapping[e]},s.plugins={},s.extendPlugin=function(e,t){s.plugins[e]=t},s.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},s.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},s.deletePlugin=function(e){delete s.plugins[e]},e.exports=s},function(e,t,n){var r,i,o;(function(e,n){"use strict";var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! art-template@4.10.1 for browser | https://github.com/aui/art-template */
!function(e,s){"object"==a(t)&&"object"==a(n)?n.exports=s():(i=[],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(n.exports=o)))}(void 0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=22)}([function(e,t,n){(function(t){e.exports=!1;try{e.exports="[object process]"===Object.prototype.toString.call(t.process)}catch(n){}}).call(t,n(4))},function(e,t,n){var r=n(17),i=n(2),o=n(18),a=function(e,t){t.onerror(e,t);var n=function(){return"{Template Error}"};return n.mappings=[],n.sourcesContent=[],n},s=function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e?t=e:t.source=e,t=i.$extend(t),e=t.source,t.debug&&(t.cache=!1,t.bail=!1,t.minimize=!1,t.compileDebug=!0),t.compileDebug&&(t.minimize=!1),t.filename&&(t.filename=t.resolveFilename(t.filename,t));var n=t.filename,s=t.cache,c=t.caches;if(s&&n){var l=c.get(n);if(l)return l}if(!e)try{e=t.loader(n,t),t.source=e}catch(d){var f=new o({name:"CompileError",path:n,message:"template not found: "+d.message,stack:d.stack});if(t.bail)throw f;return a(f,t)}var h=void 0,p=new r(t);try{h=p.build()}catch(f){if(f=new o(f),t.bail)throw f;return a(f,t)}var m=function(e,n){try{return h(e,n)}catch(r){if(!t.compileDebug)return t.cache=!1,t.compileDebug=!0,u(t)(e,n);if(r=new o(r),t.bail)throw r;return a(r,t)()}};return m.mappings=h.mappings,m.sourcesContent=h.sourcesContent,m.toString=function(){return h.toString()},s&&n&&c.set(n,m),m};s.Compiler=r,e.exports=s},function(t,n,r){function i(){this.$extend=function(e){return e=e||{},s(e,e instanceof i?e:this)}}var o=r(0),a=r(20),s=r(9),u=r(11),c=r(13),l=r(8),d=r(12),f=r(15),h=r(16),p=r(10),m=r(14),_={source:null,filename:null,rules:[h,f],escape:!0,debug:!!o&&"production"!==e.env.NODE_ENV,bail:!1,cache:!0,minimize:!0,compileDebug:!1,resolveFilename:m,include:u,htmlMinifier:p,htmlMinifierOptions:{collapseWhitespace:!0,minifyCSS:!0,minifyJS:!0,ignoreCustomFragments:[]},onerror:c,loader:d,caches:l,root:"/",extname:".art",ignore:[],imports:a};i.prototype=_,t.exports=new i},function(e,t){},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){"object"==("undefined"==typeof window?"undefined":a(window))&&(n=window)}e.exports=n},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,t.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},function(e,t,n){e.exports=n(2)},function(e,t,n){var r=n(1),i=function(e,t,n){return r(e,n)(t)};e.exports=i},function(e,t,n){var r={__data:Object.create(null),set:function(e,t){this.__data[e]=t},get:function(e){return this.__data[e]},reset:function(){this.__data={}}};e.exports=r},function(e,t,n){var r=Object.prototype.toString,i=function(e){return null===e?"Null":r.call(e).slice(8,-1)},o=function a(e,t){var n=void 0,r=i(e);if("Object"===r?n=Object.create(t||{}):"Array"===r&&(n=[].concat(t||[])),n){for(var o in e)e.hasOwnProperty(o)&&(n[o]=a(e[o],n[o]));return n}return e};e.exports=o},function(e,t,n){var r=n(0),i=function o(e,t){if(r){var o,i=n(23).minify,a=t.htmlMinifierOptions,s=t.rules.map(function(e){return e.test});(o=a.ignoreCustomFragments).push.apply(o,s),e=i(e,a)}return e};e.exports=i},function(e,t,n){var r=function(e,t,r,i){var o=n(1);return i=i.$extend({filename:i.resolveFilename(e,i),bail:!0,source:null}),o(i)(t,r)};e.exports=r},function(e,t,n){var r=n(0),i=function(e){if(r)return n(3).readFileSync(e,"utf8");var t=document.getElementById(e);return t.value||t.innerHTML};e.exports=i},function(e,t,n){var r=function(e){console.error(e.name,e.message)};e.exports=r},function(e,t,n){var r=n(0),i=/^\.+\//,o=function a(e,t){if(r){var a=n(3),o=t.root,s=t.extname;if(i.test(e)){var u=t.filename,c=!u||e===u,l=c?o:a.dirname(u);e=a.resolve(l,e)}else e=a.resolve(o,e);a.extname(e)||(e+=s)}return e};e.exports=o},function(e,t,n){var r={test:/{{[ \t]*([@#]?)(\/?)([\w\W]*?)[ \t]*}}/,use:function(e,t,n,i){var o=this,a=o.options,s=o.getEsTokens(i.trim()),u=s.map(function(e){return e.value}),c={},l=void 0,d=!!t&&"raw",f=n+u.shift(),h=function(t,n){console&&console.warn&&console.warn((a.filename||"anonymous")+":"+(e.line+1)+":"+(e.start+1)+"\nTemplate upgrade: {{"+t+"}} -> {{"+n+"}}")};switch("#"===t&&h("#value","@value"),f){case"set":i="var "+u.join("");break;case"if":i="if("+u.join("")+"){";break;case"else":var p=u.indexOf("if");p>-1?(u.splice(0,p+1),i="}else if("+u.join("")+"){"):i="}else{";break;case"/if":i="}";break;case"each":l=r._split(s),l.shift(),"as"===l[1]&&(h("each object as value index","each object value index"),l.splice(1,1));var m=l[0]||"$data",_=l[1]||"$value",v=l[2]||"$index";i="$each("+m+",function("+_+","+v+"){";break;case"/each":i="})";break;case"echo":f="print",h("echo value","value");case"print":case"include":case"extend":l=r._split(s),l.shift(),i=f+"("+l.join(",")+")";break;case"block":i="block("+u.join("")+",function(){";break;case"/block":i="})";break;default:if(-1!==u.indexOf("|")){for(var y=f,g=[],b=u.filter(function(e){return!/^\s+$/.test(e)});"|"!==b[0];)y+=b.shift();b.filter(function(e){return":"!==e}).forEach(function(e){"|"===e?g.push([]):g[g.length-1].push(e)}),g.reduce(function(e,t){var n=t.shift();return t.unshift(e),i="$imports."+n+"("+t.join(",")+")"},y)}else i=""+f+u.join("");d||(d="escape")}return c.code=i,c.output=d,c},_split:function(e){for(var t=0,n=e.shift(),r=[[n]];t<e.length;){var i=e[t],o=i.type;"whitespace"!==o&&"comment"!==o&&("punctuator"===n.type&&"]"!==n.value||"punctuator"===o?r[r.length-1].push(i):r.push([i]),n=i),t++}return r.map(function(e){return e.map(function(e){return e.value}).join("")})}};e.exports=r},function(e,t,n){var r={test:/<%(#?)((?:==|=#|[=-])?)([\w\W]*?)(-?)%>/,use:function(e,t,n,r){return n={"-":"raw","=":"escape","":!1,"==":"raw","=#":"raw"}[n],t&&(r="/*"+e+"*/",n=!1),{code:r,output:n}}};e.exports=r},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(19),o=n(21),a="$data",s="$imports",u="print",c="include",l="extend",d="block",f="$$out",h="$$line",p="$$blocks",m="$$slice",_="$$from",v="$$options",y=function(e,t){return e.hasOwnProperty(t)},g=JSON.stringify,b=function(){function e(t){var n,i,y=this;r(this,e);var g=t.source,b=t.minimize,S=t.htmlMinifier;if(this.options=t,this.stacks=[],this.context=[],this.scripts=[],this.CONTEXT_MAP={},this.ignore=[a,s,v].concat(t.ignore),this.internal=(n={},n[f]="''",n[h]="[0,0]",n[p]="arguments[1]||{}",n[_]="null",n[u]="function(){var s=''.concat.apply('',arguments);"+f+"+=s;return s}",n[c]="function(src,data){var s="+v+".include(src,data||"+a+",arguments[2]||"+p+","+v+");"+f+"+=s;return s}",n[l]="function(from){"+_+"=from}",n[m]="function(c,p,s){p="+f+";"+f+"='';c();s="+f+";"+f+"=p+s;return s}",n[d]="function(){var a=arguments,s;if(typeof a[0]==='function'){return "+m+"(a[0])}else if("+_+"){"+p+"[a[0]]="+m+"(a[1])}else{s="+p+"[a[0]];if(typeof s==='string'){"+f+"+=s}else{s="+m+"(a[1])}return s}}",n),this.dependencies=(i={},i[u]=[f],i[c]=[f,v,a,p],i[l]=[_,c],i[d]=[m,_,f,p],i),this.importContext(f),t.compileDebug&&this.importContext(h),b)try{g=S(g,t)}catch(k){}this.source=g,this.getTplTokens(g,t.rules,this).forEach(function(e){e.type===o.TYPE_STRING?y.parseString(e):y.parseExpression(e)})}return e.prototype.getTplTokens=function(){return o.apply(void 0,arguments)},e.prototype.getEsTokens=function(e){return i(e)},e.prototype.getVariables=function(e){var t=!1;return e.filter(function(e){return"whitespace"!==e.type&&"comment"!==e.type}).filter(function(e){return"name"===e.type&&!t||(t="punctuator"===e.type&&"."===e.value,!1)}).map(function(e){return e.value})},e.prototype.importContext=function(e){var t=this,n="",r=this.internal,i=this.dependencies,o=this.ignore,u=this.context,c=this.options,l=c.imports,d=this.CONTEXT_MAP;y(d,e)||-1!==o.indexOf(e)||(y(r,e)?(n=r[e],y(i,e)&&i[e].forEach(function(e){return t.importContext(e)})):n="$escape"===e||"$each"===e||y(l,e)?s+"."+e:a+"."+e,d[e]=n,u.push({name:e,value:n}))},e.prototype.parseString=function(e){var t=e.value;if(t){var n=f+"+="+g(t);this.scripts.push({source:t,tplToken:e,code:n})}},e.prototype.parseExpression=function(e){var t=this,n=e.value,r=e.script,i=r.output,a=r.code;i&&(a=!1===escape||i===o.TYPE_RAW?f+"+="+r.code:f+"+=$escape("+r.code+")");var s=this.getEsTokens(a);this.getVariables(s).forEach(function(e){return t.importContext(e)}),this.scripts.push({source:n,tplToken:e,code:a})},e.prototype.checkExpression=function(e){for(var t=[[/^\s*}[\w\W]*?{?[\s;]*$/,""],[/(^[\w\W]*?\([\w\W]*?(?:=>|\([\w\W]*?\))\s*{[\s;]*$)/,"$1})"],[/(^[\w\W]*?\([\w\W]*?\)\s*{[\s;]*$)/,"$1}"]],n=0;n<t.length;){if(t[n][0].test(e)){var r;e=(r=e).replace.apply(r,t[n]);break}n++}try{return new Function(e),!0}catch(i){return!1}},e.prototype.build=function(){var e=this.options,t=this.context,n=this.scripts,r=this.stacks,i=this.source,u=e.filename,d=e.imports,m=[],b=y(this.CONTEXT_MAP,l),S=0,k=function(e,t){var n=t.line,i=t.start,o={generated:{line:r.length+S+1,column:1},original:{line:n+1,column:i+1}};return S+=e.split(/\n/).length-1,o},C=function(e){return e.replace(/^[\t ]+|[\t ]$/g,"")};r.push("function("+a+"){"),r.push("'use strict'"),r.push(a+"="+a+"||{}"),r.push("var "+t.map(function(e){return e.name+"="+e.value}).join(",")),e.compileDebug?(r.push("try{"),n.forEach(function(e){e.tplToken.type===o.TYPE_EXPRESSION&&r.push(h+"=["+[e.tplToken.line,e.tplToken.start].join(",")+"]"),m.push(k(e.code,e.tplToken)),r.push(C(e.code))}),r.push("}catch(error){"),r.push("throw {"+["name:'RuntimeError'","path:"+g(u),"message:error.message","line:"+h+"[0]+1","column:"+h+"[1]+1","source:"+g(i),"stack:error.stack"].join(",")+"}"),r.push("}")):n.forEach(function(e){m.push(k(e.code,e.tplToken)),r.push(C(e.code))}),b&&(r.push(f+"=''"),r.push(c+"("+_+","+a+","+p+")")),r.push("return "+f),r.push("}");var T=r.join("\n");try{var x=new Function(s,v,"return "+T)(d,e);return x.mappings=m,x.sourcesContent=[i],x}catch(w){for(var E=0,O=0,A=0;E<n.length;){var D=n[E];if(!this.checkExpression(D.code)){O=D.tplToken.line,A=D.tplToken.start;break}E++}throw{name:"CompileError",path:u,message:w.message,line:O+1,column:A+1,source:i,generated:T,stack:w.stack}}},e}();b.CONSTS={DATA:a,IMPORTS:s,PRINT:u,INCLUDE:c,EXTEND:l,BLOCK:d,OPTIONS:v,OUT:f,LINE:h,BLOCKS:p,SLICE:m,FROM:_,ESCAPE:"$escape",EACH:"$each"},e.exports=b},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.name,n=e.source,r=e.path,i=e.line,o=e.column,a=e.message;if(!n)return a;var s=n.split(/\n/),u=Math.max(i-3,0),c=Math.min(s.length,i+3),l=s.slice(u,c).map(function(e,t){var n=t+u+1;return(n===i?" >> ":" ")+n+"| "+e}).join("\n");return(r||"anonymous")+":"+i+":"+o+"\n"+l+"\n\n"+t+": "+a}var u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n.message));return o.name="TemplateError",o.message=s(n),Error.captureStackTrace&&Error.captureStackTrace(o,o.constructor),o}return o(t,e),t}(Error);e.exports=u},function(e,t,n){var r=n(24),i=n(5)["default"],o=n(5).matchToToken,a=function(e){return e.match(i).map(function(e){return i.lastIndex=0,o(i.exec(e))}).map(function(e){return"name"===e.type&&r(e.value)&&(e.type="keyword"),e})};e.exports=a},function(e,t,n){(function(t){function r(e){return"string"!=typeof e&&(e=void 0===e||null===e?"":"function"==typeof e?r(e.call(e)):JSON.stringify(e)),e}function i(e){var t=""+e,n=s.exec(t);if(!n)return e;var r="",i=void 0,o=void 0,a=void 0;for(i=n.index,o=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:a="&#34;";break;case 38:a="&#38;";break;case 39:a="&#39;";break;case 60:a="&#60;";break;case 62:a="&#62;";break;default:continue}o!==i&&(r+=t.substring(o,i)),o=i+1,r+=a}return o!==i?r+t.substring(o,i):r}/*! art-template@runtime | https://github.com/aui/art-template */
var o=n(0),a=Object.create(o?t:window),s=/["&'<>]/;a.$escape=function(e){return i(r(e))},a.$each=function(e,t){if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)t(e[n],n);else for(var i in e)t(e[i],i)},e.exports=a}).call(t,n(4))},function(e,t,n){function r(e,t,n,r){this.content=e,this.line=t,this.start=n,this.end=r}r.prototype.toString=function(){return this.content};var i=function o(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[{type:"string",value:e,line:0,start:0,end:e.length}],i=0;i<t.length;i++)!function(e){for(var t=e.test.ignoreCase?"ig":"g",i=e.test.source+"|^$|[\\w\\W]",a=new RegExp(i,t),s=0;s<o.length;s++)if("string"===o[s].type){for(var u=o[s].line,c=o[s].start,l=o[s].end,d=o[s].value.match(a),f=[],h=0;h<d.length;h++){var p=d[h];e.test.lastIndex=0;var m=e.test.exec(p),_=m?"expression":"string",v=f[f.length-1],y=v||o[s],g=y.value;c=y.line===u?v?v.end:c:g.length-g.lastIndexOf("\n")-1,l=c+p.length;var b={type:_,value:p,line:u,start:c,end:l};if("string"===_)v&&"string"===v.type?(v.value+=p,v.end+=p.length):f.push(b);else{m[0]=new r(m[0],u,c,l);var S=e.use.apply(n,m);b.script=S,f.push(b)}u+=p.split(/\n/).length-1}o.splice.apply(o,[s,1].concat(f)),s+=f.length-1}}(t[i]);return o};i.TYPE_STRING="string",i.TYPE_EXPRESSION="expression",i.TYPE_RAW="raw",i.TYPE_ESCAPE="escape",e.exports=i},function(e,t,n){var r=n(7),i=n(1),o=n(6),a=function(e,t){return t instanceof Object?r({filename:e},t):i({filename:e,source:t})};a.render=r,a.compile=i,a.defaults=o,e.exports=a},function(e,t){!function(e){e.noop=function(){}}("object"==("undefined"==typeof e?"undefined":a(e))&&"object"==a(e.exports)?e.exports:window)},function(e,t,n){var r={"abstract":!0,await:!0,"boolean":!0,"break":!0,"byte":!0,"case":!0,"catch":!0,"char":!0,"class":!0,"const":!0,"continue":!0,"debugger":!0,"default":!0,"delete":!0,"do":!0,"double":!0,"else":!0,"enum":!0,"export":!0,"extends":!0,"false":!0,"final":!0,"finally":!0,"float":!0,"for":!0,"function":!0,"goto":!0,"if":!0,"implements":!0,"import":!0,"in":!0,"instanceof":!0,"int":!0,"interface":!0,"let":!0,"long":!0,"native":!0,"new":!0,"null":!0,"package":!0,"private":!0,"protected":!0,"public":!0,"return":!0,"short":!0,"static":!0,"super":!0,"switch":!0,"synchronized":!0,"this":!0,"throw":!0,"transient":!0,"true":!0,"try":!0,"typeof":!0,"var":!0,"void":!0,"volatile":!0,"while":!0,"with":!0,"yield":!0};e.exports=function(e){return r.hasOwnProperty(e)}}])})}).call(t,n(3),n(4)(e))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?p=h.concat(p):_=-1,p.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=p.length;t;){for(h=p,p=[];++_<t;)h&&h[_].run();_=-1,t=p.length}h=null,m=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var l,d,f=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var h,p=[],m=!1,_=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||m||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_omi=__webpack_require__(1),_omi2=_interopRequireDefault(_omi),_style=__webpack_require__(6),_style2=_interopRequireDefault(_style),_event=__webpack_require__(7),_event2=_interopRequireDefault(_event),_morphdom=__webpack_require__(8),_morphdom2=_interopRequireDefault(_morphdom),_html2json=__webpack_require__(9),_html2json2=_interopRequireDefault(_html2json),Component=function(){function Component(e,t){_classCallCheck(this,Component);var n=Object.assign({server:!1,ignoreStoreData:!1,preventSelfUpdate:!1,selfDataFirst:!1,domDiffDisabled:!1,scopedSelfCSS:!1},t);this._omi_scopedSelfCSS=n.scopedSelfCSS,this._omi_preventSelfUpdate=n.preventSelfUpdate,this._omi_domDiffDisabled=n.domDiffDisabled,this._omi_ignoreStoreData=n.ignoreStoreData,this.data=e||{},this._omi_server_rendering=n.server,this.id=this._omi_server_rendering?1e6+_omi2["default"].getInstanceId():_omi2["default"].getInstanceId(),this.refs={},this.children=[],this.HTML=null,_omi2["default"].instances[this.id]=this,this.selfDataFirst=n.selfDataFirst,this._omi_scoped_attr=_omi2["default"].STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},this._omi_installedHandlers=null}return _createClass(Component,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"onInstalled",value:function(e){this._omi_installedHandlers||(this._omi_installedHandlers=[]),this._omi_installedHandlers.push(e)}},{key:"_execInstalledHandlers",value:function(){this._omi_installedHandlers&&this._omi_installedHandlers.forEach(function(e){e()})}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"beforeRender",value:function(){}},{key:"useStore",value:function(e){var t=this;this.$$store=e;var n=!1;e.instances.forEach(function(e){e.id===t.id&&(n=!0)}),n||e.instances.push(this)}},{key:"updateSelf",value:function(){if(this.beforeUpdate(),this.renderTo)this._render(!1,!0);else{if(this._omi_preventSelfUpdate)return;if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,_morphdom2["default"])(this.node,(0,_event2["default"])(this._childRender(this._omiChildStr,!0),this.id),{ignoreAttr:this._getIgnoreAttr()}),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm()}this.afterUpdate()}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this._omiGroupDataCounter={},this.renderTo)this._render(!1,!1,!0);else{if(this._omi_preventSelfUpdate)return;if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else this._omi_domDiffDisabled?this.node.parentNode.replaceChild(_morphdom2["default"].toElement((0,_event2["default"])(this._childRender(this._omiChildStr,!1,!0),this.id)),this.node):(0,_morphdom2["default"])(this.node,(0,_event2["default"])(this._childRender(this._omiChildStr,!1,!0),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm()}this._childrenInstalledAfterUpdate(this),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),e._omiGroupDataCounter={},t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed(),this._execInstalledHandlers()}},{key:"_render",value:function(e,t,n){var r=this;if(this._omi_removed){var i=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(i):(this.node.parentNode.replaceChild(i,this.node),this.node=i))}this._omi_autoStoreToData&&(this._omi_ignoreStoreData||(this.data=this.$store.data)),this.beforeRender(),this._generateHTMLCSS(),t?this._extractChildrenString(this,n):this._extractChildren(this,n),this.children.forEach(function(e){r.HTML=r.HTML.replace(e._omiChildStr,t?e.node.outerHTML:e.HTML)}),this.HTML=(0,_event2["default"])(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?this._omi_domDiffDisabled?this.renderTo.innerHTML=this.HTML:(0,_morphdom2["default"])(this.node,this.HTML,t?{ignoreAttr:this._getIgnoreAttr()}:null):(0,_morphdom2["default"])(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_getIgnoreAttr",value:function(){var e=[];return this.children.forEach(function(t){e.push(t._omi_scoped_attr)}),e}},{key:"_childRender",value:function(e,t,n){var r=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this.parent._omi_autoStoreToData&&(this._omi_autoStoreToData=!0,this._omi_ignoreStoreData||(this.data=this.$store.data)),this.beforeRender(),this._fixSlot(this._generateHTMLCSS()),t?this._extractChildrenString(this,n):this._extractChildren(this,n),this.children.forEach(function(e){r.HTML=r.HTML.replace(e._omiChildStr,t?e.node.outerHTML:e.HTML)}),this.HTML=(0,_event2["default"])(this.HTML,this.id),this.HTML)}},{key:"_fixSlot",value:function(e){var t=this;if(this._omi_slotContent){this._omi_slotContent=this._scopedAttr(this._omi_slotContent,this._omi_scoped_attr,e);var n=_morphdom2["default"].toElements(this._omi_slotContent),r=this.HTML.match(/<slot[\s\S]*?<\/slot>/g);1===n.length&&r&&1===r.length?this.HTML=this.HTML.replace(/<slot[\s\S]*?<\/slot>/,this._omi_slotContent):(n.sort(function(e,t){return parseInt(e.getAttribute("slot-index"))-parseInt(t.getAttribute("slot-index"))}),n.forEach(function(e){t.HTML=t.HTML.replace(/<slot[\s\S]*?<\/slot>/,e.outerHTML)}))}}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+_omi2["default"].STYLESCOPEDPREFIX+t.id+"]"),t.node&&e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=_omi2["default"].$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(_omi2["default"].plugins).forEach(function(t){var n=_omi2["default"].$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&_omi2["default"].plugins[t](n,e)}),e.node.hasAttribute(t)&&_omi2["default"].plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed(),e._execInstalledHandlers()})}},{key:"_childrenInstalledAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){e._omi_needInstalled&&(e._omi_needInstalled=!1,t._childrenInstalled(e),e.installed(),e._execInstalledHandlers())})}},{key:"_fixForm",value:function(){_omi2["default"].$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),_omi2["default"].$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),_omi2["default"].$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)_omi2["default"].$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=_omi2["default"].$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t,n,r){var i=this;if(0!==_omi2["default"].customTags.length){var o=e.join("|"),a=new RegExp("<("+o+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*((\\/>)|>(([\\s\\S]*?)<\\/\\1>))","g"),s=0;return t.replace(a,function(e,t,o,a,u,c,l){if(n){var d=i.children[s];d&&d.___omi_constructor_name===t&&(d._omiChildStr=e)}else i._initComponentByString(t,e,l,s++,i,r)})}}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.selfDataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,"");var e=this.___omi_constructor_name?_omi2["default"].STYLESCOPEDPREFIX+this.___omi_constructor_name.toLowerCase():this._omi_scoped_attr;this.CSS&&(!this._omi_scopedSelfCSS&&_omi2["default"].style[e]||(this.CSS=_style2["default"].scoper(this.CSS,this._omi_scopedSelfCSS?"["+this._omi_scoped_attr+"]":"["+e+"]"),_omi2["default"].style[e]=this.CSS,this.CSS===this._preCSS||this._omi_server_rendering||(_style2["default"].addStyle(this.CSS,this.id),this._preCSS=this.CSS)));var t=this.render();return this.HTML=this._scopedAttr(_omi2["default"].template(t?t:"",this.data),this._omi_scoped_attr,e).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+_omi2["default"].STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+_omi2["default"].STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n"),e}},{key:"_scopedAttr",value:function(e,t,n){var r=this;return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var i=e.split(" ")[0].replace(">","");return r._omi_scopedSelfCSS||!r.___omi_constructor_name?e.replace(i,i+" "+t):e.replace(i,i+" "+t+" "+n)})}},{key:"_getDataset",value:function _getDataset(childStr){var _this13=this,json=(0,_html2json2["default"])(childStr),attr=json.child[0].attr,baseData={};return Object.keys(attr).forEach(function(key){var value=attr[key];if(0===key.indexOf("on")){var handler=_this13.parent[value];handler&&(baseData[_this13._capitalize(key)]=handler.bind(_this13.parent))}else 0===key.indexOf("data-")?_this13._dataset[_this13._capitalize(key.replace("data-",""))]=value:0===key.indexOf(":data-")?_this13._dataset[_this13._capitalize(key.replace(":data-",""))]=eval("("+value+")"):0===key.indexOf("::data-")?_this13._dataset[_this13._capitalize(key.replace("::data-",""))]=_this13._extractPropertyFromString(value,_this13.parent):"data"===key?_this13._dataset=_this13._extractPropertyFromString(value,_this13.parent):":data"===key?_this13._dataset=eval("("+value+")"):"group-data"===key&&(_this13._dataset=_this13._extractPropertyFromString(value,_this13.parent)[_this13._omi_groupDataIndex])}),Object.assign(baseData,this._dataset)}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildrenString",value:function(e,t){this._replaceTags(_omi2["default"].customTags,e.HTML,!0,t)}},{key:"_extractChildren",value:function(e,t){this._replaceTags(_omi2["default"].customTags,e.HTML,!1,t)}},{key:"_initComponentByString",value:function _initComponentByString(name,childStr,slotContent,i,child,fromUpdate){var _this14=this,json=(0,_html2json2["default"])(childStr),attr=json.child[0].attr,cmi=this.children[i];if(cmi&&cmi.___omi_constructor_name===name)cmi._omiChildStr=childStr,cmi._omi_slotContent=slotContent,Object.keys(attr).forEach(function(e){var t=attr[e];"group-data"===e&&(child._omiGroupDataCounter.hasOwnProperty(t)?child._omiGroupDataCounter[t]++:child._omiGroupDataCounter[t]=0,cmi._omi_groupDataIndex=child._omiGroupDataCounter[t])}),cmi._childRender(childStr);else{var baseData={},dataset={},groupDataIndex=null,omiID=null,instanceName=null,_omi_option={};Object.keys(attr).forEach(function(key){var value=attr[key];if(0===key.indexOf("on")){var handler=child[value];handler&&(baseData[_this14._capitalize(key)]=handler.bind(child))}else"omi-id"===key?omiID=value:"name"===key?instanceName=value:"group-data"===key?(child._omiGroupDataCounter.hasOwnProperty(value)?child._omiGroupDataCounter[value]++:child._omiGroupDataCounter[value]=0,groupDataIndex=child._omiGroupDataCounter[value],dataset=_this14._extractPropertyFromString(value,child)[groupDataIndex]):0===key.indexOf("data-")?dataset[_this14._capitalize(key.replace("data-",""))]=value:0===key.indexOf(":data-")?dataset[_this14._capitalize(key.replace(":data-",""))]=eval("("+value+")"):0===key.indexOf("::data-")?dataset[_this14._capitalize(key.replace("::data-",""))]=_this14._extractPropertyFromString(value,child):"data"===key?dataset=_this14._extractPropertyFromString(value,child):":data"===key?dataset=eval("("+value+")"):"preventSelfUpdate"===key||"psu"===key||"preventselfupdate"===key?_omi_option.preventSelfUpdate=!0:"selfDataFirst"===key||"sdf"===key||"selfdatafirst"===key?_omi_option.selfDataFirst=!0:"domDiffDisabled"===key||"ddd"===key||"domdiffdisabled"===key?_omi_option.domDiffDisabled=!0:"ignoreStoreData"===key||"isd"===key||"ignorestoredata"===key?_omi_option.ignoreStoreData=!0:"scopedSelfCSS"!==key&&"ssc"!==key&&"scopedselfcss"!==key||(_omi_option.scopedSelfCSS=!0)});var ChildClass=_omi2["default"].getClassFromString(name);if(!ChildClass)throw"Can't find Class called ["+name+"]";var sub_child=new ChildClass(Object.assign(baseData,dataset),_omi_option);sub_child._omi_groupDataIndex=groupDataIndex,sub_child._omiChildStr=childStr,sub_child._omi_slotContent=slotContent,sub_child.parent=child,sub_child.$store=child.$store,sub_child.___omi_constructor_name=name,sub_child._dataset={},sub_child.install(),omiID&&(_omi2["default"].mapping[omiID]=sub_child),instanceName&&(child[instanceName]=sub_child),cmi?child.children[i]=sub_child:child.children.push(sub_child),sub_child._childRender(childStr),fromUpdate&&(sub_child._omi_needInstalled=!0)}}}]),Component}();exports["default"]=Component},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){e=e.replace(/\/\*[^*]*\*+([^\/][^*]*\*+)*\//g,"");var n=new RegExp("([^\r\n,{}:]+)(:[^\r\n,{}]+)?(,(?=[^{}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r,i){if("undefined"==typeof r&&(r=""),n.match(/^\s*(@media|\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/))return n+r+i;var o=n.replace(/(\s*)$/,"")+t+r,a=t+" "+n.trim()+r;return o+","+a+i})}function o(e,t){var n=document.getElementById(s["default"].STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",s["default"].STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=r(a);t["default"]={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=(('([\s\S]*?)')|("([\s\S]*?)"))/g,function(e,n,r){if(1===r.indexOf("Omi.instances["))return e;if(r.lastIndexOf(")")===r.length-2)return e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].");var i=e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].");return i.substr(0,i.length-1)+"(event)"+i.substr(i.length-1,1)})})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,s){"object"===o(t)&&"undefined"!=typeof e?e.exports=s():(r=s,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!l&&h.createRange&&(l=h.createRange(),l.selectNode(h.body));var t;return l&&l.createContextualFragment?t=l.createContextualFragment(e):(t=h.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e){!l&&h.createRange&&(l=h.createRange(),l.selectNode(h.body));var t;l&&l.createContextualFragment?t=l.createContextualFragment(e):(t=h.createElement("body"),t.innerHTML=e);for(var n=[],r=0,i=t.childNodes.length;r<i;r++){var o=t.childNodes[r];1===o.nodeType&&n.push(o)}return n}function n(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function r(e,t){return t&&t!==f?h.createElementNS(t,e):h.createElement(e)}function i(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function o(e,t){var n,r,i,o,a,s,u=t.attributes;for(n=u.length-1;n>=0;--n)r=u[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,s=e.getAttributeNS(o,i),s!==a&&e.setAttributeNS(o,i,a)):(s=e.getAttribute(i),s!==a&&e.setAttribute(i,a));for(u=e.attributes,n=u.length-1;n>=0;--n)r=u[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,m(t,o,i)||e.removeAttributeNS(o,i)):m(t,null,i)||e.removeAttribute(i))}function a(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function s(){}function u(e){return e.id}function c(t){return function(o,a,c){function l(e){k?k.push(e):k=[e]}function d(e,t){if(e.nodeType===v)for(var n=e.firstChild;n;){var r=void 0;t&&(r=C(n))?l(r):(A(n),n.firstChild&&d(n,t)),n=n.nextSibling}}function f(e,t,n){O(e)!==!1&&(t&&t.removeChild(e),A(e),d(e,n))}function p(e){if(e.nodeType===v)for(var t=e.firstChild;t;){var n=C(t);n&&(j[n]=t),p(t),t=t.nextSibling}}function m(e){x(e);for(var t=e.firstChild;t;){var r=t.nextSibling,i=C(t);if(i){var o=j[i];o&&n(t,o)&&(t.parentNode.replaceChild(o,t),b(o,t))}m(t),t=r}}function b(e,r,i){if(P){for(var s=!1,u=!1,c=null,d=null,p=0,S=P.length;p<S;p++){var k=P[p];if(s||null===e.getAttribute(k)||(s=!0,c=k),u||null===r.getAttribute(k)||(u=!0,d=k),s&&u)break}if(s&&u&&c===d)return}var x,O=C(r);if(O&&delete j[O],!a.isSameNode||!a.isSameNode(o)){if(!i){if(w(e,r)===!1)return;if(t(e,r),E(e),D(e,r)===!1)return}if("TEXTAREA"!==e.nodeName){var A,I,M,L,N=r.firstChild,$=e.firstChild;e:for(;N;){for(M=N.nextSibling,A=C(N);$;){if(I=$.nextSibling,N.isSameNode&&N.isSameNode($)){N=M,$=I;continue e}x=C($);var H=$.nodeType,F=void 0;if(H===N.nodeType&&(H===v?(A?A!==x&&((L=j[A])?$.nextSibling===L?F=!1:(e.insertBefore(L,$),I=$.nextSibling,x?l(x):f($,e,!0),$=L):F=!1):x&&(F=!1),F=F!==!1&&n($,N),F&&b($,N)):H!==y&&H!=g||(F=!0,$.nodeValue=N.nodeValue)),F){N=M,$=I;continue e}x?l(x):f($,e,!0),$=I}if(A&&(L=j[A])&&n(L,N))e.appendChild(L),b(L,N);else{var R=T(N);R!==!1&&(R&&(N=R),N.actualize&&(N=N.actualize(e.ownerDocument||h)),e.appendChild(N),m(N))}N=M,$=I}for(;$;)I=$.nextSibling,(x=C($))?l(x):f($,e,!0),$=I}var U=_[e.nodeName];U&&U(e,r)}}if(c||(c={}),"string"==typeof a)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=a;a=h.createElement("html"),a.innerHTML=S}else a=e(a);var k,C=c.getNodeKey||u,T=c.onBeforeNodeAdded||s,x=c.onNodeAdded||s,w=c.onBeforeElUpdated||s,E=c.onElUpdated||s,O=c.onBeforeNodeDiscarded||s,A=c.onNodeDiscarded||s,D=c.onBeforeElChildrenUpdated||s,I=c.childrenOnly===!0,P=c.ignoreAttr,j={};p(o);var M=o,L=M.nodeType,N=a.nodeType;if(!I)if(L===v)N===v?n(o,a)||(A(o),M=i(o,r(a.nodeName,a.namespaceURI))):M=a;else if(L===y||L===g){if(N===L)return M.nodeValue=a.nodeValue,M;M=a}if(M===a)A(o);else if(b(M,a,I),k)for(var $=0,H=k.length;$<H;$++){var F=j[k[$]];F&&f(F,F.parentNode,!1)}return!I&&M!==o&&o.parentNode&&(M.actualize&&(M=M.actualize(o.ownerDocument||h)),o.parentNode.replaceChild(M,o)),M}}var l,d,f="http://www.w3.org/1999/xhtml",h="undefined"==typeof document?void 0:document,p=h?h.body||h.createElement("div"):{};d=p.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:p.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var m=d,_={OPTION:function(e,t){a(e,t,"selected")},INPUT:function(e,t){a(e,t,"checked"),a(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),m(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!m(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(m(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},v=1,y=3,g=8,b=c(o);return b.toElement=e,b.toElements=t,b})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(o=!!o,o||l.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=l.length-1;r>=0&&l[r]!=n;r--);else var r=0;if(r>=0){for(var i=l.length-1;i>=r;i--)t.end&&t.end(l[i]);l.length=r}}var s,u,c,l=[],d=e;for(l.last=function(){return this[this.length-1]};e;){if(u=!0,l.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+l.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",l.last());else if(0==e.indexOf("</")?(c=e.match(r),c&&(e=e.substring(c[0].length),c[0].replace(r,a),u=!1)):0==e.indexOf("<")&&(c=e.match(n),c&&(e=e.substring(c[0].length),c[0].replace(n,o),u=!1)),u){s=e.indexOf("<");var f=s<0?e:e.substring(0,s);e=s<0?"":e.substring(s),t.chars&&t.chars(f)}if(e==d)throw"Parse Error: "+e;d=e}a()},a=!1,s=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var u=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){s(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){s(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){s(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t["default"]=u},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.readyHandlers=[],this.isReady=t,this.instances=[],this.updateSelfInstances=[]}return r(e,[{key:"ready",value:function(e){return this.isReady?void e():void this.readyHandlers.push(e)}},{key:"addSelfView",value:function(e){for(var t=!1,n=0,r=this.updateSelfInstances.length;n<r;n++)if(this.updateSelfInstances[n].id===e.id){t=!0;break}t||this.updateSelfInstances.push(e)}},{key:"addView",value:function(e){for(var t=!1,n=0,r=this.instances.length;n<r;n++)if(this.instances[n].id===e.id){t=!0;break}t||this.instances.push(e)}},{key:"beReady",value:function(){this.isReady=!0,this.readyHandlers.forEach(function(e){return e()})}},{key:"update",value:function(){this._mergeInstances(),this._mergeSelfInstances(),this.instances.forEach(function(e){return e.update()}),this.updateSelfInstances.forEach(function(e){return e.updateSelf()})}},{key:"_mergeSelfInstances",value:function(){var e=this,t=[];this.updateSelfInstances.forEach(function(n){e._checkSelfUpdateInstance(n)||t.push(n)}),this.updateSelfInstances=t}},{key:"_mergeInstances",value:function(){var e=this,t=[];this.idArr=[],this.instances.forEach(function(t){e.idArr.push(t.id)}),this.instances.forEach(function(n){n.parent?e._isSubInstance(n)||t.push(n):t.push(n)}),this.instances=t}},{key:"_checkSelfUpdateInstance",value:function(e){return this.idArr.indexOf(e.id)!==-1||(e.parent?this._checkSelfUpdateInstance(e.parent):void 0)}},{key:"_isSubInstance",value:function(e){return this.idArr.indexOf(e.parent.id)!==-1||(e.parent.parent?this._isSubInstance(e.parent):void 0)}}]),e}();t["default"]=i}])});