BookStack/public/js/common.js

11 lines
330 KiB
JavaScript
Raw Normal View History

2016-04-09 10:49:02 -04:00
!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){!function(e,t,n){"use strict";function r(e,t,n){if(!e)throw ge("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function i(e,t){return e||t?e?t?(H(e)&&(e=e.join(" ")),H(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function o(e){var t={};return e&&(e.to||e.from)&&(t.to=e.to,t.from=e.from),t}function a(e,t,n){var r="";return e=H(e)?e:e&&q(e)&&e.length?e.split(/\s+/):[],z(e,function(e,i){e&&e.length>0&&(r+=i>0?" ":"",r+=n?t+e:e+t)}),r}function s(e,t){var n=e.indexOf(t);t>=0&&e.splice(n,1)}function u(e){if(e instanceof V)switch(e.length){case 0:return[];case 1:if(e[0].nodeType===Q)return e;break;default:return V(l(e))}return e.nodeType===Q?V(e):void 0}function l(e){if(!e[0])return e;for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType==Q)return n}}function c(e,t,n){z(t,function(t){e.addClass(t,n)})}function f(e,t,n){z(t,function(t){e.removeClass(t,n)})}function d(e){return function(t,n){n.addClass&&(c(e,t,n.addClass),n.addClass=null),n.removeClass&&(f(e,t,n.removeClass),n.removeClass=null)}}function h(e){if(e=e||{},!e.$$prepared){var t=e.domOperation||L;e.domOperation=function(){e.$$domOperationFired=!0,t(),t=L},e.$$prepared=!0}return e}function p(e,t){m(e,t),g(e,t)}function m(e,t){t.from&&(e.css(t.from),t.from=null)}function g(e,t){t.to&&(e.css(t.to),t.to=null)}function v(e,t,n){var r=t.options||{},i=n.options||{},o=(r.addClass||"")+" "+(i.addClass||""),a=(r.removeClass||"")+" "+(i.removeClass||""),s=$(e.attr("class"),o,a);i.preparationClasses&&(r.preparationClasses=S(i.preparationClasses,r.preparationClasses),delete i.preparationClasses);var u=r.domOperation!==L?r.domOperation:null;return U(r,i),u&&(r.domOperation=u),s.addClass?r.addClass=s.addClass:r.addClass=null,s.removeClass?r.removeClass=s.removeClass:r.removeClass=null,t.addClass=r.addClass,t.removeClass=r.removeClass,r}function $(e,t,n){function r(e){q(e)&&(e=e.split(" "));var t={};return z(e,function(e){e.length&&(t[e]=!0)}),t}var i=1,o=-1,a={};e=r(e),t=r(t),z(t,function(e,t){a[t]=i}),n=r(n),z(n,function(e,t){a[t]=a[t]===i?null:o});var s={addClass:"",removeClass:""};return z(a,function(t,n){var r,a;t===i?(r="addClass",a=!e[n]):t===o&&(r="removeClass",a=e[n]),a&&(s[r].length&&(s[r]+=" "),s[r]+=n)}),s}function y(e){return e instanceof t.element?e[0]:e}function b(e,t,n){var r="";t&&(r=a(t,K,!0)),n.addClass&&(r=S(r,a(n.addClass,X))),n.removeClass&&(r=S(r,a(n.removeClass,J))),r.length&&(n.preparationClasses=r,e.addClass(r))}function w(e,t){t.preparationClasses&&(e.removeClass(t.preparationClasses),t.preparationClasses=null),t.activeClasses&&(e.removeClass(t.activeClasses),t.activeClasses=null)}function x(e,t){var n=t?"-"+t+"s":"";return C(e,[pe,n]),[pe,n]}function k(e,t){var n=t?"paused":"",r=j+ce;return C(e,[r,n]),[r,n]}function C(e,t){var n=t[0],r=t[1];e.style[n]=r}function S(e,t){return e?t?e+" "+t:e:t}function _(e){return[he,e+"s"]}function E(e,t){var n=t?de:pe;return[n,e+"s"]}function D(e,t,n){var r=Object.create(null),i=e.getComputedStyle(t)||{};return z(n,function(e,t){var n=i[e];if(n){var o=n.charAt(0);("-"===o||"+"===o||o>=0)&&(n=T(n)),0===n&&(n=null),r[t]=n}}),r}function T(e){var t=0,n=e.split(/\s*,\s*/);return z(n,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function A(e){return 0===e||null!=e}function M(e,t){var n=N,r=e+"s";return t?n+=oe:r+=" linear all",[n,r]}function O(){var e=Object.create(null);return{flush:function(){e=Object.create(null)},count:function(t){var n=e[t];return n?n.total:0},get:function(t){var n=e[t];return n&&n.value},put:function(t,n){e[t]?e[t].total++:e[t]={total:1,value:n}}}}function F(e,t,n){z(n,function(n){e[n]=B
}function s(e){for(var t={},n=0,r=e.length;r>n;n++){var i=e[n];t[i.name]=i.value}return t}function u(e){return e.replace(/&/g,"&amp;").replace(h,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(p,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(e,n){var r=!1,i=t.bind(e,e.push);return{start:function(e,o){e=t.lowercase(e),!r&&x[e]&&(r=e),r||k[e]!==!0||(i("<"),i(e),t.forEach(o,function(r,o){var a=t.lowercase(o),s="img"===e&&"src"===a||"background"===a;E[a]!==!0||C[a]===!0&&!n(r,s)||(i(" "),i(o),i('="'),i(u(r)),i('"'))}),i(">"))},end:function(e){e=t.lowercase(e),r||k[e]!==!0||m[e]===!0||(i("</"),i(e),i(">")),e==r&&(r=!1)},chars:function(e){r||i(u(e))}}}function c(e){if(e.nodeType===Node.ELEMENT_NODE)for(var t=e.attributes,n=0,r=t.length;r>n;n++){var i=t[n],o=i.name.toLowerCase();("xmlns:ns1"===o||0===o.indexOf("ns1:"))&&(e.removeAttributeNode(i),n--,r--)}var a=e.firstChild;a&&c(a),a=e.nextSibling,a&&c(a)}var f,d=t.$$minErr("$sanitize"),h=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=/([^\#-~ |!])/g,m=o("area,br,col,hr,img,wbr"),g=o("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),v=o("rp,rt"),$=t.extend({},v,g),y=t.extend({},g,o("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),b=t.extend({},v,o("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),w=o("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),x=o("script,style"),k=t.extend({},m,y,b,$),C=o("background,cite,href,longdesc,src,xlink:href"),S=o("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),_=o("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),E=t.extend({},C,_,S);!function(e){var t;if(!e.document||!e.document.implementation)throw d("noinert","Can't create an inert html document");t=e.document.implementation.createHTMLDocument("inert");var n=t.documentElement||t.getDocumentElement(),r=n.getElementsByTagName("body");if(1===r.length)f=r[0];else{var i=t.createElement("html");f=t.createElement("body"),i.appendChild(f),t.appendChild(i)}}(e),t.module("ngSanitize",[]).provider("$sanitize",r),t.module("ngSanitize").filter("linky",["$sanitize",function(e){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,r=/^mailto:/
r.push(s)}catch(l){n(l)}}),r}])),l[t].push(n)):o(t,s(E)),this},this.component=function(e,t){function n(e){function n(t){return _(t)||Wr(t)?function(n,r){return e.invoke(t,this,{$element:n,$attrs:r})}:t}var i=t.template||t.templateUrl?t.template:"";return{controller:r,controllerAs:$t(t.controller)||t.controllerAs||"$ctrl",template:n(i),templateUrl:n(t.templateUrl),transclude:t.transclude,scope:{},bindToController:t.bindings||{},restrict:"E",require:t.require}}var r=t.controller||function(){};return o(t,function(e,t){"$"===t.charAt(0)&&(n[t]=e)}),n.$inject=["$injector"],this.directive(e,n)},this.aHrefSanitizationWhitelist=function(e){return b(e)?(r.aHrefSanitizationWhitelist(e),this):r.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return b(e)?(r.imgSrcSanitizationWhitelist(e),this):r.imgSrcSanitizationWhitelist()};var S=!0;this.debugInfoEnabled=function(e){return b(e)?(S=e,this):S},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(e,r,i,a,s,u,v,b,E,D){function A(e,t,n){le.innerHTML="<span "+t+">";var r=le.firstChild.attributes,i=r[0];r.removeNamedItem(i.name),i.value=n,e.attributes.setNamedItem(i)}function M(e,t){try{e.addClass(t)}catch(n){}}function O(e,n,r,i,o){e instanceof Ir||(e=Ir(e));for(var a=/\S+/,s=0,u=e.length;u>s;s++){var l=e[s];l.nodeType===ri&&l.nodeValue.match(a)&&Ae(l,e[s]=t.createElement("span"))}var c=I(e,n,e,r,i,o);O.$$addScopeClass(e);var f=null;return function(t,n,r){de(t,"scope"),o&&o.needsNewScope&&(t=t.$parent.$new()),r=r||{};var i=r.parentBoundTranscludeFn,a=r.transcludeControllers,s=r.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),f||(f=N(s));var u;if(u="html"!==f?Ir(te(f,Ir("<div>").append(e).html())):n?xi.clone.call(e):e,a)for(var l in a)u.data("$"+l+"Controller",a[l].instance);return O.$$addScopeInfo(u,t),n&&n(u,t),c&&c(t,u,u,i),u}}function N(e){var t=e&&e[0];return t&&"foreignobject"!==R(t)&&Vr.call(t).match(/SVG/)?"svg":"html"}function I(e,t,r,i,o,a){function s(e,r,i,o){var a,s,u,l,c,f,d,h,g;if(p){var v=r.length;for(g=new Array(v),c=0;c<m.length;c+=3)d=m[c],g[d]=r[d]}else g=r;for(c=0,f=m.length;f>c;)u=g[m[c++]],a=m[c++],s=m[c++],a?(a.scope?(l=e.$new(),O.$$addScopeInfo(Ir(u),l)):l=e,h=a.transcludeOnThisElement?j(e,a.transclude,o):!a.templateOnThisElement&&o?o:!o&&t?j(e,t):null,a(s,l,u,i,h)):s&&s(e,u.childNodes,n,o)}for(var u,l,c,f,d,h,p,m=[],g=0;g<e.length;g++)u=new fe,l=P(e[g],[],u,0===g?i:n,o),c=l.length?q(l,e[g],u,t,r,null,[],[],a):null,c&&c.scope&&O.$$addScopeClass(u.$$element),d=c&&c.terminal||!(f=e[g].childNodes)||!f.length?null:I(f,c?(c.transcludeOnThisElement||!c.templateOnThisElement)&&c.transclude:t),(c||d)&&(m.push(g,c,d),h=!0,p=p||c),a=null;return h?s:null}function j(e,t,n){var r=function(r,i,o,a,s){return r||(r=e.$new(!1,s),r.$$transcluded=!0),t(r,i,{parentBoundTranscludeFn:n,transcludeControllers:o,futureParentElement:a})},i=r.$$slots=ve();for(var o in t.$$slots)t.$$slots[o]?i[o]=j(e,t.$$slots[o],n):i[o]=null;return r}function P(e,t,n,r,i){var o,a,s=e.nodeType,u=n.$attr;switch(s){case ti:B(t,mt(R(e)),"E",r,i);for(var l,c,f,p,m,g,v=e.attributes,$=0,y=v&&v.length;y>$;$++){var b=!1,x=!1;l=v[$],c=l.name,m=Gr(l.value),p=mt(c),(g=ge.test(p))&&(c=c.replace(Hi,"").substr(8).replace(/_(.)/g,function(e,t){return t.toUpperCase()}));var C=p.match($e);C&&G(C[1])&&(b=c,x=c.substr(0,c.length-5)+"end",c=c.substr(0,c.length-6)),f=mt(c.toLowerCase()),u[f]=c,(g||!n.hasOwnProperty(f))&&(n[f]=m,Be(e,f)&&(n[f]=!0)),re(e,t,m,f,g),B(t,f,"A",r,i,b,x)}if(a=e.className,w(a)&&(a=a.animVal),k(a)&&""!==a)for(;o=h.exec(a);)f=mt(o[2]),B(t,f,"C",r,i)&&(n[f]=Gr(o[3])),a=a.substr(o.index+o[0].length);break;case ri:if(11===Nr)for(;e.parentNode&&e.nextSibling&&e.nextSibling.nodeType===ri;)e.nodeValue=e.nodeValue+e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);ee(t,e.nodeValue);break;case ii:try{o=d.exec(e.nodeValue),o&&(f=mt(o[1]),B(t,f,"M",r,i)&&(n[f]=Gr(o[2])))}catch(S){}}return t.sort(X),t}function L(e,t,n){var r=[],i=0;if(t&&e.hasAttribute&&e.
error:i("error"),debug:function(){var n=i("debug");return function(){e&&n.apply(t,arguments)}}()}}]}function Jt(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw oo("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function Kt(e){return e+""}function en(e,t){if(e){if(e.constructor===e)throw oo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw oo("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw oo("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw oo("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function tn(e,t){if(e){if(e.constructor===e)throw oo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===ao||e===so||e===uo)throw oo("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function nn(e,t){if(e&&(e===0..constructor||e===(!1).constructor||e==="".constructor||e==={}.constructor||e===[].constructor||e===Function.constructor))throw oo("isecaf","Assigning to a constructor is disallowed! Expression: {0}",t)}function rn(e,t){return"undefined"!=typeof e?e:t}function on(e,t){return"undefined"==typeof e?t:"undefined"==typeof t?e:e+t}function an(e,t){var n=e(t);return!n.$stateful}function sn(e,t){var n,r;switch(e.type){case ho.Program:n=!0,o(e.body,function(e){sn(e.expression,t),n=n&&e.expression.constant}),e.constant=n;break;case ho.Literal:e.constant=!0,e.toWatch=[];break;case ho.UnaryExpression:sn(e.argument,t),e.constant=e.argument.constant,e.toWatch=e.argument.toWatch;break;case ho.BinaryExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.left.toWatch.concat(e.right.toWatch);break;case ho.LogicalExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.constant?[]:[e];break;case ho.ConditionalExpression:sn(e.test,t),sn(e.alternate,t),sn(e.consequent,t),e.constant=e.test.constant&&e.alternate.constant&&e.consequent.constant,e.toWatch=e.constant?[]:[e];break;case ho.Identifier:e.constant=!1,e.toWatch=[e];break;case ho.MemberExpression:sn(e.object,t),e.computed&&sn(e.property,t),e.constant=e.object.constant&&(!e.computed||e.property.constant),e.toWatch=[e];break;case ho.CallExpression:n=e.filter?an(t,e.callee.name):!1,r=[],o(e.arguments,function(e){sn(e,t),n=n&&e.constant,e.constant||r.push.apply(r,e.toWatch)}),e.constant=n,e.toWatch=e.filter&&an(t,e.callee.name)?r:[e];break;case ho.AssignmentExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=[e];break;case ho.ArrayExpression:n=!0,r=[],o(e.elements,function(e){sn(e,t),n=n&&e.constant,e.constant||r.push.apply(r,e.toWatch)}),e.constant=n,e.toWatch=r;break;case ho.ObjectExpression:n=!0,r=[],o(e.properties,function(e){sn(e.value,t),n=n&&e.value.constant,e.value.constant||r.push.apply(r,e.value.toWatch)}),e.constant=n,e.toWatch=r;break;case ho.ThisExpression:e.constant=!1,e.toWatch=[];break;case ho.LocalsExpression:e.constant=!1,e.toWatch=[]}}function un(e){if(1==e.length){var t=e[0].expression,r=t.toWatch;return 1!==r.length?r:r[0]!==t?r:n}}function ln(e){return e.type===ho.Identifier||e.type===ho.MemberExpression}function cn(e){return 1===e.body.length&&ln(e.body[0].expression)?{type:ho.AssignmentExpression,left:e.body[0].expression,right:{type:ho.NGValueParameter},operator:"="}:void 0}function fn(e){return 0===e.body.length||1===e.body.length&&(e.body[0].expression.type===ho.Literal||e.body[0].expression.type===ho.ArrayExpression||e.body[0].expression.type===ho.ObjectExpression)}function dn(e){return e.constant}function hn(e,t){this.astBuilder=e,this.$filter=t}function pn(e,t){this.astBuilder=e,this.$filter=t}function mn(e){return"constructor"==e}function gn(e){return
t.val()!==e&&t.val(e)}}function hr(e,t){if(S(e))return e;if(k(e)){Vo.lastIndex=0;var n=Vo.exec(e);if(n){var r=+n[1],i=+n[2],o=0,a=0,s=0,u=0,l=Xn(r),c=7*(i-1);return t&&(o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),u=t.getMilliseconds()),new Date(r,0,l.getDate()+c,o,a,s,u)}}return NaN}function pr(e,t){return function(n,r){var i,a;if(S(n))return n;if(k(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),Io.test(n))return new Date(n);if(e.lastIndex=0,i=e.exec(n))return i.shift(),a=r?{yyyy:r.getFullYear(),MM:r.getMonth()+1,dd:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds(),sss:r.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(i,function(e,n){n<t.length&&(a[t[n]]=+e)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0,1e3*a.sss||0)}return NaN}}function mr(e,t,r,i){return function(o,a,s,u,l,c,f){function d(e){return e&&!(e.getTime&&e.getTime()!==e.getTime())}function h(e){return b(e)&&!S(e)?r(e)||n:e}gr(o,a,s,u),dr(o,a,s,u,l,c);var p,m=u&&u.$options&&u.$options.timezone;if(u.$$parserName=e,u.$parsers.push(function(e){if(u.$isEmpty(e))return null;if(t.test(e)){var i=r(e,p);return m&&(i=J(i,m)),i}return n}),u.$formatters.push(function(e){if(e&&!S(e))throw ya("datefmt","Expected `{0}` to be a date",e);return d(e)?(p=e,p&&m&&(p=J(p,m,!0)),f("date")(e,i,m)):(p=null,"")}),b(s.min)||s.ngMin){var g;u.$validators.min=function(e){return!d(e)||y(g)||r(e)>=g},s.$observe("min",function(e){g=h(e),u.$validate()})}if(b(s.max)||s.ngMax){var v;u.$validators.max=function(e){return!d(e)||y(v)||r(e)<=v},s.$observe("max",function(e){v=h(e),u.$validate()})}}}function gr(e,t,r,i){var o=t[0],a=i.$$hasNativeValidators=w(o.validity);a&&i.$parsers.push(function(e){var r=t.prop(Dr)||{};return r.badInput||r.typeMismatch?n:e})}function vr(e,t,r,i,o,a){if(gr(e,t,r,i),dr(e,t,r,i,o,a),i.$$parserName="number",i.$parsers.push(function(e){return i.$isEmpty(e)?null:Lo.test(e)?parseFloat(e):n}),i.$formatters.push(function(e){if(!i.$isEmpty(e)){if(!C(e))throw ya("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),b(r.min)||r.ngMin){var s;i.$validators.min=function(e){return i.$isEmpty(e)||y(s)||e>=s},r.$observe("min",function(e){b(e)&&!C(e)&&(e=parseFloat(e,10)),s=C(e)&&!isNaN(e)?e:n,i.$validate()})}if(b(r.max)||r.ngMax){var u;i.$validators.max=function(e){return i.$isEmpty(e)||y(u)||u>=e},r.$observe("max",function(e){b(e)&&!C(e)&&(e=parseFloat(e,10)),u=C(e)&&!isNaN(e)?e:n,i.$validate()})}}function $r(e,t,n,r,i,o){dr(e,t,n,r,i,o),cr(r),r.$$parserName="url",r.$validators.url=function(e,t){var n=e||t;return r.$isEmpty(n)||jo.test(n)}}function yr(e,t,n,r,i,o){dr(e,t,n,r,i,o),cr(r),r.$$parserName="email",r.$validators.email=function(e,t){var n=e||t;return r.$isEmpty(n)||Po.test(n)}}function br(e,t,n,r){y(n.name)&&t.attr("name",u());var i=function(e){t[0].checked&&r.$setViewValue(n.value,e&&e.type)};t.on("click",i),r.$render=function(){var e=n.value;t[0].checked=e==r.$viewValue},n.$observe("value",r.$render)}function wr(e,t,n,r,i){var o;if(b(r)){if(o=e(r),!o.constant)throw ya("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,r);return o(t)}return i}function xr(e,t,n,r,i,o,a,s){var u=wr(s,e,"ngTrueValue",n.ngTrueValue,!0),l=wr(s,e,"ngFalseValue",n.ngFalseValue,!1),c=function(e){r.$setViewValue(t[0].checked,e&&e.type)};t.on("click",c),r.$render=function(){t[0].checked=r.$viewValue},r.$isEmpty=function(e){return e===!1},r.$formatters.push(function(e){return H(e,u)}),r.$parsers.push(function(e){return e?u:l})}function kr(e,t){return e="ngClass"+e,["$animate",function(n){function r(e,t){var n=[];e:for(var r=0;r<e.length;r++){for(var i=e[r],o=0;o<t.length;o++)if(i==t[o])continue e;n.push(i)}return n}function i(e){var t=[];return Wr(e)?(o(e,function(e){t=t.concat(i(e))}),t):k(e)?e.split(" "):w(e)?(o(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t):e}return{restrict:"AC",link:function(a,s,u){function l(e){var t=f(e,1);u.$addClass(t)}function c(e){var t=f(e,-1);u.$removeClass(t)}function f(e,t){var n=s.data("$classCounts")||ve(),r=[];return o(e,function(e){(t>0||n[e])&&(n[e
(d.state.expensiveChecks||mn(e.name))&&d.addEnsureSafeObject(t),i(t);break;case ho.MemberExpression:u=r&&(r.context=this.nextId())||this.nextId(),t=t||this.nextId(),d.recurse(e.object,u,n,function(){d.if_(d.notNull(u),function(){a&&1!==a&&d.addEnsureSafeAssignContext(u),e.computed?(l=d.nextId(),d.recurse(e.property,l),d.getStringValue(l),d.addEnsureSafeMemberName(l),a&&1!==a&&d.if_(d.not(d.computedMember(u,l)),d.lazyAssign(d.computedMember(u,l),"{}")),f=d.ensureSafeObject(d.computedMember(u,l)),d.assign(t,f),r&&(r.computed=!0,r.name=l)):(Jt(e.property.name),a&&1!==a&&d.if_(d.not(d.nonComputedMember(u,e.property.name)),d.lazyAssign(d.nonComputedMember(u,e.property.name),"{}")),f=d.nonComputedMember(u,e.property.name),(d.state.expensiveChecks||mn(e.property.name))&&(f=d.ensureSafeObject(f)),d.assign(t,f),r&&(r.computed=!1,r.name=e.property.name))},function(){d.assign(t,"undefined")}),i(t)},!!a);break;case ho.CallExpression:t=t||this.nextId(),e.filter?(l=d.filter(e.callee.name),c=[],o(e.arguments,function(e){var t=d.nextId();d.recurse(e,t),c.push(t)}),f=l+"("+c.join(",")+")",d.assign(t,f),i(t)):(l=d.nextId(),u={},c=[],d.recurse(e.callee,l,u,function(){d.if_(d.notNull(l),function(){d.addEnsureSafeFunction(l),o(e.arguments,function(e){d.recurse(e,d.nextId(),n,function(e){c.push(d.ensureSafeObject(e))})}),u.name?(d.state.expensiveChecks||d.addEnsureSafeObject(u.context),f=d.member(u.context,u.name,u.computed)+"("+c.join(",")+")"):f=l+"("+c.join(",")+")",f=d.ensureSafeObject(f),d.assign(t,f)},function(){d.assign(t,"undefined")}),i(t)}));break;case ho.AssignmentExpression:if(l=this.nextId(),u={},!ln(e.left))throw oo("lval","Trying to assign a value to a non l-value");this.recurse(e.left,n,u,function(){d.if_(d.notNull(u.context),function(){d.recurse(e.right,l),d.addEnsureSafeObject(d.member(u.context,u.name,u.computed)),d.addEnsureSafeAssignContext(u.context),f=d.member(u.context,u.name,u.computed)+e.operator+l,d.assign(t,f),i(t||f)})},1);break;case ho.ArrayExpression:c=[],o(e.elements,function(e){d.recurse(e,d.nextId(),n,function(e){c.push(e)})}),f="["+c.join(",")+"]",this.assign(t,f),i(f);break;case ho.ObjectExpression:c=[],o(e.properties,function(e){d.recurse(e.value,d.nextId(),n,function(t){c.push(d.escape(e.key.type===ho.Identifier?e.key.name:""+e.key.value)+":"+t)})}),f="{"+c.join(",")+"}",this.assign(t,f),i(f);break;case ho.ThisExpression:this.assign(t,"s"),i("s");break;case ho.LocalsExpression:this.assign(t,"l"),i("l");break;case ho.NGValueParameter:this.assign(t,"v"),i("v")}},getHasOwnProperty:function(e,t){var n=e+"."+t,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,e+"&&("+this.escape(t)+" in "+e+")")),r[n]},assign:function(e,t){return e?(this.current().body.push(e,"=",t,";"),e):void 0},filter:function(e){return this.state.filters.hasOwnProperty(e)||(this.state.filters[e]=this.nextId(!0)),this.state.filters[e]},ifDefined:function(e,t){return"ifDefined("+e+","+this.escape(t)+")"},plus:function(e,t){return"plus("+e+","+t+")"},return_:function(e){this.current().body.push("return ",e,";")},if_:function(e,t,n){if(e===!0)t();else{var r=this.current().body;r.push("if(",e,"){"),t(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(e){return"!("+e+")"},notNull:function(e){return e+"!=null"},nonComputedMember:function(e,t){return e+"."+t},computedMember:function(e,t){return e+"["+t+"]"},member:function(e,t,n){return n?this.computedMember(e,t):this.nonComputedMember(e,t)},addEnsureSafeObject:function(e){this.current().body.push(this.ensureSafeObject(e),";")},addEnsureSafeMemberName:function(e){this.current().body.push(this.ensureSafeMemberName(e),";")},addEnsureSafeFunction:function(e){this.current().body.push(this.ensureSafeFunction(e),";")},addEnsureSafeAssignContext:function(e){this.current().body.push(this.ensureSafeAssignContext(e),";")},ensureSafeObject:function(e){return"ensureSafeObject("+e+",text)"},ensureSafeMemberName:function(e){return"ensureSafeMemberName("+e+",text)"},ensureSafeFunction:function(e){return"ensureSafeFunction("+e+",text)"},getStringValue:function(e){this.assign(e,
a.enter(e,null,Ir(N)),N=n,M.clone=e,I[M.id]=M,l(M.scope,d,b,E,w,_,x)});g=I})}}}}],Aa="ng-hide",Ma="ng-hide-animate",Oa=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngShow,function(t){e[t?"removeClass":"addClass"](n,Aa,{tempClasses:Ma})})}}}],Fa=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngHide,function(t){e[t?"addClass":"removeClass"](n,Aa,{tempClasses:Ma})})}}}],Na=sr(function(e,t,n){e.$watch(n.ngStyle,function(e,n){n&&e!==n&&o(n,function(e,n){t.css(n,"")}),e&&t.css(e)},!0)}),Ia=["$animate",function(e){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,r,i,a){var s=i.ngSwitch||i.on,u=[],l=[],c=[],f=[],d=function(e,t){return function(){e.splice(t,1)}};n.$watch(s,function(n){var r,i;for(r=0,i=c.length;i>r;++r)e.cancel(c[r]);for(c.length=0,r=0,i=f.length;i>r;++r){var s=ge(l[r].clone);f[r].$destroy();var h=c[r]=e.leave(s);h.then(d(c,r))}l.length=0,f.length=0,(u=a.cases["!"+n]||a.cases["?"])&&o(u,function(n){n.transclude(function(r,i){f.push(i);var o=n.element;r[r.length++]=t.createComment(" end ngSwitchWhen: ");var a={clone:r};l.push(a),e.enter(r,o.parent(),o)})})})}}}],ja=sr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:t})}}),Pa=sr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:t})}}),La=r("ngTransclude"),Ra=sr({restrict:"EAC",link:function(e,t,n,r,i){function o(e){e.length&&(t.empty(),t.append(e))}if(n.ngTransclude===n.$attr.ngTransclude&&(n.ngTransclude=""),!i)throw La("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",K(t));var a=n.ngTransclude||n.ngTranscludeSlot;i(o,null,a)}}),Ua=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){if("text/ng-template"==n.type){var r=n.id,i=t[0].text;e.put(r,i)}}}}],Va={$setViewValue:m,$render:m},za=["$element","$scope","$attrs",function(e,r,i){var o=this,a=new et;o.ngModelCtrl=Va,o.unknownOption=Ir(t.createElement("option")),o.renderUnknownOption=function(t){var n="? "+Ke(t)+" ?";o.unknownOption.val(n),e.prepend(o.unknownOption),e.val(n)},r.$on("$destroy",function(){o.renderUnknownOption=m}),o.removeUnknownOption=function(){o.unknownOption.parent()&&o.unknownOption.remove()},o.readValue=function(){return o.removeUnknownOption(),e.val()},o.writeValue=function(t){o.hasOption(t)?(o.removeUnknownOption(),e.val(t),""===t&&o.emptyOption.prop("selected",!0)):null==t&&o.emptyOption?(o.removeUnknownOption(),e.val("")):o.renderUnknownOption(t)},o.addOption=function(e,t){pe(e,'"option value"'),""===e&&(o.emptyOption=t);var n=a.get(e)||0;a.put(e,n+1),o.ngModelCtrl.$render(),_r(t)},o.removeOption=function(e){var t=a.get(e);t&&(1===t?(a.remove(e),""===e&&(o.emptyOption=n)):a.put(e,t-1))},o.hasOption=function(e){return!!a.get(e)},o.registerOption=function(e,t,n,r,i){if(r){var a;n.$observe("value",function(e){b(a)&&o.removeOption(a),a=e,o.addOption(e,t)})}else i?e.$watch(i,function(e,r){n.$set("value",e),r!==e&&o.removeOption(r),o.addOption(e,t)}):o.addOption(n.value,t);t.on("$destroy",function(){o.removeOption(n.value),o.ngModelCtrl.$render()})}}],Ha=function(){function e(e,t,n,r){var i=r[1];if(i){var a=r[0];if(a.ngModelCtrl=i,t.on("change",function(){e.$apply(function(){i.$setViewValue(a.readValue())})}),n.multiple){a.readValue=function(){var e=[];return o(t.find("option"),function(t){t.selected&&e.push(t.value)}),e},a.writeValue=function(e){var n=new et(e);o(t.find("option"),function(e){e.selected=b(n.get(e.value))})};var s,u=NaN;e.$watch(function(){u!==i.$viewValue||H(s,i.$viewValue)||(s=z(i.$viewValue),i.$render()),u=i.$viewValue}),i.$isEmpty=function(e){return!e||0===e.length}}}}function t(e,t,n,r){var i=r[1];if(i){var o=r[0];i.$render=function(){o.writeValue(i.$vi
u=r.toDataURL("image/png"),t.emit("thumbnail",e,u),null!=n?n():void 0}}(this),null!=n&&(i.onerror=n),i.src=t},t.prototype.processQueue=function(){var e,t,n,r;if(t=this.options.parallelUploads,n=this.getUploadingFiles().length,e=n,!(n>=t)&&(r=this.getQueuedFiles(),r.length>0)){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));for(;t>e;){if(!r.length)return;this.processFile(r.shift()),e++}}},t.prototype.processFile=function(e){return this.processFiles([e])},t.prototype.processFiles=function(e){var n,r,i;for(r=0,i=e.length;i>r;r++)n=e[r],n.processing=!0,n.status=t.UPLOADING,this.emit("processing",n);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},t.prototype._getFilesWithXhr=function(e){var t,n;return n=function(){var n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;r>n;n++)t=i[n],t.xhr===e&&o.push(t);return o}.call(this)},t.prototype.cancelUpload=function(e){var n,r,i,o,a,s,u;if(e.status===t.UPLOADING){for(r=this._getFilesWithXhr(e.xhr),i=0,a=r.length;a>i;i++)n=r[i],n.status=t.CANCELED;for(e.xhr.abort(),o=0,s=r.length;s>o;o++)n=r[o],this.emit("canceled",n);this.options.uploadMultiple&&this.emit("canceledmultiple",r)}else((u=e.status)===t.ADDED||u===t.QUEUED)&&(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));return this.options.autoProcessQueue?this.processQueue():void 0},i=function(){var e,t;return t=arguments[0],e=2<=arguments.length?l.call(arguments,1):[],"function"==typeof t?t.apply(this,e):t},t.prototype.uploadFile=function(e){return this.uploadFiles([e])},t.prototype.uploadFiles=function(e){var n,o,a,s,u,l,c,f,d,h,p,m,g,v,$,y,b,w,x,k,C,S,_,E,D,T,A,M,O,F,N,I,j,P;for(x=new XMLHttpRequest,k=0,E=e.length;E>k;k++)n=e[k],n.xhr=x;m=i(this.options.method,e),b=i(this.options.url,e),x.open(m,b,!0),x.withCredentials=!!this.options.withCredentials,$=null,a=function(t){return function(){var r,i,o;for(o=[],r=0,i=e.length;i>r;r++)n=e[r],o.push(t._errorProcessing(e,$||t.options.dictResponseError.replace("{{statusCode}}",x.status),x));return o}}(this),y=function(t){return function(r){var i,o,a,s,u,l,c,f,d;if(null!=r)for(o=100*r.loaded/r.total,a=0,l=e.length;l>a;a++)n=e[a],n.upload={progress:o,total:r.total,bytesSent:r.loaded};else{for(i=!0,o=100,s=0,c=e.length;c>s;s++)n=e[s],(100!==n.upload.progress||n.upload.bytesSent!==n.upload.total)&&(i=!1),n.upload.progress=o,n.upload.bytesSent=n.upload.total;if(i)return}for(d=[],u=0,f=e.length;f>u;u++)n=e[u],d.push(t.emit("uploadprogress",n,o,n.upload.bytesSent));return d}}(this),x.onload=function(n){return function(r){var i;if(e[0].status!==t.CANCELED&&4===x.readyState){if($=x.responseText,x.getResponseHeader("content-type")&&~x.getResponseHeader("content-type").indexOf("application/json"))try{$=JSON.parse($)}catch(o){r=o,$="Invalid JSON response from server."}return y(),200<=(i=x.status)&&300>i?n._finished(e,$,r):a()}}}(this),x.onerror=function(n){return function(){return e[0].status!==t.CANCELED?a():void 0}}(this),v=null!=(O=x.upload)?O:x,v.onprogress=y,l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&r(l,this.options.headers);for(s in l)u=l[s],u&&x.setRequestHeader(s,u);if(o=new FormData,this.options.params){F=this.options.params;for(p in F)w=F[p],o.append(p,w)}for(C=0,D=e.length;D>C;C++)n=e[C],this.emit("sending",n,x,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",e,x,o),"FORM"===this.element.tagName)for(N=this.element.querySelectorAll("input, textarea, select, button"),S=0,T=N.length;T>S;S++)if(f=N[S],d=f.getAttribute("name"),h=f.getAttribute("type"),"SELECT"===f.tagName&&f.hasAttribute("multiple"))for(I=f.options,_=0,A=I.length;A>_;_++)g=I[_],g.selected&&o.append(d,g.value);else(!h||"checkbox"!==(j=h.toLowerCase())&&"radio"!==j||f.checked)&&o.append(d,f.value);for(c=M=0,P=e.length-1;P>=0?P>=M:M>=P;c=P>=0?++M:--M)o.append(this._getParamName(c),e[c],e[c].name);return this.submitRequest(x,o,e)},t.prototype.submitRequest=function(e,t,n){return e.send(t)},t.prototype._finished=function(e,n,r){v
}function oe(e,t){return i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Rr.test(t)?"format":"standalone"][e.month()]}function ae(e,t,n){var r,i,o;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;12>r;r++){if(i=l([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function se(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=y(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return n=Math.min(e.date(),re(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function ue(e){return null!=e?(se(this,e),n.updateOffset(this,!0),this):V(this,"Month")}function le(){return re(this.year(),this.month())}function ce(e){return this._monthsParseExact?(s(this,"_monthsRegex")||de.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function fe(e){return this._monthsParseExact?(s(this,"_monthsRegex")||de.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function de(){function e(e,t){return t.length-e.length}var t,n,r=[],i=[],o=[];for(t=0;12>t;t++)n=l([2e3,t]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(e),i.sort(e),o.sort(e),t=0;12>t;t++)r[t]=K(r[t]),i[t]=K(i[t]),o[t]=K(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function he(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[Mr]<0||n[Mr]>11?Mr:n[Or]<1||n[Or]>re(n[Ar],n[Mr])?Or:n[Fr]<0||n[Fr]>24||24===n[Fr]&&(0!==n[Nr]||0!==n[Ir]||0!==n[jr])?Fr:n[Nr]<0||n[Nr]>59?Nr:n[Ir]<0||n[Ir]>59?Ir:n[jr]<0||n[jr]>999?jr:-1,f(e)._overflowDayOfYear&&(Ar>t||t>Or)&&(t=Or),f(e)._overflowWeeks&&-1===t&&(t=Pr),f(e)._overflowWeekday&&-1===t&&(t=Lr),f(e).overflow=t),e}function pe(e){var t,n,r,i,o,a,s=e._i,u=qr.exec(s)||Yr.exec(s);if(u){for(f(e).iso=!0,t=0,n=Br.length;n>t;t++)if(Br[t][1].exec(u[1])){i=Br[t][0],r=Br[t][2]!==!1;break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=Gr.length;n>t;t++)if(Gr[t][1].exec(u[3])){o=(u[2]||" ")+Gr[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(u[4]){if(!Wr.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(o||"")+(a||""),Te(e)}else e._isValid=!1}function me(e){var t=Zr.exec(e._i);return null!==t?void(e._d=new Date(+t[1])):(pe(e),void(e._isValid===!1&&(delete e._isValid,n.createFromInputFallback(e))))}function ge(e,t,n,r,i,o,a){var s=new Date(e,t,n,r,i,o,a);return 100>e&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function ve(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function $e(e){return ye(e)?366:365}function ye(e){return e%4===0&&e%100!==0||e%400===0}function be(){return ye(this.year())}function we(e,t,n){var r=7+t-n,i=(7+ve(e,0,r).getUTCDay()-t)%7;return-i+r-1}function xe(e,t,n,r,i){var o,a,s=(7+n-r)%7,u=we(e,r,i),l=1+7*(t-1)+s+u;return 0>=l?(o=e-1,a=$e(o)+l):l>$e(e)?(o=e+1,a=l-$e(e)):(o=e,a=l),{year:o,dayOfYear:a}}function ke(e,t,n){var r,i,o=we(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return 1>a?(i=e.year()-1,r=a+Ce(i,t,n)):a>Ce(e.year(),t,n)?(r=a-Ce(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function Ce(e,t,n){var r=we(e,t,n),i=we(e+1,t,n);return($e(e)-r+i)/7}function Se(e,t,n){return n
var $i=vi,yi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},bi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},wi="Invalid date",xi="%d",ki=/\d{1,2}/,Ci={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Si=D.prototype;Si._calendar=yi,Si.calendar=wn,Si._longDateFormat=bi,Si.longDateFormat=xn,Si._invalidDate=wi,Si.invalidDate=kn,Si._ordinal=xi,Si.ordinal=Cn,Si._ordinalParse=ki,Si.preparse=Sn,Si.postformat=Sn,Si._relativeTime=Ci,Si.relativeTime=_n,Si.pastFuture=En,Si.set=_,Si.months=ie,Si._months=Ur,Si.monthsShort=oe,Si._monthsShort=Vr,Si.monthsParse=ae,Si._monthsRegex=Hr,Si.monthsRegex=fe,Si._monthsShortRegex=zr,Si.monthsShortRegex=ce,Si.week=Qt,Si._week=ai,Si.firstDayOfYear=Jt,Si.firstDayOfWeek=Xt,Si.weekdays=nn,Si._weekdays=ui,Si.weekdaysMin=on,Si._weekdaysMin=ci,Si.weekdaysShort=rn,Si._weekdaysShort=li,Si.weekdaysParse=an,Si.isPM=pn,Si._meridiemParse=fi,Si.meridiem=mn,O("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",O),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",I);var _i=Math.abs,Ei=Yn("ms"),Di=Yn("s"),Ti=Yn("m"),Ai=Yn("h"),Mi=Yn("d"),Oi=Yn("w"),Fi=Yn("M"),Ni=Yn("y"),Ii=Bn("milliseconds"),ji=Bn("seconds"),Pi=Bn("minutes"),Li=Bn("hours"),Ri=Bn("days"),Ui=Bn("months"),Vi=Bn("years"),zi=Math.round,Hi={s:45,m:45,h:22,d:26,M:11},qi=Math.abs,Yi=Ve.prototype;Yi.abs=In,Yi.add=Pn,Yi.subtract=Ln,Yi.as=Hn,Yi.asMilliseconds=Ei,Yi.asSeconds=Di,Yi.asMinutes=Ti,Yi.asHours=Ai,Yi.asDays=Mi,Yi.asWeeks=Oi,Yi.asMonths=Fi,Yi.asYears=Ni,Yi.valueOf=qn,Yi._bubble=Un,Yi.get=Wn,Yi.milliseconds=Ii,Yi.seconds=ji,Yi.minutes=Pi,Yi.hours=Li,Yi.days=Ri,Yi.weeks=Gn,Yi.months=Ui,Yi.years=Vi,Yi.humanize=Jn,Yi.toISOString=Kn,Yi.toString=Kn,Yi.toJSON=Kn,Yi.locale=Dt,Yi.localeData=Tt,Yi.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),Yi.lang=oi,Y("X",0,0,"unix"),Y("x",0,0,"valueOf"),Q("x",kr),Q("X",_r),ee("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ee("x",function(e,t,n){n._d=new Date(y(e))}),n.version="2.12.0",r(Pe),n.fn=$i,n.min=Re,n.max=Ue,n.now=Kr,n.utc=l,n.unix=yn,n.months=An,n.isDate=o,n.locale=O,n.invalid=h,n.duration=it,n.isMoment=v,n.weekdays=On,n.parseZone=bn,n.localeData=I,n.isDuration=ze,n.monthsShort=Mn,n.weekdaysMin=Nn,n.defineLocale=F,n.updateLocale=N,n.locales=j,n.weekdaysShort=Fn,n.normalizeUnits=L,n.relativeTimeThreshold=Xn,n.prototype=$i;var Wi=n;return Wi})},{}],12:[function(e,t,n){!function(e,n){"use strict";var r,i,o,a=e,s=a.document,u=a.navigator,l=a.setTimeout,c=a.clearTimeout,f=a.setInterval,d=a.clearInterval,h=a.getComputedStyle,p=a.encodeURIComponent,m=a.ActiveXObject,g=a.Error,v=a.Number.parseInt||a.parseInt,$=a.Number.parseFloat||a.parseFloat,y=a.Number.isNaN||a.isNaN,b=a.Date.now,w=a.Object.keys,x=a.Object.defineProperty,k=a.Object.prototype.hasOwnProperty,C=a.Array.prototype.slice,S=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=s.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(r){}return e}(),_=function(e){return C.call(e,0)},E=function(){var e,t,r,i,o,a,s=_(arguments),u=s[0]||{};for(e=1,t=s.length;t>e;e++)if(null!=(r=s[e]))for(i in r)k.call(r,i)&&(o=u[i],a=r[i],u!==a&&a!==n&&(u[i]=a));return u},D=function(e){var t,n,r,i;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,r=e.length;r>n;n++)k.call(e,n)&&(t[n]=D(e[n]));else{t={};for(i in e)k.call(e,i)&&(t[i]=D(e[i]))}return t},T=function(e,t){for(var n={},r=0,i=t.length;i>r;r++)t[r]in e&&(n[t[r]]=e[t[r]]);return n},A=function(e,t){var n={};for(var r in e)
this},Ge.prototype.getData=function(){if(!Qe[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Ge.getData.apply(this,_(arguments))},"function"==typeof define&&define.amd?define(function(){return Ge}):"object"==typeof t&&t&&"object"==typeof t.exports&&t.exports?t.exports=Ge:e.ZeroClipboard=Ge}(function(){return this||window}())},{}],13:[function(e,t,n){t.exports='<div class="dropzone-container">\n <div class="dz-message">Drop files or click here to upload</div>\n</div>'},{}],14:[function(e,t,n){t.exports='\n<div class="image-picker">\n <div>\n <img ng-if="image && image !== \'none\'" ng-src="{{image}}" ng-class="{{imageClass}}" alt="Image Preview">\n <img ng-if="image === \'\' && defaultImage" ng-src="{{defaultImage}}" ng-class="{{imageClass}}" alt="Image Preview">\n </div>\n <button class="button" type="button" ng-click="showImageManager()">Select Image</button>\n <br>\n\n <button class="text-button" ng-click="reset()" type="button">Reset</button>\n <span ng-show="showRemove" class="sep">|</span>\n <button ng-show="showRemove" class="text-button neg" ng-click="remove()" type="button">Remove</button>\n\n <input type="hidden" ng-attr-name="{{name}}" ng-attr-id="{{name}}" ng-attr-value="{{value}}">\n</div>'},{}],15:[function(e,t,n){t.exports='<div class="toggle-switch" ng-click="switch()" ng-class="{\'active\': isActive}">\n <input type="hidden" ng-attr-name="{{name}}" ng-attr-value="{{value}}"/>\n <div class="switch-handle"></div>\n</div>'},{}],16:[function(e,t,n){"use strict";var r=e("moment");t.exports=function(t,n){t.controller("ImageManagerController",["$scope","$attrs","$http","$timeout","imageManagerService",function(e,t,r,i,o){function a(){e.searching=!1,e.searchTerm="",e.images=m,e.hasMore=g}function s(t){p&&p(t),e.showing=!1}function u(t){p=t,e.showing=!0,h||(l(),h=!0)}function l(){var t=v+c+"?",n={};e.uploadedTo&&(n.page_id=e.uploadedTo),e.searching&&(n.term=e.searchTerm);var i=Object.keys(n).map(function(e){return e+"="+encodeURIComponent(n[e])}).join("&");t+=i,r.get(t).then(function(t){e.images=e.images.concat(t.data.images),e.hasMore=t.data.hasMore,c++})}e.images=[],e.imageType=t.imageType,e.selectedImage=!1,e.dependantPages=!1,e.showing=!1,e.hasMore=!1,e.imageUpdateSuccess=!1,e.imageDeleteSuccess=!1,e.uploadedTo=t.uploadedTo,e.view="all",e.searching=!1,e.searchTerm="";var c=0,f=0,d=0,h=!1,p=!1,m=[],g=!1;e.getUploadUrl=function(){return"/images/"+e.imageType+"/upload"},e.cancelSearch=a,e.uploadSuccess=function(t,r){e.$apply(function(){e.images.unshift(r)}),n.emit("success","Image uploaded")},e.imageSelect=function(t){var n=300,r=Date.now(),i=r-f;n>i&&t.id===d?s(t):(e.selectedImage=t,e.dependantPages=!1),f=r,d=t.id},e.selectButtonClick=function(){s(e.selectedImage)},o.show=u,o.showExternal=function(t){e.$apply(function(){u(t)})},window.ImageManager=o,e.hide=function(){e.showing=!1};var v="/images/"+e.imageType+"/all/";e.fetchData=l,e.searchImages=function(){return""===e.searchTerm?void a():(e.searching||(m=e.images,g=e.hasMore),e.searching=!0,e.images=[],e.hasMore=!1,c=0,v="/images/"+e.imageType+"/search/",void l())},e.setView=function(t){a(),e.images=[],e.hasMore=!1,c=0,e.view=t,v="/images/"+e.imageType+"/"+t+"/",l()},e.saveImageDetails=function(t){t.preventDefault();var i="/images/update/"+e.selectedImage.id;r.put(i,this.selectedImage).then(function(e){n.emit("success","Image details updated")},function(e){if(422===e.status){var t=e.data,r="";Object.keys(t).forEach(function(e){r+=t[e].join("\n")}),n.emit("error",r)}else 403===e.status&&n.emit("error",e.data.error)})},e.deleteImage=function(t){t.preventDefault();var i=e.dependantPages!==!1,o="/images/"+e.selectedImage.id;i&&(o+="?force=true"),r["delete"](o).then(function(t){e.images.splice(e.images.indexOf(e.selectedImage),1),e.selectedImage=!1,n.emit("success","Image successfully deleted")},function(t){400===t.status?e.dependantPages=t.data:403===t.status&&n.emit("error",t.data.error)})},e.getDate=function(e){return new Date(e)}}]),t.control