(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-66bd7591"],{"04e1":function(t,e,n){"use strict";var r=n("7afa");function o(t){this.message=t}o.prototype=new Error,o.prototype.name="InvalidTokenError",t.exports=function(t,e){if("string"!==typeof t)throw new o("Invalid token specified");e=e||{};var n=!0===e.header?0:1;try{return JSON.parse(r(t.split(".")[n]))}catch(i){throw new o("Invalid token specified: "+i.message)}},t.exports.InvalidTokenError=o},"072d9":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return t.route?e("router-link",{class:t.styles,attrs:{to:t.route}},[t._t("default")],2):e("a",{class:t.styles,attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleClick.apply(null,arguments)}}},[t._t("default")],2)},o=[],i=n("d73f"),s=n("3843"),a=Object(i["a"])(s["a"]),c=a,l=n("2fc8"),u=n("fcfb"),h=n("f0dc"),f=n("248e"),p=n("931f"),d=Object(l["a"])((function(t,e){if(Object(u["a"])(t)){if(Object(u["a"])(e))return t.concat(e);throw new TypeError(Object(p["a"])(e)+" is not an array")}if(Object(f["a"])(t)){if(Object(f["a"])(e))return t+e;throw new TypeError(Object(p["a"])(e)+" is not a string")}if(null!=t&&Object(h["a"])(t["fantasy-land/concat"]))return t["fantasy-land/concat"](e);if(null!=t&&Object(h["a"])(t.concat))return t.concat(e);throw new TypeError(Object(p["a"])(t)+' does not have a method named "concat" or "fantasy-land/concat"')})),m=d,g={props:{type:{type:String,default:"default"},size:{type:String,default:"base"},route:{type:[String,Object]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!1}},computed:{styles:function(){var t=["button-transition","inline-block","font-bold","rounded"],e={small:["text-xs","px-4","py-2"],base:["text-sm","px-4","py-2"],large:["text-base","px-6","py-3"]},n=this.disabled?{default:[],primary:[],success:[],danger:[],text:[]}:{default:["text-white","bg-gray-500","hover:bg-gray-600"],primary:["text-black","bg-green-500","hover:bg-green-700"],success:["text-black","bg-green-500","hover:bg-green-700"],danger:["text-white","bg-red-500","hover:bg-red-700"],normal:["text-black, ","bg-gray-200","hover:bg-gray-400"],secondary:["text-black","bg-white","hover:bg-gray-300"],text:["text-gray-500","hover:bg-white","hover:text-gray-600"]},r=this.disabled?["bg-gray-300","hover:bg-gray-300","text-gray-600","cursor-default"]:[],o=this.uppercase?["uppercase"]:[];return c(m,[],[t,e[this.size],n[this.type],r,o])}},methods:{handleClick:function(){this.disabled||this.$emit("click")}}},y=g,v=(n("d663"),n("2877")),w=Object(v["a"])(y,r,o,!1,null,"5d46a938",null);e["a"]=w.exports},"073e":function(t,e,n){"use strict";var r=n("5dbe"),o=i(Error);function i(t){return e.displayName=t.displayName||t.name,e;function e(e){return e&&(e=r.apply(null,arguments)),new t(e)}}t.exports=o,o.eval=i(EvalError),o.range=i(RangeError),o.reference=i(ReferenceError),o.syntax=i(SyntaxError),o.type=i(TypeError),o.uri=i(URIError),o.create=i},"0a06":function(t,e,n){"use strict";var r=n("c532"),o=n("30b5"),i=n("f6b4"),s=n("5270"),a=n("4a7b");function c(t){this.defaults=t,this.interceptors={request:new i,response:new i}}c.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=a(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],n=Promise.resolve(t);this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));while(e.length)n=n.then(e.shift(),e.shift());return n},c.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}})),r.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}})),t.exports=c},"0df6":function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"0f53":function(t,e,n){},1020:function(t,e){function n(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(e){var r=t[e];"object"!=typeof r||Object.isFrozen(r)||n(r)})),t}var r=n,o=n;r.default=o;class i{constructor(t){void 0===t.data&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach((function(t){for(const e in t)n[e]=t[e]})),n}const c="</span>",l=t=>!!t.kind;class u{constructor(t,e){this.buffer="",this.classPrefix=e.classPrefix,t.walk(this)}addText(t){this.buffer+=s(t)}openNode(t){if(!l(t))return;let e=t.kind;t.sublanguage||(e=`${this.classPrefix}${e}`),this.span(e)}closeNode(t){l(t)&&(this.buffer+=c)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}class h{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const e={kind:t,children:[]};this.add(e),this.stack.push(e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,e){return"string"===typeof e?t.addText(e):e.children&&(t.openNode(e),e.children.forEach(e=>this._walk(t,e)),t.closeNode(e)),t}static _collapse(t){"string"!==typeof t&&t.children&&(t.children.every(t=>"string"===typeof t)?t.children=[t.children.join("")]:t.children.forEach(t=>{h._collapse(t)}))}}class f extends h{constructor(t){super(),this.options=t}addKeyword(t,e){""!==t&&(this.openNode(e),this.addText(t),this.closeNode())}addText(t){""!==t&&this.add(t)}addSublanguage(t,e){const n=t.root;n.kind=e,n.sublanguage=!0,this.add(n)}toHTML(){const t=new u(this,this.options);return t.value()}finalize(){return!0}}function p(t){return new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function d(t){return t?"string"===typeof t?t:t.source:null}function m(...t){const e=t.map(t=>d(t)).join("");return e}function g(...t){const e="("+t.map(t=>d(t)).join("|")+")";return e}function y(t){return new RegExp(t.toString()+"|").exec("").length-1}function v(t,e){const n=t&&t.exec(e);return n&&0===n.index}const w=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(t,e="|"){let n=0;return t.map(t=>{n+=1;const e=n;let r=d(t),o="";while(r.length>0){const t=w.exec(r);if(!t){o+=r;break}o+=r.substring(0,t.index),r=r.substring(t.index+t[0].length),"\\"===t[0][0]&&t[1]?o+="\\"+String(Number(t[1])+e):(o+=t[0],"("===t[0]&&n++)}return o}).map(t=>`(${t})`).join(e)}const x=/\b\B/,k="[a-zA-Z]\\w*",S="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",E="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",C="\\b(0b[01]+)",N="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",M=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=m(e,/.*\b/,t.binary,/\b.*/)),a({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,e)=>{0!==t.index&&e.ignoreMatch()}},t)},T={begin:"\\\\[\\s\\S]",relevance:0},L={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[T]},A={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[T]},D={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},_=function(t,e,n={}){const r=a({className:"comment",begin:t,end:e,contains:[]},n);return r.contains.push(D),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},j=_("//","$"),P=_("/\\*","\\*/"),R=_("#","$"),I={className:"number",begin:O,relevance:0},$={className:"number",begin:E,relevance:0},B={className:"number",begin:C,relevance:0},z={className:"number",begin:O+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},F={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[T,{begin:/\[/,end:/\]/,relevance:0,contains:[T]}]}]},V={className:"title",begin:k,relevance:0},U={className:"title",begin:S,relevance:0},q={begin:"\\.\\s*"+S,relevance:0},G=function(t){return Object.assign(t,{"on:begin":(t,e)=>{e.data._beginMatch=t[1]},"on:end":(t,e)=>{e.data._beginMatch!==t[1]&&e.ignoreMatch()}})};var H=Object.freeze({__proto__:null,MATCH_NOTHING_RE:x,IDENT_RE:k,UNDERSCORE_IDENT_RE:S,NUMBER_RE:O,C_NUMBER_RE:E,BINARY_NUMBER_RE:C,RE_STARTERS_RE:N,SHEBANG:M,BACKSLASH_ESCAPE:T,APOS_STRING_MODE:L,QUOTE_STRING_MODE:A,PHRASAL_WORDS_MODE:D,COMMENT:_,C_LINE_COMMENT_MODE:j,C_BLOCK_COMMENT_MODE:P,HASH_COMMENT_MODE:R,NUMBER_MODE:I,C_NUMBER_MODE:$,BINARY_NUMBER_MODE:B,CSS_NUMBER_MODE:z,REGEXP_MODE:F,TITLE_MODE:V,UNDERSCORE_TITLE_MODE:U,METHOD_GUARD:q,END_SAME_AS_BEGIN:G});function J(t,e){const n=t.input[t.index-1];"."===n&&e.ignoreMatch()}function W(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=J,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,void 0===t.relevance&&(t.relevance=0))}function K(t,e){Array.isArray(t.illegal)&&(t.illegal=g(...t.illegal))}function Y(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function X(t,e){void 0===t.relevance&&(t.relevance=1)}const Z=["of","and","for","in","not","or","if","then","parent","list","value"],Q="keyword";function tt(t,e,n=Q){const r={};return"string"===typeof t?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach((function(n){Object.assign(r,tt(t[n],e,n))})),r;function o(t,n){e&&(n=n.map(t=>t.toLowerCase())),n.forEach((function(e){const n=e.split("|");r[n[0]]=[t,et(n[0],n[1])]}))}}function et(t,e){return e?Number(e):nt(t)?0:1}function nt(t){return Z.includes(t.toLowerCase())}function rt(t,{plugins:e}){function n(e,n){return new RegExp(d(e),"m"+(t.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(t,e){e.position=this.position++,this.matchIndexes[this.matchAt]=e,this.regexes.push([e,t]),this.matchAt+=y(t)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const t=this.regexes.map(t=>t[1]);this.matcherRe=n(b(t),!0),this.lastIndex=0}exec(t){this.matcherRe.lastIndex=this.lastIndex;const e=this.matcherRe.exec(t);if(!e)return null;const n=e.findIndex((t,e)=>e>0&&void 0!==t),r=this.matchIndexes[n];return e.splice(0,n),Object.assign(e,r)}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(t){if(this.multiRegexes[t])return this.multiRegexes[t];const e=new r;return this.rules.slice(t).forEach(([t,n])=>e.addRule(t,n)),e.compile(),this.multiRegexes[t]=e,e}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(t,e){this.rules.push([t,e]),"begin"===e.type&&this.count++}exec(t){const e=this.getMatcher(this.regexIndex);e.lastIndex=this.lastIndex;let n=e.exec(t);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const e=this.getMatcher(0);e.lastIndex=this.lastIndex+1,n=e.exec(t)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(t){const e=new o;return t.contains.forEach(t=>e.addRule(t.begin,{rule:t,type:"begin"})),t.terminatorEnd&&e.addRule(t.terminatorEnd,{type:"end"}),t.illegal&&e.addRule(t.illegal,{type:"illegal"}),e}function s(e,r){const o=e;if(e.isCompiled)return o;[Y].forEach(t=>t(e,r)),t.compilerExtensions.forEach(t=>t(e,r)),e.__beforeBegin=null,[W,K,X].forEach(t=>t(e,r)),e.isCompiled=!0;let a=null;if("object"===typeof e.keywords&&(a=e.keywords.$pattern,delete e.keywords.$pattern),e.keywords&&(e.keywords=tt(e.keywords,t.case_insensitive)),e.lexemes&&a)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return a=a||e.lexemes||/\w+/,o.keywordPatternRe=n(a,!0),r&&(e.begin||(e.begin=/\B|\b/),o.beginRe=n(e.begin),e.endSameAsBegin&&(e.end=e.begin),e.end||e.endsWithParent||(e.end=/\B|\b/),e.end&&(o.endRe=n(e.end)),o.terminatorEnd=d(e.end)||"",e.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(e.end?"|":"")+r.terminatorEnd)),e.illegal&&(o.illegalRe=n(e.illegal)),e.contains||(e.contains=[]),e.contains=[].concat(...e.contains.map((function(t){return it("self"===t?e:t)}))),e.contains.forEach((function(t){s(t,o)})),e.starts&&s(e.starts,r),o.matcher=i(o),o}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return t.classNameAliases=a(t.classNameAliases||{}),s(t)}function ot(t){return!!t&&(t.endsWithParent||ot(t.starts))}function it(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map((function(e){return a(t,{variants:null},e)}))),t.cachedVariants?t.cachedVariants:ot(t)?a(t,{starts:t.starts?a(t.starts):null}):Object.isFrozen(t)?a(t):t}var st="10.7.3";function at(t){return Boolean(t||""===t)}function ct(t){const e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!t.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,s(this.code);let e={};return this.autoDetect?(e=t.highlightAuto(this.code),this.detectedLanguage=e.language):(e=t.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),e.value},autoDetect(){return!this.language||at(this.autodetect)},ignoreIllegals(){return!0}},render(t){return t("pre",{},[t("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}},n={install(t){t.component("highlightjs",e)}};return{Component:e,VuePlugin:n}}const lt={"after:highlightElement":({el:t,result:e,text:n})=>{const r=ht(t);if(!r.length)return;const o=document.createElement("div");o.innerHTML=e.value,e.value=ft(r,ht(o),n)}};function ut(t){return t.nodeName.toLowerCase()}function ht(t){const e=[];return function t(n,r){for(let o=n.firstChild;o;o=o.nextSibling)3===o.nodeType?r+=o.nodeValue.length:1===o.nodeType&&(e.push({event:"start",offset:r,node:o}),r=t(o,r),ut(o).match(/br|hr|img|input/)||e.push({event:"stop",offset:r,node:o}));return r}(t,0),e}function ft(t,e,n){let r=0,o="";const i=[];function a(){return t.length&&e.length?t[0].offset!==e[0].offset?t[0].offset<e[0].offset?t:e:"start"===e[0].event?t:e:t.length?t:e}function c(t){function e(t){return" "+t.nodeName+'="'+s(t.value)+'"'}o+="<"+ut(t)+[].map.call(t.attributes,e).join("")+">"}function l(t){o+="</"+ut(t)+">"}function u(t){("start"===t.event?c:l)(t.node)}while(t.length||e.length){let e=a();if(o+=s(n.substring(r,e[0].offset)),r=e[0].offset,e===t){i.reverse().forEach(l);do{u(e.splice(0,1)[0]),e=a()}while(e===t&&e.length&&e[0].offset===r);i.reverse().forEach(c)}else"start"===e[0].event?i.push(e[0].node):i.pop(),u(e.splice(0,1)[0])}return o+s(n.substr(r))}const pt={},dt=t=>{console.error(t)},mt=(t,...e)=>{console.log("WARN: "+t,...e)},gt=(t,e)=>{pt[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),pt[`${t}/${e}`]=!0)},yt=s,vt=a,wt=Symbol("nomatch"),bt=function(t){const e=Object.create(null),n=Object.create(null),o=[];let s=!0;const a=/(^(<[^>]+>|\t|)+|\n)/gm,c="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let u={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:f};function h(t){return u.noHighlightRe.test(t)}function d(t){let e=t.className+" ";e+=t.parentNode?t.parentNode.className:"";const n=u.languageDetectRe.exec(e);if(n){const e=R(n[1]);return e||(mt(c.replace("{}",n[1])),mt("Falling back to no-highlight mode for this block.",t)),e?n[1]:"no-highlight"}return e.split(/\s+/).find(t=>h(t)||R(t))}function m(t,e,n,r){let o="",i="";"object"===typeof e?(o=t,n=e.ignoreIllegals,i=e.language,r=void 0):(gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),gt("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=t,o=e);const s={code:o,language:i};F("before:highlight",s);const a=s.result?s.result:g(s.language,s.code,n,r);return a.code=s.code,F("after:highlight",a),a}function g(t,n,r,a){function l(t,e){const n=C.case_insensitive?e[0].toLowerCase():e[0];return Object.prototype.hasOwnProperty.call(t.keywords,n)&&t.keywords[n]}function h(){if(!T.keywords)return void A.addText(D);let t=0;T.keywordPatternRe.lastIndex=0;let e=T.keywordPatternRe.exec(D),n="";while(e){n+=D.substring(t,e.index);const r=l(T,e);if(r){const[t,o]=r;if(A.addText(n),n="",_+=o,t.startsWith("_"))n+=e[0];else{const n=C.classNameAliases[t]||t;A.addKeyword(e[0],n)}}else n+=e[0];t=T.keywordPatternRe.lastIndex,e=T.keywordPatternRe.exec(D)}n+=D.substr(t),A.addText(n)}function f(){if(""===D)return;let t=null;if("string"===typeof T.subLanguage){if(!e[T.subLanguage])return void A.addText(D);t=g(T.subLanguage,D,!0,L[T.subLanguage]),L[T.subLanguage]=t.top}else t=w(D,T.subLanguage.length?T.subLanguage:null);T.relevance>0&&(_+=t.relevance),A.addSublanguage(t.emitter,t.language)}function d(){null!=T.subLanguage?f():h(),D=""}function m(t){return t.className&&A.openNode(C.classNameAliases[t.className]||t.className),T=Object.create(t,{parent:{value:T}}),T}function y(t,e,n){let r=v(t.endRe,n);if(r){if(t["on:end"]){const n=new i(t);t["on:end"](e,n),n.isMatchIgnored&&(r=!1)}if(r){while(t.endsParent&&t.parent)t=t.parent;return t}}if(t.endsWithParent)return y(t.parent,e,n)}function b(t){return 0===T.matcher.regexIndex?(D+=t[0],1):(I=!0,0)}function x(t){const e=t[0],n=t.rule,r=new i(n),o=[n.__beforeBegin,n["on:begin"]];for(const i of o)if(i&&(i(t,r),r.isMatchIgnored))return b(e);return n&&n.endSameAsBegin&&(n.endRe=p(e)),n.skip?D+=e:(n.excludeBegin&&(D+=e),d(),n.returnBegin||n.excludeBegin||(D=e)),m(n),n.returnBegin?0:e.length}function k(t){const e=t[0],r=n.substr(t.index),o=y(T,t,r);if(!o)return wt;const i=T;i.skip?D+=e:(i.returnEnd||i.excludeEnd||(D+=e),d(),i.excludeEnd&&(D=e));do{T.className&&A.closeNode(),T.skip||T.subLanguage||(_+=T.relevance),T=T.parent}while(T!==o.parent);return o.starts&&(o.endSameAsBegin&&(o.starts.endRe=o.endRe),m(o.starts)),i.returnEnd?0:e.length}function S(){const t=[];for(let e=T;e!==C;e=e.parent)e.className&&t.unshift(e.className);t.forEach(t=>A.openNode(t))}let O={};function E(e,o){const i=o&&o[0];if(D+=e,null==i)return d(),0;if("begin"===O.type&&"end"===o.type&&O.index===o.index&&""===i){if(D+=n.slice(o.index,o.index+1),!s){const e=new Error("0 width match regex");throw e.languageName=t,e.badRule=O.rule,e}return 1}if(O=o,"begin"===o.type)return x(o);if("illegal"===o.type&&!r){const t=new Error('Illegal lexeme "'+i+'" for mode "'+(T.className||"<unnamed>")+'"');throw t.mode=T,t}if("end"===o.type){const t=k(o);if(t!==wt)return t}if("illegal"===o.type&&""===i)return 1;if(P>1e5&&P>3*o.index){const t=new Error("potential infinite loop, way more iterations than matches");throw t}return D+=i,i.length}const C=R(t);if(!C)throw dt(c.replace("{}",t)),new Error('Unknown language: "'+t+'"');const N=rt(C,{plugins:o});let M="",T=a||N;const L={},A=new u.__emitter(u);S();let D="",_=0,j=0,P=0,I=!1;try{for(T.matcher.considerAll();;){P++,I?I=!1:T.matcher.considerAll(),T.matcher.lastIndex=j;const t=T.matcher.exec(n);if(!t)break;const e=n.substring(j,t.index),r=E(e,t);j=t.index+r}return E(n.substr(j)),A.closeAllNodes(),A.finalize(),M=A.toHTML(),{relevance:Math.floor(_),value:M,language:t,illegal:!1,emitter:A,top:T}}catch($){if($.message&&$.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:$.message,context:n.slice(j-100,j+100),mode:$.mode},sofar:M,relevance:0,value:yt(n),emitter:A};if(s)return{illegal:!1,relevance:0,value:yt(n),emitter:A,language:t,top:T,errorRaised:$};throw $}}function y(t){const e={relevance:0,emitter:new u.__emitter(u),value:yt(t),illegal:!1,top:l};return e.emitter.addText(t),e}function w(t,n){n=n||u.languages||Object.keys(e);const r=y(t),o=n.filter(R).filter($).map(e=>g(e,t,!1));o.unshift(r);const i=o.sort((t,e)=>{if(t.relevance!==e.relevance)return e.relevance-t.relevance;if(t.language&&e.language){if(R(t.language).supersetOf===e.language)return 1;if(R(e.language).supersetOf===t.language)return-1}return 0}),[s,a]=i,c=s;return c.second_best=a,c}function b(t){return u.tabReplace||u.useBR?t.replace(a,t=>"\n"===t?u.useBR?"<br>":t:u.tabReplace?t.replace(/\t/g,u.tabReplace):t):t}function x(t,e,r){const o=e?n[e]:r;t.classList.add("hljs"),o&&t.classList.add(o)}const k={"before:highlightElement":({el:t})=>{u.useBR&&(t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:t})=>{u.useBR&&(t.value=t.value.replace(/\n/g,"<br>"))}},S=/^(<[^>]+>|\t)+/gm,O={"after:highlightElement":({result:t})=>{u.tabReplace&&(t.value=t.value.replace(S,t=>t.replace(/\t/g,u.tabReplace)))}};function E(t){let e=null;const n=d(t);if(h(n))return;F("before:highlightElement",{el:t,language:n}),e=t;const r=e.textContent,o=n?m(r,{language:n,ignoreIllegals:!0}):w(r);F("after:highlightElement",{el:t,result:o,text:r}),t.innerHTML=o.value,x(t,n,o.language),t.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(t.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}function C(t){t.useBR&&(gt("10.3.0","'useBR' will be removed entirely in v11.0"),gt("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),u=vt(u,t)}const N=()=>{if(N.called)return;N.called=!0,gt("10.6.0","initHighlighting() is deprecated.  Use highlightAll() instead.");const t=document.querySelectorAll("pre code");t.forEach(E)};function M(){gt("10.6.0","initHighlightingOnLoad() is deprecated.  Use highlightAll() instead."),T=!0}let T=!1;function L(){if("loading"===document.readyState)return void(T=!0);const t=document.querySelectorAll("pre code");t.forEach(E)}function A(){T&&L()}function D(n,r){let o=null;try{o=r(t)}catch(i){if(dt("Language definition for '{}' could not be registered.".replace("{}",n)),!s)throw i;dt(i),o=l}o.name||(o.name=n),e[n]=o,o.rawDefinition=r.bind(null,t),o.aliases&&I(o.aliases,{languageName:n})}function _(t){delete e[t];for(const e of Object.keys(n))n[e]===t&&delete n[e]}function j(){return Object.keys(e)}function P(t){gt("10.4.0","requireLanguage will be removed entirely in v11."),gt("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const e=R(t);if(e)return e;const n=new Error("The '{}' language is required, but not loaded.".replace("{}",t));throw n}function R(t){return t=(t||"").toLowerCase(),e[t]||e[n[t]]}function I(t,{languageName:e}){"string"===typeof t&&(t=[t]),t.forEach(t=>{n[t.toLowerCase()]=e})}function $(t){const e=R(t);return e&&!e.disableAutodetect}function B(t){t["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))})}function z(t){B(t),o.push(t)}function F(t,e){const n=t;o.forEach((function(t){t[n]&&t[n](e)}))}function V(t){return gt("10.2.0","fixMarkup will be removed entirely in v11.0"),gt("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),b(t)}function U(t){return gt("10.7.0","highlightBlock will be removed entirely in v12.0"),gt("10.7.0","Please use highlightElement now."),E(t)}"undefined"!==typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",A,!1),Object.assign(t,{highlight:m,highlightAuto:w,highlightAll:L,fixMarkup:V,highlightElement:E,highlightBlock:U,configure:C,initHighlighting:N,initHighlightingOnLoad:M,registerLanguage:D,unregisterLanguage:_,listLanguages:j,getLanguage:R,registerAliases:I,requireLanguage:P,autoDetection:$,inherit:vt,addPlugin:z,vuePlugin:ct(t).VuePlugin}),t.debugMode=function(){s=!1},t.safeMode=function(){s=!0},t.versionString=st;for(const i in H)"object"===typeof H[i]&&r(H[i]);return Object.assign(t,H),t.addPlugin(k),t.addPlugin(lt),t.addPlugin(O),t};var xt=bt({});t.exports=xt},"103c":function(t,e,n){"use strict";n("37ae")},"1d2b":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},"21a6":function(t,e,n){(function(n){var r,o,i;(function(n,s){o=[],r=s,i="function"===typeof r?r.apply(e,o):r,void 0===i||(t.exports=i)})(0,(function(){"use strict";function e(t,e){return"undefined"==typeof e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}function r(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){c(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function o(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(r){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=s.saveAs||("object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(t,e,n){var a=s.URL||s.webkitURL,c=document.createElement("a");e=e||t.name||"download",c.download=e,c.rel="noopener","string"==typeof t?(c.href=t,c.origin===location.origin?i(c):o(c.href)?r(t,e,n):i(c,c.target="_blank")):(c.href=a.createObjectURL(t),setTimeout((function(){a.revokeObjectURL(c.href)}),4e4),setTimeout((function(){i(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,s){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(e(t,s),n);else if(o(t))r(t,n,s);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout((function(){i(a)}))}}:function(t,e,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return r(t,e,n);var i="application/octet-stream"===t.type,c=/constructor/i.test(s.HTMLElement)||s.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||i&&c||a)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},u.readAsDataURL(t)}else{var h=s.URL||s.webkitURL,f=h.createObjectURL(t);o?o.location=f:location.href=f,o=null,setTimeout((function(){h.revokeObjectURL(f)}),4e4)}});s.saveAs=c.saveAs=c,t.exports=c}))}).call(this,n("c8ba"))},2444:function(t,e,n){"use strict";(function(e){var r=n("c532"),o=n("c8af"),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function a(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=n("b50d")),t}var c={adapter:a(),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"===typeof t)try{t=JSON.parse(t)}catch(e){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(i)})),t.exports=c}).call(this,n("4362"))},"248e":function(t,e,n){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},2550:function(t,e,n){"use strict";function r(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,s){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,s,a){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,s,a,c){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,s,a,c,l){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,s,a,c,l,u){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}n.d(e,"a",(function(){return r}))},2970:function(t,e,n){"use strict";n("c483")},"2d83":function(t,e,n){"use strict";var r=n("387f");t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},"2e67":function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},"30b5":function(t,e,n){"use strict";var r=n("c532");function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,(function(t,e){null!==t&&"undefined"!==typeof t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))})))})),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},"32bc":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("validation-observer",{ref:"observer",attrs:{tag:"form",autocomplete:"off"},on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)}},scopedSlots:t._u([{key:"default",fn:function(n){n.invalid;return[t._t("default"),e("div",{staticClass:"flex"},[e("ui-link",{attrs:{type:"primary",disabled:t.submitDisabled},on:{click:t.handleSubmit}},[t._v(t._s(t.submitText))]),t.hideCancel?t._e():e("ui-link",{staticClass:"ml-4",attrs:{type:"text"},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))]),t._t("buttons")],2)]}}],null,!0)})},o=[],i=n("072d9");function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,a,c){var l=p(t[o],t,i);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==s(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){c(i,r,o,s,a,"next",t)}function a(t){c(i,r,o,s,a,"throw",t)}s(void 0)}))}}var u={props:{submitText:{type:String,default:function(){return this.$t("actions.save")}},submitDisabled:{type:Boolean,default:!1},cancelText:{type:String,default:function(){return this.$t("actions.cancel")}},hideCancel:{type:Boolean,default:!1}},components:{UiLink:i["a"]},methods:{handleSubmit:function(){var t=l(a().mark((function t(){var e;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$refs.observer.validate();case 2:e=t.sent,e&&this.$emit("submit");case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleCancel:function(){this.$emit("cancel")}}},h=u,f=n("2877"),p=Object(f["a"])(h,r,o,!1,null,null,null);e["a"]=p.exports},"37ae":function(t,e,n){},3843:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n("4aa2"),o=n("fcfb"),i=n("248e"),s=Object(r["a"])((function(t){return!!Object(o["a"])(t)||!!t&&("object"===typeof t&&(!Object(i["a"])(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))})),a=s,c=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}();function l(t){return new c(t)}var u=n("2550"),h=n("2fc8"),f=Object(h["a"])((function(t,e){return Object(u["a"])(t.length,(function(){return t.apply(e,arguments)}))})),p=f;function d(t,e,n){var r=0,o=n.length;while(r<o){if(e=t["@@transducer/step"](e,n[r]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}function m(t,e,n){var r=n.next();while(!r.done){if(e=t["@@transducer/step"](e,r.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)}function g(t,e,n,r){return t["@@transducer/result"](n[r](p(t["@@transducer/step"],t),e))}var y="undefined"!==typeof Symbol?Symbol.iterator:"@@iterator";function v(t,e,n){if("function"===typeof t&&(t=l(t)),a(n))return d(t,e,n);if("function"===typeof n["fantasy-land/reduce"])return g(t,e,n,"fantasy-land/reduce");if(null!=n[y])return m(t,e,n[y]());if("function"===typeof n.next)return m(t,e,n);if("function"===typeof n.reduce)return g(t,e,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},3934:function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},"3ce4":function(t,e,n){"use strict";var r=n("1020"),o=n("073e");e.highlight=s,e.highlightAuto=a,e.registerLanguage=c,e.listLanguages=l,e.registerAlias=u,h.prototype.addText=d,h.prototype.addKeyword=f,h.prototype.addSublanguage=p,h.prototype.openNode=m,h.prototype.closeNode=g,h.prototype.closeAllNodes=v,h.prototype.finalize=v,h.prototype.toHTML=y;var i="hljs-";function s(t,e,n){var s,a=r.configure({}),c=n||{},l=c.prefix;if("string"!==typeof t)throw o("Expected `string` for name, got `%s`",t);if(!r.getLanguage(t))throw o("Unknown language: `%s` is not registered",t);if("string"!==typeof e)throw o("Expected `string` for value, got `%s`",e);if(null!==l&&void 0!==l||(l=i),r.configure({__emitter:h,classPrefix:l}),s=r.highlight(e,{language:t,ignoreIllegals:!0}),r.configure(a||{}),s.errorRaised)throw s.errorRaised;return{relevance:s.relevance,language:s.language,value:s.emitter.rootNode.children}}function a(t,e){var n,a,c,l,u=e||{},h=u.subset||r.listLanguages(),f=u.prefix,p=h.length,d=-1;if(null!==f&&void 0!==f||(f=i),"string"!==typeof t)throw o("Expected `string` for value, got `%s`",t);a={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};while(++d<p)l=h[d],r.getLanguage(l)&&(c=s(l,t,e),c.language=l,c.relevance>a.relevance&&(a=c),c.relevance>n.relevance&&(a=n,n=c));return a.language&&(n.secondBest=a),n}function c(t,e){r.registerLanguage(t,e)}function l(){return r.listLanguages()}function u(t,e){var n,o=t;for(n in e&&(o={},o[t]=e),o)r.registerAliases(o[n],{languageName:n})}function h(t){this.options=t,this.rootNode={children:[]},this.stack=[this.rootNode]}function f(t,e){this.openNode(e),this.addText(t),this.closeNode()}function p(t,e){var n=this.stack,r=n[n.length-1],o=t.rootNode.children,i=e?{type:"element",tagName:"span",properties:{className:[e]},children:o}:o;r.children=r.children.concat(i)}function d(t){var e,n,r=this.stack;""!==t&&(e=r[r.length-1],n=e.children[e.children.length-1],n&&"text"===n.type?n.value+=t:e.children.push({type:"text",value:t}))}function m(t){var e=this.stack,n=this.options.classPrefix+t,r=e[e.length-1],o={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(o),e.push(o)}function g(){this.stack.pop()}function y(){return""}function v(){}},"3d9d":function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.r(e);var o=["class","staticClass","style","staticStyle","attrs"];function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=c(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function u(t,e){if(null==t)return{};var n,r,o=h(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function h(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}e["default"]={functional:!0,render:function(t,e){var n=e._c,r=(e._v,e.data),i=e.children,a=void 0===i?[]:i,c=r.class,l=r.staticClass,h=r.style,f=r.staticStyle,p=r.attrs,d=void 0===p?{}:p,m=u(r,o);return n("svg",s({class:[c,l],style:[h,f],attrs:Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},d)},m),a.concat([n("path",{attrs:{d:"M7.75 4.5h15a1 1 0 000-2h-15a1 1 0 000 2zM22.75 11h-15a1 1 0 100 2h15a1 1 0 000-2zM22.75 19.5h-15a1 1 0 000 2h15a1 1 0 000-2zM2.212 17.248a2 2 0 00-1.933 1.484.75.75 0 101.45.386.5.5 0 11.483.63.75.75 0 100 1.5.5.5 0 11-.482.635.75.75 0 10-1.445.4 2 2 0 103.589-1.648.251.251 0 010-.278 2 2 0 00-1.662-3.111zM4.25 10.748a2 2 0 00-4 0 .75.75 0 001.5 0 .5.5 0 011 0 1.031 1.031 0 01-.227.645L.414 14.029A.75.75 0 001 15.248h2.5a.75.75 0 000-1.5h-.419a.249.249 0 01-.195-.406L3.7 12.33a2.544 2.544 0 00.55-1.582zM4 5.248h-.25A.25.25 0 013.5 5V1.623A1.377 1.377 0 002.125.248H1.5a.75.75 0 000 1.5h.25A.25.25 0 012 2v3a.25.25 0 01-.25.25H1.5a.75.75 0 000 1.5H4a.75.75 0 000-1.5z"}})]))}}},4362:function(t,e,n){e.nextTick=function(t){var e=Array.prototype.slice.call(arguments);e.shift(),setTimeout((function(){t.apply(null,e)}),0)},e.platform=e.arch=e.execPath=e.title="browser",e.pid=1,e.browser=!0,e.env={},e.argv=[],e.binding=function(t){throw new Error("No such module. (Possibly not yet loaded)")},function(){var t,r="/";e.cwd=function(){return r},e.chdir=function(e){t||(t=n("df7c")),r=t.resolve(e,r)}}(),e.exit=e.kill=e.umask=e.dlopen=e.uptime=e.memoryUsage=e.uvCounters=function(){},e.features={}},4524:function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.r(e);var o=["class","staticClass","style","staticStyle","attrs"];function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=c(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function u(t,e){if(null==t)return{};var n,r,o=h(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function h(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}e["default"]={functional:!0,render:function(t,e){var n=e._c,r=(e._v,e.data),i=e.children,a=void 0===i?[]:i,c=r.class,l=r.staticClass,h=r.style,f=r.staticStyle,p=r.attrs,d=void 0===p?{}:p,m=u(r,o);return n("svg",s({class:[c,l],style:[h,f],attrs:Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},d)},m),a.concat([n("path",{attrs:{d:"M22.5 21.248h-21a1.25 1.25 0 000 2.5h21a1.25 1.25 0 000-2.5zM1.978 2.748h1.363a.25.25 0 01.25.25v8.523a8.409 8.409 0 0016.818 0V3a.25.25 0 01.25-.25h1.363a1.25 1.25 0 000-2.5H16.3a1.25 1.25 0 000 2.5h1.363a.25.25 0 01.25.25v8.523a5.909 5.909 0 01-11.818 0V3a.25.25 0 01.25-.25H7.7a1.25 1.25 0 100-2.5H1.978a1.25 1.25 0 000 2.5z"}})]))}}},"45e9":function(t,e,n){"use strict";function r(t,e){var n=0,r=e.length,o=Array(r);while(n<r)o[n]=t(e[n]),n+=1;return o}n.d(e,"a",(function(){return r}))},"467f":function(t,e,n){"use strict";var r=n("2d83");t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},"4a7b":function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e){e=e||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,(function(t){"undefined"!==typeof e[t]&&(n[t]=e[t])})),r.forEach(i,(function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):"undefined"!==typeof e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):"undefined"!==typeof t[o]&&(n[o]=t[o])})),r.forEach(s,(function(r){"undefined"!==typeof e[r]?n[r]=e[r]:"undefined"!==typeof t[r]&&(n[r]=t[r])}));var a=o.concat(i).concat(s),c=Object.keys(e).filter((function(t){return-1===a.indexOf(t)}));return r.forEach(c,(function(r){"undefined"!==typeof e[r]?n[r]=e[r]:"undefined"!==typeof t[r]&&(n[r]=t[r])})),n}},"4f2e":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("ui-form",{on:{submit:t.handleSubmit,cancel:t.handleCancel}},[e("ui-form-field",{attrs:{label:t.$t("fields.email"),rules:"required|email"}},[e("el-input",{attrs:{type:"email"},model:{value:t.user.email,callback:function(e){t.$set(t.user,"email",e)},expression:"user.email"}})],1),e("ui-form-field",{attrs:{label:t.$tc("models.role"),rules:"required"}},[e("role-field",{model:{value:t.user.role,callback:function(e){t.$set(t.user,"role",e)},expression:"user.role"}})],1),e("ui-form-field",{directives:[{name:"show",rawName:"v-show",value:t.user.role&&"CompanyAdmin"===t.user.role.name,expression:"user.role && user.role.name === 'CompanyAdmin'"}],attrs:{label:t.$tc("models.company")}},[e("company-field",{model:{value:t.user.company,callback:function(e){t.$set(t.user,"company",e)},expression:"user.company"}})],1),e("ui-form-field",{directives:[{name:"show",rawName:"v-show",value:t.user.role&&"BuildingAdmin"===t.user.role.name,expression:"user.role && user.role.name === 'BuildingAdmin'"}],attrs:{label:t.$tc("models.company")}},[e("building-field",{model:{value:t.user.building,callback:function(e){t.$set(t.user,"building",e)},expression:"user.building"}})],1),e("ui-form-field",{directives:[{name:"show",rawName:"v-show",value:t.user.role&&("DepartmentAdmin"===t.user.role.name||"User"===t.user.role.name),expression:"\n      user.role &&\n        (user.role.name === 'DepartmentAdmin' || user.role.name === 'User')\n    "}],attrs:{label:t.$tc("models.department")}},[e("department-field",{model:{value:t.user.department,callback:function(e){t.$set(t.user,"department",e)},expression:"user.department"}})],1),e("ui-form-field",{attrs:{label:t.$tc("models.permissions")}},[e("user-permission-table",{attrs:{permissions:t.user.permissions}})],1)],1)},o=[],i=n("32bc"),s=n("5fbc"),a=n("fa43"),c=n("ad5a"),l=n("6834"),u=n("ec2e"),h=function(){var t=this,e=t._self._c;return e("ui-list",{attrs:{disableXScroll:!0,headings:[t.$tc("models.scope"),t.$tc("models.permission"),t.$tc("models.company"),"",t.$tc("models.allow")],items:t.permissions},scopedSlots:t._u([{key:"default",fn:function(n){return[e("ui-list-data",{attrs:{type:"tag",text:n.item.scope}}),e("ui-list-data",{attrs:{type:"tag",text:n.item.permission}}),e("ui-list-data",{attrs:{type:"tag",text:n.item.companyName}}),e("ui-list-data"),e("ui-list-data",[e("el-checkbox",{model:{value:n.item.hasPermission,callback:function(e){t.$set(n.item,"hasPermission",e)},expression:"props.item.hasPermission"}})],1)]}}])})},f=[],p=n("97420"),d=n("698d"),m={name:"UserPermissionTable",components:{UiList:p["a"],UiListData:d["a"]},props:{permissions:{required:!0,type:Array}}},g=m,y=n("2877"),v=Object(y["a"])(g,h,f,!1,null,null,null),w=v.exports,b={props:{user:{type:Object,required:!0}},components:{UiForm:i["a"],UiFormField:s["a"],RoleField:a["a"],CompanyField:c["a"],BuildingField:l["a"],DepartmentField:u["a"],UserPermissionTable:w},methods:{handleSubmit:function(){this.$emit("submit")},handleCancel:function(){this.$emit("cancel")}}},x=b,k=Object(y["a"])(x,r,o,!1,null,null,null);e["a"]=k.exports},5270:function(t,e,n){"use strict";var r=n("c532"),o=n("c401"),i=n("2e67"),s=n("2444");function a(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){a(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]}));var e=t.adapter||s.adapter;return e(t).then((function(e){return a(t),e.data=o(e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(a(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},5933:function(t,e,n){"use strict";n.d(e,"k",(function(){return c})),n.d(e,"f",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"n",(function(){return h})),n.d(e,"d",(function(){return f})),n.d(e,"h",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"j",(function(){return m})),n.d(e,"m",(function(){return g})),n.d(e,"i",(function(){return y})),n.d(e,"l",(function(){return v})),n.d(e,"o",(function(){return w})),n.d(e,"e",(function(){return b})),n.d(e,"c",(function(){return x})),n.d(e,"a",(function(){return k}));var r=n("7424");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:M(t,n,a)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(i,s,a,c){var l=p(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(o(e)+" is not iterable")}return b.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){s(i,r,o,a,c,"next",t)}function c(t){s(i,r,o,a,c,"throw",t)}a(void 0)}))}}var c=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/buildings",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].patch("/buildings/".concat(e.id),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/buildings/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/".concat(e,"/departments"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/courses/building/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/".concat(e,"/users"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/buildings/".concat(e,"/users/").concat(n));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),y=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/role");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){var t=a(i().mark((function t(){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/utilities/migrate");case 2:return t.abrupt("return",null);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),w=function(){var t=a(i().mark((function t(e,n){var o,s;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=new FormData,o.append("image",e),t.next=4,r["c"].request({method:"post",url:"/images/background/building/"+n,data:o,headers:{"content-type":"multipart/form-data"}});case 4:return s=t.sent,t.abrupt("return",s.data);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),b=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"images/background"});case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),x=function(){var t=a(i().mark((function t(e){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"delete",url:"/images/background/building/"+e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"/images/background/building/exists/"+e});case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},"5dbe":function(t,e,n){(function(){var e;function n(){console.log(o.apply(null,arguments))}function r(t,e){return o.apply(null,[t].concat(e))}function o(t){for(var e,n,r,o,i=1,s=[].slice.call(arguments),a=0,c=t.length,l="",u=!1,h=!1,f=function(){return s[i++]},p=function(){var n="";while(/\d/.test(t[a]))n+=t[a++],e=t[a];return n.length>0?parseInt(n):null};a<c;++a)if(e=t[a],u)switch(u=!1,"."==e?(h=!1,e=t[++a]):"0"==e&&"."==t[a+1]?(h=!0,a+=2,e=t[a]):h=!0,o=p(),e){case"b":l+=parseInt(f(),10).toString(2);break;case"c":n=f(),l+="string"===typeof n||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":l+=parseInt(f(),10);break;case"f":r=String(parseFloat(f()).toFixed(o||6)),l+=h?r:r.replace(/^0/,"");break;case"j":l+=JSON.stringify(f());break;case"o":l+="0"+parseInt(f(),10).toString(8);break;case"s":l+=f();break;case"x":l+="0x"+parseInt(f(),10).toString(16);break;case"X":l+="0x"+parseInt(f(),10).toString(16).toUpperCase();break;default:l+=e;break}else"%"===e?u=!0:l+=e;return l}e=t.exports=o,e.format=o,e.vsprintf=r,"undefined"!==typeof console&&"function"===typeof console.log&&(e.printf=n)})()},"5eab":function(t,e,n){},"5fbc":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",{class:t.margin},[e("label",{staticClass:"block uppercase tracking-wide text-gray-700 text-sm font-bold mb-2"},[t._v(" "+t._s(t.label)+" "),t.isRequired?e("span",[t._v("*")]):t._e()]),e("validation-provider",{attrs:{name:t.label,rules:t.rules},scopedSlots:t._u([{key:"default",fn:function(n){var r=n.errors;return[t._t("default"),e("span",{staticClass:"block text-sm mt-2 text-red-500"},[t._v(t._s(r[0]))])]}}],null,!0)})],1)},o=[],i=n("e417"),s=n("2fc8"),a=n("f0dc"),c=n("611e"),l=n("931f"),u=Object(s["a"])((function(t,e){return Object(c["a"])(t+1,(function(){var n=arguments[t];if(null!=n&&Object(a["a"])(n[e]))return n[e].apply(n,Array.prototype.slice.call(arguments,0,t));throw new TypeError(Object(l["a"])(n)+' does not have a method named "'+e+'"')}))})),h=u,f=h(1,"split"),p=f,d={props:{label:{type:String,required:!0},rules:{type:String},minimize:{type:Boolean,default:!1}},computed:{isRequired:function(){return this.rules&&Object(i["a"])("required",p("|",this.rules))},margin:function(){return this.minimize?"mb-3":"mb-8"}}},m=d,g=n("2877"),y=Object(g["a"])(m,r,o,!1,null,null,null);e["a"]=y.exports},"611e":function(t,e,n){"use strict";var r=n("2550"),o=n("4aa2"),i=n("2fc8"),s=n("9ebd");function a(t,e,n){return function(){var o=[],i=0,c=t,l=0;while(l<e.length||i<arguments.length){var u;l<e.length&&(!Object(s["a"])(e[l])||i>=arguments.length)?u=e[l]:(u=arguments[i],i+=1),o[l]=u,Object(s["a"])(u)||(c-=1),l+=1}return c<=0?n.apply(this,o):Object(r["a"])(c,a(t,o,n))}}var c=Object(i["a"])((function(t,e){return 1===t?Object(o["a"])(e):Object(r["a"])(t,a(t,[],e))}));e["a"]=c},"63c8":function(t,e,n){"use strict";n.d(e,"l",(function(){return c})),n.d(e,"i",(function(){return l})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return h})),n.d(e,"n",(function(){return f})),n.d(e,"c",(function(){return p})),n.d(e,"e",(function(){return d})),n.d(e,"j",(function(){return m})),n.d(e,"d",(function(){return g})),n.d(e,"h",(function(){return y})),n.d(e,"f",(function(){return v})),n.d(e,"g",(function(){return w})),n.d(e,"k",(function(){return b})),n.d(e,"m",(function(){return x}));var r=n("7424");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:M(t,n,a)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(i,s,a,c){var l=p(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(o(e)+" is not iterable")}return b.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){s(i,r,o,a,c,"next",t)}function c(t){s(i,r,o,a,c,"throw",t)}a(void 0)}))}}var c=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/users");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/users/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/users",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/users/import",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].patch("/users/".concat(e.id),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/users/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=a(i().mark((function t(e,n,o){var s;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/users/filter/".concat(e,"/").concat(n,"/").concat(o));case 2:return s=t.sent,t.abrupt("return",s.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),m=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/myCourses/user/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/myCourses/".concat(e,"/user/").concat(n));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),y=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/user/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),v=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/user/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/user/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/users/".concat(e,"/permissions"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"put",url:"/users/".concat(e,"/permissions"),data:n});case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},"648a":function(t,e,n){},"64c8":function(t,e,n){"use strict";e["a"]={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}}},6834:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("el-select",{attrs:{placeholder:"".concat(t.$t("actions.select")," ").concat(t.$tc("models.building")),loading:t.loading,filterable:"","value-key":"id"},on:{change:t.handleSelect},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},t._l(t.buildings,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t}})})),1)},o=[],i=n("5933");function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,a,c){var l=p(t[o],t,i);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==s(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){c(i,r,o,s,a,"next",t)}function a(t){c(i,r,o,s,a,"throw",t)}s(void 0)}))}}var u={props:{value:{type:Object,default:null}},data:function(){return{localValue:this.value,buildings:[],loading:!1}},watch:{value:function(t){this.localValue=t}},methods:{handleSelect:function(){this.$emit("input",this.localValue)},getBuildings:function(){var t=l(a().mark((function t(){return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(i["k"])();case 3:this.buildings=t.sent,this.loading=!1;case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},created:function(){this.getBuildings()}},h=u,f=n("2877"),p=Object(f["a"])(h,r,o,!1,null,null,null);e["a"]=p.exports},"698d":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("td",{class:{small:t.small}},[t.text?e("span",{class:t.styles},[t.$listeners.click?e("a",{staticClass:"underline hover:text-theme-primary-hover",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.handleClick.apply(null,arguments)}}},[t._v(t._s(t.text))]):e("span",[t._v(t._s(t.text))]),null!==t.progressPrecentage?e("span",[e("ui-progress-bar",{attrs:{percentage:t.courseProgress}})],1):t._e()]):t._e(),t.info?e("span",{staticClass:"mt-1 block text-sm text-gray-700"},[t._v(t._s(t.info))]):t._e(),t.infoHtml?e("span",{staticClass:"mt-1 block text-sm text-gray-700"},[e("rich-text-field",{attrs:{hideBorder:!0,showEditor:!1},model:{value:t.infoHtml,callback:function(e){t.infoHtml=e},expression:"infoHtml"}})],1):t._e(),t.$slots.default?e("div",{staticClass:"flex"},[t._t("default")],2):t._e()])},o=[],i=n("cada"),s=n("c1e5"),a={props:{type:{type:String,default:"default"},text:{type:String},info:{type:String},infoHtml:{type:String},progressPrecentage:{type:Number,default:null},small:{type:Boolean,default:!1}},components:{UiProgressBar:s["a"],RichTextField:i["a"]},computed:{styles:function(){return"default"===this.type?["block"]:"tag"===this.type?["whitespace-no-wrap","text-xs","font-bold","rounded-full","px-3","py-1","bg-blue-100","text-gray-600"]:[]},courseProgress:function(){return null!==this.progressPrecentage?this.progressPrecentage:null}},methods:{handleClick:function(){this.$emit("click")}}},c=a,l=n("2877"),u=Object(l["a"])(c,r,o,!1,null,"0d8ba5ec",null);e["a"]=u.exports},"6a21":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("svg",{attrs:{height:t.h,width:t.w}},[e("polygon",{class:"icon ".concat(t.active?"active":""),attrs:{points:t.getPoints()}}),t._v(" Sorry, your browser does not support inline SVG. ")])},o=[],i={props:{active:{type:Boolean,default:!1},size:{type:String,default:"small"}},data:function(){return{h:0,w:0}},methods:{getHeight:function(t){return 10*t},getWidth:function(t){return 20*t},getPoints:function(){var t=1,e=this.h-1,n=this.w/2,r=1,o=this.w-1,i=this.h-1,s="".concat(t,",").concat(e," ").concat(n,",").concat(r," ").concat(o,",").concat(i);return s}},created:function(){var t=1;"small"===this.size&&(t=.8),this.h=this.getHeight(t),this.w=this.getWidth(t)}},s=i,a=(n("eea2"),n("2877")),c=Object(a["a"])(s,r,o,!1,null,"ce604b1c",null);e["a"]=c.exports},7424:function(t,e,n){"use strict";n.d(e,"c",(function(){return w})),n.d(e,"b",(function(){return k}));var r=n("4aa2"),o=n("611e"),i=Object(r["a"])((function(t){return Object(o["a"])(t.length,t)})),s=i,a=n("bc3a"),c=n.n(a),l=n("4360"),u=n("2b0e"),h=n("12cb"),f=n("21a6"),p=n.n(f);function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};l(k,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,s)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,s,a){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==d(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=f;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?y:p,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(d(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),l(N.prototype,a,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(u(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),l(E,c,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function g(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function y(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){g(i,r,o,s,a,"next",t)}function a(t){g(i,r,o,s,a,"throw",t)}s(void 0)}))}}var v=new u["default"],w=c.a.create({baseURL:"/api",headers:{"X-Requested-With":"XMLHttpRequest"}});function b(){return l["a"].state.oidcStore.access_token}w.interceptors.request.use((function(t){return t.headers["Authorization"]="Bearer "+b(),t}),(function(t){return Promise.reject(t)}));var x=s((function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return t[e](n,r).then((function(t){return Promise.resolve(t)})).catch((function(t){return v.$message({message:h["a"].t("errors.general"),type:"error"}),Promise.reject(t)}))})),k=function(){var t=y(m().mark((function t(e,n){return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,fetch(e,{method:"GET",headers:{Authorization:"Bearer ".concat(b())}}).then(function(){var t=y(m().mark((function t(e){var n;return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.ok){t.next=7;break}return t.next=3,e.json();case 3:throw n=t.sent,new Error(n.detail);case 7:return t.abrupt("return",e);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then((function(t){if(void 0!==t)return t.blob()})).then((function(t){void 0!==t&&p.a.saveAs(t,n)})).catch((function(t){throw console.error(t),error}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),S={get:x(w,"get"),post:x(w,"post"),patch:x(w,"patch"),put:x(w,"put"),delete:x(w,"delete")};e["a"]=S},"7a77":function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},"7aac":function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7afa":function(t,e,n){var r=n("9b81");function o(t){return decodeURIComponent(r(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}t.exports=function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return o(e)}catch(n){return r(e)}}},"7e8f":function(t,e,n){"use strict";n("e79b")},8127:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("fcfb");function o(t){return null!=t&&"function"===typeof t["@@transducer/step"]}function i(t,e,n){return function(){if(0===arguments.length)return n();var i=Array.prototype.slice.call(arguments,0),s=i.pop();if(!Object(r["a"])(s)){var a=0;while(a<t.length){if("function"===typeof s[t[a]])return s[t[a]].apply(s,i);a+=1}if(o(s)){var c=e.apply(null,i);return c(s)}}return n.apply(this,arguments)}}},"81e8":function(t,e,n){"use strict";n.d(e,"o",(function(){return c})),n.d(e,"m",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"q",(function(){return h})),n.d(e,"f",(function(){return f})),n.d(e,"n",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"k",(function(){return m})),n.d(e,"j",(function(){return g})),n.d(e,"p",(function(){return y})),n.d(e,"a",(function(){return v})),n.d(e,"h",(function(){return w})),n.d(e,"b",(function(){return b})),n.d(e,"i",(function(){return x})),n.d(e,"c",(function(){return k})),n.d(e,"e",(function(){return S})),n.d(e,"l",(function(){return O}));var r=n("7424");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:M(t,n,a)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(i,s,a,c){var l=p(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(o(e)+" is not iterable")}return b.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){s(i,r,o,a,c,"next",t)}function c(t){s(i,r,o,a,c,"throw",t)}a(void 0)}))}}var c=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/departments",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].patch("/departments/".concat(e.id),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/departments/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e,"/users"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/departments/".concat(e,"/users/").concat(n));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),m=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e,"/courses"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e,"/courses/").concat(n));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),y=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e,"/courses/").concat(n,"/notincourse"));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),v=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/departments/".concat(e.departmentId,"/courses/").concat(e.courseId),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/departments/".concat(e.departmentId,"/courses/").concat(e.courseId,"/users/").concat(e.userId));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/departments/".concat(e.departmentId,"/courses/").concat(e.courseId,"/users/").concat(e.userId,"/reminder"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/activecourse/".concat(e));case 2:if(n=t.sent,204!=n.status){t.next=5;break}return t.abrupt("return",[]);case 5:return t.abrupt("return",n.data);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"post",url:"/activecourse",data:{departmentId:e,courseId:n}});case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),S=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"delete",url:"/activecourse",data:{departmentId:e,courseId:n},options:{ContentType:"application/json"}});case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),O=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/buildings/".concat(e,"/course"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},"83b9":function(t,e,n){"use strict";var r=n("d925"),o=n("e683");t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},"84e0":function(t,e,n){},"899d":function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"fade"}},[t.show?e("div",{staticClass:"modal-container"},[e("div",{staticClass:"w-full max-w-2xl"},[e("ui-card",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("div",{staticClass:"flex"},[e("ui-link",{attrs:{type:"danger"},on:{click:t.handleConfirm}},[t._v(t._s(t.confirmText))]),e("ui-link",{staticClass:"ml-4",attrs:{type:"text"},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))])],1)]},proxy:!0}],null,!1,1535319682)},[e("p",{staticClass:"py-4"},[t._v(t._s(t.text))]),t.info?e("em",{staticClass:"py-4"},[t._v(t._s(t.info))]):t._e()])],1)]):t._e()])},o=[],i=n("f19f"),s=n("072d9"),a={props:{show:{type:Boolean,required:!0},text:{type:String,required:!0},info:{type:String,required:!1,default:null},confirmText:{type:String,default:function(){return this.$t("actions.confirm")}},cancelText:{type:String,default:function(){return this.$t("actions.cancel")}}},components:{UiCard:i["a"],UiLink:s["a"]},data:function(){return{}},methods:{handleConfirm:function(){this.$emit("confirm")},handleCancel:function(){this.$emit("cancel")}}},c=a,l=(n("2970"),n("2877")),u=Object(l["a"])(c,r,o,!1,null,"3990259a",null);e["a"]=u.exports},"8df4":function(t,e,n){"use strict";var r=n("7a77");function o(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t,e=new o((function(e){t=e}));return{token:e,cancel:t}},t.exports=o},"931f":function(t,e,n){"use strict";var r=n("4aa2"),o=n("b4d1"),i=n("45e9");function s(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var a=function(t){return(t<10?"0":"")+t},c="function"===typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},l=c,u=n("66e1");function h(t){return function(){return!t.apply(this,arguments)}}var f=n("2fc8"),p=n("8127");function d(t,e){var n=0,r=e.length,o=[];while(n<r)t(e[n])&&(o[o.length]=e[n]),n+=1;return o}function m(t){return"[object Object]"===Object.prototype.toString.call(t)}var g=n("3843"),y=n("64c8"),v=function(){function t(t,e){this.xf=e,this.f=t}return t.prototype["@@transducer/init"]=y["a"].init,t.prototype["@@transducer/result"]=y["a"].result,t.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.xf["@@transducer/step"](t,e):t},t}(),w=Object(f["a"])((function(t,e){return new v(t,e)})),b=w,x=Object(f["a"])(Object(p["a"])(["filter"],b,(function(t,e){return m(e)?Object(g["a"])((function(n,r){return t(e[r])&&(n[r]=e[r]),n}),{},Object(u["a"])(e)):d(t,e)}))),k=x,S=Object(f["a"])((function(t,e){return k(h(t),e)})),O=S;function E(t,e){var n=function(n){var r=e.concat([t]);return Object(o["a"])(n,r)?"<Circular>":E(n,r)},r=function(t,e){return Object(i["a"])((function(e){return s(e)+": "+n(t[e])}),e.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Object(i["a"])(n,t).join(", ")+"))";case"[object Array]":return"["+Object(i["a"])(n,t).concat(r(t,O((function(t){return/^\d+$/.test(t)}),Object(u["a"])(t)))).join(", ")+"]";case"[object Boolean]":return"object"===typeof t?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):s(l(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"===typeof t?"new Number("+n(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object String]":return"object"===typeof t?"new String("+n(t.valueOf())+")":s(t);case"[object Undefined]":return"undefined";default:if("function"===typeof t.toString){var a=t.toString();if("[object Object]"!==a)return a}return"{"+r(t,Object(u["a"])(t)).join(", ")+"}"}}var C=Object(r["a"])((function(t){return E(t,[])}));e["a"]=C},97420:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"bg-white rounded overflow-hidden"},[t._t("filter"),t.heading||t.$slots.actions?e("div",{staticClass:"p-4 md:p-6 flex justify-between items-center"},[t.heading?e("div",{staticClass:"font-bold uppercase"},[t._v(" "+t._s(t.heading)+" ")]):t._e(),t.$slots.actions?e("div",[t._t("actions")],2):t._e()]):t._e(),e("div",{staticClass:"w-full",class:{"overflow-x-scroll":!t.disableXScroll}},[e("table",{staticClass:"table"},[e("thead",[e("tr",t._l(t.headings,(function(n,r){return e("th",{key:r,staticStyle:{"border-bottom-width":"0"}},["search"===n?[e("el-input",{attrs:{placeholder:"Type to search"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})]:"template"===n?[t._t("tmpl-"+r)]:[t.sort&&t.sort[r]?t._e():e("div",[t._v(" "+t._s(n)+" ")]),t.sort&&t.sort[r]?e("div",[t.currentSort.prop!==t.sort[r].prop?e("div",{staticClass:"sort-column",on:{click:function(e){return t.onSort(t.sort[r],!0)}}},[t._v(" "+t._s(n)+" "),e("div",{staticClass:"icon-container"},[e("ui-triangle-up"),e("ui-triangle-down")],1)]):t._e(),t.currentSort.prop===t.sort[r].prop&&!1===t.currentSort.asc?e("div",{staticClass:"sort-column",on:{click:function(e){return t.onSort(t.sort[r],!0)}}},[t._v(" "+t._s(n)+" "),e("div",{staticClass:"icon-container"},[e("ui-triangle-up",{attrs:{active:!0}}),e("ui-triangle-down")],1)]):t._e(),t.currentSort.prop===t.sort[r].prop&&!0===t.currentSort.asc?e("div",{staticClass:"sort-column",on:{click:function(e){return t.onSort(t.sort[r],!1)}}},[t._v(" "+t._s(n)+" "),e("div",{staticClass:"icon-container"},[e("ui-triangle-up"),e("ui-triangle-down",{attrs:{active:!0}})],1)]):t._e()]):t._e()]],2)})),0)]),e("tbody",[t._l(t.computedPaginatedList,(function(n,r){return e("tr",{key:n.id?n.id:"item_"+r},[t._t("default",null,{item:n})],2)})),t._t("footer")],2)]),e("div",{staticClass:"block px-4 pt-2 pb-4 md:px-6 md:pt-2 md:pb-6"},[e("el-pagination",{attrs:{"hide-on-single-page":!0,"current-page":t.currentPage,"page-sizes":[10,25,50,100],"page-size":25,layout:"total, sizes, prev, pager, next, jumper",total:null!==t.filteredItems?t.filteredItems.length:t.items.length},on:{"size-change":t.handlePaginationSizeChange,"current-change":t.handleItemsPaginationChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)])],2)},o=[],i=n("6a21"),s=n("e3f2");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c={props:{heading:{type:String},headings:{type:Array,required:!0},sort:{type:Array,required:!1},items:{type:Array,required:!0},search_selectors:{type:Array,required:!1},selectedFilterVal:{type:Object,required:!1},disableXScroll:{type:Boolean,required:!1,default:!0}},components:{UiTriangleDown:s["a"],UiTriangleUp:i["a"]},data:function(){return{currentSort:null,search:"",timeout:null,filteredItems:null,showSearchResults:!1,currentPage:1,minNumbItems:0,maxNumbItems:25,selectedPaginationSize:25}},computed:{computedPaginatedList:function(){return null!==this.filteredItems?this.filteredItems.slice(this.minNumbItems,this.maxNumbItems):this.items.slice(this.minNumbItems,this.maxNumbItems)}},watch:{items:function(){this.filteredItems=this.items},search:function(t){clearTimeout(this.timeout);var e=this;this.timeout=setTimeout((function(){var n=[];e.items.forEach((function(r){if(t.includes("-")){var o=0;e.search_selectors.forEach((function(t){null!==r[t]&&(o+=1)})),0===o&&n.push(r)}else if(""===t)n.push(r);else{var i="";e.search_selectors.forEach((function(t){"object"===a(t)&&("translation"===t.type?void 0!==r[t.prop]&&(i+=r[t.prop].filter((function(t){return t.lang===e.$i18n.locale}))[0].value):"level2"===t.type&&void 0!==r[t.prop]&&void 0!==r[t.prop][t.prop2]&&(i+=r[t.prop][t.prop2])),e.search_selectors.indexOf(t)>=e.search_selectors.length?i+=r[t]:i+=r[t]+" "})),i.toLowerCase().includes(t.toLowerCase())&&n.push(r)}})),e.filteredItems=n}),500)}},methods:{sortTranslation:function(t,e){var n=this;try{var r=e?1:-1;null!==this.filteredItems?this.filteredItems.sort((function(e,o){return e[t].filter((function(t){return t.lang===n.$i18n.locale}))[0].value>o[t].filter((function(t){return t.lang===n.$i18n.locale}))[0].value?r:-1*r})):this.items.sort((function(e,o){return e[t].filter((function(t){return t.lang===n.$i18n.locale}))[0].value>o[t].filter((function(t){return t.lang===n.$i18n.locale}))[0].value?1*r:-1*r})),this.currentSort={prop:t,asc:e}}catch(o){}},sortLevel2:function(t,e,n){try{var r=n?1:-1;null!==this.filteredItems?this.filteredItems.sort((function(n,o){return n[t][e]>o[t][e]?1*r:-1*r})):this.items.sort((function(n,o){return n[t][e]>o[t][e]?1*r:-1*r})),this.currentSort={prop:t,asc:n}}catch(o){}},sortSimple:function(t,e){try{var n=e?1:-1;null!==this.filteredItems?this.filteredItems.sort((function(e,r){return e[t]>r[t]?1*n:-1*n})):this.items.sort((function(e,r){return e[t]>r[t]?1*n:-1*n})),this.currentSort={prop:t,asc:e}}catch(r){}},onSort:function(t,e){switch(t.type){case"translation":this.sortTranslation(t.prop,e);break;case"level2":this.sortLevel2(t.prop,t.prop2,e);break;default:this.sortSimple(t.prop,e);break}},handlePaginationSizeChange:function(t){this.selectedPaginationSize=t,this.currentPage<=1?(this.minNumbItems=0,this.maxNumbItems=t):(this.minNumbItems=(this.currentPage-1)*t,this.maxNumbItems=this.currentPage*t)},handleItemsPaginationChange:function(t){this.currentPage=t,t<=1?(this.minNumbItems=0,this.maxNumbItems=this.selectedPaginationSize):(this.minNumbItems=(t-1)*this.selectedPaginationSize,this.maxNumbItems=t*this.selectedPaginationSize)}},created:function(){this.sort&&this.sort.length>0&&(this.currentSort={prop:this.sort[0].prop,asc:!0})}},l=c,u=(n("ece2"),n("2877")),h=Object(u["a"])(l,r,o,!1,null,"56898f8c",null);e["a"]=h.exports},"9b81":function(t,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(t){this.message=t}function o(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,s=0,a=0,c="";i=e.charAt(a++);~i&&(o=s%4?64*o+i:i,s++%4)?c+=String.fromCharCode(255&o>>(-2*s&6)):0)i=n.indexOf(i);return c}r.prototype=new Error,r.prototype.name="InvalidCharacterError",t.exports="undefined"!==typeof window&&window.atob&&window.atob.bind(window)||o},"9c47":function(t,e,n){},"9d0b":function(t,e,n){"use strict";n("5eab")},a243:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return t.showComponent?e("span",[t._t("default")],2):t._e()},o=[],i=n("04e1"),s=n.n(i),a=n("2f62");function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){h(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t,e,n){return(e=f(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t){var e=p(t,"string");return"symbol"==c(e)?e:e+""}function p(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var d={props:{accessRoles:{type:Array,required:!0},exact:{type:Boolean,default:!1},debug:{type:String}},data:function(){return{userRoles:[]}},computed:u(u({},Object(a["c"])("oidcStore",["oidcAccessToken"])),{},{showComponent:function(){var t=this.hasRole();return t}}),methods:{hasRole:function(){var t=this,e=!1;return this.userRoles.forEach((function(n){t.accessRoles.forEach((function(t){n!==t||e||(e=!0)}))})),this.debug&&console.debug(this.debug,e,this.userRoles,this.accessRoles),e},setUserRoles:function(){var t=this,e=s()(this.oidcAccessToken).role;"string"!==typeof e?e.map((function(e){return t.userRoles.push(e)})):this.userRoles.push(e)}},created:function(){this.setUserRoles()}},m=d,g=n("2877"),y=Object(g["a"])(m,r,o,!1,null,null,null);e["a"]=y.exports},ac12:function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.r(e);var o=["class","staticClass","style","staticStyle","attrs"];function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=c(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function u(t,e){if(null==t)return{};var n,r,o=h(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function h(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}e["default"]={functional:!0,render:function(t,e){var n=e._c,r=(e._v,e.data),i=e.children,a=void 0===i?[]:i,c=r.class,l=r.staticClass,h=r.style,f=r.staticStyle,p=r.attrs,d=void 0===p?{}:p,m=u(r,o);return n("svg",s({class:[c,l],style:[h,f],attrs:Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},d)},m),a.concat([n("circle",{attrs:{cx:"2.5",cy:"3.998",r:"2.5"}}),n("path",{attrs:{d:"M8.5 5H23a1 1 0 000-2H8.5a1 1 0 000 2z"}}),n("circle",{attrs:{cx:"2.5",cy:"11.998",r:"2.5"}}),n("path",{attrs:{d:"M23 11H8.5a1 1 0 000 2H23a1 1 0 000-2z"}}),n("circle",{attrs:{cx:"2.5",cy:"19.998",r:"2.5"}}),n("path",{attrs:{d:"M23 19H8.5a1 1 0 000 2H23a1 1 0 000-2z"}})]))}}},ad5a:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",[e("auth-checker",{attrs:{"access-roles":["SuperAdmin","CompanyAdmin"]}},[e("el-select",{attrs:{placeholder:"".concat(t.$t("actions.select")," ").concat(t.$tc("models.company")),loading:t.loading,filterable:"","value-key":"id"},on:{change:t.handleSelect},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},t._l(t.companies,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t}})})),1)],1),e("auth-checker",{attrs:{"access-roles":["BuildingAdmin"]}},[e("el-select",{attrs:{placeholder:"".concat(t.$t("actions.select")," ").concat(t.$tc("models.company")),loading:t.loading,filterable:"",disabled:"","value-key":"id"},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},t._l(t.companies,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t}})})),1)],1)],1)},o=[],i=n("c791"),s=n("a243");function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,s)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,s,c){var l=p(t[o],t,i);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==a(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(a(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,s,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function l(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){l(i,r,o,s,a,"next",t)}function a(t){l(i,r,o,s,a,"throw",t)}s(void 0)}))}}var h={components:{AuthChecker:s["a"]},props:{value:{type:Object,default:null}},data:function(){return{localValue:this.value,companies:[],loading:!1}},watch:{value:function(t){this.localValue=t}},methods:{handleSelect:function(){this.$emit("input",this.localValue)},getCompanies:function(){var t=u(c().mark((function t(){var e;return c().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(i["l"])();case 3:e=t.sent,this.companies=e,this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},created:function(){this.getCompanies()}},f=h,p=n("2877"),d=Object(p["a"])(f,r,o,!1,null,null,null);e["a"]=d.exports},b50d:function(t,e,n){"use strict";var r=n("c532"),o=n("467f"),i=n("30b5"),s=n("83b9"),a=n("c345"),c=n("3934"),l=n("2d83");t.exports=function(t){return new Promise((function(e,u){var h=t.data,f=t.headers;r.isFormData(h)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",m=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+m)}var g=s(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),i(g,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?p.response:p.responseText,i={data:r,status:p.status,statusText:p.statusText,headers:n,config:t,request:p};o(e,u,i),p=null}},p.onabort=function(){p&&(u(l("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){u(l("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),u(l(e,t,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=n("7aac"),v=(t.withCredentials||c(g))&&t.xsrfCookieName?y.read(t.xsrfCookieName):void 0;v&&(f[t.xsrfHeaderName]=v)}if("setRequestHeader"in p&&r.forEach(f,(function(t,e){"undefined"===typeof h&&"content-type"===e.toLowerCase()?delete f[e]:p.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(w){if("json"!==t.responseType)throw w}"function"===typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),u(t),p=null)})),void 0===h&&(h=null),p.send(h)}))}},bc3a:function(t,e,n){t.exports=n("cee4")},c1e5:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"progress_bar_wrapper"},[e("div",{staticClass:"progress_bar"},[e("div",{staticClass:"progress_bar_done",style:t.getProgressBarDoneStyle(t.percentage)},[t.percentage>14?e("span",{staticClass:"progress_bar_inner_text"},[t._v(t._s(t.percentage)+"%")]):t._e()]),e("div",{staticClass:"progress_bar_done"},[t.percentage<=14?e("span",{staticClass:"unfinished_progress_bar_inner_text"},[t._v(t._s(t.percentage)+"%")]):t._e()])])])},o=[],i={name:"UiProgressBar",props:{percentage:{required:!0}},mounted:function(){},methods:{getProgressBarDoneStyle:function(t){return"backgroundColor: hsl("+t+", 100%, 42.4%;width: "+t+"%"},getProgressBarNotDoneWidth:function(t){var e=100-t;return e+"%"}}},s=i,a=(n("efad"),n("2877")),c=Object(a["a"])(s,r,o,!1,null,"558a75b2",null);e["a"]=c.exports},c345:function(t,e,n){"use strict";var r=n("c532"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,s={};return t?(r.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},c401:function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},c483:function(t,e,n){},c532:function(t,e,n){"use strict";var r=n("1d2b"),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function s(t){return"undefined"===typeof t}function a(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function c(t){return"[object ArrayBuffer]"===o.call(t)}function l(t){return"undefined"!==typeof FormData&&t instanceof FormData}function u(t){var e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function h(t){return"string"===typeof t}function f(t){return"number"===typeof t}function p(t){return null!==t&&"object"===typeof t}function d(t){return"[object Date]"===o.call(t)}function m(t){return"[object File]"===o.call(t)}function g(t){return"[object Blob]"===o.call(t)}function y(t){return"[object Function]"===o.call(t)}function v(t){return p(t)&&y(t.pipe)}function w(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function b(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function k(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}function S(){var t={};function e(e,n){"object"===typeof t[n]&&"object"===typeof e?t[n]=S(t[n],e):t[n]=e}for(var n=0,r=arguments.length;n<r;n++)k(arguments[n],e);return t}function O(){var t={};function e(e,n){"object"===typeof t[n]&&"object"===typeof e?t[n]=O(t[n],e):t[n]="object"===typeof e?O({},e):e}for(var n=0,r=arguments.length;n<r;n++)k(arguments[n],e);return t}function E(t,e,n){return k(e,(function(e,o){t[o]=n&&"function"===typeof e?r(e,n):e})),t}t.exports={isArray:i,isArrayBuffer:c,isBuffer:a,isFormData:l,isArrayBufferView:u,isString:h,isNumber:f,isObject:p,isUndefined:s,isDate:d,isFile:m,isBlob:g,isFunction:y,isStream:v,isURLSearchParams:w,isStandardBrowserEnv:x,forEach:k,merge:S,deepMerge:O,extend:E,trim:b}},c791:function(t,e,n){"use strict";n.d(e,"l",(function(){return c})),n.d(e,"m",(function(){return l})),n.d(e,"c",(function(){return u})),n.d(e,"A",(function(){return h})),n.d(e,"f",(function(){return f})),n.d(e,"n",(function(){return p})),n.d(e,"o",(function(){return d})),n.d(e,"r",(function(){return m})),n.d(e,"z",(function(){return g})),n.d(e,"q",(function(){return y})),n.d(e,"D",(function(){return v})),n.d(e,"C",(function(){return w})),n.d(e,"s",(function(){return b})),n.d(e,"g",(function(){return x})),n.d(e,"e",(function(){return k})),n.d(e,"b",(function(){return S})),n.d(e,"x",(function(){return O})),n.d(e,"p",(function(){return E})),n.d(e,"k",(function(){return C})),n.d(e,"y",(function(){return N})),n.d(e,"i",(function(){return M})),n.d(e,"j",(function(){return T})),n.d(e,"d",(function(){return L})),n.d(e,"B",(function(){return A})),n.d(e,"u",(function(){return D})),n.d(e,"t",(function(){return _})),n.d(e,"v",(function(){return j})),n.d(e,"a",(function(){return P})),n.d(e,"h",(function(){return R})),n.d(e,"w",(function(){return I}));var r=n("7424");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:M(t,n,a)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(i,s,a,c){var l=p(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(o(e)+" is not iterable")}return b.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){s(i,r,o,a,c,"next",t)}function c(t){s(i,r,o,a,c,"throw",t)}a(void 0)}))}}var c=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/companies",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].patch("/companies/".concat(e.id),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/companies/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/".concat(e,"/buildings"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/".concat(e,"/departments"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/".concat(e,"/users"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/companies/".concat(e,"/users/").concat(n));case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),y=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/companies/role");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){var t=a(i().mark((function t(e,n){var o,s;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=new FormData,o.append("image",e),t.next=4,r["c"].request({method:"post",url:"/images/logo/"+n,data:o,headers:{"content-type":"multipart/form-data"}});case 4:return s=t.sent,t.abrupt("return",s.data);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),w=function(){var t=a(i().mark((function t(e,n){var o,s;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=new FormData,o.append("image",e),t.next=4,r["c"].request({method:"post",url:"/images/background/company/"+n,data:o,headers:{"content-type":"multipart/form-data"}});case 4:return s=t.sent,t.abrupt("return",s.data);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),b=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"images/logo"});case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),x=function(){var t=a(i().mark((function t(e){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"delete",url:"/images/logo/"+e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=a(i().mark((function t(e){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"delete",url:"/images/background/company/"+e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"/images/background/company/exists/"+e});case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),O=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"/images/logo/company/exists/"+e});case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),E=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"/companies/".concat(e,"/permissions")});case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),C=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"get",url:"/companies/".concat(e,"/permissions?active=true")});case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),N=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].request({method:"put",url:"/companies/".concat(e,"/permissions"),data:n});case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),M=function(){var t=a(i().mark((function t(e,n,o){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(r["b"])("/api/students/exportExcel?companyId=".concat(e,"&startDate=").concat(n,"&endDate=").concat(o),"student_excel_report.xlsx");case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),T=function(){var t=a(i().mark((function t(e,n,o){return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(r["b"])("/api/users/exportExcel?companyId=".concat(e,"&startDate=").concat(n,"&endDate=").concat(o),"user_excel_report.xlsx");case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),L=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("/registrationlinks/",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),A=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].put("/registrationlinks/".concat(e.reference),e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),D=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/registrationlinks/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/registrationlinks?companyId=".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/registrationlinks/".concat(e,"/extended"));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),P=function(){var t=a(i().mark((function t(e,n,o,s){var a;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].post("/registrationlinks/".concat(e,"/associateuser"),{},{params:{email:n,departmentId:o,password:s}});case 2:return a=t.sent,t.abrupt("return",a.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r,o){return t.apply(this,arguments)}}(),R=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].delete("/registrationlinks/".concat(e));case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),I=function(){var t=a(i().mark((function t(){var e;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].get("/registrationlinks");case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},c8af:function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},cada:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",[t.showEditor?e("editor-menu-bar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(n){var r=n.commands,o=n.isActive;return[e("div",{staticClass:"editor-menu"},[e("button",{staticClass:"editor-button",class:{"editor-button-active":o.bold()},on:{click:function(t){return t.preventDefault(),r.bold.apply(null,arguments)}}},[e("span",{staticClass:"font-bold"},[t._v("B")])]),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.italic()},on:{click:function(t){return t.preventDefault(),r.italic.apply(null,arguments)}}},[e("span",{staticClass:"italic"},[t._v("I")])]),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.heading({level:1})},on:{click:function(t){return t.preventDefault(),r.heading({level:1})}}},[e("span",{},[t._v("H1")])]),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.heading({level:2})},on:{click:function(t){return t.preventDefault(),r.heading({level:2})}}},[e("span",{},[t._v("H2")])]),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.heading({level:3})},on:{click:function(t){return t.preventDefault(),r.heading({level:3})}}},[e("span",{},[t._v("H3")])]),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.underline()},on:{click:function(t){return t.preventDefault(),r.underline.apply(null,arguments)}}},[e("UnderlineIcon",{staticClass:"icon"})],1),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.ordered_list()},on:{click:function(t){return t.preventDefault(),r.ordered_list.apply(null,arguments)}}},[e("OlIcon",{staticClass:"icon"})],1),e("button",{staticClass:"editor-button",class:{"editor-button-active":o.bullet_list()},on:{click:function(t){return t.preventDefault(),r.bullet_list.apply(null,arguments)}}},[e("UlIcon",{staticClass:"icon"})],1)])]}}],null,!1,3397012639)}):t._e(),!1===t.hideBorder?e("editor-content",{staticClass:"editor-content",class:{"editor-content-active":t.isFocused},attrs:{editor:t.editor}}):t._e(),!0===t.hideBorder?e("editor-content",{staticClass:"editor-content",class:{"editor-content-active":t.isFocused},staticStyle:{border:"0",padding:"0"},attrs:{editor:t.editor}}):t._e()],1)},o=[],i=n("4524"),s=n("3d9d"),a=n("ac12");function c(t){this.content=t}c.prototype={constructor:c,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new c(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new c(n)},addToStart:function(t,e){return new c([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new c(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new c(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=c.from(t),t.size?new c(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=c.from(t),t.size?new c(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=c.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},c.from=function(t){if(t instanceof c)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new c(e)};var l=c;function u(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=u(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function h(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);while(t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1])t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=h(s.content,a.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class f{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],c=s+a.nodeSize;if(c>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,(s,a)=>{let c=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"===typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new f(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new f(n,r)}cutByIndex(t,e){return t==e?f.empty:0==t&&e==this.content.length?this:new f(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new f(r,o)}addToStart(t){return new f([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new f(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return u(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return h(this,t,e,n)}findIndex(t,e=-1){if(0==t)return d(0,t);if(t==this.size)return d(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=t)return i==t||e>0?d(n+1,i):d(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return f.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new f(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return f.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new f(e||t,n)}static from(t){if(!t)return f.empty;if(t instanceof f)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new f([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}f.empty=new f([],0);const p={index:0,offset:0};function d(t,e){return p.index=t,p.offset=e,p}function m(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!m(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!m(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class g{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&m(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return g.none;if(t instanceof g)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}g.none=[];class y extends Error{}class v{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=b(this.content,t+this.openStart,e);return n&&new v(n,this.openStart,this.openEnd)}removeBetween(t,e){return new v(w(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return v.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new v(f.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)r++;return new v(t,n,r)}}function w(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(w(i.content,e-o-1,n-o-1)))}function b(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=b(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function x(t,e,n){if(n.openStart>t.depth)throw new y("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new y("Inconsistent open depths");return k(t,e,n,0)}function k(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=k(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=L(n,t);return N(i,M(t,o,s,e,r))}{let r=t.parent,o=r.content;return N(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return N(i,T(t,e,r))}function S(t,e){if(!e.type.compatibleContent(t.type))throw new y("Cannot join "+e.type.name+" onto "+t.type.name)}function O(t,e,n){let r=t.node(n);return S(r,e.node(n)),r}function E(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function C(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(E(t.nodeAfter,r),i++));for(let a=i;a<s;a++)E(o.child(a),r);e&&e.depth==n&&e.textOffset&&E(e.nodeBefore,r)}function N(t,e){return t.type.checkContent(e),t.copy(e)}function M(t,e,n,r,o){let i=t.depth>o&&O(t,e,o+1),s=r.depth>o&&O(n,r,o+1),a=[];return C(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(S(i,s),E(N(i,M(t,e,n,r,o+1)),a)):(i&&E(N(i,T(t,e,o+1)),a),C(e,n,o,a),s&&E(N(s,T(n,r,o+1)),a)),C(r,null,o,a),new f(a)}function T(t,e,n){let r=[];if(C(null,t,n,r),t.depth>n){let o=O(t,e,n+1);E(N(o,T(t,e,n+1)),r)}return C(e,null,n,r),new f(r)}function L(t,e){let n=e.depth-t.openStart,r=e.node(n),o=r.copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(f.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}v.empty=new v(f.empty,0,0);class A{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return t=this.resolveDepth(t),0==t?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let o=0;o<t;o++)r+=n.child(o).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return g.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new P(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let i=t;;){let{index:t,offset:e}=i.content.findIndex(o),s=o-e;if(n.push(i,t,r+e),!s)break;if(i=i.child(t),i.isText)break;o=s-1,r+=e+1}return new A(e,n,o)}static resolveCached(t,e){let n=j.get(t);if(n)for(let o=0;o<n.elts.length;o++){let t=n.elts[o];if(t.pos==e)return t}else j.set(t,n=new D);let r=n.elts[n.i]=A.resolve(t,e);return n.i=(n.i+1)%_,r}}class D{constructor(){this.elts=[],this.i=0}}const _=12,j=new WeakMap;class P{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const R=Object.create(null);class I{constructor(t,e,n,r=g.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||f.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&m(this.attrs,e||t.defaultAttrs||R)&&g.sameSet(this.marks,n||g.none)}copy(t=null){return t==this.content?this:new I(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new I(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return v.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i),c=a.content.cut(r.pos-s,o.pos-s);return new v(c,r.depth-i,o.depth-i)}replace(t,e,n){return x(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return A.resolveCached(this,t)}resolveNoCache(t){return A.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),B(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=f.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let a=r;a<o;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=g.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!g.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=void 0;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=f.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}I.prototype.text=void 0;class $ extends I{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):B(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new $(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new $(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function B(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class z{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new F(t,e);if(null==n.next)return z.empty;let r=V(n);n.next&&n.err("Unexpected trailing text");let o=Z(K(r));return Q(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return f.from(s.map(t=>t.createAndFill()));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}return o(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];while(n.length){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}return e(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let o=0;o<e.next.length;o++)r+=(o?", ":"")+e.next[o].type.name+"->"+t.indexOf(e.next[o].next);return r}).join("\n")}}z.empty=new z(!0);class F{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function V(t){let e=[];do{e.push(U(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function U(t){let e=[];do{e.push(q(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function q(t){let e=W(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=H(t,e)}return e}function G(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function H(t,e){let n=G(t),r=n;return t.eat(",")&&(r="}"!=t.next?G(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function J(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let t=n[i];t.groups.indexOf(e)>-1&&o.push(t)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}function W(t){if(t.eat("(")){let e=V(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=J(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}function K(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach(t=>t.to=e)}function i(t,e){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(i(n,e)),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}function Y(t,e){return e-t}function X(t,e){let n=[];return r(e),n.sort(Y);function r(e){let o=t[e];if(1==o.length&&!o[0].term)return r(o[0].to);n.push(e);for(let t=0;t<o.length;t++){let{term:e,to:i}=o[t];e||-1!=n.indexOf(i)||r(i)}}}function Z(t){let e=Object.create(null);return n(X(t,0));function n(r){let o=[];r.forEach(e=>{t[e].forEach(({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);X(t,n).forEach(t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})})});let i=e[r.join(",")]=new z(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Y);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}function Q(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function tt(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function et(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function nt(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let n=t[o];n.validate&&n.validate(e[o])}}function rt(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new st(t,r,e[r]);return n}class ot{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=rt(t,n.attrs),this.defaultAttrs=tt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==z.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:et(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new I(this,this.computeAttrs(t),f.from(e),g.setFrom(n))}createChecked(t=null,e,n){return e=f.from(e),this.checkContent(e),new I(this,this.computeAttrs(t),e,g.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),e=f.from(e),e.size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(f.empty,!0);return o?new I(this,t,e.append(o),g.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){nt(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:g.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new ot(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function it(t,e,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class st{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?it(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class at{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=rt(t,r.attrs),this.excluded=null;let o=tt(this.attrs);this.instance=o?new g(this,o):null}create(t=null){return!t&&this.instance?this.instance:new g(this,et(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,o)=>n[t]=new at(t,r++,e,o)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){nt(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class ct{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=l.from(t.nodes),e.marks=l.from(t.marks||{}),this.nodes=ot.compile(this.spec.nodes,this),this.marks=at.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[e]||(n[e]=z.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?lt(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:lt(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof ot))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new $(n,n.defaultAttrs,t,g.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return I.fromJSON(this,t)}markFromJSON(t){return g.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function lt(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ut(t){return null!=t.tag}function ht(t){return null!=t.style}class ft{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(ut(t))this.tags.push(t);else if(ht(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new xt(this,e,!1);return n.addAll(t,g.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new xt(this,e,!0);return n.addAll(t,g.none,e.from,e.to),v.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(St(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r],o=null==t.priority?50:t.priority;if(o<n)break}e.splice(r,0,t)}for(let r in t.marks){let e=t.marks[r].spec.parseDOM;e&&e.forEach(t=>{n(t=Ot(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)})}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach(t=>{n(t=Ot(t)),t.node||t.ignore||t.mark||(t.node=r)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ft(t,ft.schemaRules(t)))}}const pt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},dt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mt={ol:!0,ul:!0},gt=1,yt=2,vt=4;function wt(t,e,n){return null!=e?(e?gt:0)|("full"===e?yt:0):t&&"pre"==t.whitespace?gt|yt:n&~vt}class bt{constructor(t,e,n,r,o,i){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=g.none,this.match=o||(i&vt?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(f.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&gt)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=f.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(f.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!pt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class xt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=wt(null,e.preserveWhitespace,0)|(n?vt:0);r=o?new bt(o.type,o.attrs,g.none,!0,e.topMatch||o.type.contentMatch,i):new bt(n?null:t.schema.topNodeType,null,g.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top;if(r.options&yt||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&gt)n=r.options&yt?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],o=t.previousSibling;(!e||o&&"BR"==o.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r,o=t.nodeName.toLowerCase();mt.hasOwnProperty(o)&&this.parser.normalizeLists&&kt(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,n));if(i?i.ignore:dt.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let n,r=this.top,s=this.needsBlock;if(pt.hasOwnProperty(o))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t,e);let a=i&&i.skip?e:this.readStyles(t,e);a&&this.addAll(t,a),n&&this.sync(r),this.needsBlock=s}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,i,n,!1===i.consuming?r:void 0)}}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let t=this.parser.matchedStyles[r],o=n.getPropertyValue(t);if(o)for(let n=void 0;;){let r=this.parser.matchStyle(t,o,this,n);if(!r)break;if(r.ignore)return null;if(e=r.clearMark?e.filter(t=>!r.clearMark(t)):e.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return e}addElementByRule(t,e,n,r){let o,i;if(e.node)if(i=this.parser.schema.nodes[e.node],i.isLeaf)this.insertNode(i.create(e.attrs),n)||this.leafFallback(t,n);else{let t=this.enter(i,e.attrs||null,n,e.preserveWhitespace);t&&(o=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n)}o&&this.sync(s)&&this.open--}addAll(t,e,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=null==r?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i,e);this.findAtPoint(t,o)}findPlace(t,e){let n,r;for(let o=this.open;o>=0;o--){let e=this.nodes[o],i=e.findWrapping(t);if(i&&(!n||n.length>i.length)&&(n=i,r=e,!i.length))break;if(e.solid)break}if(!n)return null;this.sync(r);for(let o=0;o<n.length;o++)e=this.enterInner(n[o],null,e,!1);return e}insertNode(t,e){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let n=this.findPlace(t,e);if(n){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let r=g.none;for(let o of n.concat(t.marks))(e.type?e.type.allowsMarkType(o.type):Et(o.type,t.type))&&(r=o.addToSet(r));return e.content.push(t.mark(r)),!0}return!1}enter(t,e,n,r){let o=this.findPlace(t.create(e),n);return o&&(o=this.enterInner(t,e,n,!0,r)),o}enterInner(t,e,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(t);let s=wt(t,o,i.options);i.options&vt&&0==i.content.length&&(s|=vt);let a=g.none;return n=n.filter(e=>!(i.type?i.type.allowsMarkType(e.type):Et(e.type,t))||(a=e.addToSet(a),!1)),this.nodes.push(new bt(t,e,a,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){let t=e.compareDocumentPosition(this.find[r].node);t&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function kt(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&mt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}function St(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ot(t){let e={};for(let n in t)e[n]=t[n];return e}function Et(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Ct{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Mt(e).createDocumentFragment());let r=n,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let n=0,i=0;while(n<o.length&&i<t.marks.length){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}while(n<o.length)r=o.pop()[1];while(i<t.marks.length){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Dt(Mt(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Dt(Mt(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return Dt(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ct(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Nt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Nt(t.marks)}}function Nt(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Mt(t){return t.document||window.document}const Tt=new WeakMap;function Lt(t){let e=Tt.get(t);return void 0===e&&Tt.set(t,e=At(t)),e}function At(t){let e=null;function n(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(let e=0;e<t.length;e++)n(t[e]);else for(let e in t)n(t[e])}return n(t),e}function Dt(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Lt(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let c=n?t.createElementNS(n,i):t.createElement(i),l=e[1],u=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){u=2;for(let t in l)if(null!=l[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),l[t]):c.setAttribute(t,l[t])}}for(let h=u;h<e.length;h++){let o=e[h];if(0===o){if(h<e.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:i}=Dt(t,o,n,r);if(c.appendChild(e),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:c,contentDOM:s}}const _t=65535,jt=Math.pow(2,16);function Pt(t,e){return t+e*jt}function Rt(t){return t&_t}function It(t){return(t-(t&_t))/jt}const $t=1,Bt=2,zt=4,Ft=8;class Vt{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(this.delInfo&Ft)>0}get deletedBefore(){return(this.delInfo&($t|zt))>0}get deletedAfter(){return(this.delInfo&(Bt|zt))>0}get deletedAcross(){return(this.delInfo&zt)>0}}class Ut{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Ut.empty)return Ut.empty}recover(t){let e=0,n=Rt(t);if(!this.inverted)for(let r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+It(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let c=this.ranges[s+o],l=this.ranges[s+i],u=a+c;if(t<=u){let o=c?t==a?-1:t==u?1:e:e,i=a+r+(o<0?0:l);if(n)return i;let h=t==(e<0?a:u)?null:Pt(s/3,t-a),f=t==a?Bt:t==u?$t:zt;return(e<0?t!=a:t!=u)&&(f|=Ft),new Vt(i,f,h)}r+=l-c}return n?t+r:new Vt(t+r,0,null)}touches(t,e){let n=0,r=Rt(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let e=this.ranges[s]-(this.inverted?n:0);if(e>t)break;let a=this.ranges[s+o],c=e+a;if(t<=c&&s==3*r)return!0;n+=this.ranges[s+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[r+e],l=this.ranges[r+n];t(s,s+c,a,a+l),o+=l-c}}invert(){return new Ut(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Ut.empty:new Ut(t<0?[0,-t,0]:[0,0,t])}}Ut.empty=new Ut([]);class qt{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new qt(this.maps,this.mirror,t,e)}copy(){return new qt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new qt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let o=this.from;o<this.to;o++){let n=this.maps[o],i=n.mapResult(t,e);if(null!=i.recover){let e=this.getMirror(o);if(null!=e&&e>o&&e<this.to){o=e,t=this.maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new Vt(t,r,null)}}const Gt=Object.create(null);class Ht{getMap(){return Ut.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Gt[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Gt)throw new RangeError("Duplicate use of step JSON ID "+t);return Gt[t]=e,e.prototype.jsonID=t,e}}class Jt{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new Jt(t,null)}static fail(t){return new Jt(null,t)}static fromReplace(t,e,n,r){try{return Jt.ok(t.replace(e,n,r))}catch(o){if(o instanceof y)return Jt.fail(o.message);throw o}}}function Wt(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Wt(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return f.fromArray(r)}class Kt extends Ht{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new v(Wt(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,r),e.openStart,e.openEnd);return Jt.fromReplace(t,this.from,this.to,o)}invert(){return new Yt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Kt(e.pos,n.pos,this.mark)}merge(t){return t instanceof Kt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Kt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Kt(e.from,e.to,t.markFromJSON(e.mark))}}Ht.jsonID("addMark",Kt);class Yt extends Ht{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new v(Wt(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return Jt.fromReplace(t,this.from,this.to,n)}invert(){return new Kt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Yt(e.pos,n.pos,this.mark)}merge(t){return t instanceof Yt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Yt(e.from,e.to,t.markFromJSON(e.mark))}}Ht.jsonID("removeMark",Yt);class Xt extends Ht{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Jt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Jt.fromReplace(t,this.pos,this.pos+1,new v(f.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new Xt(this.pos,e.marks[n]);return new Xt(this.pos,this.mark)}}return new Zt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Xt(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Xt(e.pos,t.markFromJSON(e.mark))}}Ht.jsonID("addNodeMark",Xt);class Zt extends Ht{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Jt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return Jt.fromReplace(t,this.pos,this.pos+1,new v(f.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new Xt(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Zt(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zt(e.pos,t.markFromJSON(e.mark))}}Ht.jsonID("removeNodeMark",Zt);class Qt extends Ht{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&ee(t,this.from,this.to)?Jt.fail("Structure replace would overwrite content"):Jt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ut([this.from,this.to-this.from,this.slice.size])}invert(t){return new Qt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new Qt(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof Qt)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?v.empty:new v(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Qt(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?v.empty:new v(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Qt(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Qt(e.from,e.to,v.fromJSON(t,e.slice),!!e.structure)}}Ht.jsonID("replace",Qt);class te extends Ht{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(ee(t,this.from,this.gapFrom)||ee(t,this.gapTo,this.to)))return Jt.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Jt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?Jt.fromReplace(t,this.from,this.to,n):Jt.fail("Content does not fit in gap")}getMap(){return new Ut([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new te(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new te(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new te(e.from,e.to,e.gapFrom,e.gapTo,v.fromJSON(t,e.slice),e.insert,!!e.structure)}}function ee(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;while(o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));while(o>0){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function ne(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,(t,c,l)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,e),h=Math.min(c+t.nodeSize,n),f=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[t])?o.to=h:s.push(o=new Yt(l,h,u[t])));i&&i.to==l?i.to=h:a.push(i=new Kt(l,h,r))}}),s.forEach(e=>t.step(e)),a.forEach(e=>t.step(e))}function re(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof at){let e,n=t.marks;while(e=r.isInSet(n))(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,c=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&c.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:c,from:Math.max(s,e),to:r,step:i})}}}),o.forEach(e=>t.step(new Yt(e.from,e.to,e.style)))}function oe(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<i.childCount;c++){let e=i.child(c),l=a+e.nodeSize,u=r.matchType(e.type);if(u){r=u;for(let r=0;r<e.marks.length;r++)n.allowsMarkType(e.marks[r].type)||t.step(new Yt(a,l,e.marks[r]));if(o&&e.isText&&"pre"!=n.whitespace){let t,r,o=/\r?\n|\r/g;while(t=o.exec(e.text))r||(r=new v(f.from(n.schema.text(" ",n.allowedMarks(e.marks))),0,0)),s.push(new Qt(a+t.index,a+t.index+t[0].length,r))}}else s.push(new Qt(a,l,v.empty));a=l}if(!r.validEnd){let e=r.fillBefore(f.empty,!0);t.replace(a,a,new v(e,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function ie(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function se(t){let e=t.parent,n=e.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let e=t.$from.node(r),o=t.$from.index(r),i=t.$to.indexAfter(r);if(r<t.depth&&e.canReplace(o,i,n))return r;if(0==r||e.type.spec.isolating||!ie(e,o,i))break}return null}function ae(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),c=s,l=a,u=f.empty,h=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=f.from(r.node(m).copy(u)),h++):c--;let p=f.empty,d=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)<o.end(m)?(g=!0,p=f.from(o.node(m).copy(p)),d++):l++;t.step(new te(c,l,s,a,new v(u.append(p),h,d),u.size-h,!0))}function ce(t,e,n=null,r=t){let o=ue(t,e),i=o&&he(r,e);return i?o.map(le).concat({type:e,attrs:n}).concat(i.map(le)):null}function le(t){return{type:t,attrs:null}}function ue(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function he(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=s.length?s[s.length-1]:e,c=a.contentMatch;for(let l=r;c&&l<o;l++)c=c.matchType(n.child(l).type);return c&&c.validEnd?s:null}function fe(t,e,n){let r=f.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=f.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new te(o,i,o,i,new v(r,0,0),n.length,!0))}function pe(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{let s="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(r,s)&&ge(t.doc,t.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let t="pre"==r.whitespace,e=!!r.contentMatch.matchType(r.schema.linebreakReplacement);t&&!e?o=!1:!t&&e&&(o=!0)}!1===o&&me(t,e,n,i),oe(t,t.mapping.slice(i).map(n,1),r,void 0,null===o);let a=t.mapping.slice(i),c=a.map(n,1),l=a.map(n+e.nodeSize,1);return t.step(new te(c,l,c+1,l-1,new v(f.from(r.create(s,null,e.marks)),0,0),1,!0)),!0===o&&de(t,e,n,i),!1}})}function de(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;while(s=a.exec(o.text)){let o=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(o,o+1,e.type.schema.linebreakReplacement.create())}}})}function me(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text("\n"))}})}function ge(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function ye(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new te(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new v(f.from(s),0,0),1,!0))}function ve(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let l=o.depth-1,u=n-2;l>i;l--,u--){let t=o.node(l),e=o.index(l);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),i=r&&r[u+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let s=r&&r[u]||t;if(!t.canReplace(e+1,t.childCount)||!s.type.validContent(n))return!1}let a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function we(t,e,n=1,r){let o=t.doc.resolve(e),i=f.empty,s=f.empty;for(let a=o.depth,c=o.depth-n,l=n-1;a>c;a--,l--){i=f.from(o.node(a).copy(i));let t=r&&r[l];s=f.from(t?t.type.create(t.attrs,s):o.node(a).copy(s))}t.step(new Qt(e,e,new v(i.append(s),n,n),!0))}function be(t,e){let n=t.resolve(e),r=n.index();return xe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function xe(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function ke(t,e,n){let r=new Qt(e-n,e+n,v.empty,!0);t.step(r)}function Se(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let t=r.index(o);if(r.node(o).canReplaceWith(t,t,n))return r.before(o+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let t=r.indexAfter(o);if(r.node(o).canReplaceWith(t,t,n))return r.after(o+1);if(t<r.node(o).childCount)return null}return null}function Oe(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(0==n.openStart&&n.size?2:1);i++)for(let t=r.depth;t>=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),a=!1;if(1==i)a=s.canReplace(n,n,o);else{let t=s.contentMatchAt(n).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(n,n,t[0])}if(a)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}function Ee(t,e,n=e,r=v.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Ce(o,i,r)?new Qt(e,n,r):new Ne(o,i,r).fit()}function Ce(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Ht.jsonID("replaceAround",te);class Ne{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=f.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=f.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){while(this.unplaced.size){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;while(i&&s&&1==o.childCount)o=o.firstChild.content,i--,s--;let a=new v(o,i,s);return t>-1?new te(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Qt(n.pos,r.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let o=e.firstChild;if(e.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){t=n;break}e=o.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,r=null;n?(r=Le(this.unplaced.content,n-1).firstChild,t=r.content):t=this.unplaced.content;let o=t.firstChild;for(let i=this.depth;i>=0;i--){let t,{type:s,match:a}=this.frontier[i],c=null;if(1==e&&(o?a.matchType(o.type)||(c=a.fillBefore(f.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:i,parent:r,inject:c};if(2==e&&o&&(t=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:r,wrap:t};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Le(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new v(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Le(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new v(Me(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new v(Me(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){while(this.depth>e)this.closeFrontierNode();if(o)for(let f=0;f<o.length;f++)this.openFrontierNode(o[f]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,c=0,l=[],{match:u,type:h}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)l.push(r.child(t));u=u.matchFragment(r)}let p=s.size+t-(i.content.size-i.openEnd);while(c<s.childCount){let t=s.child(c),e=u.matchType(t.type);if(!e)break;c++,(c>1||0==a||t.content.size)&&(u=e,l.push(Ae(t.mark(h.allowedMarks(t.marks)),1==c?a:0,c==s.childCount?p:-1)))}let d=c==s.childCount;d||(p=-1),this.placed=Te(this.placed,e,f.from(l)),this.frontier[e].match=u,d&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<p;f++){let t=m.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),m=t.content}this.unplaced=d?0==t?v.empty:new v(Me(i.content,t-1,1),t-1,p<0?i.openEnd:t-1):new v(Me(i.content,t,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!De(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);while(n>1&&r==this.$to.end(--n))++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=De(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=De(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;while(this.depth>e.depth)this.closeFrontierNode();e.fit.childCount&&(this.placed=Te(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Te(this.placed,this.depth,f.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop(),e=t.match.fillBefore(f.empty,!0);e.childCount&&(this.placed=Te(this.placed,this.frontier.length,e))}}function Me(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Me(t.firstChild.content,e-1,n)))}function Te(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Te(t.lastChild.content,e-1,n)))}function Le(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ae(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ae(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(f.empty,!0)))),t.copy(r)}function De(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!_e(n,i.content,s)?a:null}function _e(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function je(t){return t.spec.defining||t.spec.definingForContent}function Pe(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Ce(o,i,r))return t.step(new Qt(e,n,r));let s=Be(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let t=o.node(f).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let c=s.indexOf(a),l=[],u=r.openStart;for(let f=r.content,p=0;;p++){let t=f.firstChild;if(l.push(t),p==r.openStart)break;f=t.content}for(let f=u-1;f>=0;f--){let t=l[f],e=je(t.type);if(e&&!t.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(e||!t.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let e=(f+u+1)%(r.openStart+1),a=l[e];if(a)for(let l=0;l<s.length;l++){let u=s[(l+c)%s.length],h=!0;u<0&&(h=!1,u=-u);let f=o.node(u-1),p=o.index(u-1);if(f.canReplaceWith(p,p,a.type,a.marks))return t.replace(o.before(u),h?i.after(u):n,new v(Re(r.content,0,r.openStart,e),e,r.openEnd))}}let h=t.steps.length;for(let f=s.length-1;f>=0;f--){if(t.replace(e,n,r),t.steps.length>h)break;let a=s[f];a<0||(e=o.before(a),n=i.after(a))}}function Re(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Re(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(f.empty,!0))}return t}function Ie(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Se(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new v(f.from(r),0,0))}function $e(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Be(r,o);for(let s=0;s<i.length;s++){let e=i[s],n=s==i.length-1;if(n&&0==e||r.node(e).type.contentMatch.validEnd)return t.delete(r.start(e),o.end(e));if(e>0&&(n||r.node(e-1).canReplace(r.index(e-1),o.indexAfter(e-1))))return t.delete(r.before(e),o.after(e))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Be(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let r=t.start(o);if(r<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(r==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==r-1)&&n.push(o)}return n}class ze extends Ht{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return Jt.fail("No node at attribute step's position");let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return Jt.fromReplace(t,this.pos,this.pos+1,new v(f.from(r),0,e.isLeaf?0:1))}getMap(){return Ut.empty}invert(t){return new ze(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ze(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new ze(e.pos,e.attr,e.value)}}Ht.jsonID("attr",ze);class Fe extends Ht{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return Jt.ok(n)}getMap(){return Ut.empty}invert(t){return new Fe(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Fe(e.attr,e.value)}}Ht.jsonID("docAttr",Fe);let Ve=class extends Error{};Ve=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Ve.prototype=Object.create(Error.prototype),Ve.prototype.constructor=Ve,Ve.prototype.name="TransformError";class Ue{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new qt}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ve(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=v.empty){let r=Ee(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new v(f.from(n),0,0))}delete(t,e){return this.replace(t,e,v.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return Pe(this,t,e,n),this}replaceRangeWith(t,e,n){return Ie(this,t,e,n),this}deleteRange(t,e){return $e(this,t,e),this}lift(t,e){return ae(this,t,e),this}join(t,e=1){return ke(this,t,e),this}wrap(t,e){return fe(this,t,e),this}setBlockType(t,e=t,n,r=null){return pe(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return ye(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new ze(t,e,n)),this}setDocAttribute(t,e){return this.step(new Fe(t,e)),this}addNodeMark(t,e){return this.step(new Xt(t,e)),this}removeNodeMark(t,e){if(!(e instanceof g)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e=e.isInSet(n.marks),!e)return this}return this.step(new Zt(t,e)),this}split(t,e=1,n){return we(this,t,e,n),this}addMark(t,e,n){return ne(this,t,e,n),this}removeMark(t,e,n){return re(this,t,e,n),this}clearIncompatible(t,e,n){return oe(this,t,e,n),this}}const qe=Object.create(null);class Ge{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new He(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=v.empty){let n=e.content.lastChild,r=null;for(let s=0;s<e.openEnd;s++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:c}=i[s],l=t.mapping.slice(o);t.replaceRange(l.map(a.pos),l.map(c.pos),s?v.empty:e),0==s&&nn(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),c=a.map(i.pos),l=a.map(s.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,e),nn(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Ke(t):en(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let o=t.depth-1;o>=0;o--){let r=e<0?en(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):en(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Qe(t.node(0))}static atStart(t){return en(t,t,0,0,1)||new Qe(t)}static atEnd(t){return en(t,t,t.content.size,t.childCount,-1)||new Qe(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=qe[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in qe)throw new RangeError("Duplicate use of selection JSON ID "+t);return qe[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}Ge.prototype.visible=!0;class He{constructor(t,e){this.$from=t,this.$to=e}}let Je=!1;function We(t){Je||t.parent.inlineContent||(Je=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ke extends Ge{constructor(t,e=t){We(t),We(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Ge.near(n);let r=t.resolve(e.map(this.anchor));return new Ke(r.parent.inlineContent?r:n,n)}replace(t,e=v.empty){if(super.replace(t,e),e==v.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Ke&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ye(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ke(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Ge.findFrom(e,n,!0)||Ge.findFrom(e,-n,!0);if(!t)return Ge.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(Ge.findFrom(t,-n,!0)||Ge.findFrom(t,n,!0)).$anchor,t.pos<e.pos!=r<0&&(t=e))),new Ke(t,e)}}Ge.jsonID("text",Ke);class Ye{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Ye(t.map(this.anchor),t.map(this.head))}resolve(t){return Ke.between(t.resolve(this.anchor),t.resolve(this.head))}}class Xe extends Ge{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?Ge.near(o):new Xe(o)}content(){return new v(f.from(this.node),0,0)}eq(t){return t instanceof Xe&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ze(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Xe(t.resolve(e.anchor))}static create(t,e){return new Xe(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Xe.prototype.visible=!1,Ge.jsonID("node",Xe);class Ze{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Ye(n,n):new Ze(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Xe.isSelectable(n)?new Xe(e):Ge.near(e)}}class Qe extends Ge{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=v.empty){if(e==v.empty){t.delete(0,t.doc.content.size);let e=Ge.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Qe(t)}map(t){return new Qe(t)}eq(t){return t instanceof Qe}getBookmark(){return tn}}Ge.jsonID("all",Qe);const tn={map(){return this},resolve(t){return new Qe(t)}};function en(t,e,n,r,o,i=!1){if(e.inlineContent)return Ke.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Xe.isSelectable(r))return Xe.create(t,n-(o<0?r.nodeSize:0))}else{let e=en(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function nn(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Qt||o instanceof te))return;let i,s=t.mapping.maps[r];s.forEach((t,e,n,r)=>{null==i&&(i=r)}),t.setSelection(Ge.near(t.doc.resolve(i),n))}const rn=1,on=2,sn=4;class an extends Ue{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|rn)&~on,this.storedMarks=null,this}get selectionSet(){return(this.updated&rn)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=on,this}ensureMarks(t){return g.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&on)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~on,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||g.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Ge.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=sn,this}get scrolledIntoView(){return(this.updated&sn)>0}}function cn(t,e){return e&&t?t.bind(e):t}class ln{constructor(t,e,n){this.name=t,this.init=cn(e.init,n),this.apply=cn(e.apply,n)}}const un=[new ln("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ln("selection",{init(t,e){return t.selection||Ge.atStart(e.doc)},apply(t){return t.selection}}),new ln("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ln("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class hn{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=un.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new ln(t.key,t.spec.state,t))})}}class fn{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,c=r?r[i].state:this,l=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,c,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<i?{state:n,n:e.length}:{state:this,n:0})}e.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new fn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new an(this)}static create(t){let e=new hn(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new fn(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new hn(this.schema,t.plugins),n=e.fields,r=new fn(e);for(let o=0;o<n.length;o++){let e=n[o].name;r[e]=this.hasOwnProperty(e)?this[e]:n[o].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new hn(t.schema,t.plugins),o=new fn(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=I.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Ge.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}}),o}}function pn(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=pn(o,e,{})),n[r]=o}return n}class dn{constructor(t){this.spec=t,this.props={},t.props&&pn(t.props,this,this.props),this.key=t.key?t.key.key:gn("plugin")}getState(t){return t[this.key]}}const mn=Object.create(null);function gn(t){return t in mn?t+"$"+ ++mn[t]:(mn[t]=0,t+"$")}class yn{constructor(t="key"){this.key=gn(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const vn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},wn=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let bn=null;const xn=function(t,e,n){let r=bn||(bn=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},kn=function(){bn=null},Sn=function(t,e,n,r){return n&&(En(t,e,n,r,-1)||En(t,e,n,r,1))},On=/^(img|br|input|textarea|hr)$/i;function En(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Cn(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Ln(t)||On.test(t.nodeName)||"false"==t.contentEditable)return!1;e=vn(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if(t=t.childNodes[e+(o<0?-1:0)],"false"==t.contentEditable)return!1;e=o<0?Cn(t):0}}}function Cn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Nn(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;t=t.childNodes[e-1],e=Cn(t)}else{if(!t.parentNode||Ln(t))return null;e=vn(t),t=t.parentNode}}}function Mn(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||Ln(t))return null;e=vn(t)+1,t=t.parentNode}}}function Tn(t,e,n){for(let r=0==e,o=e==Cn(t);r||o;){if(t==n)return!0;let e=vn(t);if(t=t.parentNode,!t)return!1;r=r&&0==e,o=o&&e==Cn(t)}}function Ln(t){let e;for(let n=t;n;n=n.parentNode)if(e=n.pmViewDesc)break;return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const An=function(t){return t.focusNode&&Sn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Dn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function _n(t){let e=t.activeElement;while(e&&e.shadowRoot)e=e.shadowRoot.activeElement;return e}function jn(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Cn(r.offsetNode),r.offset)}}catch(r){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Cn(r.startContainer),r.startOffset)}}}const Pn="undefined"!=typeof navigator?navigator:null,Rn="undefined"!=typeof document?document:null,In=Pn&&Pn.userAgent||"",$n=/Edge\/(\d+)/.exec(In),Bn=/MSIE \d/.exec(In),zn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),Fn=!!(Bn||zn||$n),Vn=Bn?document.documentMode:zn?+zn[1]:$n?+$n[1]:0,Un=!Fn&&/gecko\/(\d+)/i.test(In);Un&&(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const qn=!Fn&&/Chrome\/(\d+)/.exec(In),Gn=!!qn,Hn=qn?+qn[1]:0,Jn=!Fn&&!!Pn&&/Apple Computer/.test(Pn.vendor),Wn=Jn&&(/Mobile\/\w+/.test(In)||!!Pn&&Pn.maxTouchPoints>2),Kn=Wn||!!Pn&&/Mac/.test(Pn.platform),Yn=!!Pn&&/Win/.test(Pn.platform),Xn=/Android \d/.test(In),Zn=!!Rn&&"webkitFontSmoothing"in Rn.documentElement.style,Qn=Zn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tr(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function er(t,e){return"number"==typeof t?t:t[e]}function nr(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function rr(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;;s=wn(s)){if(!s)break;if(1!=s.nodeType)continue;let t=s,n=t==i.body,a=n?tr(i):nr(t),c=0,l=0;if(e.top<a.top+er(r,"top")?l=-(a.top-e.top+er(o,"top")):e.bottom>a.bottom-er(r,"bottom")&&(l=e.bottom-e.top>a.bottom-a.top?e.top+er(o,"top")-a.top:e.bottom-a.bottom+er(o,"bottom")),e.left<a.left+er(r,"left")?c=-(a.left-e.left+er(o,"left")):e.right>a.right-er(r,"right")&&(c=e.right-a.right+er(o,"right")),c||l)if(n)i.defaultView.scrollBy(c,l);else{let n=t.scrollLeft,r=t.scrollTop;l&&(t.scrollTop+=l),c&&(t.scrollLeft+=c);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function or(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=t.root.elementFromPoint(i,s);if(!r||r==t.dom||!t.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:ir(t.dom)}}function ir(t){let e=[],n=t.ownerDocument;for(let r=t;r;r=wn(r))if(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t==n)break;return e}function sr({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;ar(n,0==r?0:r-e)}function ar(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let cr=null;function lr(t){if(t.setActive)return t.setActive();if(cr)return t.focus(cr);let e=ir(t);t.focus(null==cr?{get preventScroll(){return cr={preventScroll:!0},!0}}:void 0),cr||(cr=!1,ar(e,0))}function ur(t,e){let n,r,o,i,s=2e8,a=0,c=e.top,l=e.top;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let t;if(1==u.nodeType)t=u.getClientRects();else{if(3!=u.nodeType)continue;t=xn(u).getClientRects()}for(let f=0;f<t.length;f++){let p=t[f];if(p.top<=c&&p.bottom>=l){c=Math.max(p.bottom,c),l=Math.min(p.top,l);let t=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(t<s){n=u,s=t,r=t&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==u.nodeType&&t&&(a=h+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!o&&p.left<=e.left&&p.right>=e.left&&(o=u,i={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=h+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?hr(n,r):!n||s&&1==n.nodeType?{node:t,offset:a}:ur(n,r)}function hr(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let n=wr(r,1);if(n.top!=n.bottom&&fr(e,n))return{node:t,offset:o+(e.left>=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}function fr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function pr(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function dr(t,e,n){let{node:r,offset:o}=ur(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function mr(t,e,n,r){let o=-1;for(let i=e,s=!1;;){if(i==t.dom)break;let e=t.docView.nearestDesc(i,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&(!s&&t.left>r.left||t.top>r.top?o=e.posBefore:(!s&&t.right<r.left||t.bottom<r.top)&&(o=e.posAfter),s=!0),!e.contentDOM&&o<0&&!e.node.isText){let n=e.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2;return n?e.posBefore:e.posAfter}}i=e.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function gr(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=t.childNodes[i];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let o=t[r];if(fr(e,o))return gr(n,e,o)}}if((i=(i+1)%r)==o)break}return t}function yr(t,e){let n,r=t.dom.ownerDocument,o=0,i=jn(r,e.left,e.top);i&&({node:n,offset:o}=i);let s,a=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!a||!t.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=t.dom.getBoundingClientRect();if(!fr(e,n))return null;if(a=gr(t.dom,e,n),!a)return null}if(Jn)for(let l=a;n&&l;l=wn(l))l.draggable&&(n=void 0);if(a=pr(a,e),n){if(Un&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let t,r=n.childNodes[o];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&o++}let r;Zn&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&o--,n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=mr(t,n,o,e))}null==s&&(s=dr(t,a,e));let c=t.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function vr(t){return t.top<t.bottom||t.left<t.right}function wr(t,e){let n=t.getClientRects();if(n.length){let t=n[e<0?0:n.length-1];if(vr(t))return t}return Array.prototype.find.call(n,vr)||t.getBoundingClientRect()}const br=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function xr(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Zn||Un;if(3==r.nodeType){if(!s||!br.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,kr(wr(xn(r,t,e),i),i<0)}{let t=wr(xn(r,o,o),n);if(Un&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let e=wr(xn(r,o-1,o-1),-1);if(e.top==t.top){let n=wr(xn(r,o,o+1),-1);if(n.top!=t.top)return kr(n,n.left<e.left)}}return t}}let a=t.state.doc.resolve(e-(i||0));if(!a.parent.inlineContent){if(null==i&&o&&(n<0||o==Cn(r))){let t=r.childNodes[o-1];if(1==t.nodeType)return Sr(t.getBoundingClientRect(),!1)}if(null==i&&o<Cn(r)){let t=r.childNodes[o];if(1==t.nodeType)return Sr(t.getBoundingClientRect(),!0)}return Sr(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Cn(r))){let t=r.childNodes[o-1],e=3==t.nodeType?xn(t,Cn(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return kr(wr(e,1),!1)}if(null==i&&o<Cn(r)){let t=r.childNodes[o];while(t.pmViewDesc&&t.pmViewDesc.ignoreForCoords)t=t.nextSibling;let e=t?3==t.nodeType?xn(t,0,s?0:1):1==t.nodeType?t:null:null;if(e)return kr(wr(e,-1),!0)}return kr(wr(3==r.nodeType?xn(r):r,-n),n>=0)}function kr(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Sr(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Or(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function Er(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return Or(t,e,()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=xr(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=xn(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let o=e[t];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}const Cr=/[\u0590-\u08ac]/;function Nr(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?Cr.test(r.parent.textContent)&&a.modify?Or(t,e,()=>{let{focusNode:e,focusOffset:o,anchorNode:i,anchorOffset:s}=t.domSelectionRange(),c=a.caretBidiLevel;a.modify("move",n,"character");let l=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:u,focusOffset:h}=t.domSelectionRange(),f=u&&!l.contains(1==u.nodeType?u:u.parentNode)||e==u&&o==h;try{a.collapse(i,s),e&&(e!=i||o!=s)&&a.extend&&a.extend(e,o)}catch(p){}return null!=c&&(a.caretBidiLevel=c),f}):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}let Mr=null,Tr=null,Lr=!1;function Ar(t,e,n){return Mr==e&&Tr==n?Lr:(Mr=e,Tr=n,Lr="up"==n||"down"==n?Er(t,e,n):Nr(t,e,n))}const Dr=0,_r=1,jr=2,Pr=3;class Rr{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=Dr,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.previousSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.nextSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>vn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],o=n+r.size;if(n==t&&o!=n){while(!r.border&&r.children.length)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n,r=0,o=0;for(let i=0;r<this.children.length;r++){let e=this.children[r],n=i+e.size;if(n>t||e instanceof Ur){o=t-i;break}i=n}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ir&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;;r--,n=!1)if(t=r?this.children[r-1]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?vn(t.dom)+1:0}}{let t,n=!0;for(;;r++,n=!1)if(t=r<this.children.length?this.children[r]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&n&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?vn(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&t<=a){let o=i+n.border;if(t>=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=vn(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=vn(n.dom);break}e+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let o=Math.min(t,e),i=Math.max(t,e);for(let f=0,p=0;f<this.children.length;f++){let s=this.children[f],a=p+s.size;if(o>p&&i<a)return s.setSelection(t-p-s.border,e-p-s.border,n,r);p=a}let s=this.domFromPos(t,t?-1:1),a=e==t?s:this.domFromPos(e,e?-1:1),c=n.getSelection(),l=!1;if((Un||Jn)&&t==e){let{node:t,offset:e}=s;if(3==t.nodeType){if(l=!(!e||"\n"!=t.nodeValue[e-1]),l&&e==t.nodeValue.length)for(let n,r=t;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:vn(n)+1});break}let t=r.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];l=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Un&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let t=c.focusNode.childNodes[c.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||l&&Jn)&&Sn(s.node,s.offset,c.anchorNode,c.anchorOffset)&&Sn(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((c.extend||t==e)&&!l){c.collapse(s.node,s.offset);try{t!=e&&c.extend(a.node,a.offset),u=!0}catch(h){}}if(!u){if(t>e){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?jr:_r,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=Pr);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?Pr:jr}n=i}this.dirty=jr}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?jr:_r;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class Ir extends Rr{constructor(t,e,n,r){let o,i=e.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return this.dirty==Dr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class $r extends Rr{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Br extends Rr{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=Ct.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new Br(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return this.dirty&Pr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Pr&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=Dr){let t=this.parent;while(!t.node)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=Dr}}slice(t,e,n){let r=Br.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;e<i&&(o=so(o,e,i,n)),t>0&&(o=so(o,0,t,n));for(let s=0;s<o.length;s++)o[s].parent=r;return r.children=o,r}}class zr extends Rr{constructor(t,e,n,r,o,i,s,a,c){super(t,[],o,i),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(t,e,n,r,o,i){let s,a=o.nodeViews[e.type.name],c=a&&a(e,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i,n,r),l=c&&c.dom,u=c&&c.contentDOM;if(e.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(e.text);else if(!l){let t=Ct.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:l,contentDOM:u}=t)}u||e.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),e.type.spec.draggable&&(l.draggable=!0));let h=l;return l=Xr(l,n,e),c?s=new qr(t,e,n,r,l,u||null,h,c,o,i+1):e.isText?new Vr(t,e,n,r,l,h,o):new zr(t,e,n,r,l,u||null,h,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>f.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return this.dirty==Dr&&t.eq(this.node)&&Zr(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new to(this,i&&i.node,t);ro(this.node,this.innerDeco,(e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?g.none:this.node.child(o).marks,n,t),a.placeWidget(e,t,r)},(e,i,c,l)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,i,c,l)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(e,i,c,u,t)||a.updateNextNode(e,i,c,t,l,r)||a.addNode(e,i,c,t,r),r+=e.nodeSize}),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==jr)&&(i&&this.protectLocalComposition(t,i),Gr(this.contentDOM,this.children,t),Wn&&oo(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Ke)||n<e||r>e+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let t=o.nodeValue,i=io(this.node.content,t,n-e,r-e);return i<0?null:{node:o,pos:i,text:t}}return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;for(;;o=o.parentNode){if(o.parentNode==this.contentDOM)break;while(o.previousSibling)o.parentNode.removeChild(o.previousSibling);while(o.nextSibling)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new $r(this,o,e,r);t.input.compositionNodes.push(i),this.children=so(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(this.dirty==Pr||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Dr}updateOuterDeco(t){if(Zr(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Kr(this.dom,this.nodeDOM,Wr(this.outerDeco,this.node,e),Wr(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Fr(t,e,n,r,o){Xr(r,e,t);let i=new zr(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Vr extends zr{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;while(t&&t!=this.dom&&!t.pmIsDeco)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(this.dirty==Pr||this.dirty!=Dr&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==Dr&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=Dr,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new Vr(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=Pr)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Ur extends Rr{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Dr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class qr extends zr{constructor(t,e,n,r,o,i,s,a,c,l){super(t,e,n,r,o,i,s,c,l),this.spec=a}update(t,e,n,r){if(this.dirty==Pr)return!1;if(this.spec.update){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Gr(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){while(a!=r)r=Qr(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof Br){let e=r?r.previousSibling:t.lastChild;Gr(s.contentDOM,s.children,n),r=e?e.nextSibling:t.firstChild}}while(r)r=Qr(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Hr=function(t){t&&(this.nodeName=t)};Hr.prototype=Object.create(null);const Jr=[new Hr];function Wr(t,e,n){if(0==t.length)return Jr;let r=n?Jr[0]:new Hr,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Hr(s.nodeName));for(let t in s){let i=s[t];null!=i&&(n&&1==o.length&&o.push(r=new Hr(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+i:"style"==t?r.style=(r.style?r.style+";":"")+i:"nodeName"!=t&&(r[t]=i))}}}return o}function Kr(t,e,n,r){if(n==Jr&&r==Jr)return e;let o=e;for(let i=0;i<r.length;i++){let e=r[i],s=n[i];if(i){let n;s&&s.nodeName==e.nodeName&&o!=t&&(n=o.parentNode)&&n.nodeName.toLowerCase()==e.nodeName||(n=document.createElement(e.nodeName),n.pmIsDeco=!0,n.appendChild(o),s=Jr[0]),o=n}Yr(o,s||Jr[0],e)}return o}function Yr(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==o.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<o.length;e++)-1==r.indexOf(o[e])&&t.classList.add(o[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;while(n=r.exec(e.style))t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function Xr(t,e,n){return Kr(t,t,Jr,Wr(e,n,1!=t.nodeType))}function Zr(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Qr(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class to{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=eo(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,o=this.stack.length>>1,i=Math.min(o,t.length);while(r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning)r++;while(r<o)this.destroyRest(),this.top.dirty=Dr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;while(o<t.length){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++){let n=this.top.children[e];if(n.matchesMark(t[o])&&!this.isLocked(n.dom)){r=e;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Br.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(t,e,n)&&!this.preMatch.matched.has(r)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,e,n,r,o){let i=this.top.children[r];return i.dirty==Pr&&i.dom==i.contentDOM&&(i.dirty=jr),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof zr){let c=this.preMatch.matched.get(a);if(null!=c&&c!=o)return!1;let l,u=a.dom,h=this.isLocked(u)&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&a.dirty!=Pr&&Zr(e,a.outerDeco));if(!h&&a.update(t,e,n,r))return this.destroyBetween(this.index,s),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(l=this.recreateWrapper(a,t,e,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=l,l.contentDOM&&(l.dirty=jr,l.updateChildren(r,i+1),l.dirty=Dr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,o,i){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Zr(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=zr.create(this.top,e,n,r,o,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let t of s.children)t.parent=s}return t.destroy(),s}addNode(t,e,n,r,o){let i=zr.create(this.top,t,e,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ir(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;while(t instanceof Br)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof Vr)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Jn||Gn)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new Ur(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function eo(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:while(o>0){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof Br)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function no(t,e){return t.type.side-e.type.side}function ro(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;n<t.childCount;n++){let s=t.child(n);r(s,o,e.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],c=null;for(let l=0;;){let u,h,f,p;while(s<o.length&&o[s].to==i){let t=o[s++];t.widget&&(u?(h||(h=[u])).push(t):u=t)}if(u)if(h){h.sort(no);for(let t=0;t<h.length;t++)n(h[t],l,!!c)}else n(u,l,!!c);if(c)p=-1,f=c,c=null;else{if(!(l<t.childCount))break;p=l,f=t.child(l++)}for(let t=0;t<a.length;t++)a[t].to<=i&&a.splice(t--,1);while(s<o.length&&o[s].from<=i&&o[s].to>i)a.push(o[s++]);let d=i+f.nodeSize;if(f.isText){let t=d;s<o.length&&o[s].from<t&&(t=o[s].from);for(let e=0;e<a.length;e++)a[e].to<t&&(t=a[e].to);t<d&&(c=f.cut(t-i),f=f.cut(0,t-i),d=t,p=-1)}else while(s<o.length&&o[s].to<d)s++;let m=f.isInline&&!f.isLeaf?a.filter(t=>!t.inline):a.slice();r(f,m,e.forChild(i,f),p),i=d}}function oo(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function io(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let c=s.text;while(o<t.childCount){let e=t.child(o++);if(i+=e.nodeSize,!e.isText)break;c+=e.text}if(i>=n){if(i>=r&&c.slice(r-e.length-a,r-a)==e)return r-e.length;let t=a<r?c.lastIndexOf(e,r-a-1):-1;if(t>=0&&t+e.length+a>=n)return a+t;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function so(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let c=t[s],l=a,u=a+=c.size;l>=n||u<=e?i.push(c):(l<e&&i.push(c.slice(0,e-l,r)),o&&(i.push(o),o=void 0),u>n&&i.push(c.slice(n-l,c.size,r)))}return i}function ao(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,c,l=r.resolve(s);if(An(n)){a=s;while(o&&!o.node)o=o.parent;let t=o.node;if(o&&t.isAtom&&Xe.isSelectable(t)&&o.parent&&(!t.isInline||!Tn(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;c=new Xe(s==t?l:r.resolve(t))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let e=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);e=Math.min(e,t.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,t.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(e<0)return null;[a,s]=o==t.state.selection.anchor?[o,e]:[e,o],l=r.resolve(s)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let n="pointer"==e||t.state.selection.head<l.pos&&!i?1:-1;c=wo(t,u,l,n)}return c}function co(t){return t.editable?t.hasFocus():xo(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function lo(t,e=!1){let n=t.state.selection;if(yo(t,n),co(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Gn){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&Sn(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)go(t);else{let r,o,{anchor:i,head:s}=n;!uo||n instanceof Ke||(n.$from.parent.inlineContent||(r=ho(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=ho(t,n.to))),t.docView.setSelection(i,s,t.root,e),uo&&(r&&po(r),o&&po(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&mo(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const uo=Jn||Gn&&Hn<63;function ho(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Jn&&o&&"false"==o.contentEditable)return fo(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return fo(o);if(i)return fo(i)}}function fo(t){return t.contentEditable="true",Jn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function po(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function mo(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{co(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")},20))})}function go(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setStart(r.parentNode,vn(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Fn&&Vn<=11&&(r.disabled=!0,r.disabled=!1)}function yo(t,e){if(e instanceof Xe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(vo(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else vo(t)}function vo(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function wo(t,e,n,r){return t.someProp("createSelectionBetween",r=>r(t,e,n))||Ke.between(e,n,r)}function bo(t){return!(t.editable&&!t.hasFocus())&&xo(t)}function xo(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function ko(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Sn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function So(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ge.findFrom(i,e)}function Oo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Eo(t,e,n){let r=t.state.selection;if(!(r instanceof Ke)){if(r instanceof Xe&&r.node.isInline)return Oo(t,new Ke(e>0?r.$to:r.$from));{let n=So(t.state,e);return!!n&&Oo(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=t.state.doc.resolve(n.pos+o.nodeSize*(e<0?-1:1));return Oo(t,new Ke(r.$anchor,i))}if(!r.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=So(t.state,e);return!!(n&&n instanceof Xe)&&Oo(t,n)}if(!(Kn&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Xe.isSelectable(i)?Oo(t,new Xe(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Zn&&Oo(t,new Ke(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Co(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function No(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Mo(t,e){return e<0?To(t):Lo(t)}function To(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Un&&1==n.nodeType&&r<Co(n)&&No(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(No(t,-1))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Ao(n))break;{let e=n.previousSibling;while(e&&No(e,-1))o=n.parentNode,i=vn(e),e=e.previousSibling;if(e)n=e,r=Co(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?jo(t,n,r):o&&jo(t,o,i)}function Lo(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Co(n);for(;;)if(r<s){if(1!=n.nodeType)break;let t=n.childNodes[r];if(!No(t,1))break;o=n,i=++r}else{if(Ao(n))break;{let e=n.nextSibling;while(e&&No(e,1))o=e.parentNode,i=vn(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Co(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&jo(t,o,i)}function Ao(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Do(t,e){while(t&&e==t.childNodes.length&&!Ln(t))e=vn(t)+1,t=t.parentNode;while(t&&e<t.childNodes.length){let n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}function _o(t,e){while(t&&!e&&!Ln(t))e=vn(t),t=t.parentNode;while(t&&e){let n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=t.childNodes.length}}function jo(t,e,n){if(3!=e.nodeType){let t,r;(r=Do(e,n))?(e=r,n=0):(t=_o(e,n))&&(e=t,n=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(An(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&lo(t)},50)}function Po(t,e){let n=t.state.doc.resolve(e);if(!Gn&&!Yn&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(e<n.end()){let n=t.coordsAtPos(e+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}let r=getComputedStyle(t.dom).direction;return"rtl"==r?"rtl":"ltr"}function Ro(t,e,n){let r=t.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1)return!1;if(Kn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=So(t.state,e);if(n&&n instanceof Xe)return Oo(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Qe?Ge.near(n,e):Ge.findFrom(n,e);return!!s&&Oo(t,s)}return!1}function Io(t,e){if(!(t.state.selection instanceof Ke))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function $o(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Bo(t){if(!Jn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;$o(t,n,"true"),setTimeout(()=>$o(t,n,"false"),20)}return!1}function zo(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Fo(t,e){let n=e.keyCode,r=zo(e);if(8==n||Kn&&72==n&&"c"==r)return Io(t,-1)||Mo(t,-1);if(46==n&&!e.shiftKey||Kn&&68==n&&"c"==r)return Io(t,1)||Mo(t,1);if(13==n||27==n)return!0;if(37==n||Kn&&66==n&&"c"==r){let e=37==n?"ltr"==Po(t,t.state.selection.from)?-1:1:-1;return Eo(t,e,r)||Mo(t,e)}if(39==n||Kn&&70==n&&"c"==r){let e=39==n?"ltr"==Po(t,t.state.selection.from)?1:-1:1;return Eo(t,e,r)||Mo(t,e)}return 38==n||Kn&&80==n&&"c"==r?Ro(t,-1,r)||Mo(t,-1):40==n||Kn&&78==n&&"c"==r?Bo(t)||Ro(t,1,r)||Mo(t,1):r==(Kn?"m":"c")&&(66==n||73==n||89==n||90==n)}function Vo(t,e){t.someProp("transformCopied",n=>{e=n(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;while(o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||Ct.fromSchema(t.state.schema),a=Qo(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let l,u=c.firstChild,h=0;while(u&&1==u.nodeType&&(l=Xo[u.nodeName.toLowerCase()])){for(let t=l.length-1;t>=0;t--){let e=a.createElement(l[t]);while(c.firstChild)e.appendChild(c.firstChild);c.appendChild(e),h++}u=c.firstChild}u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${h?" -"+h:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",n=>n(e,t))||e.content.textBetween(0,e.content.size,"\n\n");return{dom:c,text:f,slice:e}}function Uo(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(r||a||!n);if(c){if(t.someProp("transformPastedText",n=>{e=n(e,a||r,t)}),a)return e?new v(f.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):v.empty;let n=t.someProp("clipboardTextParser",n=>n(e,o,r,t));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Ct.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))})}}else t.someProp("transformPastedHTML",e=>{n=e(n,t)}),i=ei(n),Zn&&ni(i);let l=i&&i.querySelector("[data-pm-slice]"),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let t=i.firstChild;while(t&&1!=t.nodeType)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||ft.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!c&&!u),context:o,ruleFromNode(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||qo.test(t.parentNode.nodeName)?null:{ignore:!0}}})}if(u)s=ri(Yo(s,+u[1],+u[2]),u[4]);else if(s=v.maxOpen(Go(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t<s.openStart&&!n.type.spec.isolating;t++,n=n.firstChild);for(let n=s.content.lastChild;e<s.openEnd&&!n.type.spec.isolating;e++,n=n.lastChild);s=Yo(s,t,e)}return t.someProp("transformPasted",e=>{s=e(s,t)}),s}const qo=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Go(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n),i=o.contentMatchAt(e.index(n)),s=[];if(t.forEach(t=>{if(!s)return;let e,n=i.findWrapping(t.type);if(!n)return s=null;if(e=s.length&&r.length&&Jo(n,r,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=Wo(s[s.length-1],r.length));let e=Ho(t,n);s.push(e),i=i.matchType(e.type),r=n}}),s)return f.from(s)}return t}function Ho(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,f.from(t));return t}function Jo(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Jo(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));let s=r.contentMatchAt(r.childCount);if(s.matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(f.from(Ho(n,t,o+1))))}}function Wo(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,Wo(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(f.empty,!0);return t.copy(n.append(r))}function Ko(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Ko(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(f.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Yo(t,e,n){return e<t.openStart&&(t=new v(Ko(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new v(Ko(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Xo={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Zo=null;function Qo(){return Zo||(Zo=document.implementation.createHTMLDocument("title"))}function ti(t){let e=window.trustedTypes;return e?e.createPolicy("detachedDocument",{createHTML:t=>t}).createHTML(t):t}function ei(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=Qo().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);if((n=o&&Xo[o[1].toLowerCase()])&&(t=n.map(t=>"<"+t+">").join("")+t+n.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=ti(t),n)for(let i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}function ni(t){let e=t.querySelectorAll(Gn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function ri(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(a){return t}let{content:o,openStart:i,openEnd:s}=t;for(let c=n.length-2;c>=0;c-=2){let t=r.nodes[n[c]];if(!t||t.hasRequiredAttrs())break;o=f.from(t.create(n[c+1],o)),i++,s++}return new v(o,i,s)}const oi={},ii={},si={touchstart:!0,touchmove:!0};class ai{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ci(t){for(let e in oi){let n=oi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!pi(t,e)||fi(t,e)||!t.editable&&e.type in ii||n(t,e)},si[e]?{passive:!0}:void 0)}Jn&&t.dom.addEventListener("input",()=>null),hi(t)}function li(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ui(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function hi(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>fi(t,e))})}function fi(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)})}function pi(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function di(t,e){fi(t,e)||!oi[e.type]||!t.editable&&e.type in ii||oi[e.type](t,e)}function mi(t){return{left:t.clientX,top:t.clientY}}function gi(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function yi(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,e=>s>i.depth?e(t,n,i.nodeAfter,i.before(s),o,!0):e(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function vi(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function wi(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Xe.isSelectable(r))&&(vi(t,new Xe(n),"pointer"),!0)}function bi(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Xe&&(n=o.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let t=s>i.depth?i.nodeAfter:i.node(s);if(Xe.isSelectable(t)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(vi(t,Xe.create(t.state.doc,r),"pointer"),!0)}function xi(t,e,n,r,o){return yi(t,"handleClickOn",e,n,r)||t.someProp("handleClick",n=>n(t,e,r))||(o?bi(t,n):wi(t,n))}function ki(t,e,n,r){return yi(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",n=>n(t,e,r))}function Si(t,e,n,r){return yi(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",n=>n(t,e,r))||Oi(t,n,r)}function Oi(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(vi(t,Ke.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let e=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(e.inlineContent)vi(t,Ke.create(r,n+1,n+1+e.content.size),"pointer");else{if(!Xe.isSelectable(e))continue;vi(t,Xe.create(r,n),"pointer")}return!0}}function Ei(t){return ji(t)}ii.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Mi(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Xn||!Gn||13!=n.keyCode))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():229!=n.keyCode&&t.domObserver.forceFlush(),!Wn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",e=>e(t,n))||Fo(t,n)?n.preventDefault():li(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",e=>e(t,Dn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},ii.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},ii.keypress=(t,e)=>{let n=e;if(Mi(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Kn&&n.metaKey)return;if(t.someProp("handleKeyPress",e=>e(t,n)))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,e))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const Ci=Kn?"metaKey":"ctrlKey";oi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ei(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&gi(n,t.input.lastClick)&&!n[Ci]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(mi(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Ni(t,s,n,!!r)):("doubleClick"==i?ki:Si)(t,s.pos,s.inside,n)?n.preventDefault():li(t,"pointer"))};class Ni{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Ci],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a&&1==a.dom.nodeType?a.dom:null;let{selection:c}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof Xe&&c.from<=i&&c.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Un||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),li(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>lo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(mi(t))),this.updateAllowDefault(t),this.allowDefault||!e?li(this.view,"pointer"):xi(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Jn&&this.mightDrag&&!this.mightDrag.node.isAtom||Gn&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(vi(this.view,Ge.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):li(this.view,"pointer")}move(t){this.updateAllowDefault(t),li(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function Mi(t,e){return!!t.composing||!!(Jn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}oi.touchstart=t=>{t.input.lastTouch=Date.now(),Ei(t),li(t,"pointer")},oi.touchmove=t=>{t.input.lastTouch=Date.now(),li(t,"pointer")},oi.contextmenu=t=>Ei(t);const Ti=Xn?5e3:-1;function Li(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ji(t),e))}function Ai(t){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=_i());while(t.input.compositionNodes.length>0)t.input.compositionNodes.pop().markParentsDirty()}function Di(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Nn(e.focusNode,e.focusOffset),r=Mn(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let e=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=n.pmViewDesc;if(t&&t.isText(n.nodeValue))return r}}return n||r}function _i(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ji(t,e=!1){if(!(Xn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ai(t),e||t.docView&&t.docView.dirty){let n=ao(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||t.state.selection.empty?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}function Pi(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}ii.compositionstart=ii.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||n.marks(),ji(t,!0),t.markCursor=null;else if(ji(t,!e.selection.empty),Un&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}Li(t,Ti)},ii.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Li(t,20))};const Ri=Fn&&Vn<15||Wn&&Qn<604;function Ii(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}function $i(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Bi(t,r.value,null,o,e):Bi(t,r.textContent,r.innerHTML,o,e)},50)}function Bi(t,e,n,r,o){let i=Uo(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",e=>e(t,o,i||v.empty)))return!0;if(!i)return!1;let s=Ii(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function zi(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}oi.copy=ii.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ri?null:n.clipboardData,s=r.content(),{dom:a,text:c}=Vo(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):Pi(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ii.paste=(t,e)=>{let n=e;if(t.composing&&!Xn)return;let r=Ri?null:n.clipboardData,o=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Bi(t,zi(r),r.getData("text/html"),o,n)?n.preventDefault():$i(t,n)};class Fi{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const Vi=Kn?"altKey":"ctrlKey";oi.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=t.state.selection,s=i.empty?null:t.posAtCoords(mi(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Xe?i.to-1:i.to));else if(r&&r.mightDrag)o=Xe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(o=Xe.create(t.state.doc,e.posBefore))}let a=(o||t.state.selection).content(),{dom:c,text:l,slice:u}=Vo(t,a);(!n.dataTransfer.files.length||!Gn||Hn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ri?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ri||n.dataTransfer.setData("text/plain",l),t.dragging=new Fi(u,!n[Vi],o)},oi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},ii.dragover=ii.dragenter=(t,e)=>e.preventDefault(),ii.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(mi(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",e=>{s=e(s,t)}):s=Uo(t,zi(n.dataTransfer),Ri?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Vi]);if(t.someProp("handleDrop",e=>e(t,n,s||v.empty,a)))return void n.preventDefault();if(!s)return;n.preventDefault();let c=s?Oe(t.state.doc,i.pos,s):i.pos;null==c&&(c=i.pos);let l=t.state.tr;if(a){let{node:t}=r;t?t.replace(l):l.deleteSelection()}let u=l.mapping.map(c),h=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=l.doc;if(h?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(f))return;let p=l.doc.resolve(u);if(h&&Xe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Xe(p));else{let e=l.mapping.map(c);l.mapping.maps[l.mapping.maps.length-1].forEach((t,n,r,o)=>e=o),l.setSelection(wo(t,p,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},oi.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&lo(t)},20))},oi.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},oi.beforeinput=(t,e)=>{let n=e;if(Gn&&Xn&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",e=>e(t,Dn(8,"Backspace"))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let os in ii)oi[os]=ii[os];function Ui(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class qi{constructor(t,e){this.toDOM=t,this.spec=e||Ki,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Ji(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof qi&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ui(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Gi{constructor(t,e){this.attrs=t,this.spec=e||Ki}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Ji(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Gi&&Ui(this.attrs,t.attrs)&&Ui(this.spec,t.spec)}static is(t){return t.type instanceof Gi}destroy(){}}class Hi{constructor(t,e){this.attrs=t,this.spec=e||Ki}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Ji(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof Hi&&Ui(this.attrs,t.attrs)&&Ui(this.spec,t.spec)}destroy(){}}class Ji{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Ji(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new Ji(t,t,new qi(e,n))}static inline(t,e,n,r){return new Ji(t,e,new Gi(n,r))}static node(t,e,n,r){return new Ji(t,e,new Hi(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Gi}get widget(){return this.type instanceof qi}}const Wi=[],Ki={};class Yi{constructor(t,e){this.local=t.length?t:Wi,this.children=e.length?e:Wi}static create(t,e){return e.length?is(e,t,0,Ki):Xi}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Xi||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Ki)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?Qi(this.children,i||[],t,e,n,r,o):i?new Yi(i.sort(ss),Wi):Xi}add(t,e){return e.length?this==Xi?Yi.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach((t,i)=>{let s,a=i+n;if(s=ns(e,t,a)){r||(r=this.children.slice());while(o<r.length&&r[o]<i)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,is(s,t,a+1,Ki)),o+=3}});let i=ts(o?rs(e):e,-n);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||i.splice(s--,1);return new Yi(i.length?this.local.concat(i).sort(ss):this.local,r||this.children)}remove(t){return 0==t.length||this==Xi?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let o=0;o<n.length;o+=3){let r,i=n[o]+e,s=n[o+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(r||(r=[])).push(e));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[o+2].removeInner(r,i+1);a!=Xi?n[o+2]=a:(n.splice(o,3),o-=3)}if(r.length)for(let o,i=0;i<t.length;i++)if(o=t[i])for(let t=0;t<r.length;t++)r[t].eq(o,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Yi(r,n):Xi}forChild(t,e){if(this==Xi)return this;if(e.isLeaf)return Yi.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(n=this.children[s+2]);break}let o=t+1,i=o+e.content.size;for(let s=0;s<this.local.length;s++){let t=this.local[s];if(t.from<i&&t.to>o&&t.type instanceof Gi){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let t=new Yi(r.sort(ss),Wi);return n?new Zi([t,n]):t}return n||Xi}eq(t){if(this==t)return!0;if(!(t instanceof Yi)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return as(this.localsInner(t))}localsInner(t){if(this==Xi)return Wi;if(t.inlineContent||!this.local.some(Gi.is))return this.local;let e=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Gi||e.push(this.local[n]);return e}forEachSet(t){t(this)}}Yi.empty=new Yi([],[]),Yi.removeOverlap=as;const Xi=Yi.empty;class Zi{constructor(t){this.members=t}map(t,e){const n=this.members.map(n=>n.map(t,e,Ki));return Zi.from(n)}forChild(t,e){if(e.isLeaf)return Yi.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Xi&&(o instanceof Zi?n=n.concat(o.members):n.push(o))}return Zi.from(n)}eq(t){if(!(t instanceof Zi)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?as(n?e:e.sort(ss)):Wi}static from(t){switch(t.length){case 0:return Xi;case 1:return t[0];default:return new Zi(t.every(t=>t instanceof Yi)?t:t.reduce((t,e)=>t.concat(e instanceof Yi?e:e.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function Qi(t,e,n,r,o,i,s){let a=t.slice();for(let l=0,u=i;l<n.maps.length;l++){let t=0;n.maps[l].forEach((e,n,r,o)=>{let i=o-r-(n-e);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||e>r+u-t)continue;let o=a[s]+u-t;n>=o?a[s+1]=e<=o?-2:-1:e>=u&&i&&(a[s]+=i,a[s+1]+=i)}t+=i}),u=n.maps[l].map(u,-1)}let c=!1;for(let l=0;l<a.length;l+=3)if(a[l+1]<0){if(-2==a[l+1]){c=!0,a[l+1]=-1;continue}let e=n.map(t[l]+i),u=e-o;if(u<0||u>=r.content.size){c=!0;continue}let h=n.map(t[l+1]+i,-1),f=h-o,{index:p,offset:d}=r.content.findIndex(u),m=r.maybeChild(p);if(m&&d==u&&d+m.nodeSize==f){let r=a[l+2].mapInner(n,m,e+1,t[l]+i+1,s);r!=Xi?(a[l]=u,a[l+1]=f,a[l+2]=r):(a[l+1]=-2,c=!0)}else c=!0}if(c){let c=es(a,t,e,n,o,i,s),l=is(c,r,0,s);e=l.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<l.children.length;t+=3){let n=l.children[t];while(e<a.length&&a[e]<n)e+=3;a.splice(e,0,l.children[t],l.children[t+1],l.children[t+2])}}return new Yi(e.sort(ss),a)}function ts(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Ji(o.from+e,o.to+e,o.type))}return n}function es(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&a(t[c+2],e[c]+i+1);return n}function ns(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i,s=0;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function rs(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function is(t,e,n,r){let o=[],i=!1;e.forEach((e,s)=>{let a=ns(t,e,s+n);if(a){i=!0;let t=is(a,e,n+s+1,r);t!=Xi&&o.push(s,s+e.nodeSize,t)}});let s=ts(i?rs(t):t,-n).sort(ss);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Yi(s,o):Xi}function ss(t,e){return t.from-e.from||t.to-e.to}function as(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),cs(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),cs(e,o+1,i.copy(r.to,i.to)))}}return e}function cs(t,e,n){while(e<t.length&&ss(n,t[e])>0)e++;t.splice(e,0,n)}function ls(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Xi&&e.push(r)}),t.cursorWrapper&&e.push(Yi.create(t.state.doc,[t.cursorWrapper.deco])),Zi.from(e)}const us={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},hs=Fn&&Vn<=11;class fs{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class ps{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new fs,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Fn&&Vn<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),hs&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,us)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(bo(this.view)){if(this.suppressingSelectionUpdates)return lo(this.view);if(Fn&&Vn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Sn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let o=t.focusNode;o;o=wn(o))n.add(o);for(let o=t.anchorNode;o;o=wn(o))if(n.has(o)){e=o;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}selectionChanged(t){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&bo(this.view)&&!this.ignoreSelectionChange(t)}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=this.selectionChanged(n),o=-1,i=-1,s=!1,a=[];if(t.editable)for(let l=0;l<e.length;l++){let t=this.registerMutation(e[l],a);t&&(o=o<0?t.from:Math.min(t.from,o),i=i<0?t.to:Math.max(t.to,i),t.typeOver&&(s=!0))}if(Un&&a.length){let e=a.filter(t=>"BR"==t.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&ws(t,n)==e||r.remove()}}}let c=null;o<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&An(n)&&(c=ao(t))&&c.eq(Ge.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,lo(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||r)&&(o>-1&&(t.docView.markDirty(o,i),gs(t)),this.handleDOMChange(o,i,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||lo(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++){let r=t.addedNodes[n];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,o=t.nextSibling;if(Fn&&Vn<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:i}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==t.target?vn(r)+1:0,s=n.localPosFromDOM(t.target,i,-1),a=o&&o.parentNode==t.target?vn(o):t.target.childNodes.length,c=n.localPosFromDOM(t.target,a,1);return{from:s,to:c}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let ds=new WeakMap,ms=!1;function gs(t){if(!ds.has(t)&&(ds.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=Un,ms)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ms=!0}}function ys(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Sn(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function vs(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return ys(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?ys(t,n):null}function ws(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let e=t.docView.nearestDesc(n,!0);if(e&&e.node.isBlock)return n}return null}function bs(t,e,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:c}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u=l.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:l.anchorOffset}],An(l)||r.push({node:l.focusNode,offset:l.focusOffset})),Gn&&8===t.input.lastKeyCode)for(let g=s;g>i;g--){let t=o.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let h=t.state.doc,f=t.someProp("domParser")||ft.fromSchema(t.state.schema),p=h.resolve(a),d=null,m=f.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:xs,context:p});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),d={anchor:t+a,head:e+a}}return{doc:m,sel:d,from:a,to:c}}function xs(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Jn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||Jn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ks=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ss(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=ao(t,e);if(n&&!t.state.selection.eq(n)){if(Gn&&Xn&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",e=>e(t,Dn(13,"Enter"))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),i&&r.setMeta("composition",i),t.dispatch(r)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c,l,u=t.state.selection,h=bs(t,e,n),f=t.state.doc,p=f.slice(h.from,h.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,l="end"):(c=t.state.selection.from,l="start"),t.input.lastKeyCode=null;let d=Ms(p.content,h.doc.content,h.from,c,l);if(d&&t.input.domChangeCount++,(Wn&&t.input.lastIOSEnter>Date.now()-225||Xn)&&o.some(t=>1==t.nodeType&&!ks.test(t.nodeName))&&(!d||d.endA>=d.endB)&&t.someProp("handleKeyDown",e=>e(t,Dn(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(!d){if(!(r&&u instanceof Ke&&!u.empty&&u.$head.sameParent(u.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let e=Os(t,t.state.doc,h.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);i&&n.setMeta("composition",i),t.dispatch(n)}}return}d={start:u.from,endA:u.to,endB:u.to}}t.state.selection.from<t.state.selection.to&&d.start==d.endB&&t.state.selection instanceof Ke&&(d.start>t.state.selection.from&&d.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?d.start=t.state.selection.from:d.endA<t.state.selection.to&&d.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(d.endB+=t.state.selection.to-d.endA,d.endA=t.state.selection.to)),Fn&&Vn<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>h.from&&"  "==h.doc.textBetween(d.start-h.from-1,d.start-h.from+1)&&(d.start--,d.endA--,d.endB--);let m,g=h.doc.resolveNoCache(d.start-h.from),y=h.doc.resolveNoCache(d.endB-h.from),v=f.resolve(d.start),w=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=d.endA;if((Wn&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&g.pos<h.doc.content.size&&!g.sameParent(y)&&(m=Ge.findFrom(h.doc.resolve(g.pos+1),1,!0))&&m.head==y.pos)&&t.someProp("handleKeyDown",e=>e(t,Dn(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>d.start&&Cs(f,d.start,d.endA,g,y)&&t.someProp("handleKeyDown",e=>e(t,Dn(8,"Backspace"))))return void(Xn&&Gn&&t.domObserver.suppressSelectionUpdates());Gn&&Xn&&d.endB==d.start&&(t.input.lastAndroidDelete=Date.now()),Xn&&!w&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==d.endA&&(d.endB-=2,y=h.doc.resolveNoCache(d.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",(function(e){return e(t,Dn(13,"Enter"))}))},20));let b,x,k,S=d.start,O=d.endA;if(w)if(g.pos==y.pos)Fn&&Vn<=11&&0==g.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>lo(t),20)),b=t.state.tr.delete(S,O),x=f.resolve(d.start).marksAcross(f.resolve(d.endA));else if(d.endA==d.endB&&(k=Es(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,d.endA-v.start()))))b=t.state.tr,"add"==k.type?b.addMark(S,O,k.mark):b.removeMark(S,O,k.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let e=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",n=>n(t,S,O,e)))return;b=t.state.tr.insertText(e,S,O)}if(b||(b=t.state.tr.replace(S,O,h.doc.slice(d.start-h.from,d.endB-h.from))),h.sel){let e=Os(t,b.doc,h.sel);e&&!(Gn&&Xn&&t.composing&&e.empty&&(d.start!=d.endB||t.input.lastAndroidDelete<Date.now()-100)&&(e.head==S||e.head==b.mapping.map(O)-1)||Fn&&e.empty&&e.head==S)&&b.setSelection(e)}x&&b.ensureMarks(x),i&&b.setMeta("composition",i),t.dispatch(b.scrollIntoView())}function Os(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:wo(t,e.resolve(n.anchor),e.resolve(n.head))}function Es(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,c=s;for(let u=0;u<s.length;u++)a=s[u].removeFromSet(a);for(let u=0;u<i.length;u++)c=i[u].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=t=>t.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let l=[];for(let u=0;u<e.childCount;u++)l.push(o(e.child(u)));if(f.from(l).eq(t))return{mark:r,type:n}}function Cs(t,e,n,r,o){if(n-e<=o.pos-r.pos||Ns(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let t=i.nodeAfter;return null!=t&&n==e+t.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Ns(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ns(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Ns(t,e,n){let r=t.depth,o=e?t.end():t.pos;while(r>0&&(e||t.indexAfter(r)==t.node(r).childCount))r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));while(e&&!e.isLeaf)e=e.firstChild,o++}return o}function Ms(t,e,n,r,o){let i=t.findDiffStart(e,n);if(null==i)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if("end"==o){let t=Math.max(0,i-Math.min(s,a));r-=s+t-i}if(s<i&&t.size<e.size){let t=r<=i&&r>=s?i-r:0;i-=t,i&&i<e.size&&Ts(e.textBetween(i-1,i+1))&&(i+=t?1:-1),a=i+(a-s),s=i}else if(a<i){let e=r<=i&&r>=a?i-r:0;i-=e,i&&i<t.size&&Ts(t.textBetween(i-1,i+1))&&(i+=e?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Ts(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Ls{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ai,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Is),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=_s(this),Ds(this),this.nodeViews=Ps(this),this.docView=Fr(this.state.doc,As(this),ls(this),this.dom,this),this.domObserver=new ps(this,(t,e,n,r)=>Ss(this,t,e,n,r)),this.domObserver.start(),ci(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&hi(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Is),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(Ai(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Ps(this);Rs(t,this.nodeViews)&&(this.nodeViews=t,o=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&hi(this),this.editable=_s(this),Ds(this);let a=ls(this),c=As(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=o||!this.docView.matchesNode(t.doc,c,a);!u&&t.selection.eq(r.selection)||(i=!0);let h="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&or(this);if(i){this.domObserver.stop();let e=u&&(Fn||Gn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&js(r.selection,t.selection);if(u){let n=Gn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Di(this)),!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Fr(t.doc,c,a,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ko(this))?lo(this,e):(yo(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():h&&sr(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",t=>t(this)));else if(this.state.selection instanceof Xe){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&rr(this,e.getBoundingClientRect(),t)}else rr(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;while(t=this.pluginViews.pop())t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(t,e){let n=t.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let t=n.from+(this.state.doc.content.size-e.doc.content.size),o=t>0&&this.state.doc.nodeAt(t);o==n.node&&(r=t)}this.dragging=new Fi(t.slice,t.move,r<0?void 0:Xe.create(this.state.doc,r))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[t];if(null!=r&&(n=e?e(r):r))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[t];if(null!=r&&(n=e?e(r):r))return n}}hasFocus(){if(Fn){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;while(t&&this.dom!=t&&this.dom.contains(t)){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&lr(this.dom),lo(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return t||document}updateRoot(){this._root=null}posAtCoords(t){return yr(this,t)}coordsAtPos(t,e=1){return xr(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return Ar(this,e||this.state,t)}pasteHTML(t,e){return Bi(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Bi(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(ui(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ls(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,kn())}get isDestroyed(){return null==this.docView}dispatchEvent(t){return di(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return t?Jn&&11===this.root.nodeType&&_n(this.dom.ownerDocument)==this.dom&&vs(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function As(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))}),e.translate||(e.translate="no"),[Ji.node(0,t.state.doc.content.size,e)]}function Ds(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ji.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function _s(t){return!t.someProp("editable",e=>!1===e(t.state))}function js(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ps(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Rs(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Is(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function $s(t={}){return new dn({view(e){return new Bs(e,t)}})}class Bs{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let o=e.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let r,o,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!i||i==document.body&&"static"==getComputedStyle(i).position)r=-pageXOffset,o=-pageYOffset;else{let t=i.getBoundingClientRect();r=t.left-i.scrollLeft,o=t.top-i.scrollTop}this.element.style.left=t.left-r+"px",this.element.style.top=t.top-o+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e,t):r;if(e&&!o){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Oe(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}for(var zs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Vs="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Us="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),qs=0;qs<10;qs++)zs[48+qs]=zs[96+qs]=String(qs);for(qs=1;qs<=24;qs++)zs[qs+111]="F"+qs;for(qs=65;qs<=90;qs++)zs[qs]=String.fromCharCode(qs+32),Fs[qs]=String.fromCharCode(qs);for(var Gs in zs)Fs.hasOwnProperty(Gs)||(Fs[Gs]=zs[Gs]);function Hs(t){var e=Vs&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Us&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key,n=!e&&t.key||(t.shiftKey?Fs:zs)[t.keyCode]||t.key||"Unidentified";return"Esc"==n&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n}const Js="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Ws(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a<i.length-1;a++){let t=i[a];if(/^(cmd|meta|m)$/i.test(t))o=!0;else if(/^a(lt)?$/i.test(t))e=!0;else if(/^(c|ctrl|control)$/i.test(t))n=!0;else if(/^s(hift)?$/i.test(t))r=!0;else{if(!/^mod$/i.test(t))throw new Error("Unrecognized modifier name: "+t);Js?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ks(t){let e=Object.create(null);for(let n in t)e[Ws(n)]=t[n];return e}function Ys(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Xs(t){return new dn({props:{handleKeyDown:Zs(t)}})}function Zs(t){let e=Ks(t);return function(t,n){let r,o=Hs(n),i=e[Ys(o,n)];if(i&&i(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=e[Ys(o,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=zs[n.keyCode])&&r!=o){let o=e[Ys(r,n)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}class Qs extends Ge{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return Qs.valid(n)?new Qs(n):Ge.near(n)}content(){return v.empty}eq(t){return t instanceof Qs&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Qs(t.resolve(e.pos))}getBookmark(){return new ta(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!ea(t)||!na(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&Qs.valid(t))return t;let r=t.pos,o=null;for(let n=t.depth;;n--){let i=t.node(n);if(e>0?t.indexAfter(n)<i.childCount:t.index(n)>0){o=i.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(Qs.valid(s))return s}for(;;){let i=e>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Xe.isSelectable(o)){t=t.doc.resolve(r+o.nodeSize*e),n=!1;continue t}break}o=i,r+=e;let s=t.doc.resolve(r);if(Qs.valid(s))return s}return null}}}Qs.prototype.visible=!1,Qs.findFrom=Qs.findGapCursorFrom,Ge.jsonID("gapcursor",Qs);class ta{constructor(t){this.pos=t}map(t){return new ta(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return Qs.valid(e)?new Qs(e):Ge.near(e)}}function ea(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function na(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function ra(){return new dn({props:{decorations:ca,createSelectionBetween(t,e,n){return e.pos==n.pos&&Qs.valid(n)?new Qs(n):null},handleClick:sa,handleKeyDown:oa,handleDOMEvents:{beforeinput:aa}}})}const oa=Zs({ArrowLeft:ia("horiz",-1),ArrowRight:ia("horiz",1),ArrowUp:ia("vert",-1),ArrowDown:ia("vert",1)});function ia(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){let i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof Ke){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let c=Qs.findGapCursorFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new Qs(c))),!0)}}function sa(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Qs.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Xe.isSelectable(t.state.doc.nodeAt(o.inside)))&&(t.dispatch(t.state.tr.setSelection(new Qs(r))),!0)}function aa(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Qs))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=f.empty;for(let s=r.length-1;s>=0;s--)o=f.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new v(o,0,0));return i.setSelection(Ke.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function ca(t){if(!(t.selection instanceof Qs))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Yi.create(t.doc,[Ji.widget(t.selection.head,e,{key:"gapcursor"})])}const la=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ua(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const ha=(t,e,n)=>{let r=ua(t,n);if(!r)return!1;let o=da(r);if(!o){let n=r.blockRange(),o=n&&se(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(Ma(t,o,e,-1))return!0;if(0==r.parent.content.size&&(fa(i,"end")||Xe.isSelectable(i)))for(let s=r.depth;;s--){let n=Ee(t.doc,r.before(s),r.after(s),v.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(fa(i,"end")?Ge.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Xe.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function fa(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const pa=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=da(r)}let s=i&&i.nodeBefore;return!(!s||!Xe.isSelectable(s))&&(e&&e(t.tr.setSelection(Xe.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function da(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ma(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const ga=(t,e,n)=>{let r=ma(t,n);if(!r)return!1;let o=va(r);if(!o)return!1;let i=o.nodeAfter;if(Ma(t,o,e,1))return!0;if(0==r.parent.content.size&&(fa(i,"start")||Xe.isSelectable(i))){let n=Ee(t.doc,r.before(),r.after(),v.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(fa(i,"start")?Ge.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Xe.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},ya=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=va(r)}let s=i&&i.nodeAfter;return!(!s||!Xe.isSelectable(s))&&(e&&e(t.tr.setSelection(Xe.create(t.doc,i.pos)).scrollIntoView()),!0)};function va(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const wa=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function ba(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const xa=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ba(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Ge.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0},ka=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Qe||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ba(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Ke.create(s.doc,n+1)),e(s.scrollIntoView())}return!0},Sa=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ve(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&se(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Oa(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Xe&&e.selection.node.isBlock)return!(!r.parentOffset||!ve(e.doc,r.pos))&&(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof Ke||e.selection instanceof Qe)&&s.deleteSelection();let a=0==r.depth?null:ba(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=t&&t(o.parent,i,r),l=c?[c]:i&&a?[{type:a}]:void 0,u=ve(s.doc,s.mapping.map(r.pos),1,l);if(l||u||!ve(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)||(a&&(l=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=a)){let t=s.mapping.map(r.before()),e=s.doc.resolve(t);a&&r.node(-1).canReplaceWith(e.index(),e.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const Ea=Oa(),Ca=(t,e)=>(e&&e(t.tr.setSelection(new Qe(t.doc))),!0);function Na(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(i,i+1)||!o.isTextblock&&!be(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}function Ma(t,e,n,r){let o,i,s=e.nodeBefore,a=e.nodeAfter,c=s.type.spec.isolating||a.type.spec.isolating;if(!c&&Na(t,e,n))return!0;let l=!c&&e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(o[0]||a.type).validEnd){if(n){let r=e.pos+a.nodeSize,i=f.empty;for(let t=o.length-1;t>=0;t--)i=f.from(o[t].create(null,i));i=f.from(s.copy(i));let c=t.tr.step(new te(e.pos-1,r,e.pos,r,new v(i,1,0),o.length,!0)),l=r+2*o.length;be(c.doc,l)&&c.join(l),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Ge.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),p=h&&se(h);if(null!=p&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(l&&fa(a,"start",!0)&&fa(s,"end")){let r=s,o=[];for(;;){if(o.push(r),r.isTextblock)break;r=r.lastChild}let i=a,c=1;for(;!i.isTextblock;i=i.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=f.empty;for(let t=o.length-1;t>=0;t--)r=f.from(o[t].copy(r));let i=t.tr.step(new te(e.pos-o.length,e.pos+a.nodeSize,e.pos+c,e.pos+a.nodeSize-c,new v(r,o.length,0),0,!0));n(i.scrollIntoView())}return!0}}return!1}function Ta(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;while(o.node(i).isInline){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Ke.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const La=Ta(-1),Aa=Ta(1);function Da(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[i];n.doc.nodesBetween(r,s,(r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function _a(t,e,n,r){for(let o=0;o<e.length;o++){let{$from:i,$to:s}=e[o],a=0==i.depth&&(t.inlineContent&&t.type.allowsMarkType(n));if(t.nodesBetween(i.pos,s.pos,(t,e)=>{if(a||!r&&t.isAtom&&t.isInline&&e>=i.pos&&e+t.nodeSize<=s.pos)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)}),a)return!0}return!1}function ja(t){let e=[];for(let n=0;n<t.length;n++){let{$from:r,$to:o}=t[n];r.doc.nodesBetween(r.pos,o.pos,(t,n)=>{if(t.isAtom&&t.content.size&&t.isInline&&n>=r.pos&&n+t.nodeSize<=o.pos)return n+1>r.pos&&e.push(new He(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+t.content.size),!1}),r.pos<o.pos&&e.push(new He(r,o))}return e}function Pa(t,e=null,n){let r=!1!==(n&&n.removeWhenPresent),o=!1!==(n&&n.enterInlineAtoms);return function(n,i){let{empty:s,$cursor:a,ranges:c}=n.selection;if(s&&!a||!_a(n.doc,c,t,o))return!1;if(i)if(a)t.isInSet(n.storedMarks||a.marks())?i(n.tr.removeStoredMark(t)):i(n.tr.addStoredMark(t.create(e)));else{let s,a=n.tr;o||(c=ja(c)),s=r?!c.some(e=>n.doc.rangeHasMark(e.$from.pos,e.$to.pos,t)):!c.every(e=>{let n=!1;return a.doc.nodesBetween(e.$from.pos,e.$to.pos,(r,o,i)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!i&&i.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-o),Math.min(r.nodeSize,e.$to.pos-o))))}),!n});for(let n=0;n<c.length;n++){let{$from:r,$to:o}=c[n];if(s){let n=r.pos,i=o.pos,s=r.nodeAfter,c=o.nodeBefore,l=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+l<i&&(n+=l,i-=u),a.addMark(n,i,t.create(e))}else a.removeMark(r.pos,o.pos,t)}i(a.scrollIntoView())}return!0}}function Ra(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Ia=Ra(la,ha,pa),$a=Ra(la,ga,ya);const Ba={Enter:Ra(wa,ka,Sa,Ea),"Mod-Enter":xa,Backspace:Ia,"Mod-Backspace":Ia,"Shift-Backspace":Ia,Delete:$a,"Mod-Delete":$a,"Mod-a":Ca},za={"Ctrl-h":Ba["Backspace"],"Alt-Backspace":Ba["Mod-Backspace"],"Ctrl-d":Ba["Delete"],"Ctrl-Alt-Backspace":Ba["Mod-Delete"],"Alt-Delete":Ba["Mod-Delete"],"Alt-d":Ba["Mod-Delete"],"Ctrl-a":La,"Ctrl-e":Aa};for(let os in Ba)za[os]=Ba[os];const Fa="undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform(),Va=Fa?za:Ba;class Ua{constructor(t,e,n={}){this.match=t,this.match=t,this.handler="string"==typeof e?qa(e):e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function qa(t){return function(e,n,r,o){let i=t;if(n[1]){let t=n[0].lastIndexOf(n[1]);i+=n[0].slice(t+n[1].length),r+=t;let e=r-o;e>0&&(i=n[0].slice(t-e,t)+i,r=o)}return e.tr.insertText(i,r,o)}}const Ga=500;function Ha({rules:t}){let e=new dn({state:{init(){return null},apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput(n,r,o,i){return Ja(n,r,o,i,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&Ja(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function Ja(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),c=a.parent.textBetween(Math.max(0,a.parentOffset-Ga),a.parentOffset,null,"￼")+r;for(let l=0;l<o.length;l++){let u=o[l];if(a.parent.type.spec.code){if(!u.inCode)continue}else if("only"===u.inCode)continue;let h=u.match.exec(c),f=h&&u.handler(s,h,e-(h[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}const Wa=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let o,i=n[r];if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let n=t.tr,r=o.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1};new Ua(/--$/,"—"),new Ua(/\.\.\.$/,"…"),new Ua(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Ua(/"$/,"”"),new Ua(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Ua(/'$/,"’");function Ka(t,e,n=null,r){return new Ua(t,(t,o,i,s)=>{let a=n instanceof Function?n(o):n,c=t.tr.delete(i,s),l=c.doc.resolve(i),u=l.blockRange(),h=u&&ce(u,e,a);if(!h)return null;c.wrap(u,h);let f=c.doc.resolve(i-1).nodeBefore;return f&&f.type==e&&be(c.doc,i-1)&&(!r||r(o,f))&&c.join(i-1),c})}function Ya(t,e,n=null){return new Ua(t,(t,r,o,i)=>{let s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null})}
/*!
    * tiptap-utils v1.13.0
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */function Xa(t,e){return Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t}function Za(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Qa(t){return e=>Za(e.$from,t)}function tc(t){return t instanceof Xe}function ec(t){return function(e){if(tc(e)){const{node:n}=e,{$from:r}=e;if(Xa(t,n))return{node:n,pos:r.pos,depth:r.depth}}}}function nc(t,e){const{from:n,to:r}=t.selection;let o=[];t.doc.nodesBetween(n,r,t=>{o=[...o,...t.marks]});const i=o.find(t=>t.type.name===e.name);return i?i.attrs:{}}function rc(t=null,e=null){if(!t||!e)return!1;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;const r=n.node.marks.find(t=>t.type===e);if(!r)return!1;let o=t.index(),i=t.start()+n.offset,s=o+1,a=i+n.node.nodeSize;while(o>0&&r.isInSet(t.parent.child(o-1).marks))o-=1,i-=t.parent.child(o).nodeSize;while(s<t.parent.childCount&&r.isInSet(t.parent.child(s).marks))a+=t.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function oc(t,e){const{from:n,to:r}=t.selection;let o=[];t.doc.nodesBetween(n,r,t=>{o=[...o,t]});const i=o.reverse().find(t=>t.type.name===e.name);return i?i.attrs:{}}function ic(t,e){const{from:n,$from:r,to:o,empty:i}=t.selection;return i?!!e.isInSet(t.storedMarks||r.marks()):!!t.doc.rangeHasMark(n,o,e)}function sc(t,e,n={}){const r=t=>t.type===e,o=ec(e)(t.selection)||Qa(r)(t.selection);return Object.keys(n).length&&o?o.node.hasMarkup(e,{...o.node.attrs,...n}):!!o}var ac=n("2b0e");function cc(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,c=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);c=new P(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new P(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let l=ce(c,t,e,s);return!!l&&(r&&r(lc(n.tr,s,l,a,t).scrollIntoView()),!0)}}function lc(t,e,n,r,o){let i=f.empty;for(let u=n.length-1;u>=0;u--)i=f.from(n[u].type.create(n[u].attrs,i));t.step(new te(e.start-(r?2:0),e.end,e.start,e.end,new v(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,c=e.start+n.length-(r?2:0),l=e.parent;for(let u=e.startIndex,h=e.endIndex,f=!0;u<h;u++,f=!1)!f&&ve(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=l.child(u).nodeSize;return t}function uc(t,e){return function(n,r){let{$from:o,$to:i,node:s}=n.selection;if(s&&s.isBlock||o.depth<2||!o.sameParent(i))return!1;let a=o.node(-1);if(a.type!=t)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(3==o.depth||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(r){let e=f.empty,i=o.index(-1)?1:o.index(-2)?2:3;for(let t=o.depth-i;t>=o.depth-3;t--)e=f.from(o.node(t).copy(e));let s=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;e=e.append(f.from(t.createAndFill()));let a=o.before(o.depth-(i-1)),c=n.tr.replace(a,o.after(-s),new v(e,4-i,0)),l=-1;c.doc.nodesBetween(a,c.doc.content.size,(t,e)=>{if(l>-1)return!1;t.isTextblock&&0==t.content.size&&(l=e+1)}),l>-1&&c.setSelection(Ge.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let c=i.pos==o.end()?a.contentMatchAt(0).defaultType:null,l=n.tr.delete(o.pos,i.pos),u=c?[e?{type:t,attrs:e}:null,{type:c}]:void 0;return!!ve(l.doc,o.pos,2,u)&&(r&&r(l.split(o.pos,2,u).scrollIntoView()),!0)}}function hc(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==t);return!!i&&(!n||(r.node(i.depth-1).type==t?fc(e,n,t,i):pc(e,n,i)))}}function fc(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new te(i-1,s,i,s,new v(f.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new P(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=se(r);if(null==a)return!1;o.lift(r,a);let c=o.mapping.map(i,-1)-1;return be(o.doc,c)&&o.join(c),e(o.scrollIntoView()),!0}function pc(t,e,n){let r=t.tr,o=n.parent;for(let f=n.end,d=n.endIndex-1,m=n.startIndex;d>m;d--)f-=o.child(d).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,c=n.endIndex==o.childCount,l=i.node(-1),u=i.index(-1);if(!l.canReplace(u+(a?0:1),u+1,s.content.append(c?f.empty:f.from(o))))return!1;let h=i.pos,p=h+s.nodeSize;return r.step(new te(h-(a?1:0),p+(c?1:0),h+1,p-1,new v((a?f.empty:f.from(o.copy(f.empty))).append(c?f.empty:f.from(o.copy(f.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function dc(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=t)return!1;if(n){let r=c.lastChild&&c.lastChild.type==a.type,o=f.from(r?t.create():null),s=new v(f.from(t.create(null,f.from(a.type.create(null,o)))),r?3:1,0),l=i.start,u=i.end;n(e.tr.step(new te(l-(r?3:1),u,l,u,s,1,!0)).scrollIntoView())}return!0}}
/*!
    * tiptap-commands v1.17.0
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */function mc(t,e,n){let r=[];return n.doc.nodesBetween(t,e,(t,e)=>{r=[...r,...t.marks.map(n=>({start:e,end:e+t.nodeSize,mark:n}))]}),r}function gc(t,e,n){return new Ua(t,(t,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=t,c=r.length-1;let l=i,u=o;if(r[c]){const n=o+r[0].indexOf(r[c-1]),s=n+r[c-1].length-1,h=n+r[c-1].lastIndexOf(r[c]),f=h+r[c].length,p=mc(o,i,t).filter(t=>{const{excluded:n}=t.mark.type;return n.find(t=>t.name===e.name)}).filter(t=>t.end>n);if(p.length)return!1;f<s&&a.delete(f,s),h>n&&a.delete(n,h),u=n,l=u+r[c].length}return a.addMark(u,l,e.create(s)),a.removeStoredMark(e),a})}function yc(t,e,n){const r=o=>{const i=[];return o.forEach(o=>{if(o.isText){const{text:r}=o;let s,a=0;do{if(s=t.exec(r),s){const t=s.index,r=t+s[0].length,c=n instanceof Function?n(s[0]):n;t>0&&i.push(o.cut(a,t)),i.push(o.cut(t,r).mark(e.create(c).addToSet(o.marks))),a=r}}while(s);a<r.length&&i.push(o.cut(a))}else i.push(o.copy(r(o.content)))}),f.fromArray(i)};return new dn({props:{transformPasted:t=>new v(r(t.content),t.openStart,t.openEnd)}})}function vc(t,e,n){const r=(o,i)=>{const s=[];return o.forEach(o=>{if(o.isText){const{text:r,marks:a}=o;let c,l=0;const u=!!a.filter(t=>"link"===t.type.name)[0];while(!u&&null!==(c=t.exec(r)))if(i&&i.type.allowsMarkType(e)&&c[1]){const t=c.index,r=t+c[0].length,i=t+c[0].indexOf(c[1]),a=i+c[1].length,u=n instanceof Function?n(c):n;t>0&&s.push(o.cut(l,t)),s.push(o.cut(i,a).mark(e.create(u).addToSet(o.marks))),l=r}l<r.length&&s.push(o.cut(l))}else s.push(o.copy(r(o.content,o)))}),f.fromArray(s)};return new dn({props:{transformPasted:t=>new v(r(t.content),t.openStart,t.openEnd)}})}function wc(t){return(e,n)=>{const{tr:r,selection:o}=e;let{from:i,to:s}=o;const{$from:a,empty:c}=o;if(c){const e=rc(a,t);i=e.from,s=e.to}return r.removeMark(i,s,t),n(r)}}function bc(t,e,n={}){return(r,o,i)=>{const s=sc(r,t,n);return s?Da(e)(r,o,i):Da(t,n)(r,o,i)}}function xc(t,e){return t.type===e.nodes.bullet_list||t.type===e.nodes.ordered_list||t.type===e.nodes.todo_list}function kc(t,e){return(n,r,o)=>{const{schema:i,selection:s}=n,{$from:a,$to:c}=s,l=a.blockRange(c);if(!l)return!1;const u=Qa(t=>xc(t,i))(s);if(l.depth>=1&&u&&l.depth-u.depth<=1){if(u.node.type===t)return hc(e)(n,r,o);if(xc(u.node,i)&&t.validContent(u.node.content)){const{tr:e}=n;return e.setNodeMarkup(u.pos,t),r&&r(e),!1}}return cc(t)(n,r,o)}}function Sc(t,e){return(n,r)=>{const{tr:o,selection:i,doc:s}=n,{ranges:a,empty:c}=i;if(c){const{from:n,to:r}=rc(i.$from,t);s.rangeHasMark(n,r,t)&&o.removeMark(n,r,t),o.addMark(n,r,t.create(e))}else a.forEach(n=>{const{$to:r,$from:i}=n;s.rangeHasMark(i.pos,r.pos,t)&&o.removeMark(i.pos,r.pos,t),o.addMark(i.pos,r.pos,t.create(e))});return r(o)}}
/*!
    * tiptap v1.32.1
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */function Oc(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(t,e)=>0===e?t.toLowerCase():t.toUpperCase()).replace(/\s+/g,"")}class Ec{constructor(t,{editor:e,extension:n,parent:r,node:o,view:i,decorations:s,getPos:a}){this.component=t,this.editor=e,this.extension=n,this.parent=r,this.node=o,this.view=i,this.decorations=s,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:a,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const t=ac["default"].extend(this.component),e={editor:this.editor,node:this.node,view:this.view,getPos:()=>this.getPos(),decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:t=>this.updateAttrs(t)};return"function"===typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),"function"===typeof this.extension.update&&(this.update=this.extension.update),this.vm=new t({parent:this.parent,propsData:e}).$mount(),this.vm.$el}update(t,e){return t.type===this.node.type&&(t===this.node&&this.decorations===e||(this.node=t,this.decorations=e,this.updateComponentProps({node:t,decorations:e})),!0)}updateComponentProps(t){if(!this.vm._props)return;const e=ac["default"].config.silent;ac["default"].config.silent=!0,Object.entries(t).forEach(([t,e])=>{this.vm._props[t]=e}),ac["default"].config.silent=e}updateAttrs(t){if(!this.view.editable)return;const{state:e}=this.view,{type:n}=this.node,r=this.getPos(),o={...this.node.attrs,...t},i=this.isMark?e.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(o)):e.tr.setNodeMarkup(r,null,o);this.view.dispatch(i)}ignoreMutation(t){return"selection"!==t.type&&(!this.contentDOM||!this.contentDOM.contains(t.target))}stopEvent(t){if("function"===typeof this.extension.stopEvent)return this.extension.stopEvent(t);const e=!!this.extension.schema.draggable;if(e&&"mousedown"===t.type){const e=t.target.closest&&t.target.closest("[data-drag-handle]"),n=e&&(this.dom===e||this.dom.contains(e));n&&(this.captureEvents=!1,document.addEventListener("dragend",()=>{this.captureEvents=!0},{once:!0}))}const n="copy"===t.type,r="paste"===t.type,o="cut"===t.type,i=t.type.startsWith("drag")||"drop"===t.type;return!(e&&i||n||r||o)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const t=this.view.posAtDOM(this.dom),e=this.view.state.doc.resolve(t),n=rc(e,this.node.type);return n}destroy(){this.vm.$destroy()}}class Cc{on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this}emit(t,...e){this._callbacks=this._callbacks||{};const n=this._callbacks[t];return n&&n.forEach(t=>t.apply(this,e)),this}off(t,e){if(arguments.length){const n=this._callbacks?this._callbacks[t]:null;n&&(e?this._callbacks[t]=n.filter(t=>t!==e):delete this._callbacks[t])}else this._callbacks={};return this}}class Nc{constructor(t={}){this.options={...this.defaultOptions,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaultOptions(){return{}}get plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class Mc{constructor(t=[],e){t.forEach(t=>{t.bindEditor(e),t.init()}),this.extensions=t}get nodes(){return this.extensions.filter(t=>"node"===t.type).reduce((t,{name:e,schema:n})=>({...t,[e]:n}),{})}get options(){const{view:t}=this;return this.extensions.reduce((e,n)=>({...e,[n.name]:new Proxy(n.options,{set(e,n,r){const o=e[n]!==r;return Object.assign(e,{[n]:r}),o&&t.updateState(t.state),!0}})}),{})}get marks(){return this.extensions.filter(t=>"mark"===t.type).reduce((t,{name:e,schema:n})=>({...t,[e]:n}),{})}get plugins(){return this.extensions.filter(t=>t.plugins).reduce((t,{plugins:e})=>[...t,...e],[])}keymaps({schema:t}){const e=this.extensions.filter(t=>["extension"].includes(t.type)).filter(t=>t.keys).map(e=>e.keys({schema:t})),n=this.extensions.filter(t=>["node","mark"].includes(t.type)).filter(t=>t.keys).map(e=>e.keys({type:t[e.type+"s"][e.name],schema:t}));return[...e,...n].map(t=>Xs(t))}inputRules({schema:t,excludedExtensions:e}){if(!(e instanceof Array)&&e)return[];const n=e instanceof Array?this.extensions.filter(t=>!e.includes(t.name)):this.extensions,r=n.filter(t=>["extension"].includes(t.type)).filter(t=>t.inputRules).map(e=>e.inputRules({schema:t})),o=n.filter(t=>["node","mark"].includes(t.type)).filter(t=>t.inputRules).map(e=>e.inputRules({type:t[e.type+"s"][e.name],schema:t}));return[...r,...o].reduce((t,e)=>[...t,...e],[])}pasteRules({schema:t,excludedExtensions:e}){if(!(e instanceof Array)&&e)return[];const n=e instanceof Array?this.extensions.filter(t=>!e.includes(t.name)):this.extensions,r=n.filter(t=>["extension"].includes(t.type)).filter(t=>t.pasteRules).map(e=>e.pasteRules({schema:t})),o=n.filter(t=>["node","mark"].includes(t.type)).filter(t=>t.pasteRules).map(e=>e.pasteRules({type:t[e.type+"s"][e.name],schema:t}));return[...r,...o].reduce((t,e)=>[...t,...e],[])}commands({schema:t,view:e}){return this.extensions.filter(t=>t.commands).reduce((n,r)=>{const{name:o,type:i}=r,s={},a=r.commands({schema:t,...["node","mark"].includes(i)?{type:t[i+"s"][o]}:{}}),c=(t,n)=>!!e.editable&&(e.focus(),t(n)(e.state,e.dispatch,e)),l=(t,e)=>{Array.isArray(e)?s[t]=t=>e.forEach(e=>c(e,t)):"function"===typeof e&&(s[t]=t=>c(e,t))};return"object"===typeof a?Object.entries(a).forEach(([t,e])=>{l(t,e)}):l(o,a),{...n,...s}},{})}}function Tc(t){{const e=document.createElement("style");e.type="text/css",e.textContent=t;const{head:n}=document,{firstChild:r}=n;r?n.insertBefore(e,r):n.appendChild(e)}}class Lc extends Nc{constructor(t={}){super(t)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function Ac(t=0,e=0,n=0){return Math.min(Math.max(parseInt(t,10),e),n)}class Dc extends Nc{constructor(t={}){super(t)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class _c extends Dc{get name(){return"doc"}get schema(){return{content:"block+"}}}class jc extends Dc{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:t}){return()=>Da(t)}}class Pc extends Dc{get name(){return"text"}get schema(){return{group:"inline"}}}var Rc='.ProseMirror {\n  position: relative;\n}\n\n.ProseMirror {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  -webkit-font-variant-ligatures: none;\n  font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n  white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n  content: "";\n  display: block;\n  position: absolute;\n  top: -2px;\n  width: 20px;\n  border-top: 1px solid black;\n  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n  to {\n    visibility: hidden;\n  }\n}\n\n.ProseMirror-hideselection *::selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection * {\n  caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n  display: block;\n}\n';class Ic extends Cc{constructor(t={}){super(),this.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},enableDropCursor:!0,enableGapCursor:!0,parseOptions:{},injectCSS:!0,onInit:()=>{},onTransaction:()=>{},onUpdate:()=>{},onFocus:()=>{},onBlur:()=>{},onPaste:()=>{},onDrop:()=>{}},this.events=["init","transaction","update","focus","blur","paste","drop"],this.init(t)}init(t={}){this.setOptions({...this.defaultOptions,...t}),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&Tc(Rc),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(t=>{this.on(t,this.options[Oc("on "+t)]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(t){this.options={...this.options,...t},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new _c,new Pc,new jc]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new Mc([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new ct({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return fn.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,Ha({rules:this.inputRules}),...this.pasteRules,...this.keymaps,Xs({Backspace:Wa}),Xs(Va),...this.options.enableDropCursor?[$s(this.options.dropCursor)]:[],...this.options.enableGapCursor?[ra()]:[],new dn({key:new yn("editable"),props:{editable:()=>this.options.editable}}),new dn({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(t,e)=>{this.focused=!0,this.emit("focus",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(t,e)=>{this.focused=!1,this.emit("blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new dn({props:this.options.editorProps})]})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"===typeof t)try{return this.schema.nodeFromJSON(t)}catch(error){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",error),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"===typeof t){const n=`<div>${t}</div>`,r=new window.DOMParser,o=r.parseFromString(n,"text/html").body.firstElementChild;return ft.fromSchema(this.schema).parse(o,e)}return!1}createView(){return new Ls(this.element,{state:this.createState(),handlePaste:(...t)=>{this.emit("paste",...t)},handleDrop:(...t)=>{this.emit("drop",...t)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(t=null){t&&this.view.setProps({nodeViews:this.initNodeViews({parent:t,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:t,extensions:e}){return e.filter(t=>["node","mark"].includes(t.type)).filter(t=>t.view).reduce((e,n)=>{const r=(e,r,o,i)=>{const s=n.view;return new Ec(s,{editor:this,extension:n,parent:t,node:e,view:r,getPos:o,decorations:i})};return{...e,[n.name]:r}},{})}dispatchTransaction(t){const e=this.state.apply(t);this.view.updateState(e),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emitUpdate(t)}emitUpdate(t){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t})}resolveSelection(t=null){if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){const{doc:t}=this.state;return{from:t.content.size,to:t.content.size}}return{from:t,to:t}}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:n}=this.resolveSelection(t);this.setSelection(e,n),setTimeout(()=>this.view.focus(),10)}setSelection(t=0,e=0){const{doc:n,tr:r}=this.state,o=Ac(t,0,n.content.size),i=Ac(e,0,n.content.size),s=Ke.create(n,o,i),a=r.setSelection(s);this.view.dispatch(a)}blur(){this.view.dom.blur()}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}getHTML(){const t=document.createElement("div"),e=Ct.fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),t.innerHTML}getJSON(){return this.state.doc.toJSON()}setContent(t={},e=!1,n){const{doc:r,tr:o}=this.state,i=this.createDocument(t,n),s=Ke.create(r,0,r.content.size),a=o.setSelection(s).replaceSelectionWith(i,!1).setMeta("preventUpdate",!e);this.view.dispatch(a)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((t,[e,n])=>({...t,[e]:(t={})=>ic(this.state,n,t)}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((t,[e,n])=>({...t,[e]:nc(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((t,[e,n])=>({...t,[e]:(t={})=>sc(this.state,n,t)}),{})}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getNodeAttrs(t=null){return{...oc(this.state,this.schema.nodes[t])}}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce((t,[e,n])=>({...t,[e]:(t={})=>n(t)}),{})}registerPlugin(t=null,e){const n="function"===typeof e?e(t,this.state.plugins):[t,...this.state.plugins],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t=null){if(!t||!this.view.docView)return;const e=this.state.reconfigure({plugins:this.state.plugins.filter(e=>!e.key.startsWith(t+"$"))});this.view.updateState(e)}destroy(){this.view&&this.view.destroy()}}var $c={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(t){t&&t.element&&this.$nextTick(()=>{this.$el.appendChild(t.element.firstChild),t.setParentComponent(this)})}}},render(t){return t("div")},beforeDestroy(){this.editor.element=this.$el}};class Bc{constructor({options:t}){this.options=t,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.blurHandler=()=>{this.preventHide?this.preventHide=!1:this.options.editor.emit("menubar:focusUpdate",!1)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("blur",this.blurHandler)}}function zc(t){return new dn({key:new yn("menu_bar"),view(e){return new Bc({editorView:e,options:t})}})}var Fc={props:{editor:{default:null,type:Object}},data(){return{focused:!1}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.registerPlugin(zc({editor:t,element:this.$el})),this.focused=t.focused,t.on("focus",()=>{this.focused=!0}),t.on("menubar:focusUpdate",t=>{this.focused=t})})}}},render(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor),getNodeAttrs:this.editor.getNodeAttrs.bind(this.editor)}):null}};function Vc(t,e,n){const r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,Math.max(e,0)),r}function Uc(t,e){const n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function qc(t,e,n=!1){const{node:r,offset:o}=t.docView.domFromPos(e);let i,s;if(3===r.nodeType)n&&o<r.nodeValue.length?(s=Uc(Vc(r,o-1,o),-1),i="right"):o<r.nodeValue.length&&(s=Uc(Vc(r,o,o+1),-1),i="left");else if(r.firstChild){if(o<r.childNodes.length){const t=r.childNodes[o];s=Uc(3===t.nodeType?Vc(t):t,-1),i="left"}if((!s||s.top===s.bottom)&&o){const t=r.childNodes[o-1];s=Uc(3===t.nodeType?Vc(t):t,1),i="right"}}else s=r.getBoundingClientRect(),i="left";const a=s[i];return{top:s.top,bottom:s.bottom,left:a,right:a}}class Gc{constructor({options:t,editorView:e}){this.options={element:null,keepInBounds:!0,onUpdate:()=>!1,...t},this.editorView=e,this.isActive=!1,this.left=0,this.bottom=0,this.top=0,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.focusHandler=({view:t})=>{this.update(t)},this.options.editor.on("focus",this.focusHandler),this.blurHandler=({event:t})=>{this.preventHide?this.preventHide=!1:this.hide(t)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}update(t,e){const{state:n}=t;if(t.composing)return;if(e&&e.doc.eq(n.doc)&&e.selection.eq(n.selection))return;if(n.selection.empty)return void this.hide();const{from:r,to:o}=n.selection,i=qc(t,r),s=qc(t,o,!0),a=this.options.element.offsetParent;if(!a)return void this.hide();const c=a.getBoundingClientRect(),l=this.options.element.getBoundingClientRect(),u=(i.left+s.left)/2-c.left;this.left=Math.round(this.options.keepInBounds?Math.min(c.width-l.width/2,Math.max(u,l.width/2)):u),this.bottom=Math.round(c.bottom-i.top),this.top=Math.round(s.bottom-c.top),this.isActive=!0,this.sendUpdate()}sendUpdate(){this.options.onUpdate({isActive:this.isActive,left:this.left,bottom:this.bottom,top:this.top})}hide(t){t&&t.relatedTarget&&this.options.element.parentNode&&this.options.element.parentNode.contains(t.relatedTarget)||(this.isActive=!1,this.sendUpdate())}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("focus",this.focusHandler),this.options.editor.off("blur",this.blurHandler)}}function Hc(t){return new dn({key:new yn("menu_bubble"),view(e){return new Gc({editorView:e,options:t})}})}Boolean;var Jc,Wc;n("3ce4");if("undefined"!=typeof WeakMap){let t=new WeakMap;Jc=e=>t.get(e),Wc=(e,n)=>(t.set(e,n),n)}else{const t=[],e=10;let n=0;Jc=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},Wc=(r,o)=>(n==e&&(n=0),t[n++]=r,t[n++]=o)}var Kc=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let t=1;i<this.width&&this.map[e+t]==n;t++)i++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:a,top:c,bottom:l}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,c),right:Math.max(r,a),bottom:Math.max(i,l)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let n=e+t*this.width;const r=(t+1)*this.width;while(n<r&&this.map[n]<o)n++;return n==r?i-1:this.map[n]}o=i}}static get(t){return Jc(t)||Wc(t,Yc(t))}};function Yc(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);const e=Xc(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let l=0,u=e*n;l<u;l++)r[l]=0;for(let l=0,u=0;l<n;l++){const a=t.child(l);u++;for(let t=0;;t++){while(o<r.length&&0!=r[o])o++;if(t==a.childCount)break;const c=a.child(t),{colspan:h,rowspan:f,colwidth:p}=c.attrs;for(let t=0;t<f;t++){if(t+l>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:f-t});break}const a=o+t*e;for(let t=0;t<h;t++){0==r[a+t]?r[a+t]=u:(i||(i=[])).push({type:"collision",row:l,pos:u,n:h-t});const n=p&&p[t];if(n){const r=(a+t)%e*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=h,u+=c.nodeSize}const c=(l+1)*e;let h=0;while(o<c)0==r[o++]&&h++;h&&(i||(i=[])).push({type:"missing",row:l,n:h}),u++}const a=new Kc(e,n,r,i);let c=!1;for(let l=0;!c&&l<s.length;l+=2)null!=s[l]&&s[l+1]<n&&(c=!0);return c&&Zc(a,s,t),a}function Xc(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let e=0;e<r;e++){const n=t.child(e);for(let t=0;t<n.childCount;t++){const o=n.child(t);e+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let t=0;t<o.childCount;t++){const e=o.child(t);i+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}function Zc(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const c=s.attrs;for(let n=0;n<c.colspan;n++){const r=(o+n)%t.width,i=e[2*r];null==i||c.colwidth&&c.colwidth[n]==i||((a||(a=Qc(c)))[n]=i)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function Qc(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function tl(t,e){if("string"===typeof t)return{};const n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(t=>Number(t)):null,o=Number(t.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const s in e){const n=e[s].getFromDOM,r=n&&n(t);null!=r&&(i[s]=r)}return i}function el(t,e){const n={};1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(","));for(const r in e){const o=e[r].setDOMAttr;o&&o(t.attrs[r],n)}return n}function nl(t){const e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:t=>tl(t,e)}],toDOM(t){return["td",el(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:t=>tl(t,e)}],toDOM(t){return["th",el(t,e),0]}}}}function rl(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}new yn("selectingCells");function ol(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function il(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function sl(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;const n=ol(e.$head)||al(e.$head);if(n)return n;throw new RangeError("No cell found around position "+e.head)}function al(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n-e.nodeSize)}}function cl(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function ll(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ul(t,e,n){const r=t.node(-1),o=Kc.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return null==s?null:t.node(0).resolve(i+s)}function hl(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(t=>t>0)||(r.colwidth=null)),r}var fl=class t extends Ge{constructor(t,e=t){const n=t.node(-1),r=Kc.get(n),o=t.start(-1),i=r.rectBetween(t.pos-o,e.pos-o),s=t.node(0),a=r.cellsInRect(i).filter(t=>t!=e.pos-o);a.unshift(e.pos-o);const c=a.map(t=>{const e=n.nodeAt(t);if(!e)throw RangeError(`No cell with offset ${t} found`);const r=o+t+1;return new He(s.resolve(r),s.resolve(r+e.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=e}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(cl(r)&&cl(o)&&ll(r,o)){const e=this.$anchorCell.node(-1)!=r.node(-1);return e&&this.isRowSelection()?t.rowSelection(r,o):e&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return Ke.between(r,o)}content(){const t=this.$anchorCell.node(-1),e=Kc.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let a=r.top;a<r.bottom;a++){const n=[];for(let i=a*e.width+r.left,s=r.left;s<r.right;s++,i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const a=e.findCell(s);let c=t.nodeAt(s);if(!c)throw RangeError(`No cell with offset ${s} found`);const l=r.left-a.left,u=a.right-r.right;if(l>0||u>0){let t=c.attrs;if(l>0&&(t=hl(t,0,l)),u>0&&(t=hl(t,t.colspan-u,u)),a.left<r.left){if(c=c.type.createAndFill(t),!c)throw RangeError("Could not create cell with attrs "+JSON.stringify(t))}else c=c.type.create(t,c.content)}if(a.top<r.top||a.bottom>r.bottom){const t={...c.attrs,rowspan:Math.min(a.bottom,r.bottom)-Math.max(a.top,r.top)};c=a.top<r.top?c.type.createAndFill(t):c.type.create(t,c.content)}n.push(c)}i.push(t.child(a).copy(f.from(n)))}const s=this.isColSelection()&&this.isRowSelection()?t:i;return new v(f.from(s),1,1)}replace(t,e=v.empty){const n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){const{$from:o,$to:s}=r[i],a=t.mapping.slice(n);t.replace(a.map(o.pos),a.map(s.pos),i?v.empty:e)}const o=Ge.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,e){this.replace(t,new v(f.from(e),0,0))}forEachCell(t){const e=this.$anchorCell.node(-1),n=Kc.get(e),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let i=0;i<o.length;i++)t(e.nodeAt(o[i]),r+o[i])}isColSelection(){const t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Kc.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),c=e.node(0);return s.top<=a.top?(s.top>0&&(e=c.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=c.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=c.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=c.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new t(e,n)}isRowSelection(){const t=this.$anchorCell.node(-1),e=Kc.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),o=e.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==e.width}eq(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Kc.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),c=e.node(0);return s.left<=a.left?(s.left>0&&(e=c.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=c.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=c.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=c.resolve(i+o.map[o.width*(s.top+1)-1]))),new t(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new t(e.resolve(n),e.resolve(r))}getBookmark(){return new pl(this.$anchorCell.pos,this.$headCell.pos)}};fl.prototype.visible=!1,Ge.jsonID("cell",fl);var pl=class t{constructor(t,e){this.anchor=t,this.head=e}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(t){const e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&ll(e,n)?new fl(e,n):Ge.near(n,1)}};new yn("fix-tables");function dl(t){const e=t.selection,n=sl(t),r=n.node(-1),o=n.start(-1),i=Kc.get(r),s=e instanceof fl?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o);return{...s,tableStart:o,map:i,table:r}}function ml(t){return function(e,n){if(!il(e))return!1;if(n){const r=rl(e.schema),o=dl(e),i=e.tr,s=o.map.cellsInRect("column"==t?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==t?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(t=>o.table.nodeAt(t));for(let t=0;t<s.length;t++)a[t].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[t],r.cell,a[t].attrs);if(0==i.steps.length)for(let t=0;t<s.length;t++)i.setNodeMarkup(o.tableStart+s[t],r.header_cell,a[t].attrs);n(i)}return!0}}function gl(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1});for(let o=0;o<r.length;o++){const t=e.table.nodeAt(r[o]);if(t&&t.type!==n.header_cell)return!1}return!0}function yl(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?ml(t):function(e,n){if(!il(e))return!1;if(n){const r=rl(e.schema),o=dl(e),i=e.tr,s=gl("row",o,r),a=gl("column",o,r),c="column"===t?s:"row"===t&&a,l=c?1:0,u="column"==t?{left:0,top:l,right:1,bottom:o.map.height}:"row"==t?{left:l,top:0,right:o.map.width,bottom:1}:o,h="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(u).forEach(t=>{const e=t+o.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,h,n.attrs)}),n(i)}return!0}}yl("row",{useDeprecatedLogic:!0}),yl("column",{useDeprecatedLogic:!0}),yl("cell",{useDeprecatedLogic:!0});function vl(t,e){const n=t.selection;if(!(n instanceof fl))return!1;if(e){const r=t.tr,o=rl(t.schema).cell.createAndFill().content;n.forEachCell((t,e)=>{t.content.eq(o)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new v(o,0,0))}),r.docChanged&&e(r)}return!0}Zs({ArrowLeft:bl("horiz",-1),ArrowRight:bl("horiz",1),ArrowUp:bl("vert",-1),ArrowDown:bl("vert",1),"Shift-ArrowLeft":xl("horiz",-1),"Shift-ArrowRight":xl("horiz",1),"Shift-ArrowUp":xl("vert",-1),"Shift-ArrowDown":xl("vert",1),Backspace:vl,"Mod-Backspace":vl,Delete:vl,"Mod-Delete":vl});function wl(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function bl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof fl)return wl(n,r,Ge.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;const s=kl(o,t,e);if(null==s)return!1;if("horiz"==t)return wl(n,r,Ge.near(n.doc.resolve(i.head+e),e));{const o=n.doc.resolve(s),i=ul(o,t,e);let a;return a=i?Ge.near(i,1):e<0?Ge.near(n.doc.resolve(o.before(-1)),-1):Ge.near(n.doc.resolve(o.after(-1)),1),wl(n,r,a)}}}function xl(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof fl)s=i;else{const r=kl(o,t,e);if(null==r)return!1;s=new fl(n.doc.resolve(r))}const a=ul(s.$headCell,t,e);return!!a&&wl(n,r,new fl(s.$anchorCell,a))}}function kl(t,e,n){if(!(t.state.selection instanceof Ke))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o),s=n<0?r.index(o):r.indexAfter(o);if(s!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?i:null}}return null}new yn("tableColumnResizing");new yn("collab");var Sl=200,Ol=function(){};Ol.prototype.append=function(t){return t.length?(t=Ol.from(t),!this.length&&t||t.length<Sl&&this.leafAppend(t)||this.length<Sl&&t.leafPrepend(this)||this.appendInner(t)):this},Ol.prototype.prepend=function(t){return t.length?Ol.from(t).append(this):this},Ol.prototype.appendInner=function(t){return new Cl(this,t)},Ol.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Ol.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Ol.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Ol.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Ol.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Ol.from=function(t){return t instanceof Ol?t:t&&t.length?new El(t):Ol.empty};var El=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Sl)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Sl)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ol);Ol.empty=new El([]);var Cl=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Ol),Nl=Ol;const Ml=500;class Tl{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){let t=this.items.get(o-1);if(t.selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,c=[],l=[];return this.items.forEach((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void l.push(t);if(n){l.push(new Al(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],c.push(new Al(e,void 0,void 0,c.length+l.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new Tl(this.items.slice(0,o).append(l.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let l=0;l<t.steps.length;l++){let n,c=t.steps[l].invert(t.docs[l]),u=new Al(t.mapping.maps[l],c,e);(n=a&&a.merge(u))&&(u=n,l?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let c=i-n.depth;return c>_l&&(s=Ll(s,c),i-=c),new Tl(s.append(o),i)}remapping(t,e){let n=new qt;return this.items.forEach((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)},t,e),n}addMaps(t){return 0==this.eventCount?this:new Tl(this.items.append(t.map(t=>new Al(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let c=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new Al(c,i,l))}else n.push(new Al(c))},r);let c=[];for(let h=e;h<i;h++)c.push(new Al(o.maps[h]));let l=this.items.slice(0,r).append(c).append(n),u=new Tl(l,s);return u.emptyItemCount()>Ml&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let c,l=new Al(s.invert(),t,a),u=r.length-1;(c=r.length&&r[u].merge(l))?r[u]=c:r.push(l)}}else i.map&&n--},this.items.length,0),new Tl(Nl.from(r.reverse()),o)}}function Ll(t,e){let n;return t.forEach((t,r)=>{if(t.selection&&0==e--)return n=r,!1}),t.slice(n)}Tl.empty=new Tl(Nl.empty,0);class Al{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Al(e.getMap().invert(),e,this.selection)}}}class Dl{constructor(t,e,n,r,o){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const _l=20;function jl(t,e,n){let r=Il(e),o=$l.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),c=new Dl(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta($l,{redo:n,historyState:c})}let Pl=!1,Rl=null;function Il(t){let e=t.plugins;if(Rl!=e){Pl=!1,Rl=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Pl=!0;break}}return Pl}const $l=new yn("history");new yn("closeHistory");function Bl(t,e){return(n,r)=>{let o=$l.getState(n);if(!o||0==(t?o.undone:o.done).eventCount)return!1;if(r){let i=jl(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}Bl(!1,!0),Bl(!0,!0),Bl(!1,!1),Bl(!0,!1);class zl extends Dc{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:t,schema:e}){return()=>kc(t,e.nodes.list_item)}keys({type:t,schema:e}){return{"Shift-Ctrl-8":kc(t,e.nodes.list_item)}}inputRules({type:t}){return[Ka(/^\s*([-+*])\s$/,t)]}}class Fl extends Dc{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(t=>({tag:"h"+t,attrs:{level:t}})),toDOM:t=>["h"+t.attrs.level,0]}}commands({type:t,schema:e}){return n=>bc(t,e.nodes.paragraph,n)}keys({type:t}){return this.options.levels.reduce((e,n)=>({...e,["Shift-Ctrl-"+n]:Da(t,{level:n})}),{})}inputRules({type:t}){return this.options.levels.map(e=>Ya(new RegExp(`^(#{1,${e}})\\s$`),t,()=>({level:e})))}}class Vl extends Dc{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:t}){return{Enter:uc(t),Tab:dc(t),"Shift-Tab":hc(t)}}}class Ul extends Dc{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}commands({type:t,schema:e}){return()=>kc(t,e.nodes.list_item)}keys({type:t,schema:e}){return{"Shift-Ctrl-9":kc(t,e.nodes.list_item)}}inputRules({type:t}){return[Ka(/^(\d+)\.\s$/,t,t=>({order:+t[1]}),(t,e)=>e.childCount+e.attrs.order===+t[1])]}}nl({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM(t){return t.style.backgroundColor||null},setDOMAttr(t,e){if(t){const n={style:`${e.style||""}background-color: ${t};`};Object.assign(e,n)}}}}});class ql extends Lc{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}keys({type:t}){return{"Mod-b":Pa(t)}}commands({type:t}){return()=>Pa(t)}inputRules({type:t}){return[gc(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}pasteRules({type:t}){return[vc(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}}class Gl extends Lc{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:t}){return{"Mod-i":Pa(t)}}commands({type:t}){return()=>Pa(t)}inputRules({type:t}){return[gc(/(?:^|[^_])(_([^_]+)_)$/,t),gc(/(?:^|[^*])(\*([^*]+)\*)$/,t)]}pasteRules({type:t}){return[vc(/_([^_]+)_/g,t),vc(/\*([^*]+)\*/g,t)]}}class Hl extends Lc{get name(){return"link"}get defaultOptions(){return{openOnClick:!0,target:null}}get schema(){return{attrs:{href:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target")})}],toDOM:t=>["a",{...t.attrs,rel:"noopener noreferrer nofollow",target:t.attrs.target||this.options.target},0]}}commands({type:t}){return e=>e.href?Sc(t,e):wc(t)}pasteRules({type:t}){return[yc(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,()!]*)/gi,t,t=>({href:t}))]}get plugins(){return this.options.openOnClick?[new dn({props:{handleClick:(t,e,n)=>{const{schema:r}=t.state,o=nc(t.state,r.marks.link);o.href&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(o.href,o.target))}}})]:[]}}class Jl extends Lc{get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}keys({type:t}){return{"Mod-u":Pa(t)}}commands({type:t}){return()=>Pa(t)}}var Wl={props:{value:{type:String,default:""},showEditor:{type:Boolean,default:!0},hideBorder:{type:Boolean,default:!1}},data:function(){return{localValue:this.value,editor:null,editorChange:!1,isFocused:!1}},components:{EditorContent:$c,EditorMenuBar:Fc,UnderlineIcon:i["default"],OlIcon:s["default"],UlIcon:a["default"]},methods:{handleInput:function(t){this.$emit("input",t)}},mounted:function(){var t=this,e=this._props.showEditor;this.editor=new Ic({editable:e,content:this.localValue,extensions:[new ql,new Gl,new Hl,new Fl({levels:[1,2,3]}),new Jl,new zl,new Ul,new Vl],onFocus:function(){t.isFocused=!0},onBlur:function(){t.isFocused=!1},onUpdate:function(e){var n=e.getHTML;t.editorChange=!0,t.$emit("input",n())}})},beforeDestroy:function(){this.editor&&this.editor.destroy()},watch:{value:function(t){this.editor&&!this.editorChange&&this.editor.setContent(t,!0),this.editorChange=!1}}},Kl=Wl,Yl=(n("9d0b"),n("2877")),Xl=Object(Yl["a"])(Kl,r,o,!1,null,null,null);e["a"]=Xl.exports},cb30:function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h})),n.d(e,"e",(function(){return f}));var r=n("7424");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:M(t,n,a)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(i,s,a,c){var l=p(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(o(e)+" is not iterable")}return b.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){s(i,r,o,a,c,"next",t)}function c(t){s(i,r,o,a,c,"throw",t)}a(void 0)}))}}var c=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("unprotected/setpassword",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),l=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("unprotected/resetpassword",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=a(i().mark((function t(e){var n;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["a"].post("unprotected/resendsetpasswordtoken",e);case 2:return n=t.sent,t.abrupt("return",n.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=a(i().mark((function t(e,n){var o;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["c"].post("".concat("https://ids.tiv.no/","account/register"),{},{params:{email:e,password:n}});case 2:return o=t.sent,t.abrupt("return",o.data);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),f=function(){var t=a(i().mark((function t(e,n,o){var s;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r["a"].post("unprotected/set-password/tokenvalidation",{userId:e,token:n,isResetRequest:o});case 3:return s=t.sent,t.abrupt("return",200===s.status);case 7:return t.prev=7,t.t0=t["catch"](0),console.error(t.t0),t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,n,r){return t.apply(this,arguments)}}()},cee4:function(t,e,n){"use strict";var r=n("c532"),o=n("1d2b"),i=n("0a06"),s=n("4a7b"),a=n("2444");function c(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var l=c(a);l.Axios=i,l.create=function(t){return c(s(l.defaults,t))},l.Cancel=n("7a77"),l.CancelToken=n("8df4"),l.isCancel=n("2e67"),l.all=function(t){return Promise.all(t)},l.spread=n("0df6"),t.exports=l,t.exports.default=l},d663:function(t,e,n){"use strict";n("9c47")},d73f:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("4aa2"),o=n("2fc8"),i=n("9ebd");function s(t){return function e(n,s,a){switch(arguments.length){case 0:return e;case 1:return Object(i["a"])(n)?e:Object(o["a"])((function(e,r){return t(n,e,r)}));case 2:return Object(i["a"])(n)&&Object(i["a"])(s)?e:Object(i["a"])(n)?Object(o["a"])((function(e,n){return t(e,s,n)})):Object(i["a"])(s)?Object(o["a"])((function(e,r){return t(n,e,r)})):Object(r["a"])((function(e){return t(n,s,e)}));default:return Object(i["a"])(n)&&Object(i["a"])(s)&&Object(i["a"])(a)?e:Object(i["a"])(n)&&Object(i["a"])(s)?Object(o["a"])((function(e,n){return t(e,n,a)})):Object(i["a"])(n)&&Object(i["a"])(a)?Object(o["a"])((function(e,n){return t(e,s,n)})):Object(i["a"])(s)&&Object(i["a"])(a)?Object(o["a"])((function(e,r){return t(n,e,r)})):Object(i["a"])(n)?Object(r["a"])((function(e){return t(e,s,a)})):Object(i["a"])(s)?Object(r["a"])((function(e){return t(n,e,a)})):Object(i["a"])(a)?Object(r["a"])((function(e){return t(n,s,e)})):t(n,s,a)}}}},d925:function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},df7c:function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,n=0,r=-1,o=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!o){n=e+1;break}}else-1===r&&(o=!1,r=e+1);return-1===r?"":t.slice(n,r)}function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}e.resolve=function(){for(var e="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!==typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,r="/"===s.charAt(0))}return e=n(o(e.split("/"),(function(t){return!!t})),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),s="/"===i(t,-1);return t=n(o(t.split("/"),(function(t){return!!t})),!r).join("/"),t||r||(t="."),t&&s&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length;e++)if(""!==t[e])break;for(var n=t.length-1;n>=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var o=r(t.split("/")),i=r(n.split("/")),s=Math.min(o.length,i.length),a=s,c=0;c<s;c++)if(o[c]!==i[c]){a=c;break}var l=[];for(c=a;c<o.length;c++)l.push("..");return l=l.concat(i.slice(a)),l.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!==typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,o=!0,i=t.length-1;i>=1;--i)if(e=t.charCodeAt(i),47===e){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=r(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,r=-1,o=!0,i=0,s=t.length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===r&&(o=!1,r=s+1),46===a?-1===e?e=s:1!==i&&(i=1):-1!==e&&(i=-1);else if(!o){n=s+1;break}}return-1===e||-1===r||0===i||1===i&&e===r-1&&e===n+1?"":t.slice(e,r)};var i="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e3f2:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("svg",{attrs:{height:t.h,width:t.w}},[e("polygon",{class:"icon ".concat(t.active?"active":""),attrs:{points:t.getPoints()}}),t._v(" Sorry, your browser does not support inline SVG. ")])},o=[],i={props:{active:{type:Boolean,default:!1},size:{type:String,default:"small"}},data:function(){return{h:0,w:0}},methods:{getHeight:function(t){return 10*t},getWidth:function(t){return 20*t},getPoints:function(){var t=1,e=1,n=this.w/2,r=this.h-1,o=this.w-1,i=1,s="".concat(t,",").concat(e," ").concat(n,",").concat(r," ").concat(o,",").concat(i);return s}},created:function(){var t=1;"small"===this.size&&(t=.8),this.h=this.getHeight(t),this.w=this.getWidth(t)}},s=i,a=(n("7e8f"),n("2877")),c=Object(a["a"])(s,r,o,!1,null,"0904710c",null);e["a"]=c.exports},e683:function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},e79b:function(t,e,n){},ec2e:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("el-select",{attrs:{placeholder:"".concat(t.$t("actions.select")," ").concat(t.$tc("models.department")),loading:t.loading,filterable:"","value-key":"id"},on:{change:t.handleSelect},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},t._l(t.departments,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t}})})),1)},o=[],i=n("81e8");function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,a,c){var l=p(t[o],t,i);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==s(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){c(i,r,o,s,a,"next",t)}function a(t){c(i,r,o,s,a,"throw",t)}s(void 0)}))}}var u={props:{value:{type:Object,default:function(){return[]}}},data:function(){return{localValue:this.value,departments:[],loading:!1}},watch:{value:function(t){this.localValue=t}},methods:{handleSelect:function(){this.$emit("input",this.localValue)},getDepartments:function(){var t=l(a().mark((function t(){var e;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(i["o"])();case 3:e=t.sent,this.departments=e,this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},created:function(){this.getDepartments()}},h=u,f=n("2877"),p=Object(f["a"])(h,r,o,!1,null,null,null);e["a"]=p.exports},ece2:function(t,e,n){"use strict";n("84e0")},eea2:function(t,e,n){"use strict";n("648a")},efad:function(t,e,n){"use strict";n("0f53")},f0dc:function(t,e,n){"use strict";function r(t){return"[object Function]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},f19f:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"bg-white rounded overflow-hidden"},[e("div",{staticClass:"uicontainer"},[t.heading?e("div",{staticClass:"p-4 md:p-6 font-bold uppercase"},[t._v(" "+t._s(t.heading)+" ")]):t._e(),t.$slots.hright?e("div",{staticClass:"p-4 md:p-6 hright-slot"},[t._t("hright")],2):t._e()]),e("div",{staticClass:"p-4 md:p-6"},[t._t("default")],2),t.$slots.footer?e("div",{staticClass:"p-4 md:p-6 bg-gray-100"},[t._t("footer")],2):t._e()])},o=[],i={props:{heading:{type:String}}},s=i,a=(n("103c"),n("2877")),c=Object(a["a"])(s,r,o,!1,null,"a77ea89e",null);e["a"]=c.exports},f6b4:function(t,e,n){"use strict";var r=n("c532");function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},fa43:function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;return e("el-select",{attrs:{placeholder:"".concat(t.$t("actions.select")," ").concat(t.$tc("models.role")),loading:t.loading,"value-key":"id"},on:{change:t.handleSelect},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},t._l(t.roles,(function(n){return e("el-option",{key:n.id,attrs:{label:t.$t("roles.".concat(n.name)),value:n}})})),1)},o=[],i=n("7424");function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};h(k,c,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,c)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,a,c){var l=p(t[o],t,i);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==s(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(s(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),h(N.prototype,l,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(f(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),h(E,u,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function c(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){c(i,r,o,s,a,"next",t)}function a(t){c(i,r,o,s,a,"throw",t)}s(void 0)}))}}var u=function(){var t=l(a().mark((function t(){var e,n,r=arguments;return a().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]&&r[0],t.next=3,i["a"].get("/roles/".concat(e));case 3:return n=t.sent,t.abrupt("return",n.data);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};l(k,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,s)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,s,a){var c=p(t[o],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==h(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=d;return function(i,s){if(o===g)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var l=p(e,n,r);if("normal"===l.type){if(o=r.done?y:m,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(h(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),l(N.prototype,a,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(u(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),l(E,c,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function p(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){p(i,r,o,s,a,"next",t)}function a(t){p(i,r,o,s,a,"throw",t)}s(void 0)}))}}var m={props:{value:{type:Object,default:null},restricted:{type:Boolean,required:!1,default:!1}},data:function(){return{localValue:this.value,roles:[],loading:!1}},watch:{value:function(t){this.localValue=t}},methods:{handleSelect:function(){this.$emit("input",this.localValue)},getRoles:function(){var t=d(f().mark((function t(){return f().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,u(this._props.restricted);case 3:this.roles=t.sent,this.loading=!1;case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},created:function(){this.getRoles()}},g=m,y=n("2877"),v=Object(y["a"])(g,r,o,!1,null,null,null);e["a"]=v.exports},fc02:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[e("el-tabs",{attrs:{type:"border-card"}},[e("el-tab-pane",{attrs:{label:"".concat(t.$t("actions.edit")," ").concat(t.$tc("models.user"))}},[e("ui-card",{staticClass:"mb-8",attrs:{heading:"".concat(t.$t("actions.edit")," ").concat(t.$tc("models.user"))}},[t.user&&t.user.permissions?e("user-form",{attrs:{user:t.user},on:{submit:t.handleSubmit,cancel:t.handleCancel}}):t._e()],1),e("ui-card",{attrs:{heading:t.$t("auth.reset_password")}},[e("ui-link",{attrs:{type:"danger"},on:{click:t.handleResetPassword}},[t._v(t._s(t.$t("auth.reset_password")))])],1),e("ui-card",{attrs:{heading:"".concat(t.$t("actions.delete")," ").concat(t.$tc("models.user"))}},[e("ui-link",{attrs:{type:"danger"},on:{click:t.handleDelete}},[t._v(t._s("".concat(t.$t("actions.delete")," ").concat(t.$tc("models.user")))+" ")])],1),e("ui-modal",{attrs:{show:t.showDeleteModal,text:t.$t("actions.confirm_delete",{model:t.$tc("models.user")}),confirmText:t.$t("actions.delete")},on:{confirm:t.deleteUser,cancel:function(e){t.showDeleteModal=!1}}})],1),e("el-tab-pane",{attrs:{label:t.$tc("models.course",2)}},[e("ui-card",{staticClass:"mb-8",attrs:{heading:t.$tc("models.course",2)}},[e("user-courses",{staticClass:"-mt-4",attrs:{courses:t.courses},on:{onDelete:t.handleUserCourseDelete}})],1)],1),e("el-tab-pane",{attrs:{label:"".concat(t.$tc("models.buildings")," & ").concat(t.$tc("models.departments"))}},[e("ui-card",{attrs:{heading:"".concat(t.$tc("models.user",1))}},[e("department-connections",{attrs:{departments:t.departments}})],1),e("ui-card",{attrs:{heading:"".concat(t.$tc("roles.BuildingAdmin"))}},[e("building-connections",{attrs:{"building-users":t.buildingUsers}})],1),e("ui-card",{attrs:{heading:"".concat(t.$tc("roles.CompanyAdmin"))}},[e("company-connections",{attrs:{"company-users":t.companyUsers}})],1)],1)],1)],1)},o=[],i=n("f19f"),s=n("072d9"),a=n("899d"),c=n("4f2e"),l=function(){var t=this,e=t._self._c;return e("div",[e("ui-list",{attrs:{headings:[this.$t("labels.course.name"),this.$tc("models.building"),this.$t("misc.completion"),""],items:t.courses,sort:[{prop:"title",type:"translation"},{prop:"building",prop2:"name",type:"level2"},{prop:"progress",prop2:"progressPercentage",type:"level2"}]},scopedSlots:t._u([{key:"default",fn:function(n){return[e("ui-list-data",{attrs:{text:t.getTranslation(n.item.title),infoHtml:t.getTranslation(n.item.description)}}),e("ui-list-data",{attrs:{type:"tag",text:n.item.buildingName}}),e("ui-list-data",[e("ui-progress-bar",{attrs:{percentage:t.getProgress(n.item)}})],1),e("ui-list-data",{attrs:{small:""}},[e("ui-link",{attrs:{type:"danger",uppercase:"",size:"small"},on:{click:function(e){return t.handleOpenDeleteUserCourseModal(n.item)}}},[t._v(t._s(t.$t("actions.delete")))])],1)]}}])}),e("ui-modal",{attrs:{show:t.showDeleteUserCourseModal,text:t.$t("confirm.delete.userCourse")},on:{confirm:t.handleDeleteUserCourse,cancel:t.handleCloseDeleteUserCourseModal}})],1)},u=[],h=n("97420"),f=n("698d"),p=n("c1e5"),d=n("63c8");function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function g(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */g=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,s=Object.create(i.prototype),a=new D(r||[]);return o(s,"_invoke",{value:M(t,n,a)}),s}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function w(){}function b(){}function x(){}var k={};l(k,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(_([])));O&&O!==n&&r.call(O,s)&&(k=O);var E=x.prototype=w.prototype=Object.create(k);function C(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function n(o,i,s,a){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==m(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function M(e,n,r){var o=f;return function(i,s){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=T(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?y:p,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=y,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(m(e)+" is not iterable")}return b.prototype=x,o(E,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},C(N.prototype),l(N.prototype,a,(function(){return this})),e.AsyncIterator=N,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new N(u(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},C(E),l(E,c,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=_,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function y(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function v(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){y(i,r,o,s,a,"next",t)}function a(t){y(i,r,o,s,a,"throw",t)}s(void 0)}))}}var w={name:"UserCourses",components:{UiLink:s["a"],UiList:h["a"],UiModal:a["a"],UiListData:f["a"],UiProgressBar:p["a"]},props:{courses:{type:Array,required:!0}},data:function(){return{showDeleteUserCourseModal:!1,markedDelete:null}},methods:{getProgress:function(t){var e=0;return t.completed?e=100:t.lessons&&t.lessons.length>0&&t.userLessons&&t.userLessons.length>0&&(e=Math.floor(t.userLessons.length/t.lessons.length*100)),e},getTranslation:function(t){var e=this,n=t.filter((function(t){return t.lang===e.$i18n.locale}));return 0===n.length?"":n[0].value},handleOpenDeleteUserCourseModal:function(t){this.markedDelete=t,this.showDeleteUserCourseModal=!0},handleCloseDeleteUserCourseModal:function(){this.markedDelete=null,this.showDeleteUserCourseModal=!1},handleDeleteUserCourse:function(){var t=v(g().mark((function t(){var e,n;return g().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=this.markedDelete,e){t.next=3;break}return t.abrupt("return");case 3:return this.loading=!0,t.prev=4,t.next=7,Object(d["d"])(e.id,e.userId);case 7:this.loading=!1,n={message:this.$t("feedback.delete_success"),type:"success"},this.$message(n),this.$emit("onDelete",e.id),this.handleCloseDeleteUserCourseModal(),t.next=19;break;case 14:t.prev=14,t.t0=t["catch"](4),this.$message({message:this.$t("errors.general"),type:"error"}),this.loading=!1,this.handleCloseDeleteUserCourseModal();case 19:case"end":return t.stop()}}),t,this,[[4,14]])})));function e(){return t.apply(this,arguments)}return e}()}},b=w,x=n("2877"),k=Object(x["a"])(b,l,u,!1,null,"124ca71e",null),S=k.exports,O=function(){var t=this,e=t._self._c;return e("div",[e("ui-list",{attrs:{headings:[t.$t("labels.department.name"),t.$tc("models.building"),t.$tc("models.role")],sort:[{prop:"building",type:"translation"},{prop:"department",prop2:"name",type:"level2"}],items:t.departments},scopedSlots:t._u([{key:"default",fn:function(n){return[e("ui-list-data",{attrs:{text:n.item.departmentName}}),e("ui-list-data",{attrs:{type:"tag",text:n.item.buildingName}}),e("ui-list-data",{attrs:{type:"tag",text:t.$t("roles.DepartmentAdmin")}})]}}])})],1)},E=[],C={name:"DepartmentConnections",components:{UiList:h["a"],UiListData:f["a"]},props:{departments:{type:Array,required:!0}},data:function(){return{showDeleteDepartmentUserModal:!1,markedDelete:null}},methods:{getTranslation:function(t){var e=this,n=t.filter((function(t){return t.lang===e.$i18n.locale}));return 0===n.length?"":n[0].value}}},N=C,M=Object(x["a"])(N,O,E,!1,null,"c2b294c0",null),T=M.exports,L=function(){var t=this,e=t._self._c;return e("div",[e("ui-list",{attrs:{headings:[t.$tc("models.building",1),t.$tc("models.company"),t.$tc("models.role")],sort:[{prop:"building",type:"translation"},{prop:"companyName",type:!1}],items:t.buildingUsers},scopedSlots:t._u([{key:"default",fn:function(n){return[e("ui-list-data",{attrs:{text:n.item.buildingName}}),e("ui-list-data",{attrs:{type:"tag",text:n.item.companyName}}),e("ui-list-data",{attrs:{type:"tag",text:t.$t("roles.BuildingAdmin")}})]}}])})],1)},A=[],D={name:"BuildingConnections",components:{UiList:h["a"],UiListData:f["a"]},props:{buildingUsers:{type:Array,required:!0}},data:function(){return{}},methods:{}},_=D,j=Object(x["a"])(_,L,A,!1,null,"7630a6c4",null),P=j.exports,R=function(){var t=this,e=t._self._c;return e("div",[e("ui-list",{attrs:{headings:[t.$tc("models.company"),t.$tc("models.role")],sort:[{prop:"companyName",type:!1}],items:t.companyUsers},scopedSlots:t._u([{key:"default",fn:function(n){return[e("ui-list-data",{attrs:{text:n.item.companyName}}),e("ui-list-data",{attrs:{type:"tag",text:t.$t("roles.CompanyAdmin")}})]}}])})],1)},I=[],$={name:"BuildingConnections",components:{UiList:h["a"],UiListData:f["a"]},props:{companyUsers:{type:Array,required:!0}},data:function(){return{}},methods:{}},B=$,z=Object(x["a"])(B,R,I,!1,null,"4e83844b",null),F=z.exports,V=n("cb30");function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */q=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),a=new L(r||[]);return o(s,"_invoke",{value:C(t,n,a)}),s}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",d="executing",m="completed",g={};function y(){}function v(){}function w(){}var b={};l(b,s,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(A([])));k&&k!==n&&r.call(k,s)&&(b=k);var S=w.prototype=y.prototype=Object.create(b);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(o,i,s,a){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==U(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var o=f;return function(i,s){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=N(a,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?m:p,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function N(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,N(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(U(e)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=l(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new E(u(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},O(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return o(s.catchLoc,!0);if(this.prev<s.finallyLoc)return o(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return o(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return o(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function G(t,e,n,r,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,o)}function H(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){G(i,r,o,s,a,"next",t)}function a(t){G(i,r,o,s,a,"throw",t)}s(void 0)}))}}var J={data:function(){return{user:null,loading:!1,showDeleteModal:!1,courses:[],departments:[],buildingUsers:[],companyUsers:[]}},components:{BuildingConnections:P,UiCard:i["a"],UiLink:s["a"],UiModal:a["a"],UserForm:c["a"],UserCourses:S,DepartmentConnections:T,CompanyConnections:F},mounted:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["i"])(this.$route.params.id);case 2:e=t.sent,this.$store.commit("changeBreadcrumbs",[{name:"models.users",link:"/app/users/"},{name:e.email,link:"/app/users/"+e.id+"/edit"}]);case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{getUser:function(){var t=H(q().mark((function t(){return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["i"])(this.$route.params.id);case 3:return this.user=t.sent,t.next=6,Object(d["k"])(this.user.id);case 6:this.user.permissions=t.sent,this.loading=!1;case 8:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleSubmit:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,e=this.user.permissions,delete this.user.permissions,t.next=5,Object(d["n"])(this.user);case 5:return t.next=7,Object(d["m"])(this.user.id,e);case 7:this.$router.back(),this.loading=!1;case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleDelete:function(){this.showDeleteModal=!0},deleteUser:function(){var t=H(q().mark((function t(){return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["c"])(this.user.id);case 3:this.showDeleteModal=!1,this.$router.back(),this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleCancel:function(){this.$router.back()},getCourses:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["j"])(this.user.id);case 3:e=t.sent,this.courses=e||[],this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getDepartments:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["h"])(this.user.id);case 3:e=t.sent,this.departments=e||[],this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getBuildingUsers:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["f"])(this.user.id);case 3:e=t.sent,this.buildingUsers=e||[],this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getCompanyUsers:function(){var t=H(q().mark((function t(){var e;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,Object(d["g"])(this.user.id);case 3:e=t.sent,this.companyUsers=e||[],this.loading=!1;case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),handleUserCourseDelete:function(t){this.courses=this.courses.filter((function(e){return e.id!==t}))},handleResetPassword:function(){var t=H(q().mark((function t(){var e,n=this;return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,e=this.user.email,t.next=4,Object(V["c"])({email:e}).then((function(){n.$message({message:"An email has been sent to ".concat(e),type:"success"})})).catch((function(){n.$message({message:"An error has occured. Try again",type:"error"})})).finally((function(){return n.loading=!1}));case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},created:function(){var t=H(q().mark((function t(){return q().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getUser();case 2:return t.next=4,this.getCourses();case 4:return t.next=6,this.getDepartments();case 6:return t.next=8,this.getBuildingUsers();case 8:return t.next=10,this.getCompanyUsers();case 10:this.loading=!1;case 11:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},W=J,K=Object(x["a"])(W,r,o,!1,null,null,null);e["default"]=K.exports},fcfb:function(t,e,n){"use strict";e["a"]=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)}}}]);
//# sourceMappingURL=chunk-66bd7591.d5327606.js.map