Socket
Socket
Sign inDemoInstall

vue-prism-editor

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-prism-editor - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

tests/unit/__snapshots__/Editor.spec.js.snap

6

dist/VuePrismEditor.umd.min.js

@@ -1,2 +0,2 @@

(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["VuePrismEditor"]=e():t["VuePrismEditor"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"1eb2":function(t,e,n){var r;"undefined"!==typeof window&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js$/))&&(n.p=r[1]))},"214f":function(t,e,n){"use strict";var r=n("32e9"),i=n("2aba"),o=n("79e5"),s=n("be13"),u=n("2b4c");t.exports=function(t,e,n){var a=u(t),c=n(s,a,""[t]),f=c[0],l=c[1];o(function(){var e={};return e[a]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,f),r(RegExp.prototype,a,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},"230e":function(t,e,n){var r=n("d3f4"),i=n("7726").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"28a5":function(t,e,n){n("214f")("split",2,function(t,e,r){"use strict";var i=n("aae3"),o=r,s=[].push,u="split",a="length",c="lastIndex";if("c"=="abbc"[u](/(b)*/)[1]||4!="test"[u](/(?:)/,-1)[a]||2!="ab"[u](/(?:ab)*/)[a]||4!="."[u](/(.?)(.?)/)[a]||"."[u](/()()/)[a]>1||""[u](/.?/)[a]){var f=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,u,l,d,p,h=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,m=void 0===e?4294967295:e>>>0,y=new RegExp(t.source,v+"g");f||(r=new RegExp("^"+y.source+"$(?!\\s)",v));while(u=y.exec(n)){if(l=u.index+u[0][a],l>g&&(h.push(n.slice(g,u.index)),!f&&u[a]>1&&u[0].replace(r,function(){for(p=1;p<arguments[a]-2;p++)void 0===arguments[p]&&(u[p]=void 0)}),u[a]>1&&u.index<n[a]&&s.apply(h,u.slice(1)),d=u[0][a],g=l,h[a]>=m))break;y[c]===u.index&&y[c]++}return g===n[a]?!d&&y.test("")||h.push(""):h.push(n.slice(g)),h[a]>m?h.slice(0,m):h}}else"0"[u](void 0,0)[a]&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,o,i):r.call(String(o),n,i)},r]})},"2aba":function(t,e,n){var r=n("7726"),i=n("32e9"),o=n("69a8"),s=n("ca5a")("src"),u="toString",a=Function[u],c=(""+a).split(u);n("8378").inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,u){var a="function"==typeof n;a&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(a&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,u,function(){return"function"==typeof this&&this[s]||a.call(this)})},"2b4c":function(t,e,n){var r=n("5537")("wks"),i=n("ca5a"),o=n("7726").Symbol,s="function"==typeof o,u=t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))};u.store=r},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"32e9":function(t,e,n){var r=n("86cc"),i=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4917:function(t,e,n){n("214f")("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},5147:function(t,e,n){var r=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5537:function(t,e,n){var r=n("8378"),i=n("7726"),o="__core-js_shared__",s=i[o]||(i[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(t,e,n){var r=n("7726"),i=n("8378"),o=n("32e9"),s=n("2aba"),u=n("9b43"),a="prototype",c=function(t,e,n){var f,l,d,p,h=t&c.F,v=t&c.G,g=t&c.S,m=t&c.P,y=t&c.B,b=v?r:g?r[e]||(r[e]={}):(r[e]||{})[a],x=v?i:i[e]||(i[e]={}),_=x[a]||(x[a]={});for(f in v&&(n=e),n)l=!h&&b&&void 0!==b[f],d=(l?b:n)[f],p=y&&l?u(d,r):m&&"function"==typeof d?u(Function.call,d):d,b&&s(b,f,d,t&c.U),x[f]!=d&&o(x,f,p),m&&_[f]!=d&&(_[f]=d)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"6a99":function(t,e,n){var r=n("d3f4");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},"6b54":function(t,e,n){"use strict";n("3846");var r=n("cb7c"),i=n("0bfb"),o=n("9e1e"),s="toString",u=/./[s],a=function(t){n("2aba")(RegExp.prototype,s,t,!0)};n("79e5")(function(){return"/a/b"!=u.call({source:"a",flags:"b"})})?a(function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):u.name!=s&&a(function(){return u.call(this)})},"72d6":function(t,e,n){var r=n("8a8d"),i=n("ad9a");function o(t,e){if(!(this instanceof o))return new o(t,e);if(this.node=this.start=this.peeked=t,this.root=e,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],t&&this.higher(t))throw new Error("root must be a parent or ancestor to node")}function s(t,e){var n="nextSibling"==t;return function(i,o,s){i=this.compile(i),o=o&&o>0?o:1;var u=this.node,a=this.closingTag,c=this._revisit;while(u){if(r(n,a)&&u[e])u=u[e],a=!n;else if(1==u.nodeType&&!u[e]&&r(n,a)){if(a=n,!c)continue}else if(u[t])u=u[t],a=!n;else if(u=u.parentNode,a=n,!c)continue;if(!u||this.higher(u,this.root))break;if(i(u)&&this.selects(u,s)&&this.rejects(u,s)){if(--o)continue;return s||(this.node=u),this.closingTag=a,u}}return null}}t.exports=o,o.prototype.reset=function(t){return this.node=t||this.start,this},o.prototype.revisit=function(t){return this._revisit=void 0==t||t,this},o.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},o.prototype.atOpening=function(){return!this.closingTag},o.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},o.prototype.atClosing=function(){return this.closingTag},o.prototype.next=s("nextSibling","firstChild"),o.prototype.previous=o.prototype.prev=s("previousSibling","lastChild"),o.prototype.select=function(t){return t=this.compile(t),this._selects.push(t),this},o.prototype.selects=function(t,e){var n=this._selects,r=n.length;if(!r)return!0;for(var i=0;i<r;i++)if(n[i].call(this,t,e))return!0;return!1},o.prototype.reject=function(t){return t=this.compile(t),this._rejects.push(t),this},o.prototype.rejects=function(t,e){var n=this._rejects,r=n.length;if(!r)return!0;for(var i=0;i<r;i++)if(n[i].call(this,t,e))return!1;return!0},o.prototype.higher=function(t){var e=this.root;if(!e)return!1;t=t.parentNode;while(t&&t!=e)t=t.parentNode;return t!=e},o.prototype.compile=function(t){switch(typeof t){case"number":return function(e){return t==e.nodeType};case"string":return new Function("node","return "+i(t,"node."));case"function":return t;default:return function(){return!0}}},o.prototype.peak=o.prototype.peek=function(t,e){return 1==arguments.length&&(e=t,t=!0),e=void 0==e?1:e,e?e>0?this.next(t,e,!0):this.prev(t,Math.abs(e),!0):this.node},o.prototype.use=function(t){return t(this),this}},"74a0":function(t,e,n){"use strict";
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["VuePrismEditor"]=e():t["VuePrismEditor"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"0a0d":function(t,e,n){t.exports=n("82e3")},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0f89":function(t,e,n){var r=n("6f8a");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},"12fd":function(t,e,n){var r=n("6f8a"),i=n("da3c").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"214f":function(t,e,n){"use strict";var r=n("32e9"),i=n("2aba"),o=n("79e5"),u=n("be13"),c=n("2b4c");t.exports=function(t,e,n){var a=c(t),s=n(u,a,""[t]),f=s[0],l=s[1];o(function(){var e={};return e[a]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,f),r(RegExp.prototype,a,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},"230e":function(t,e,n){var r=n("d3f4"),i=n("7726").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"28a5":function(t,e,n){n("214f")("split",2,function(t,e,r){"use strict";var i=n("aae3"),o=r,u=[].push,c="split",a="length",s="lastIndex";if("c"=="abbc"[c](/(b)*/)[1]||4!="test"[c](/(?:)/,-1)[a]||2!="ab"[c](/(?:ab)*/)[a]||4!="."[c](/(.?)(.?)/)[a]||"."[c](/()()/)[a]>1||""[c](/.?/)[a]){var f=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,c,l,d,p,h=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,y=void 0===e?4294967295:e>>>0,m=new RegExp(t.source,v+"g");f||(r=new RegExp("^"+m.source+"$(?!\\s)",v));while(c=m.exec(n)){if(l=c.index+c[0][a],l>g&&(h.push(n.slice(g,c.index)),!f&&c[a]>1&&c[0].replace(r,function(){for(p=1;p<arguments[a]-2;p++)void 0===arguments[p]&&(c[p]=void 0)}),c[a]>1&&c.index<n[a]&&u.apply(h,c.slice(1)),d=c[0][a],g=l,h[a]>=y))break;m[s]===c.index&&m[s]++}return g===n[a]?!d&&m.test("")||h.push(""):h.push(n.slice(g)),h[a]>y?h.slice(0,y):h}}else"0"[c](void 0,0)[a]&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),u=void 0==n?void 0:n[e];return void 0!==u?u.call(n,o,i):r.call(String(o),n,i)},r]})},"2aba":function(t,e,n){var r=n("7726"),i=n("32e9"),o=n("69a8"),u=n("ca5a")("src"),c="toString",a=Function[c],s=(""+a).split(c);n("8378").inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,c){var a="function"==typeof n;a&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(a&&(o(n,u)||i(n,u,t[e]?""+t[e]:s.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,c,function(){return"function"==typeof this&&this[u]||a.call(this)})},"2b4c":function(t,e,n){var r=n("5537")("wks"),i=n("ca5a"),o=n("7726").Symbol,u="function"==typeof o,c=t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))};c.store=r},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2ea1":function(t,e,n){var r=n("6f8a");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},"32e9":function(t,e,n){var r=n("86cc"),i=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"3adc":function(t,e,n){var r=n("0f89"),i=n("a47f"),o=n("2ea1"),u=Object.defineProperty;e.f=n("7d95")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"3dcc":function(t,e,n){var r=n("d13f");r(r.S,"Date",{now:function(){return(new Date).getTime()}})},"412e":function(t,e,n){},"43c8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},4588:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4917:function(t,e,n){n("214f")("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},5147:function(t,e,n){var r=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(i){}}return!0}},5537:function(t,e,n){var r=n("8378"),i=n("7726"),o="__core-js_shared__",u=i[o]||(i[o]={});(t.exports=function(t,e){return u[t]||(u[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},"5ca1":function(t,e,n){var r=n("7726"),i=n("8378"),o=n("32e9"),u=n("2aba"),c=n("9b43"),a="prototype",s=function(t,e,n){var f,l,d,p,h=t&s.F,v=t&s.G,g=t&s.S,y=t&s.P,m=t&s.B,b=v?r:g?r[e]||(r[e]={}):(r[e]||{})[a],x=v?i:i[e]||(i[e]={}),w=x[a]||(x[a]={});for(f in v&&(n=e),n)l=!h&&b&&void 0!==b[f],d=(l?b:n)[f],p=m&&l?c(d,r):y&&"function"==typeof d?c(Function.call,d):d,b&&u(b,f,d,t&s.U),x[f]!=d&&o(x,f,p),y&&w[f]!=d&&(w[f]=d)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"6a99":function(t,e,n){var r=n("d3f4");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},"6b54":function(t,e,n){"use strict";n("3846");var r=n("cb7c"),i=n("0bfb"),o=n("9e1e"),u="toString",c=/./[u],a=function(t){n("2aba")(RegExp.prototype,u,t,!0)};n("79e5")(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?a(function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&a(function(){return c.call(this)})},"6f8a":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},"72d6":function(t,e,n){var r=n("8a8d"),i=n("ad9a");function o(t,e){if(!(this instanceof o))return new o(t,e);if(this.node=this.start=this.peeked=t,this.root=e,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],t&&this.higher(t))throw new Error("root must be a parent or ancestor to node")}function u(t,e){var n="nextSibling"==t;return function(i,o,u){i=this.compile(i),o=o&&o>0?o:1;var c=this.node,a=this.closingTag,s=this._revisit;while(c){if(r(n,a)&&c[e])c=c[e],a=!n;else if(1==c.nodeType&&!c[e]&&r(n,a)){if(a=n,!s)continue}else if(c[t])c=c[t],a=!n;else if(c=c.parentNode,a=n,!s)continue;if(!c||this.higher(c,this.root))break;if(i(c)&&this.selects(c,u)&&this.rejects(c,u)){if(--o)continue;return u||(this.node=c),this.closingTag=a,c}}return null}}t.exports=o,o.prototype.reset=function(t){return this.node=t||this.start,this},o.prototype.revisit=function(t){return this._revisit=void 0==t||t,this},o.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},o.prototype.atOpening=function(){return!this.closingTag},o.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},o.prototype.atClosing=function(){return this.closingTag},o.prototype.next=u("nextSibling","firstChild"),o.prototype.previous=o.prototype.prev=u("previousSibling","lastChild"),o.prototype.select=function(t){return t=this.compile(t),this._selects.push(t),this},o.prototype.selects=function(t,e){var n=this._selects,r=n.length;if(!r)return!0;for(var i=0;i<r;i++)if(n[i].call(this,t,e))return!0;return!1},o.prototype.reject=function(t){return t=this.compile(t),this._rejects.push(t),this},o.prototype.rejects=function(t,e){var n=this._rejects,r=n.length;if(!r)return!0;for(var i=0;i<r;i++)if(n[i].call(this,t,e))return!1;return!0},o.prototype.higher=function(t){var e=this.root;if(!e)return!1;t=t.parentNode;while(t&&t!=e)t=t.parentNode;return t!=e},o.prototype.compile=function(t){switch(typeof t){case"number":return function(e){return t==e.nodeType};case"string":return new Function("node","return "+i(t,"node."));case"function":return t;default:return function(){return!0}}},o.prototype.peak=o.prototype.peek=function(t,e){return 1==arguments.length&&(e=t,t=!0),e=void 0==e?1:e,e?e>0?this.next(t,e,!0):this.prev(t,Math.abs(e),!0):this.node},o.prototype.use=function(t){return t(this),this}},"74a0":function(t,e,n){"use strict";
/*!

@@ -8,3 +8,3 @@ * escape-html

* MIT Licensed
*/var r=/["'&<>]/;function i(t){var e,n=""+t,i=r.exec(n);if(!i)return n;var o="",s=0,u=0;for(s=i.index;s<n.length;s++){switch(n.charCodeAt(s)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#39;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}u!==s&&(o+=n.substring(u,s)),u=s+1,o+=e}return u!==s?o+n.substring(u,s):o}t.exports=i},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},8378:function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"86cc":function(t,e,n){var r=n("cb7c"),i=n("c69a"),o=n("6a99"),s=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8a8d":function(t,e){function n(t,e){return t^e}t.exports=n},"954e":function(t,e,n){"use strict";var r,i=n("cf4f"),o={},s={default:{"&quot;":'"',"&#34;":'"',"&apos;":"'","&#39;":"'","&amp;":"&","&#38;":"&","&gt;":">","&#62;":">","&lt;":"<","&#60;":"<"},extras:{"&cent;":"¢","&#162;":"¢","&copy;":"©","&#169;":"©","&euro;":"€","&#8364;":"€","&pound;":"£","&#163;":"£","&reg;":"®","&#174;":"®","&yen;":"¥","&#165;":"¥"}};function u(t,e){if(!c(t))return"";var n=s[e||"default"],r=a(e,n);return t.replace(r,function(t){return n[t]})}function a(t,e){if(o[t])return o[t];var n=Object.keys(e).join("|"),r=new RegExp("(?=("+n+"))\\1","g");return o[t]=r,r}function c(t){return t&&"string"===typeof t}Object.defineProperty(s,"all",{get:function(){return r||(r=i({},s.default,s.extras))}}),u.chars=s.default,u.extras=s.extras,Object.defineProperty(u,"all",{get:function(){return s.all}}),t.exports=u},"9b43":function(t,e,n){var r=n("d8e8");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"9def":function(t,e,n){var r=n("4588"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},a481:function(t,e,n){n("214f")("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),s=void 0==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},n]})},aae3:function(t,e,n){var r=n("d3f4"),i=n("2d95"),o=n("2b4c")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},ad9a:function(t,e){var n=/\b(Array|Date|Object|Math|JSON)\b/g;function r(t){return t.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(n,"").match(/[a-zA-Z_]\w*/g)||[]}function i(t,e,n){var r=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return t.replace(r,function(t){return"("==t[t.length-1]?n(t):~e.indexOf(t)?n(t):t})}function o(t){for(var e=[],n=0;n<t.length;n++)~e.indexOf(t[n])||e.push(t[n]);return e}function s(t){return function(e){return t+e}}t.exports=function(t,e){var n=o(r(t));return e&&"string"==typeof e&&(e=s(e)),e?i(t,n,e):n}},aef6:function(t,e,n){"use strict";var r=n("5ca1"),i=n("9def"),o=n("d2c8"),s="endsWith",u=""[s];r(r.P+r.F*n("5147")(s),"String",{endsWith:function(t){var e=o(this,t,s),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),c=String(t);return u?u.call(e,c,a):e.slice(a-c.length,a)===c}})},b16a:function(t,e,n){"use strict";var r=n("b67f"),i=n.n(r);i.a},b67f:function(t,e,n){},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")(function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a})},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},cf4f:function(t,e,n){"use strict";var r=n("d913");function i(t,e){for(var n in e)o(e,n)&&(t[n]=e[n])}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t){r(t)||(t={});for(var e=arguments.length,n=1;n<e;n++){var o=arguments[n];r(o)&&i(t,o)}return t}},d2c8:function(t,e,n){var r=n("aae3"),i=n("be13");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d913:function(t,e,n){"use strict";
*/var r=/["'&<>]/;function i(t){var e,n=""+t,i=r.exec(n);if(!i)return n;var o="",u=0,c=0;for(u=i.index;u<n.length;u++){switch(n.charCodeAt(u)){case 34:e="&quot;";break;case 38:e="&amp;";break;case 39:e="&#39;";break;case 60:e="&lt;";break;case 62:e="&gt;";break;default:continue}c!==u&&(o+=n.substring(c,u)),c=u+1,o+=e}return c!==u?o+n.substring(c,u):o}t.exports=i},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"7d95":function(t,e,n){t.exports=!n("d782")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"82e3":function(t,e,n){n("3dcc"),t.exports=n("a7d3").Date.now},8378:function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"86cc":function(t,e,n){var r=n("cb7c"),i=n("c69a"),o=n("6a99"),u=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(c){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8a8d":function(t,e){function n(t,e){return t^e}t.exports=n},"8ce0":function(t,e,n){var r=n("3adc"),i=n("f845");t.exports=n("7d95")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"954e":function(t,e,n){"use strict";var r,i=n("cf4f"),o={},u={default:{"&quot;":'"',"&#34;":'"',"&apos;":"'","&#39;":"'","&amp;":"&","&#38;":"&","&gt;":">","&#62;":">","&lt;":"<","&#60;":"<"},extras:{"&cent;":"¢","&#162;":"¢","&copy;":"©","&#169;":"©","&euro;":"€","&#8364;":"€","&pound;":"£","&#163;":"£","&reg;":"®","&#174;":"®","&yen;":"¥","&#165;":"¥"}};function c(t,e){if(!s(t))return"";var n=u[e||"default"],r=a(e,n);return t.replace(r,function(t){return n[t]})}function a(t,e){if(o[t])return o[t];var n=Object.keys(e).join("|"),r=new RegExp("(?=("+n+"))\\1","g");return o[t]=r,r}function s(t){return t&&"string"===typeof t}Object.defineProperty(u,"all",{get:function(){return r||(r=i({},u.default,u.extras))}}),c.chars=u.default,c.extras=u.extras,Object.defineProperty(c,"all",{get:function(){return u.all}}),t.exports=c},"9b43":function(t,e,n){var r=n("d8e8");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"9def":function(t,e,n){var r=n("4588"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},a47f:function(t,e,n){t.exports=!n("7d95")&&!n("d782")(function(){return 7!=Object.defineProperty(n("12fd")("div"),"a",{get:function(){return 7}}).a})},a481:function(t,e,n){n("214f")("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,o,i):n.call(String(o),r,i)},n]})},a7d3:function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},aae3:function(t,e,n){var r=n("d3f4"),i=n("2d95"),o=n("2b4c")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},ad9a:function(t,e){var n=/\b(Array|Date|Object|Math|JSON)\b/g;function r(t){return t.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^\/]+)\//g,"").replace(n,"").match(/[a-zA-Z_]\w*/g)||[]}function i(t,e,n){var r=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^\/]+)\/|[a-zA-Z_]\w*/g;return t.replace(r,function(t){return"("==t[t.length-1]?n(t):~e.indexOf(t)?n(t):t})}function o(t){for(var e=[],n=0;n<t.length;n++)~e.indexOf(t[n])||e.push(t[n]);return e}function u(t){return function(e){return t+e}}t.exports=function(t,e){var n=o(r(t));return e&&"string"==typeof e&&(e=u(e)),e?i(t,n,e):n}},aef6:function(t,e,n){"use strict";var r=n("5ca1"),i=n("9def"),o=n("d2c8"),u="endsWith",c=""[u];r(r.P+r.F*n("5147")(u),"String",{endsWith:function(t){var e=o(this,t,u),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),s=String(t);return c?c.call(e,s,a):e.slice(a-s.length,a)===s}})},b16a:function(t,e,n){"use strict";var r=n("412e"),i=n.n(r);i.a},bc25:function(t,e,n){var r=n("f2fe");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")(function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a})},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},cf4f:function(t,e,n){"use strict";var r=n("d913");function i(t,e){for(var n in e)o(e,n)&&(t[n]=e[n])}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t){r(t)||(t={});for(var e=arguments.length,n=1;n<e;n++){var o=arguments[n];r(o)&&i(t,o)}return t}},d13f:function(t,e,n){var r=n("da3c"),i=n("a7d3"),o=n("bc25"),u=n("8ce0"),c=n("43c8"),a="prototype",s=function(t,e,n){var f,l,d,p=t&s.F,h=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,m=t&s.W,b=h?i:i[e]||(i[e]={}),x=b[a],w=h?r:v?r[e]:(r[e]||{})[a];for(f in h&&(n=e),n)l=!p&&w&&void 0!==w[f],l&&c(b,f)||(d=l?w[f]:n[f],b[f]=h&&"function"!=typeof w[f]?n[f]:y&&l?o(d,r):m&&w[f]==d?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[a]=t[a],e}(d):g&&"function"==typeof d?o(Function.call,d):d,g&&((b.virtual||(b.virtual={}))[f]=d,t&s.R&&x&&!x[f]&&u(x,f,d)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},d2c8:function(t,e,n){var r=n("aae3"),i=n("be13");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d782:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d913:function(t,e,n){"use strict";
/*!

@@ -15,3 +15,3 @@ * is-extendable <https://github.com/jonschlinkert/is-extendable>

* Licensed under the MIT License.
*/t.exports=function(t){return"undefined"!==typeof t&&null!==t&&("object"===typeof t||"function"===typeof t)}},fb15:function(t,e,n){"use strict";n.r(e);n("1eb2");var r=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{staticClass:"prism-editor-wrapper"},[e.lineNumbers?r("div",{staticClass:"prism-editor__line-numbers",style:{"min-height":e.lineNumbersHeight},attrs:{"aria-hidden":"true"}},[r("div",{staticClass:"prism-editor__line-width-calc",staticStyle:{height:"0px",visibility:"hidden","pointer-events":"none"}},[e._v("999")]),e._l(e.lineNumbersCount,function(t){return r("div",{key:t,staticClass:"prism-editor__line-number token comment"},[e._v(e._s(t))])})],2):e._e(),r("pre",{ref:"pre",staticClass:"prism-editor__code",class:(t={},t["language-"+e.language]=!0,t),attrs:{contenteditable:!e.readonly,spellCheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","data-gramm":"false"},domProps:{innerHTML:e._s(e.content)},on:{keydown:e.handleKeyDown,keyup:e.handleKeyUp,click:e.handleClick}})])},i=[],o=(n("aef6"),n("28a5"),n("74a0")),s=n.n(o);function u(t,e){return"text"===e&&(t=s()(t)),"<code>".concat(t,"</code>")}var a=function(t,e){if(!e)return u(t,"text");e=e.toLowerCase();var n=e;if("vue"!==e&&"html"!==e||(e="markup"),"md"===e&&(e="markdown"),"ts"===e&&(e="typescript"),Prism.languages[e]){var r=Prism.highlight(t,Prism.languages[e],e);return u(r,n)}return u(t,"text")},c=(n("a481"),function(t){return t.replace("\n","<br>")}),f=c,l=n("954e"),d=n.n(l),p=function(t){return d()(t.replace(/<br>/gm,"\n").replace(/<\/?[^>]*>/gm,""))},h=p,v=(n("6b54"),n("72d6")),g=n.n(v);function m(t,e){var n=window.getSelection();if(1==arguments.length){if(!n.rangeCount)return;var r={},i=n.getRangeAt(0),o=i.cloneRange();return o.selectNodeContents(t),o.setEnd(i.endContainer,i.endOffset),r.end=o.toString().length,o.setStart(i.startContainer,i.startOffset),r.start=r.end-o.toString().length,r.atStart=0===o.startOffset,r.commonAncestorContainer=o.commonAncestorContainer,r.endContainer=o.endContainer,r.startContainer=o.startContainer,r}var s,u,a=e.end&&e.end!==e.start,c=0,f=(i=document.createRange(),g()(t).select(Node.TEXT_NODE).revisit(!1)),l=e.start>t.textContent.length?t.textContent.length:e.start,d=e.end>t.textContent.length?t.textContent.length:e.end,p=e.atStart;while(s=f.next()){var h=c;c+=s.textContent.length;var v=p?c>l:c>=l;if(!u&&v&&(u=!0,i.setStart(s,l-h),!a)){i.collapse(!0),y(t,i);break}if(a&&c>=d){i.setEnd(s,d-h),y(t,i);break}}}function y(t,e){var n=window.getSelection();t.focus(),n.removeAllRanges(),n.addRange(e)}var b=m,x=(n("4917"),function(t,e){var n=t.slice(0,e),r=n.lastIndexOf("\n")+1,i=n.slice(r);return i}),_=/^\s+/,S=function(t,e){var n=x(t,e),r=n.match(_);return null===r?"":r[0]||""},C=/^(\t| {2})* {2}$/,k=function(t,e){var n=x(t,e);return C.test(n)?2:0},w={model:{prop:"code",event:"change"},props:{emitEvents:{type:Boolean,default:!1},language:{type:String,default:"js"},lineNumbers:{type:Boolean,default:!1},autoStyleLineNumbers:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},code:{type:String,default:""}},data:function(){return{undoStack:[],selection:void 0,lineNumbersHeight:"20px",undoOffset:0,undoTimestamp:0,lastPos:0,codeData:""}},watch:{code:{immediate:!0,handler:function(t){this.codeData=t}},content:{immediate:!0,handler:function(){var t=this;this.lineNumbers&&this.$nextTick(function(){t.setLineNumbersHeight()})}},lineNumbers:function(){var t=this;this.$nextTick(function(){t.styleLineNumbers(),t.setLineNumbersHeight()})}},computed:{content:function(){return a(this.codeData,this.language)},lineNumbersCount:function(){var t=this.codeData.split(/\r\n|\n/).length;return this.codeData.endsWith("\n")&&t--,t}},updated:function(){this.selection&&b(this.$refs.pre,this.selection)},mounted:function(){var t=this;this.recordChange(this.getPlain()),this.undoTimestamp=0,this.styleLineNumbers();var e=function(e){e.preventDefault();var n=b(t.$refs.pre),r=(e.originalEvent||e).clipboardData.getData("Text");document.execCommand("insertHTML",!1,s()(r));var i=n.end+r.length;t.selection={start:i,end:i};var o=t.getPlain();t.recordChange(o,t.selection),t.updateContent(o),t.setLineNumbersHeight()},n=this.$refs.pre;n.addEventListener("paste",e),this.$once("hook:beforeDestroy",function(){n.removeEventListener("paste",e)})},methods:{setLineNumbersHeight:function(){this.lineNumbersHeight=getComputedStyle(this.$refs.pre).height},styleLineNumbers:function(){if(this.lineNumbers&&this.autoStyleLineNumbers){var t=this.$refs.pre,e=this.$el.querySelector(".prism-editor__line-numbers"),n=window.getComputedStyle(t);this.$nextTick(function(){var r="border-top-left-radius",i="border-bottom-left-radius";e.style[r]=n[r],e.style[i]=n[i],t.style[r]=0,t.style[i]=0;var o=["background-color","margin-top","padding-top","font-family","font-size","line-height"];o.forEach(function(t){e.style[t]=n[t]}),e.style["margin-bottom"]="-"+n["padding-top"]})}},handleClick:function(t){this.emitEvents&&this.$emit("editorClick",t),this.undoTimestamp=0,this.selection=b(this.$refs.pre)},getPlain:function(){if(this._innerHTML===this.$refs.pre.innerHTML)return this._plain;var t=h(f(this.$refs.pre.innerHTML));return this._innerHTML=this.$refs.pre.innerHTML,this._plain=t,this._plain},recordChange:function(t,e){if(t!==this.undoStack[this.undoStack.length-1]){this.undoOffset>0&&(this.undoStack=this.undoStack.slice(0,-this.undoOffset),this.undoOffset=0);var n=Date.now(),r={plain:t,selection:e};n-this.undoTimestamp<3e3?this.undoStack[this.undoStack.length-1]=r:(this.undoStack.push(r),this.undoStack.length>50&&this.undoStack.shift()),this.undoTimestamp=n}},updateContent:function(t){this.$emit("change",t)},restoreStackState:function(t){var e=this.undoStack[this.undoStack.length-1-t],n=e.plain,r=e.selection;this.selection=r,this.undoOffset=t,this.updateContent(n)},undo:function(){var t=this.undoOffset+1;t>=this.undoStack.length||this.restoreStackState(t)},redo:function(){var t=this.undoOffset-1;t<0||this.restoreStackState(t)},handleKeyDown:function(t){if(this.emitEvents&&this.$emit("keydown",t),9!==t.keyCode||this.ignoreTabKey)if(8===t.keyCode){var e=b(this.$refs.pre),n=e.start,r=e.end;if(n!==r)return;var i=k(this.$refs.pre.innerText,n);if(i<=0)return;for(var o=0;o<i;o++)document.execCommand("delete",!1);t.preventDefault()}else if(13===t.keyCode){var s=b(this.$refs.pre),u=s.start,a=S(this.$refs.pre.innerText,u);document.execCommand("insertHTML",!1,"\n "+a),document.execCommand("delete",!1),t.preventDefault()}else 90!==t.keyCode||t.metaKey===t.ctrlKey||t.altKey||(t.shiftKey?this.redo():this.undo(),t.preventDefault());else document.execCommand("insertHTML",!1," "),t.preventDefault()},handleKeyUp:function(t){if(this.emitEvents&&this.$emit("keyup",t),91!==t.keyCode&&93!==t.keyCode&&!t.ctrlKey&&!t.metaKey)if(13===t.keyCode&&(this.undoTimestamp=0),this.selection=b(this.$refs.pre),37!==t.keyCode&&38!==t.keyCode&&39!==t.keyCode&&40!==t.keyCode){var e=this.getPlain();this.recordChange(e,this.selection),this.updateContent(e)}else this.undoTimestamp=0}}},T=w;n("b16a");function E(t,e,n,r,i,o,s,u){var a,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=a):i&&(a=u?function(){i.call(this,this.$root.$options.shadowRoot)}:i),a)if(c.functional){c._injectStyles=a;var f=c.render;c.render=function(t,e){return a.call(e),f(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,a):[a]}return{exports:t,options:c}}var O=E(T,r,i,!1,null,null,null);O.options.__file="Editor.vue";var j=O.exports;e["default"]=j}})["default"]});
*/t.exports=function(t){return"undefined"!==typeof t&&null!==t&&("object"===typeof t||"function"===typeof t)}},da3c:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},f2fe:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},f845:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},fb15:function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var i=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{staticClass:"prism-editor-wrapper"},[e.lineNumbers?r("div",{staticClass:"prism-editor__line-numbers",style:{"min-height":e.lineNumbersHeight},attrs:{"aria-hidden":"true"}},[r("div",{staticClass:"prism-editor__line-width-calc",staticStyle:{height:"0px",visibility:"hidden","pointer-events":"none"}},[e._v("\n 999\n ")]),e._l(e.lineNumbersCount,function(t){return r("div",{key:t,staticClass:"prism-editor__line-number token comment"},[e._v("\n "+e._s(t)+"\n ")])})],2):e._e(),r("pre",{ref:"pre",staticClass:"prism-editor__code",class:(t={},t["language-"+e.language]=!0,t),attrs:{contenteditable:!e.readonly,spellCheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","data-gramm":"false"},domProps:{innerHTML:e._s(e.content)},on:{keydown:e.handleKeyDown,keyup:e.handleKeyUp,click:e.handleClick}})])},o=[],u=n("0a0d"),c=n.n(u),a=(n("aef6"),n("28a5"),n("74a0")),s=n.n(a);function f(t,e){return"text"===e&&(t=s()(t)),"<code>".concat(t,"</code>")}var l=function(t,e){if(!e)return f(t,"text");e=e.toLowerCase();var n=e;if("vue"!==e&&"html"!==e||(e="markup"),"md"===e&&(e="markdown"),"ts"===e&&(e="typescript"),Prism.languages[e]){var r=Prism.highlight(t,Prism.languages[e],e);return f(r,n)}return f(t,"text")},d=(n("a481"),function(t){return t.replace("\n","<br>")}),p=d,h=n("954e"),v=n.n(h),g=function(t){return v()(t.replace(/<br>/gm,"\n").replace(/<\/?[^>]*>/gm,""))},y=g,m=(n("6b54"),n("72d6")),b=n.n(m);function x(t,e){var n=window.getSelection();if(1==arguments.length){if(!n.rangeCount)return;var r={},i=n.getRangeAt(0),o=i.cloneRange();return o.selectNodeContents(t),o.setEnd(i.endContainer,i.endOffset),r.end=o.toString().length,o.setStart(i.startContainer,i.startOffset),r.start=r.end-o.toString().length,r.atStart=0===o.startOffset,r.commonAncestorContainer=o.commonAncestorContainer,r.endContainer=o.endContainer,r.startContainer=o.startContainer,r}var u,c,a=e.end&&e.end!==e.start,s=0,f=(i=document.createRange(),b()(t).select(Node.TEXT_NODE).revisit(!1)),l=e.start>t.textContent.length?t.textContent.length:e.start,d=e.end>t.textContent.length?t.textContent.length:e.end,p=e.atStart;while(u=f.next()){var h=s;s+=u.textContent.length;var v=p?s>l:s>=l;if(!c&&v&&(c=!0,i.setStart(u,l-h),!a)){i.collapse(!0),w(t,i);break}if(a&&s>=d){i.setEnd(u,d-h),w(t,i);break}}}function w(t,e){var n=window.getSelection();t.focus(),n.removeAllRanges(),n.addRange(e)}var _=x,S=(n("4917"),function(t,e){var n=t.slice(0,e),r=n.lastIndexOf("\n")+1,i=n.slice(r);return i}),C=/^\s+/,k=function(t,e){var n=S(t,e),r=n.match(C);return null===r?"":r[0]||""},T=/^(\t| {2})* {2}$/,E=function(t,e){var n=S(t,e);return T.test(n)?2:0},O={model:{prop:"code",event:"change"},props:{emitEvents:{type:Boolean,default:!1},language:{type:String,default:"js"},lineNumbers:{type:Boolean,default:!1},autoStyleLineNumbers:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},code:{type:String,default:""}},data:function(){return{undoStack:[],selection:void 0,lineNumbersHeight:"20px",undoOffset:0,undoTimestamp:0,lastPos:0,codeData:"",composing:!1}},watch:{code:{immediate:!0,handler:function(t){this.codeData=t||""}},content:{immediate:!0,handler:function(){var t=this;this.lineNumbers&&this.$nextTick(function(){t.setLineNumbersHeight()})}},lineNumbers:function(){var t=this;this.$nextTick(function(){t.styleLineNumbers(),t.setLineNumbersHeight()})}},computed:{content:function(){return l(this.codeData,this.language)},lineNumbersCount:function(){var t=this.codeData.split(/\r\n|\n/).length;return this.codeData.endsWith("\n")&&t--,t}},updated:function(){this.selection&&_(this.$refs.pre,this.selection)},mounted:function(){var t=this;this.recordChange(this.getPlain()),this.undoTimestamp=0,this.styleLineNumbers();var e=function(e){e.preventDefault();var n=_(t.$refs.pre),r=(e.originalEvent||e).clipboardData.getData("Text");document.execCommand("insertHTML",!1,s()(r));var i=n.end+r.length;t.selection={start:i,end:i};var o=t.getPlain();t.recordChange(o,t.selection),t.updateContent(o),t.setLineNumbersHeight()},n=this.$refs.pre;n.addEventListener("paste",e),this.$once("hook:beforeDestroy",function(){n.removeEventListener("paste",e)}),n.addEventListener("compositionstart",function(){t.composing=!0}),n.addEventListener("compositionend",function(){t.composing=!1})},methods:{setLineNumbersHeight:function(){this.lineNumbersHeight=getComputedStyle(this.$refs.pre).height},styleLineNumbers:function(){if(this.lineNumbers&&this.autoStyleLineNumbers){var t=this.$refs.pre,e=this.$el.querySelector(".prism-editor__line-numbers"),n=window.getComputedStyle(t);this.$nextTick(function(){var r="border-top-left-radius",i="border-bottom-left-radius";e.style[r]=n[r],e.style[i]=n[i],t.style[r]=0,t.style[i]=0;var o=["background-color","margin-top","padding-top","font-family","font-size","line-height"];o.forEach(function(t){e.style[t]=n[t]}),e.style["margin-bottom"]="-"+n["padding-top"]})}},handleClick:function(t){this.emitEvents&&this.$emit("editorClick",t),this.undoTimestamp=0,this.selection=_(this.$refs.pre)},getPlain:function(){if(this._innerHTML===this.$refs.pre.innerHTML)return this._plain;var t=y(p(this.$refs.pre.innerHTML));return this._innerHTML=this.$refs.pre.innerHTML,this._plain=t,this._plain},recordChange:function(t,e){if(t!==this.undoStack[this.undoStack.length-1]){this.undoOffset>0&&(this.undoStack=this.undoStack.slice(0,-this.undoOffset),this.undoOffset=0);var n=c()(),r={plain:t,selection:e};n-this.undoTimestamp<3e3?this.undoStack[this.undoStack.length-1]=r:(this.undoStack.push(r),this.undoStack.length>50&&this.undoStack.shift()),this.undoTimestamp=n}},updateContent:function(t){this.$emit("change",t)},restoreStackState:function(t){var e=this.undoStack[this.undoStack.length-1-t],n=e.plain,r=e.selection;this.selection=r,this.undoOffset=t,this.updateContent(n)},undo:function(){var t=this.undoOffset+1;t>=this.undoStack.length||this.restoreStackState(t)},redo:function(){var t=this.undoOffset-1;t<0||this.restoreStackState(t)},handleKeyDown:function(t){if(this.emitEvents&&this.$emit("keydown",t),9!==t.keyCode||this.ignoreTabKey)if(8===t.keyCode){var e=_(this.$refs.pre),n=e.start,r=e.end;if(n!==r)return;var i=E(this.$refs.pre.innerText,n);if(i<=0)return;for(var o=0;o<i;o++)document.execCommand("delete",!1);t.preventDefault()}else if(13===t.keyCode){var u=_(this.$refs.pre),c=u.start,a=k(this.$refs.pre.innerText,c);document.execCommand("insertHTML",!1,"\n "+a),document.execCommand("delete",!1),t.preventDefault()}else 90!==t.keyCode||t.metaKey===t.ctrlKey||t.altKey||(t.shiftKey?this.redo():this.undo(),t.preventDefault());else document.execCommand("insertHTML",!1," "),t.preventDefault()},handleKeyUp:function(t){var e=t.which;if(this.composing){if(13!==e)return;this.composing=!1}if(this.emitEvents&&this.$emit("keyup",t),91!==t.keyCode&&93!==t.keyCode&&!t.ctrlKey&&!t.metaKey)if(13===t.keyCode&&(this.undoTimestamp=0),this.selection=_(this.$refs.pre),37!==t.keyCode&&38!==t.keyCode&&39!==t.keyCode&&40!==t.keyCode){var n=this.getPlain();this.recordChange(n,this.selection),this.updateContent(n)}else this.undoTimestamp=0}}},j=O;n("b16a");function P(t,e,n,r,i,o,u,c){var a,s="function"===typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),r&&(s.functional=!0),o&&(s._scopeId="data-v-"+o),u?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},s._ssrRegister=a):i&&(a=c?function(){i.call(this,this.$root.$options.shadowRoot)}:i),a)if(s.functional){s._injectStyles=a;var f=s.render;s.render=function(t,e){return a.call(e),f(t,e)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,a):[a]}return{exports:t,options:s}}var $=P(j,i,o,!1,null,null,null),N=$.exports;e["default"]=N}})["default"]});
//# sourceMappingURL=VuePrismEditor.umd.min.js.map
{
"name": "vue-prism-editor",
"version": "0.2.0",
"version": "0.2.1",
"scripts": {

@@ -66,11 +66,16 @@ "serve": "vue-cli-service serve",

"lint-staged": {
"*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
"linters": {
"*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
},
"ignore": [
"dist/*"
]
}
}

@@ -72,2 +72,10 @@ import { mount } from "@vue/test-utils";

it("renders with null value", () => {
const code = null;
const wrapper = mount(Editor, {
propsData: { code }
});
expect(wrapper.html()).toMatchSnapshot();
});
it("emits keyup event", () => {

@@ -74,0 +82,0 @@ const mockHandler = jest.fn();

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc