Files
leanote/public/dist/main.js

17 lines
541 KiB
JavaScript
Raw Normal View History

2015-01-08 00:36:28 +08:00
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&b(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),x.initialized=!0,x.supported=!1}function o(t){var e="Rangy warning: "+t;x.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!x.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&b(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),x.initialized=!0,x.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](x)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=C.length;n>e;++e)C[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),b=r(n),x={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:b,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};x.fail=a,x.warn=o,{}.hasOwnProperty?x.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];x.init=s,x.addInitListener=function(t){x.initialized?t(x):w.push(t)};var C=[];x.addCreateMissingNativeApiListener=function(t){C.push(t)},x.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){x.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},x.createModule=function(t,e){var n=new c(t);x.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},x.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=x.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var S=!1,E=function(){S||(S=!0,x.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),x)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}funct
else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=S.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,b,x="boolean",w="_rangySelection",_=t.dom,C=t.util,S=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=C.areHostObjects(M,["anchorNode","focusNode"]&&C.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=C.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;C.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&C.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),C.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,b=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;C.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelect
var i=x.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=x.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return x.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=x.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(x.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r<e.length;++r)if(!A[e.charAt(r)])throw new SyntaxError("Unknown regex flag "+e.charAt(r));return{pattern:t,flags:e}}function u(t){return t=t||{},s(t,"String")&&(t=m.forEach(t,/[^\s,]+/,function(t){this[t]=!0},{})),t}function h(t){if(!/^[\w$]$/.test(t))throw new Error("Flag must be a single character A-Za-z0-9_$");A[t]=!0}function f(t,e,n,r,i){for(var a,o,s=S.length,l=null;s--;)if(o=S[s],(o.scope===r||"all"===o.scope)&&(!o.flag||e.indexOf(o.flag)>-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),b.astral=t}function p(t){RegExp.prototype.exec=(t?w:x).exec,RegExp.prototype.test=(t?w:x).test,String.prototype.match=(t?w:x).match,String.prototype.replace=(t?w:x).replace,String.prototype.split=(t?w:x).split,b.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",b={astral:!1,natives:!1},x={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},C={},S=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=x.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!C[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d<n.length;){do a=f(n,i,d,u,l),a&&a.reparse&&(n=n.slice(0,d)+a.output+n.slice(d+a.matchLength));while(a&&a.reparse);a?(h+=a.output,d+=a.matchLength||1):(o=m.exec(n,T[u],d,"sticky")[0],h+=o,d+=o.length,"["===o&&u===E?u=k:"]"===o&&u===k&&(u=E))}C[s]={pattern:x.replace.call(h,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:x.replace.call(i,/[^gimy]+/g,""),captures:l.hasNamedCapture?l.captureNames:null}}return s=C[s],e(new RegExp(s.pattern,s.flags),s.captures,!0)},m.prototype=new RegExp,m.version="3.0.0-pre",m.addToken=function(t,e,n){n=n||{};var i,a=n.optionalFlags;if(n.flag&&h(n.flag),a)for(a=x.split.call(a,""),i=0;i<a.length;++i)h(a[i]);S.push({regex:r(t,{add:"g"+(R?"y":"")}),handler:e,scope:n.scope||E,flag:n.flag,reparse:n.reparse}),m.cache.flush("patterns")},m.cache=function(t,e){var n=t+"***"+(e||"");return _[n]||(_[n]=m(t,e))},m.cache.flush=function(t){"patterns"===t?C={}:_={}},m.escape=function(t){return x.replace.call(g(t),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},m.exec=function(t,e,n,a){var o,s,l="g";return R&&(a||e.sticky&&a!==!1)&&(l+="y"),e[y]=e[y]||i(),s=e[y][l]||(e[y][l]=r(e,{add:l,remove:a===!1?"y":""})),s.lastIndex=n=n||0,o=w.exec.call(s,t),a&&o&&o.index!==n&&(o=null),e.global&&(e.lastIndex=o?s.lastIndex:0),o},m.forEach=function(t,e,n,r){for(var i,a=0,o=-1;i=m.exec(t,e,
}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");t.addUnicodeData([{name:"ASCII",bmp:"\x00-"},{name:"Alphabetic",bmp:"A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͅͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևְ-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-ٗٙ-ٟٮ-ۓە-ۜۡ-ۭۨ-ۯۺ-ۼۿܐ-ܿݍ-ޱߊ-ߪߴߵߺࠀ-ࠗࠚ-ࠬࡀ-ࡘࢠࢢ-ࢬࣤ-ࣰࣩ-ࣾऀ-ऻऽ-ौॎ-ॐॕ-ॣॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হঽ-ৄেৈোৌৎৗড়ঢ়য়-ৣৰৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੂੇੈੋੌੑਖ਼-ੜਫ਼ੰ-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ૅે-ૉોૌૐૠ-ૣଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽ-ୄେୈୋୌୖୗଡ଼ଢ଼ୟ-ୣୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-ௌௐௗఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-ౌౕౖౘౙౠ-ౣಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊ-ೌೕೖೞೠ-ೣೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൌൎൗൠ-ൣൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ුූෘ-ෟෲෳก-ฺเ-ๆํກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆໍໜ-ໟༀཀ-ཇཉ-ཬཱ-ཱྀྈ-ྗྙ-ྼက-ံးျ-ဿၐ-ၢၥ-ၨၮ-ႆႎႜႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜓᜠ-ᜳᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-ឳា-ៈៗៜᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-ᤸᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨛᨠ-ᩞᩡ-ᩴᪧᬀ-ᬳᬵ-ᭃᭅ-ᭋᮀ-ᮩᮬ-ᮯᮺ-ᯥᯧ-ᯱᰀ-ᰵᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙴ-ꙻꙿ-ꚗꚟ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠧꡀ-ꡳꢀ-ꣃꣲ-ꣷꣻꤊ-ꤪꤰ-ꥒꥠ-ꥼꦀ-ꦲꦴ-ꦿꧏꨀ-ꨶꩀ-ꩍꩠ-ꩶꩺꪀ-ꪾꫀꫂꫛ-ꫝꫠ-ꫯꫲ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA--zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",astral:"<22>[<5B>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|[<5B><>-<2D><>-<2D>][<5B>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B><>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Any",isBmpLast:!0,bmp:"\x00-￿",astral:"[<5B>-<2D>][<5B>-<2D>]"},{name:"Assigned",inverseOf:"Cn"},{name:"Default_Ignorable_Code_Point",bmp:"­͏------",astral:"[<5B>-<2D>][<5B>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Lowercase",bmp:"a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶ<EFBFBD>
}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1.0">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="'+e.MAIN_URL+'res-min/themes/base.css" />','<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>",'<body><div class="container"><%= documentHTML %></div></body>',"</html>"].join("\n"),pdfTemplate:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />','<script type="text/x-mathjax-config">','MathJax.Hub.Config({ messageStyle: "none" });',"</script>",'<script type="text/javascript" src="http://localhost/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>","<body><%= documentHTML %></body>","</html>"].join("\n"),pdfOptions:["{",' "marginTop": 25,',' "marginRight": 25,',' "marginBottom": 25,',' "marginLeft": 25,',' "pageSize": "A4"',"}"].join("\n"),couchdbUrl:e.COUCHDB_URL,extensionSettings:{}};try{t.extend(r,JSON.parse(n.settings))}catch(i){}return r}),function(t,e){function n(t,e,n){return t.addEventListener?void t.addEventListener(e,n,!1):void t.attachEvent("on"+e,n)}function r(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return S[t.which]?S[t.which]:E[t.which]?E[t.which]:String.fromCharCode(t.which).toLowerCase()}function i(t,e){return t.sort().join(",")===e.sort().join(",")}function a(t){t=t||{};var e,n=!1;for(e in R)t[e]?n=!0:R[e]=0;n||(L=!1)}function o(t,e,n,r,a,o){var s,l,c=[],u=n.type;if(!I[t])return[];for("keyup"==u&&d(t)&&(e=[t]),s=0;s<I[t].length;++s)if(l=I[t][s],(r||!l.seq||R[l.seq]==l.level)&&u==l.action&&("keypress"==u&&!n.metaKey&&!n.ctrlKey||i(e,l.modifiers))){var h=!r&&l.combo==a,f=r&&l.seq==r&&l.level==o;(h||f)&&I[t].splice(s,1),c.push(l)}return c}function s(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function l(t){return t.preventDefault?void t.preventDefault():void(t.returnValue=!1)}function c(t){return t.stopPropagation?void t.stopPropagation():void(t.cancelBubble=!0)}function u(t,e,n,r){D.stopCallback(e,e.target||e.srcElement,n,r)||t(e,n)===!1&&(l(e),c(e))}function h(t,e,n){var r,i=o(t,e,n),s={},l=0,c=!1;for(r=0;r<i.length;++r)i[r].seq&&(l=Math.max(l,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=l)continue;c=!0,s[i[r].seq]=1,u(i[r].callback,n,i[r].combo,i[r].seq)}else c||u(i[r].callback,n,i[r].combo);var h="keypress"==n.type&&M;n.type!=L||d(t)||h||a(s),M=c&&"keydown"==n.type}function f(t){"number"!=typeof t.which&&(t.which=t.keyCode);var e=r(t);if(e)return"keyup"==t.type&&A===e?void(A=!1):void D.handleKey(e,s(t),t)}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(){clearTimeout(C),C=setTimeout(a,1e3)}function g(){if(!_){_={};for(var t in S)t>95&&112>t||S.hasOwnProperty(t)&&(_[S[t]]=t)}return _}function m(t,e,n){return n||(n=g()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e,n,i){function o(e){return function(){L=e,++R[t],p()}}function s(e){u(n,e,t),"keyup"!==i&&(A=r(e)),setTimeout(a,10)}R[t]=0;for(var l=0;l<e.length;++l){var c=l+1===e.length,h=c?s:o(i||b(e[l+1]).action);x(e[l],h,i,t,l)}}function y(t){return"+"===t?["+"]:t.split("+")}function b(t,e){var n,r,i,a=[];for(n=y(t),i=0;i<n.length;++i)r=n[i],T[r]&&(r=T[r]),e&&"keypress"!=e&&k[r]&&(r=k[r],a.push("shift")),d(r)&&a.push(r);return e=m(r,a,e),{key
},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");""===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?e.get=function(t,e){var n,r,i="utf-8",a=new java.io.File(t),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),i)),l="";try{for(n=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=s.readLine());)n.append(o),n.append(r);l=String(n.toString())}finally{s.close()}e(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),a="@mozilla.org/windows-registry-key;1"in r,e.get=function(t,e){var n,o,s,l={};a&&(t=t.replace(/\//g,"\\")),s=new FileUtils.File(t);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(s,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),l),o.close(),n.close(),e(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),e}),define("text!html/markdownExtraSettingsBlock.html",[],function(){return'<p>Adds extra features to the original Markdown syntax.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-markdownextra-tables">Tables</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-tables">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-deflist">Definition lists</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-deflist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-attrlist">Special attributes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-attrlist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-footnotes">Footnotes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-footnotes">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-comments">Comments</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-comments">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-smartypants">SmartyPants</label>\n
},Markdown.Extra.init=function(t,e){var n=new Markdown.Extra,i=[],a=[],o=[],s=["unHashExtraBlocks"];return e=e||{},e.extensions=e.extensions||["all"],r(e.extensions,"all")&&(e.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]),a.push("wrapHeaders"),r(e.extensions,"attr_list")&&(i.push("hashFcbAttributeBlocks"),a.push("hashHeaderAttributeBlocks"),s.push("applyAttributeBlocks"),n.attributeBlocks=!0),r(e.extensions,"fenced_code_gfm")&&(a.push("fencedCodeBlocks"),i.push("fencedCodeBlocks")),r(e.extensions,"tables")&&a.push("tables"),r(e.extensions,"def_list")&&a.push("definitionLists"),r(e.extensions,"footnotes")&&(i.push("stripFootnoteDefinitions"),a.push("doFootnotes"),s.push("printFootnotes")),r(e.extensions,"smartypants")&&s.push("runSmartyPants"),r(e.extensions,"strikethrough")&&o.push("strikethrough"),r(e.extensions,"newlines")&&o.push("newlines"),t.hooks.chain("postNormalization",function(t){return n.doTransform(i,t)+"\n"}),t.hooks.chain("preBlockGamut",function(t,e){return n.blockGamutHookCallback=e,t=u(t),t=n.doTransform(a,t)+"\n",t=h(t)}),t.hooks.chain("postSpanGamut",function(t){return n.doTransform(o,t)}),n.previousPostConversion=t.hooks.postConversion,t.hooks.chain("postConversion",function(t){return t=n.doTransform(s,t),n.hashBlocks=[],n.footnotes={},n.usedFootnotes=[],t}),"highlighter"in e&&(n.googleCodePrettify="prettify"===e.highlighter,n.highlightJs="highlight"===e.highlighter),"table_class"in e&&(n.tableClass=e.table_class),n.converter=t,n},Markdown.Extra.prototype.doTransform=function(t,e){for(var n=0;n<t.length;n++)e=this[t[n]](e);return e},Markdown.Extra.prototype.hashExtraBlock=function(t){return"\n<p>~X"+(this.hashBlocks.push(t)-1)+"X</p>\n"},Markdown.Extra.prototype.hashExtraInline=function(t){return"~X"+(this.hashBlocks.push(t)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(t){function e(){var r=!1;t=t.replace(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g,function(t,e){r=!0;var i=parseInt(e,10);return n.hashBlocks[i]}),r===!0&&e()}var n=this;return e(),t},Markdown.Extra.prototype.wrapHeaders=function(t){function e(t){return"\n"+t+"\n"}return t=t.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,e),t=t.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,e),t=t.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,e)};var m="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",v=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+m+"[ \\t]*(?:\\n|0x03)","gm"),y=new RegExp("^(.*)[ \\t]+"+m+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),b=new RegExp("^(```[^`\\n]*)[ \\t]+"+m+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t=t.replace(v,e),t=t.replace(y,e)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t.replace(b,e)},Markdown.Extra.prototype.applyAttributeBlocks=function(t){var e=this,n=new RegExp('<p>~XX(\\d+)XX</p>[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?</\\2>))',"gm");return t=t.replace(n,function(t,n,r,i,o){if(!r)return"";for(var s=parseInt(n,10),l=e.hashBlocks[s],c=l.match(/#[^\s#.]+/g)||[],u=c[0]?' id="'+c[0].substr(1,c[0].length-1)+'"':"",h=l.match(/\.[^\s#.]+/g)||[],f=0;f<h.length;f++)h[f]=h[f].substr(1,h[f].length-1);var d="";return i&&(h=a(h,[i])),h.length>0&&(d=' class="'+h.join(" ")+'"'),"<"+r+u+d+o})},Markdown.Extra.prototype.tables=function(e){function n(e,n,i,a){n=n.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),a=a.replace(/^ *[|]/gm,""),n=n.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),a=a.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var o=0;o<alignspecs.length;o++){var s=alignspecs[o];align[o]=s.match(/^ *-+: *$/m)?' align="right"':s.match(/^ *:-+: *$/m)?' align="center"':s.match(/^ *:-+ *$/m)?' align="left"':""}var c=n.split(/ *[|] */),u=c.length,h=r.tableClass?' class="'+r.tableClass+'"':"",f=["<table",h,">\n","<thead>\n","<tr>\n"].join("");for(o=0;u>o;o++){var d=l(t(c[o]),r
},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'<p>Creates UML diagrams from plain text description.</p>\n\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="textarea-umldiagram-flowchart-options">Flow charts options (JSON)\n </label>\n <div class="col-sm-7">\n <textarea id="textarea-umldiagram-flowchart-options" class="form-control"></textarea>\n </div>\n </div>\n</div>\n<br>\n<p>Sequence diagrams:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence\nAlice->Bob: Hello Bob, how are you?\nBob-->Alice: I am good thanks!\n```</code>\n</pre>\n\n<p>Flow charts:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a></div><code>```flow\nst=>start: Start\ne=>end\nop=>operation: My Operation\ncond=>condition: Yes or No?\nst->op->cond\ncond(yes)->e\ncond(no)->op\n```</code>\n</pre>\n<blockquote>\n <p><b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.</p>\n</blockquote>\n'}),function(t){var e,n,r="0.4.2",i="hasOwnProperty",a=/[\.\/]/,o="*",s=function(){},l=function(t,e){return t-e},c={n:{}},u=function(t,r){t=String(t);var i,a=n,o=Array.prototype.slice.call(arguments,2),s=u.listeners(t),c=0,h=[],f={},d=[],p=e;e=t,n=0;for(var g=0,m=s.length;m>g;g++)"zIndex"in s[g]&&(h.push(s[g].zIndex),s[g].zIndex<0&&(f[s[g].zIndex]=s[g]));for(h.sort(l);h[c]<0;)if(i=f[h[c++]],d.push(i.apply(r,o)),n)return n=a,d;for(g=0;m>g;g++)if(i=s[g],"zIndex"in i)if(i.zIndex==h[c]){if(d.push(i.apply(r,o)),n)break;do if(c++,i=f[h[c]],i&&d.push(i.apply(r,o)),n)break;while(i)}else f[i.zIndex]=i;else if(d.push(i.apply(r,o)),n)break;return n=a,e=p,d.length?d:null};u._events=c,u.listeners=function(t){var e,n,r,i,s,l,u,h,f=t.split(a),d=c,p=[d],g=[];for(i=0,s=f.length;s>i;i++){for(h=[],l=0,u=p.length;u>l;l++)for(d=p[l].n,n=[d[f[i]],d[o]],r=2;r--;)e=n[r],e&&(h.push(e),g=g.concat(e.f||[]));p=h}return g},u.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(a),r=c,i=0,o=n.length;o>i;i++)r=r.n,r=r.hasOwnProperty(n[i])&&r[n[i]]||(r[n[i]]={n:{}});for(r.f=r.f||[],i=0,o=r.f.length;o>i;i++)if(r.f[i]==e)return s;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.f=function(t){var e=[].slice.call(arguments,1);return function(){u.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.nts=function(){return e.split(a)},u.off=u.unbind=function(t,e){if(!t)return void(u._events=c={n:{}});var n,r,s,l,h,f,d,p=t.split(a),g=[c];for(l=0,h=p.length;h>l;l++)for(f=0;f<g.length;f+=s.length-2){if(s=[f,1],n=g[f].n,p[l]!=o)n[p[l]]&&s.push(n[p[l]]);else for(r in n)n[i](r)&&s.push(n[r]);g.splice.apply(g,s)}for(l=0,h=g.length;h>l;l++)for(n=g[l];n.n;){if(e){if(n.f){for(f=0,d=n.f.length;d>f;f++)if(n.f[f]==e){n.f.splice(f,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n
},n._toback=function(t,e){e.bottom!==t&&(Pe(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pe(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pe(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Te(t),r={_:{transform:M},getBBox:function(){return n}};return je(r,e),r.matrix}),je=(n.transformPath=function(t,e){return ve(t,Be(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,b=r[h],x=b.length,w=O(b[0]).toLowerCase(),_=b[0]!=w,C=_?u.invert():0;"t"==w&&3==x?_?(d=C.x(0,0),g=C.y(0,0),m=C.x(b[1],b[2]),v=C.y(b[1],b[2]),u.translate(m-d,v-g)):u.translate(b[1],b[2]):"r"==w?2==x?(y=y||t.getBBox(1),u.rotate(b[1],y.x+y.width/2,y.y+y.height/2),i+=b[1]):4==x&&(_?(m=C.x(b[2],b[3]),v=C.y(b[2],b[3]),u.rotate(b[1],m,v)):u.rotate(b[1],b[2],b[3]),i+=b[1]):"s"==w?2==x||3==x?(y=y||t.getBBox(1),u.scale(b[1],b[x-1],y.x+y.width/2,y.y+y.height/2),s*=b[1],l*=b[x-1]):5==x&&(_?(m=C.x(b[3],b[4]),v=C.y(b[3],b[4]),u.scale(b[1],b[2],m,v)):u.scale(b[1],b[2],b[3],b[4]),s*=b[1],l*=b[2]):"m"==w&&7==x&&u.add(b[1],b[2],b[3],b[4],b[5],b[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),$e=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},He=n._equaliseTransform=function(t,e){e=O(e).replace(/\.{3}|\u2026/g,t),t=n.parseTransformString(t)||[],e=n.parseTransformString(e)||[];for(var r,i,a,o,s=$(t.length,e.length),l=[],c=[],u=0;s>u;u++){if(a=t[u]||$e(e[u]),o=e[u]||$e(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],r=0,i=$(a.length,o.length);i>r;r++)r in a&&(l[u][r]=a[r]),r in o&&(c[u][r]=o[r])}return{from:l,to:c}};n._getContainer=function(t,e,r,i){var a;return a=null!=i||n.is(t,"object")?t:k.doc.getElementById(t),null!=a?a.tagName?null==e?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:e,height:r}:{container:1,x:t,y:e,width:r,height:i}:void 0},n.pathToRelative=Ne,n._engine={},n.path2curve=Fe,n.matrix=function(t,e,n,r,i,a){return new p(t,e,n,r,i,a)},function(t){function e(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var n=j.sqrt(e(t));t[0]&&(t[0]/=n),t[1]&&(t[1]/=n)}t.add=function(t,e,n,r,i,a){var o,s,l,c,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof p&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=h[o][l]*f[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new p(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,r){t=n.rad(t),e=e||0,r=r||0;var i=+j.cos(t).toFixed(9),a=+j.sin(t).toFixed(9);this.add(i,a,-a,i,e,r),this.add(1,0,0,1,-e,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[O.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return n.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matr
break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=n.getRGB(g),l.setAttribute(p,M.hex),"stroke"==p&&M[t]("opacity")&&m(l,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&b(r,r._.arrows.startString),"endString"in r._.arrows&&b(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),L&&(O=L.getElementsByTagName("stop"),m(O[O.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var D=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[D]=g,r._.dirty=1,l.setAttribute(p,g)}}S(r,a),l.style.visibility=f},C=1.2,S=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,l=s.firstChild?i(n._g.doc.defaultView.getComputedStyle(s.firstChild,h).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=e(a.text).split("\n"),f=[],d=0,p=u.length;p>d;d++)c=m("tspan"),d&&m(c,{dy:l*C,x:o.x}),c.appendChild(n._g.doc.createTextNode(u[d])),s.appendChild(c),f[d]=c}else for(f=s.getElementsByTagName("tspan"),d=0,p=f.length;p>d;d++)d?m(f[d],{dy:l*C,x:o.x}):m(f[0],{dy:0});m(s,{x:o.x,y:o.y}),r._.dirty=1;var g=r._getBBox(),v=o.y-(g.y+g.height/2);v&&n.is(v,"finite")&&m(f[0],{dy:v})}},E=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.matrix=n.matrix(),this.realPath=null,this.paper=e,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},k=n.el;E.prototype=k,k.constructor=E,n._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new E(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},k.rotate=function(t,n,i){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,n,i]])),this},k.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3])),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this},k.translate=function(t,n){return this.removed?this:(t=e(t).split(c),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this.transform(this._.transform.concat([["t",t,n]])),this)},k.transform=function(e){var r=this._;if(null==e)return r.transf
this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,b,x,w,_,C,S={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var E="";C=[];for(x in o[v])this.terminals_[x]&&x>h&&C.push("'"+this.terminals_[x]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:C})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexer.yytext),a.push(this.lexer.yylloc),r.push(y[1]),g=null,m?(g=m,m=null):(c=this.lexer.yyleng,s=this.lexer.yytext,l=this.lexer.yylineno,d=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[y[1]][1],S.$=i[i.length-w],S._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},p&&(S._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),b=this.performAction.call(S,s,c,l,this.yy,y[1],i,a),"undefined"!=typeof b)return b;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),r.push(this.productions_[y[1]][0]),i.push(S.$),a.push(S._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.leng
else a=this.leftEnd&&b?r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,_=p.x;else a=r(this.chart,l,g,e),this.rightStart=!0,t.leftEnd=!0,_=g.x;else a=r(this.chart,c,d,e),this.bottomStart=!0,t.topEnd=!0,_=c.x;if(a){for(var k=0,T=this.chart.lines.length;T>k;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),A=a.attr("path"),M=0,L=R.length-1;L>M;M++){var O=[];O.push(["M",R[M][1],R[M][2]]),O.push(["L",R[M+1][1],R[M+1][2]]);for(var D=O[0][1],F=O[0][2],P=O[1][1],B=O[1][2],j=0,$=A.length-1;$>j;j++){var H=[];H.push(["M",A[j][1],A[j][2]]),H.push(["L",A[j+1][1],A[j+1][2]]);var U=H[0][1],q=H[0][2],z=H[1][1],G=H[1][2],W=i(D,F,P,B,U,q,z,G);if(W.onLine1&&W.onLine2){var X;q===G?U>z?(X=["L",W.x+2*S,q],A.splice(j+1,0,X),X=["C",W.x+2*S,q,W.x,q-4*S,W.x-2*S,q],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",W.x-2*S,q],A.splice(j+1,0,X),X=["C",W.x-2*S,q,W.x,q-4*S,W.x+2*S,q],A.splice(j+2,0,X),a.attr("path",A)):q>G?(X=["L",U,W.y+2*S],A.splice(j+1,0,X),X=["C",U,W.y+2*S,U+4*S,W.y,U,W.y-2*S],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",U,W.y-2*S],A.splice(j+1,0,X),X=["C",U,W.y-2*S,U+4*S,W.y,U,W.y+2*S],A.splice(j+2,0,X),a.attr("path",A)),j+=2,I+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&_>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=_)},m.inherits(s,o),m.inherits(l,o),m.inherits(c,o),m.inherits(u,o),m.inherits(h,o),h.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.textMargin;return{x:e,y:t}},h.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width-this.textMargin;return{x:e,y:t}},m.inherits(f,o),f.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var e=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(e.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var n=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(n.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var r=this;!function i(){for(var e,n=!1,a=0,o=r.chart.symbols.length;o>a;a++){e=r.chart.symbols[a];var s=Math.abs(e.getCenter().x-r.right_symbol.getCenter().x);if(e.getCenter().y>r.right_symbol.getCenter().y&&s<=r.right_symbol.width/2){n=!0;break}}n&&(r.right_symbol.setX(e.getX()+e.width+t),i())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},f.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=d,p}),define("extensions/umlDiagrams",["underscore","utils","logger","classes/Extension","text!html/umlDiagramsSettingsBlock.html","crel","Diagram","flow-chart"],function(t,e,n,r,i,a,o,s){var l=new r("umlDiagrams","UML Diagrams",!0);return l.settingsBlock=i,l.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")},l.onLoadSettings=function(){e.setInputValue("#textarea-umldiagram-flowchart-options",l.config.flowchartOptions)},l.onSaveSettings=function(t,n){t.flowchartOptions=e.getInputJSONValue("#textarea-umldiagra
},h.postMessage(JSON.stringify({language:u.language,code:u.code}))}else u.highlightedCode=e.highlight(u.code,u.grammar,u.language),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(r),e.hooks.run("after-highlight",u)}}},highlight:function(t,r,i){return n.stringify(e.tokenize(t,r),i)},tokenize:function(t,n){var r=e.Token,i=[t],a=n.rest;if(a){for(var o in a)n[o]=a[o];delete n.rest}t:for(var o in n)if(n.hasOwnProperty(o)&&n[o]){var s=n[o],l=s.inside,c=!!s.lookbehind,u=0;s=s.pattern||s;for(var h=0;h<i.length;h++){var f=i[h];if(i.length>t.length)break t;if(!(f instanceof r)){s.lastIndex=0;var d=s.exec(f);if(d){c&&(u=d[1].length);var p=d.index-1+u,d=d[0].slice(u),g=d.length,m=p+g,v=f.slice(0,p+1),y=f.slice(m+1),b=[h,1];v&&b.push(v);var x=new r(o,l?e.tokenize(d,l):d);b.push(x),y&&b.push(y),Array.prototype.splice.apply(i,b)}}}}return i},hooks:{all:{},add:function(t,n){var r=e.hooks.all;r[t]=r[t]||[],r[t].push(n)},run:function(t,n){var r=e.hooks.all[t];if(r&&r.length)for(var i,a=0;i=r[a++];)i(n)}}},n=e.Token=function(t,e){this.type=t,this.content=e};if(n.stringify=function(t,r,i){if("string"==typeof t)return t;if("[object Array]"==Object.prototype.toString.call(t))return t.map(function(e){return n.stringify(e,r,t)}).join("");var a={type:t.type,content:n.stringify(t.content,r,i),tag:"span",classes:["token",t.type],attributes:{},language:r,parent:i};"comment"==a.type&&(a.attributes.spellcheck="true"),e.hooks.run("wrap",a);var o="";for(var s in a.attributes)o+=s+'="'+(a.attributes[s]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+"</"+a.tag+">"},!self.document)return void self.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(e.tokenize(i,e.languages[r]))),self.close()},!1);var r=document.getElementsByTagName("script");r=r[r.length-1],r&&(e.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",e.highlightAll))}(),define("prism-core",function(t){return function(){var e;return e||t.Prism}}(this));var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,o=this.diff_commonPrefix(t,e),s=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=this.diff_commonSuffix(t,e);var l=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var c=this.diff_compute_(t,e,a,i);return s&&c.unshift([DIFF_EQUAL,s]),l&&c.push([DIFF_EQUAL,l]),this.diff_cleanupMerge(c),c},diff_match_patch.prototype.diff_compute_=function(t,e,n,r){var i;if(!t)return[[DIFF_INSERT,e]];if(!e)return[[DIFF_DELETE,t]];var a=t.length>e.length?t:e,o=t.length>e.length?e:t,s=a.indexOf(o);if(-1!=s)return i=[[DIFF_INSERT,a.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,a.substring(s+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o<a.length;){switch(a[o][0]){case DIFF_INSERT:l++,u+=a[o][1];break;case DIFF_DELETE:s++,c+=a[o][1];break;case DIFF_EQUAL:if(s>=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r
};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(i-1),s}return t[r][i-1]>t[r-1][i]?a(t,e,n,r,i-1,o):a(t,e,n,r-1,i,o)},o=function(t,e,n,o){o=o||{};var s=i(t,e,n||r,o),l=a(s,t,e,t.length,e.length,o);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};n.get=o},{}],12:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;n>i;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};o.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n;for(e in t.left)n=new r(t.left[e],t.right[e]),t.push(n,e);for(e in t.right)"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var u=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new a(t.delta[e]),t.push(n,e);t.exit()}};u.filterName="objects";var h=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;n>i;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};h.filterName="collectChildren",n.collectChildrenDiffFilter=o,n.objectsDiffFilter=s,n.patchFilter=l,n.collectChildrenPatchFilter=c,n.reverseFilter=u,n.collectChildrenReverseFilter=h},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5}],13:[function(t,e,n){var r=2,i=60,a=null,o=function(){if(!a){var e;if("undefined"!=typeof diff_match_patch)e=new diff_match_patch;else if("function"==typeof t){var n=t("../../external/diff_match_patch_uncompressed");e=new n.diff_match_patch}if(!e){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}a={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;i<r[1].length;i++)if(!r[1][i]){var a=new Error("text patch failed");a.textPatchFailed=!0}return r[0]}}}return a},s=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||i;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var n=o().diff;t.setResult([n(t.left,t.right),0,r]).exit()}};s.filterName="texts";var l=function(t){if(!t.nested&&t.delta[2]===r){var e=o().patch;t.setResult(e(t.left,t.delta[0])).exit()}};l.filterName="texts";var c=function(t){var e,n,r,i,a,o,s,l,c=null,u=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(r=t.split("\n"),e=0,n=r.length;n>e;e++){i=r[e];var h=i.slice(0,1);"@"===h?(c=u.exec(i),o=e,s=null,l=null,r[o]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===h?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(a=r[e],r[e]=r[e-1],r[e-1]=a)):"-"===h&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},u=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};u.filterName="texts",n.diffFilter=s,n.patchFilter=l,n.reverseFilter=u},{}],14:[function(t,e,n){var r="function"==typeof Array.isArray?Array.isArray:functi
R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.max(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(void 0,t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0});var r=!1;R.on("keydown",function(t){if(17!==t.which&&91!==t.which&&18!==t.which&&16!==t.which){W.saveSelectionState(),h();var e=t.metaKey||t.ctrlKey;switch(t.which){case 9:e||(i("indent",{inverse:t.shiftKey}),t.preventDefault());break;case 13:i("newline"),t.preventDefault()}13!==t.which&&(r=!1)}}).on("compositionstart",function(){j++}).on("compositionend",function(){setTimeout(function(){j--},0)}).on("mouseup",t.bind(W.saveSelectionState,W,!0,!1)).on("paste",function(t){Y.currentMode="paste",t.preventDefault();var e,n=(t.originalEvent||t).clipboardData;n?e=n.getData("text/plain"):(n=window.clipboardData,e=n&&n.getData("Text")),e&&(d(W.selectionStart,W.selectionEnd,e),h())}).on("cut",function(){Y.currentMode="cut",h()}).on("focus",function(){W.hasFocus=!0}).on("blur",function(){W.hasFocus=!1});var i=function(t,e){var n=v(),r=Math.min(W.selectionStart,W.selectionEnd),i=Math.max(W.selectionStart,W.selectionEnd),a={selectionStart:r,selectionEnd:i,before:n.slice(0,r),after:n.slice(i),selection:n.slice(r,i)};o[t](a,e||{}),f(a.before+a.selection+a.after),W.setSelectionStartEnd(a.selectionStart,a.selectionEnd),W.updateSelectionRange()},a=/^ {0,3}>[ ]*|^[ \t]*(?:[*+\-]|(\d+)\.)[ \t]|^\s+/,o={indent:function(t,e){function n(t,e,n,r){return n=+n||0,r=r||"",t.slice(0,e)+r+t.slice(e+n)}var r=t.before.lastIndexOf("\n")+1;if(e.inverse)/\s/.test(t.before.charAt(r))&&(t.before=n(t.before,r,1),t.selectionStart--,t.selectionEnd--),t.selection=t.selection.replace(/^[ \t]/gm,"");else{var i=t.before.slice(r);if(!t.selection&&!i.match(a))return t.before+=" ",t.selectionStart++,void t.selectionEnd++;t.before=n(t.before,r,0," "),t.selection=t.selection.replace(/\r?\n(?=[\s\S])/g,"\n "),t.selectionStart++,t.selectionEnd++}t.selectionEnd=t.selectionStart+t.selection.length},newline:function(t){var e=t.before.lastIndexOf("\n")+1;if(r)return t.before=t.before.substring(0,e),t.selection="",t.selectionStart=e,t.selectionEnd=e,void(r=!1);r=!1;var n=t.before.slice(e),i=n.match(a),o=(i||[""])[0];if(i&&i[1]){var s=parseInt(i[1],10);o=o.replace(/\d+/,s+1)}o.length&&(r=!0),Y.currentMode="newlines",t.before+="\n"+o,t.selection="",t.selectionStart+=o.length+1,t.selectionEnd=t.selectionStart}};V!==!1&&F.setContent(V)};var Q,K=[],Z=[],te=[],ee=function(){var t={"&":"&amp;","<":"&lt;"," ":" "};return function(e){return e.replace(/[&<\u00a0]/g,function(e){return t[e]})}}();return r.onEditorCreated(F),F}),function(){function t(){}function e(t){this.buttonBar=h.getElementById("wmd-button-bar"+t),this.preview=h.getElementById("wmd-preview"+t),this.input=h.getElementById("wmd-input"+t)}function n(t,e){var n,i,a,o=this,s=[],c=0,u="none",h=function(t,e){u!=t&&(u=t,e||d()),g.isIE&&"moving"==u?a=null:i=setTimeout(f,1)},f=function(t){a=new r(e,t),i=void 0};this.setCommandMode=function(){u="command",d(),i=setTimeout(f,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return s[c+1]?!0:!1},this.undo=function(){o.canUndo()&&(n?(n.restore(),n=null):(s[c]=new r(e),s[--c].restore(),t&&t())),u="none",e.input.focus(),f()},this.redo=function(){o.canRedo()&&(s[++c].restore(),t&&t()),u="none",e.input.focus(),f()};var d=function(){var i=a||new r(e);return i?"moving"==u?void(n||(n=i)):(n&&(s[c-1].text!=n.text&&(s[c++]=n),n=null),s[c++]=i,s[c+1]=null,void(t&&t())):!1},p=function(t){if(!t.ctrlKey&&!t.metaKey){var e=t.keyCode;e>=33&&40>=e||e>=63232&&63235>=e?h("moving"):8==e||46==e||127==e?h("deleting"):13==e?h("newlines"):27==e?h("escape"):(16>e||e>20
for(var n,r,i,a=0,o=t.attributes.length;o>a;++a)if(n=t.attributes[a],i=n.name,"class"!=i){if(r=e.attributes.getNamedItem(i),n.specified!=r.specified)return!1;if(n.specified&&n.nodeValue!==r.nodeValue)return!1}return!0}function f(t,e){for(var n,r=0,i=t.attributes.length;i>r;++r)if(n=t.attributes[r].name,(!e||!k.arrayContains(e,n))&&t.attributes[r].specified&&"class"!=n)return!0;return!1}function d(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function p(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||N(t)&&!N(t.parentNode))}function g(t){return(N(t)||1!=t.nodeType&&N(t.parentNode))&&!p(t)}function m(t){return t&&1==t.nodeType&&!R.test(E(t,"display"))}function v(t){if(0==t.data.length)return!0;if(A.test(t.data))return!1;var e=E(t.parentNode,"whiteSpace");switch(e){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return m(t.previousSibling)||m(t.nextSibling)}function y(t,e){return k.isCharacterDataNode(t)?0==e?!!t.previousSibling:e==t.length?!!t.nextSibling:!0:e>0&&e<t.childNodes.length}function b(t,n,r,i){var a,o=0==r;if(k.isAncestorOf(n,t))return t;if(k.isCharacterDataNode(n))if(0==r)r=k.getNodeIndex(n),n=n.parentNode;else{if(r!=n.length)throw e.createError("splitNodeAt should not be called with offset in the middle of a data node ("+r+" in "+n.data);r=k.getNodeIndex(n)+1,n=n.parentNode}if(y(n,r)){if(!a){a=n.cloneNode(!1),a.id&&a.removeAttribute("id");for(var s;s=n.childNodes[r];)a.appendChild(s);k.insertAfter(a,n)}return n==t?a:b(t,a.parentNode,k.getNodeIndex(a),i)}if(t!=n){a=n.parentNode;var l=k.getNodeIndex(n);return o||l++,b(t,a,l,i)}return t}function x(t,e){return t.tagName==e.tagName&&s(t,e)&&h(t,e)}function w(t){var e=t?"nextSibling":"previousSibling";return function(n,r){var i=n.parentNode,a=n[e];if(a){if(a&&3==a.nodeType)return a}else if(r&&(a=i[e],a&&1==a.nodeType&&x(i,a)))return a[t?"firstChild":"lastChild"];return null}}function _(t){this.isElementMerge=1==t.nodeType,this.firstTextNode=this.isElementMerge?t.lastChild:t,this.textNodes=[this.firstTextNode]}function C(t,e,r){this.cssClass=t;var i,o,s,l,c=null;if("object"==typeof e&&null!==e){for(r=e.tagNames,c=e.elementProperties,o=0;l=O[o++];)e.hasOwnProperty(l)&&(this[l]=e[l]);i=e.normalize}else i=e;this.normalize="undefined"==typeof i?!0:i,this.attrExceptions=[];var u=document.createElement(this.elementTagName);this.elementProperties={};for(var h in c)c.hasOwnProperty(h)&&(D.hasOwnProperty(h)&&(h=D[h]),u[h]=c[h],this.elementProperties[h]=u[h],this.attrExceptions.push(h));this.elementSortedClassName=this.elementProperties.hasOwnProperty("className")?a(this.elementProperties.className+" "+t):t,this.applyToAnyTagName=!1;var f=typeof r;if("string"==f)"*"==r?this.applyToAnyTagName=!0:this.tagNames=n(r.toLowerCase()).split(/\s*,\s*/);else if("object"==f&&"number"==typeof r.length)for(this.tagNames=[],o=0,s=r.length;s>o;++o)"*"==r[o]?this.applyToAnyTagName=!0:this.tagNames.push(r[o].toLowerCase());else this.tagNames=[this.elementTagName]}function S(t,e,n){return new C(t,e,n)}t.requireModules(["WrappedSelection","WrappedRange"]);var E,k=t.dom,T="span",I=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){e.className&&(e.className=e.className.replace(new RegExp("(?:^|\\s)"+n+"(?:\\s|$)"),t))}}();"undefined"!=typeof window.getComputedStyle?E=function(t,e){return k.getWindow(t).getComputedStyle(t,null)[e]}:"undefined"!=typeof document.documentElement.currentStyle?E=function(t,e){return t.currentStyle[e]}:e.fail("No means of obtaining computed style properties found");var N;!function(){var t=document.createElement("div");N="boolean"==typeof t.isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return t&&1==t.nodeType&&"false"!=t.contentEditable?"true"==t.contentEditable||N(t.parentNode):!1}}();var R=/^inline(-block|-table)?$/i,A=/[^\r\n\t\f \u200B]/,M=w(!1),L=w(!0);_.prototype={doMerge:function(){for(var t,e,n,r=[],i=0,a=this.textNodes.length;a>i;++i)t=this.textNodes[i],e=t.parentNode,r[i]=t.data,i&
}function n(t){var n=tinymce.activeEditor,i=n.dom,a=function(n){function a(){i.setAttrib(o,"src",n.src),n.title&&i.setAttrib(o,"title",n.title),i.setAttrib(o,"id",null)}var o,s={};s.id="__mcenew"+r++,s.src="http://leanote.com/images/loading-24.gif",o=i.createHTML("img",s),tinymce.activeEditor.insertContent(o),o=i.get(s.id),e(t.src,a)},o="";if(fileIds=t.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(o=fileIds[1]),o){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(t){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:o,toUserId:s.UserId},function(e){if(reIsOk(e)&&e.Id){var n=window.location.protocol+"//"+window.location.host;t.src=n+"/file/outputImage?fileId="+e.Id}a(t)})}(t):a(t)}else a(t)}t.prototype.update=function(t){var e=this;t=Math.ceil(100*t),t>=100&&(t=99),t+="%",$("#"+e.id+" .progress-bar").html(t).css("width",t)},t.prototype.replace=function(t){var n=this;e(t,function(){$("#"+n.id).replaceWith('<img src="'+t+'" />')})},t.prototype.remove=function(){var t=this;$("#"+t.id).remove()};var r=1,i=function(){function t(t){return"number"!=typeof t?"":t>=1e9?(t/1e9).toFixed(2)+" GB":t>=1e6?(t/1e6).toFixed(2)+" MB":(t/1e3).toFixed(2)+" KB"}function e(){$("#upload").css("z-index",12);var t=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",t-8),$("#upload").show()}function r(){$("#upload").css("z-index",0).css("top","auto").hide()}var i=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(){return[{name:"albumId",value:""}]},add:function(e,n){var r=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append(n.files[0].name+" <small>[<i>"+t(n.files[0].size)+"</i>]</small>"),n.context=r.appendTo(i);n.submit()},done:function(e,r){if(1==r.result.Ok){r.context.remove();var i={src:urlPrefix+"/file/outputImage?fileId="+r.result.Id};n(i)}else{r.context.empty();var a=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');a.find("div").append("<b>Error:</b> "+r.files[0].name+" <small>[<i>"+t(r.files[0].size)+"</i>]</small> "+r.result.Msg),r.context.append(a),setTimeout(function(t){return function(){t.remove()}}(a),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(e,n){n.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>Error:</b> "+n.files[0].name+" <small>[<i>"+t(n.files[0].size)+"</i>]</small> "+n.errorThrown),n.context.append(r),setTimeout(function(t){return function(){t.remove()}}(r),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(t){t.preventDefault()}),$(document).bind("dragover",function(t){var n=$("#drop"),i=window.dropZoneTimeout;i?clearTimeout(i):(n.addClass("in"),e());var a=!1,o=t.target;do{if(o===n[0]){a=!0;break}o=o.parentNode}while(null!=o);a?n.addClass("hover"):n.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,n.removeClass("in hover"),r()},100)})},a=function(){var e;$("#editorContent").fileupload({dataType:"json",pasteZone:$("#editorContent"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(t,e){e.process.update(e.loaded/e.total)},add:function(n,r){var i=Note.getCurNote();if(!i||i.IsNew)return void alert("This note hasn't saved, please save it firstly!");e=tinymce.EditorManager.activeEditor;var a=new t(e);r.process=a;r.submit()},done:function(t,e){if(1==e.result.Ok){var n=e.result,r=UrlPrefix,i=r+"/file/outputImage?fileId="+n.Id;e.process.replace(i)}else e.process.remove()},fail:function(t,e){e.process.remove()}})};i(),a()});var urlPrefix=UrlPrefix;define("at