@beterdichtbij/component-library 0.27.3 → 0.27.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var E=!0,N=!1,I;return{s:function(){w=A[Symbol.iterator]()},n:function(){var L=w.next();return E=L.done,L},e:function(L){N=!0,I=L},f:function(){try{!E&&w.return!=null&&w.return()}finally{if(N)throw I}}}}function v(A,M){if(A){if(typeof A=="string")return C(A,M);var w=Object.prototype.toString.call(A).slice(8,-1);if(w==="Object"&&A.constructor&&(w=A.constructor.name),w==="Map"||w==="Set")return Array.from(A);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return C(A,M)}}function C(A,M){(M==null||M>A.length)&&(M=A.length);for(var w=0,O=new Array(M);w<M;w++)O[w]=A[w];return O}var S={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(M,w,O){if(O)return{dzuuid:O.file.upload.uuid,dzchunkindex:O.index,dztotalfilesize:O.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:O.file.upload.totalChunkCount,dzchunkbyteoffset:O.index*this.options.chunkSize}},accept:function(M,w){return w()},chunksUploaded:function(M,w){w()},fallback:function(){var M;this.element.className="".concat(this.element.className," dz-browser-not-supported");var w=g(this.element.getElementsByTagName("div"),!0),O;try{for(w.s();!(O=w.n()).done;){var y=O.value;if(/(^| )dz-message($| )/.test(y.className)){M=y,y.className="dz-message";break}}}catch(N){w.e(N)}finally{w.f()}M||(M=j.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(M));var E=M.getElementsByTagName("span")[0];return E&&(E.textContent!=null?E.textContent=this.options.dictFallbackMessage:E.innerText!=null&&(E.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(M,w,O,y){var E={srcX:0,srcY:0,srcWidth:M.width,srcHeight:M.height},N=M.width/M.height;w==null&&O==null?(w=E.srcWidth,O=E.srcHeight):w==null?w=O*N:O==null&&(O=w/N),w=Math.min(w,E.srcWidth),O=Math.min(O,E.srcHeight);var I=w/O;if(E.srcWidth>w||E.srcHeight>O)if(y==="crop")N>I?(E.srcHeight=M.height,E.srcWidth=E.srcHeight*I):(E.srcWidth=M.width,E.srcHeight=E.srcWidth/I);else if(y==="contain")N>I?O=w/N:w=O*N;else throw new Error("Unknown resizeMethod '".concat(y,"'"));return E.srcX=(M.width-E.srcWidth)/2,E.srcY=(M.height-E.srcHeight)/2,E.trgWidth=w,E.trgHeight=O,E},transformFile:function(M,w){return(this.options.resizeWidth||this.options.resizeHeight)&&M.type.match(/image.*/)?this.resizeImage(M,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,w):w(M)},previewTemplate:m,drop:function(M){return this.element.classList.remove("dz-drag-hover")},dragstart:function(M){},dragend:function(M){return this.element.classList.remove("dz-drag-hover")},dragenter:function(M){return this.element.classList.add("dz-drag-hover")},dragover:function(M){return this.element.classList.add("dz-drag-hover")},dragleave:function(M){return this.element.classList.remove("dz-drag-hover")},paste:function(M){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(M){var w=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){M.previewElement=j.createElement(this.options.previewTemplate.trim()),M.previewTemplate=M.previewElement,this.previewsContainer.appendChild(M.previewElement);var O=g(M.previewElement.querySelectorAll("[data-dz-name]"),!0),y;try{for(O.s();!(y=O.n()).done;){var E=y.value;E.textContent=M.name}}catch(U){O.e(U)}finally{O.f()}var N=g(M.previewElement.querySelectorAll("[data-dz-size]"),!0),I;try{for(N.s();!(I=N.n()).done;)E=I.value,E.innerHTML=this.filesize(M.size)}catch(U){N.e(U)}finally{N.f()}this.options.addRemoveLinks&&(M._removeLink=j.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),M.previewElement.appendChild(M._removeLink));var _=function(K){return K.preventDefault(),K.stopPropagation(),M.status===j.UPLOADING?j.confirm(w.options.dictCancelUploadConfirmation,function(){return w.removeFile(M)}):w.options.dictRemoveFileConfirmation?j.confirm(w.options.dictRemoveFileConfirmation,function(){return w.removeFile(M)}):w.removeFile(M)},L=g(M.previewElement.querySelectorAll("[data-dz-remove]"),!0),z;try{for(L.s();!(z=L.n()).done;){var W=z.value;W.addEventListener("click",_)}}catch(U){L.e(U)}finally{L.f()}}},removedfile:function(M){return M.previewElement!=null&&M.previewElement.parentNode!=null&&M.previewElement.parentNode.removeChild(M.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(M,w){if(M.previewElement){M.previewElement.classList.remove("dz-file-preview");var O=g(M.previewElement.querySelectorAll("[data-dz-thumbnail]"),!0),y;try{for(O.s();!(y=O.n()).done;){var E=y.value;E.alt=M.name,E.src=w}}catch(N){O.e(N)}finally{O.f()}return setTimeout(function(){return M.previewElement.classList.add("dz-image-preview")},1)}},error:function(M,w){if(M.previewElement){M.previewElement.classList.add("dz-error"),typeof w!="string"&&w.error&&(w=w.error);var O=g(M.previewElement.querySelectorAll("[data-dz-errormessage]"),!0),y;try{for(O.s();!(y=O.n()).done;){var E=y.value;E.textContent=w}}catch(N){O.e(N)}finally{O.f()}}},errormultiple:function(){},processing:function(M){if(M.previewElement&&(M.previewElement.classList.add("dz-processing"),M._removeLink))return M._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(M,w,O){if(M.previewElement){var y=g(M.previewElement.querySelectorAll("[data-dz-uploadprogress]"),!0),E;try{for(y.s();!(E=y.n()).done;){var N=E.value;N.nodeName==="PROGRESS"?N.value=w:N.style.width="".concat(w,"%")}}catch(I){y.e(I)}finally{y.f()}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(M){if(M.previewElement)return M.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(M){return this.emit("error",M,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(M){if(M._removeLink&&(M._removeLink.innerHTML=this.options.dictRemoveFile),M.previewElement)return M.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},k=S;function b(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(w){return typeof w}:b=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},b(A)}function D(A,M){var w;if(typeof Symbol>"u"||A[Symbol.iterator]==null){if(Array.isArray(A)||(w=x(A))||M&&A&&typeof A.length=="number"){w&&(A=w);var O=0,y=function(){};return{s:y,n:function(){return O>=A.length?{done:!0}:{done:!1,value:A[O++]}},e:function(L){throw L},f:y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
9
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var E=!0,N=!1,I;return{s:function(){w=A[Symbol.iterator]()},n:function(){var L=w.next();return E=L.done,L},e:function(L){N=!0,I=L},f:function(){try{!E&&w.return!=null&&w.return()}finally{if(N)throw I}}}}function x(A,M){if(A){if(typeof A=="string")return P(A,M);var w=Object.prototype.toString.call(A).slice(8,-1);if(w==="Object"&&A.constructor&&(w=A.constructor.name),w==="Map"||w==="Set")return Array.from(A);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return P(A,M)}}function P(A,M){(M==null||M>A.length)&&(M=A.length);for(var w=0,O=new Array(M);w<M;w++)O[w]=A[w];return O}function F(A,M){if(!(A instanceof M))throw new TypeError("Cannot call a class as a function")}function V(A,M){for(var w=0;w<M.length;w++){var O=M[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(A,O.key,O)}}function $(A,M,w){return M&&V(A.prototype,M),w&&V(A,w),A}function B(A,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(M&&M.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),M&&R(A,M)}function R(A,M){return R=Object.setPrototypeOf||function(O,y){return O.__proto__=y,O},R(A,M)}function H(A){var M=X();return function(){var O=oe(A),y;if(M){var E=oe(this).constructor;y=Reflect.construct(O,arguments,E)}else y=O.apply(this,arguments);return Y(this,y)}}function Y(A,M){return M&&(b(M)==="object"||typeof M=="function")?M:Z(A)}function Z(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function X(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function oe(A){return oe=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},oe(A)}var j=function(A){B(w,A);var M=H(w);function w(O,y){var E;F(this,w),E=M.call(this);var N,I;if(E.element=O,E.version=w.version,E.clickableElements=[],E.listeners=[],E.files=[],typeof E.element=="string"&&(E.element=document.querySelector(E.element)),!E.element||E.element.nodeType==null)throw new Error("Invalid dropzone element.");if(E.element.dropzone)throw new Error("Dropzone already attached.");w.instances.push(Z(E)),E.element.dropzone=Z(E);var _=(I=w.optionsForElement(E.element))!=null?I:{};if(E.options=w.extend({},k,_,y??{}),E.options.previewTemplate=E.options.previewTemplate.replace(/\n*/g,""),E.options.forceFallback||!w.isBrowserSupported())return Y(E,E.options.fallback.call(Z(E)));if(E.options.url==null&&(E.options.url=E.element.getAttribute("action")),!E.options.url)throw new Error("No URL provided.");if(E.options.acceptedFiles&&E.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(E.options.uploadMultiple&&E.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return E.options.acceptedMimeTypes&&(E.options.acceptedFiles=E.options.acceptedMimeTypes,delete E.options.acceptedMimeTypes),E.options.renameFilename!=null&&(E.options.renameFile=function(L){return E.options.renameFilename.call(Z(E),L.name,L)}),typeof E.options.method=="string"&&(E.options.method=E.options.method.toUpperCase()),(N=E.getExistingFallback())&&N.parentNode&&N.parentNode.removeChild(N),E.options.previewsContainer!==!1&&(E.options.previewsContainer?E.previewsContainer=w.getElement(E.options.previewsContainer,"previewsContainer"):E.previewsContainer=E.element),E.options.clickable&&(E.options.clickable===!0?E.clickableElements=[E.element]:E.clickableElements=w.getElements(E.options.clickable,"clickable")),E.init(),E}return $(w,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(y){return y.accepted}).map(function(y){return y})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(y){return!y.accepted}).map(function(y){return y})}},{key:"getFilesWithStatus",value:function(y){return this.files.filter(function(E){return E.status===y}).map(function(E){return E})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(w.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(w.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(w.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(y){return y.status===w.UPLOADING||y.status===w.QUEUED}).map(function(y){return y})}},{key:"init",value:function(){var y=this;if(this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(w.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length){var E=function W(){y.hiddenFileInput&&y.hiddenFileInput.parentNode.removeChild(y.hiddenFileInput),y.hiddenFileInput=document.createElement("input"),y.hiddenFileInput.setAttribute("type","file"),(y.options.maxFiles===null||y.options.maxFiles>1)&&y.hiddenFileInput.setAttribute("multiple","multiple"),y.hiddenFileInput.className="dz-hidden-input",y.options.acceptedFiles!==null&&y.hiddenFileInput.setAttribute("accept",y.options.acceptedFiles),y.options.capture!==null&&y.hiddenFileInput.setAttribute("capture",y.options.capture),y.hiddenFileInput.setAttribute("tabindex","-1"),y.hiddenFileInput.style.visibility="hidden",y.hiddenFileInput.style.position="absolute",y.hiddenFileInput.style.top="0",y.hiddenFileInput.style.left="0",y.hiddenFileInput.style.height="0",y.hiddenFileInput.style.width="0",w.getElement(y.options.hiddenInputContainer,"hiddenInputContainer").appendChild(y.hiddenFileInput),y.hiddenFileInput.addEventListener("change",function(){var U=y.hiddenFileInput.files;if(U.length){var K=D(U,!0),G;try{for(K.s();!(G=K.n()).done;){var q=G.value;y.addFile(q)}}catch(ue){K.e(ue)}finally{K.f()}}y.emit("addedfiles",U),W()})};E()}this.URL=window.URL!==null?window.URL:window.webkitURL;var N=D(this.events,!0),I;try{for(N.s();!(I=N.n()).done;){var _=I.value;this.on(_,this.options[_])}}catch(W){N.e(W)}finally{N.f()}this.on("uploadprogress",function(){return y.updateTotalUploadProgress()}),this.on("removedfile",function(){return y.updateTotalUploadProgress()}),this.on("canceled",function(W){return y.emit("complete",W)}),this.on("complete",function(W){if(y.getAddedFiles().length===0&&y.getUploadingFiles().length===0&&y.getQueuedFiles().length===0)return setTimeout(function(){return y.emit("queuecomplete")},0)});var L=function(U){if(U.dataTransfer.types){for(var K=0;K<U.dataTransfer.types.length;K++)if(U.dataTransfer.types[K]==="Files")return!0}return!1},z=function(U){if(L(U))return U.stopPropagation(),U.preventDefault?U.preventDefault():U.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(U){return y.emit("dragstart",U)},dragenter:function(U){return z(U),y.emit("dragenter",U)},dragover:function(U){var K;try{K=U.dataTransfer.effectAllowed}catch{}return U.dataTransfer.dropEffect=K==="move"||K==="linkMove"?"move":"copy",z(U),y.emit("dragover",U)},dragleave:function(U){return y.emit("dragleave",U)},drop:function(U){return z(U),y.drop(U)},dragend:function(U){return y.emit("dragend",U)}}}],this.clickableElements.forEach(function(W){return y.listeners.push({element:W,events:{click:function(K){return(W!==y.element||K.target===y.element||w.elementInside(K.target,y.element.querySelector(".dz-message")))&&y.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),this.hiddenFileInput!=null&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,w.instances.splice(w.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var y,E=0,N=0,I=this.getActiveFiles();if(I.length){var _=D(this.getActiveFiles(),!0),L;try{for(_.s();!(L=_.n()).done;){var z=L.value;E+=z.upload.bytesSent,N+=z.upload.total}}catch(W){_.e(W)}finally{_.f()}y=100*E/N}else y=100;return this.emit("totaluploadprogress",y,N,E)}},{key:"_getParamName",value:function(y){return typeof this.options.paramName=="function"?this.options.paramName(y):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(y,"]"):"")}},{key:"_renameFile",value:function(y){return typeof this.options.renameFile!="function"?y.name:this.options.renameFile(y)}},{key:"getFallbackForm",value:function(){var y,E;if(y=this.getExistingFallback())return y;var N='<div class="dz-fallback">';this.options.dictFallbackText&&(N+="<p>".concat(this.options.dictFallbackText,"</p>")),N+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var I=w.createElement(N);return this.element.tagName!=="FORM"?(E=w.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>')),E.appendChild(I)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),E??I}},{key:"getExistingFallback",value:function(){for(var y=function(z){var W=D(z,!0),U;try{for(W.s();!(U=W.n()).done;){var K=U.value;if(/(^| )fallback($| )/.test(K.className))return K}}catch(G){W.e(G)}finally{W.f()}},E=0,N=["div","form"];E<N.length;E++){var I=N[E],_;if(_=y(this.element.getElementsByTagName(I)))return _}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(y){return function(){var E=[];for(var N in y.events){var I=y.events[N];E.push(y.element.addEventListener(N,I,!1))}return E}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(y){return function(){var E=[];for(var N in y.events){var I=y.events[N];E.push(y.element.removeEventListener(N,I,!1))}return E}()})}},{key:"disable",value:function(){var y=this;return this.clickableElements.forEach(function(E){return E.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(E){return y.cancelUpload(E)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(y){return y.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(y){var E=0,N="b";if(y>0){for(var I=["tb","gb","mb","kb","b"],_=0;_<I.length;_++){var L=I[_],z=Math.pow(this.options.filesizeBase,4-_)/10;if(y>=z){E=y/Math.pow(this.options.filesizeBase,4-_),N=L;break}}E=Math.round(10*E)/10}return"<strong>".concat(E,"</strong> ").concat(this.options.dictFileSizeUnits[N])}},{key:"_updateMaxFilesReachedClass",value:function(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(y){if(y.dataTransfer){this.emit("drop",y);for(var E=[],N=0;N<y.dataTransfer.files.length;N++)E[N]=y.dataTransfer.files[N];if(E.length){var I=y.dataTransfer.items;I&&I.length&&I[0].webkitGetAsEntry!=null?this._addFilesFromItems(I):this.handleFiles(E)}this.emit("addedfiles",E)}}},{key:"paste",value:function(y){if(xe(y!=null?y.clipboardData:void 0,function(N){return N.items})!=null){this.emit("paste",y);var E=y.clipboardData.items;if(E.length)return this._addFilesFromItems(E)}}},{key:"handleFiles",value:function(y){var E=D(y,!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value;this.addFile(I)}}catch(_){E.e(_)}finally{E.f()}}},{key:"_addFilesFromItems",value:function(y){var E=this;return function(){var N=[],I=D(y,!0),_;try{for(I.s();!(_=I.n()).done;){var L=_.value,z;L.webkitGetAsEntry!=null&&(z=L.webkitGetAsEntry())?z.isFile?N.push(E.addFile(L.getAsFile())):z.isDirectory?N.push(E._addFilesFromDirectory(z,z.name)):N.push(void 0):L.getAsFile!=null&&(L.kind==null||L.kind==="file")?N.push(E.addFile(L.getAsFile())):N.push(void 0)}}catch(W){I.e(W)}finally{I.f()}return N}()}},{key:"_addFilesFromDirectory",value:function(y,E){var N=this,I=y.createReader(),_=function(W){return Oe(console,"log",function(U){return U.log(W)})},L=function z(){return I.readEntries(function(W){if(W.length>0){var U=D(W,!0),K;try{for(U.s();!(K=U.n()).done;){var G=K.value;G.isFile?G.file(function(q){if(!(N.options.ignoreHiddenFiles&&q.name.substring(0,1)==="."))return q.fullPath="".concat(E,"/").concat(q.name),N.addFile(q)}):G.isDirectory&&N._addFilesFromDirectory(G,"".concat(E,"/").concat(G.name))}}catch(q){U.e(q)}finally{U.f()}z()}return null},_)};return L()}},{key:"accept",value:function(y,E){this.options.maxFilesize&&y.size>this.options.maxFilesize*1024*1024?E(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(y.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):w.isValidFile(y,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(E(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",y)):this.options.accept.call(this,y,E):E(this.options.dictInvalidFileType)}},{key:"addFile",value:function(y){var E=this;y.upload={uuid:w.uuidv4(),progress:0,total:y.size,bytesSent:0,filename:this._renameFile(y)},this.files.push(y),y.status=w.ADDED,this.emit("addedfile",y),this._enqueueThumbnail(y),this.accept(y,function(N){N?(y.accepted=!1,E._errorProcessing([y],N)):(y.accepted=!0,E.options.autoQueue&&E.enqueueFile(y)),E._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(y){var E=D(y,!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value;this.enqueueFile(I)}}catch(_){E.e(_)}finally{E.f()}return null}},{key:"enqueueFile",value:function(y){var E=this;if(y.status===w.ADDED&&y.accepted===!0){if(y.status=w.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return E.processQueue()},0)}else throw new Error("This file can't be queued because it has already been processed or was rejected.")}},{key:"_enqueueThumbnail",value:function(y){var E=this;if(this.options.createImageThumbnails&&y.type.match(/image.*/)&&y.size<=this.options.maxThumbnailFilesize*1024*1024)return this._thumbnailQueue.push(y),setTimeout(function(){return E._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var y=this;if(!(this._processingThumbnail||this._thumbnailQueue.length===0)){this._processingThumbnail=!0;var E=this._thumbnailQueue.shift();return this.createThumbnail(E,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(N){return y.emit("thumbnail",E,N),y._processingThumbnail=!1,y._processThumbnailQueue()})}}},{key:"removeFile",value:function(y){if(y.status===w.UPLOADING&&this.cancelUpload(y),this.files=ce(this.files,y),this.emit("removedfile",y),this.files.length===0)return this.emit("reset")}},{key:"removeAllFiles",value:function(y){y==null&&(y=!1);var E=D(this.files.slice(),!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value;(I.status!==w.UPLOADING||y)&&this.removeFile(I)}}catch(_){E.e(_)}finally{E.f()}return null}},{key:"resizeImage",value:function(y,E,N,I,_){var L=this;return this.createThumbnail(y,E,N,I,!0,function(z,W){if(W==null)return _(y);var U=L.options.resizeMimeType;U==null&&(U=y.type);var K=W.toDataURL(U,L.options.resizeQuality);return(U==="image/jpeg"||U==="image/jpg")&&(K=Ee.restore(y.dataURL,K)),_(w.dataURItoBlob(K))})}},{key:"createThumbnail",value:function(y,E,N,I,_,L){var z=this,W=new FileReader;W.onload=function(){if(y.dataURL=W.result,y.type==="image/svg+xml"){L!=null&&L(W.result);return}z.createThumbnailFromUrl(y,E,N,I,_,L)},W.readAsDataURL(y)}},{key:"displayExistingFile",value:function(y,E,N,I){var _=this,L=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;if(this.emit("addedfile",y),this.emit("complete",y),!L)this.emit("thumbnail",y,E),N&&N();else{var z=function(U){_.emit("thumbnail",y,U),N&&N()};y.dataURL=E,this.createThumbnailFromUrl(y,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,z,I)}}},{key:"createThumbnailFromUrl",value:function(y,E,N,I,_,L,z){var W=this,U=document.createElement("img");return z&&(U.crossOrigin=z),_=getComputedStyle(document.body).imageOrientation=="from-image"?!1:_,U.onload=function(){var K=function(q){return q(1)};return typeof EXIF<"u"&&EXIF!==null&&_&&(K=function(q){return EXIF.getData(U,function(){return q(EXIF.getTag(this,"Orientation"))})}),K(function(G){y.width=U.width,y.height=U.height;var q=W.options.resize.call(W,y,E,N,I),ue=document.createElement("canvas"),ge=ue.getContext("2d");switch(ue.width=q.trgWidth,ue.height=q.trgHeight,G>4&&(ue.width=q.trgHeight,ue.height=q.trgWidth),G){case 2:ge.translate(ue.width,0),ge.scale(-1,1);break;case 3:ge.translate(ue.width,ue.height),ge.rotate(Math.PI);break;case 4:ge.translate(0,ue.height),ge.scale(1,-1);break;case 5:ge.rotate(.5*Math.PI),ge.scale(1,-1);break;case 6:ge.rotate(.5*Math.PI),ge.translate(0,-ue.width);break;case 7:ge.rotate(.5*Math.PI),ge.translate(ue.height,-ue.width),ge.scale(-1,1);break;case 8:ge.rotate(-.5*Math.PI),ge.translate(-ue.height,0);break}we(ge,U,q.srcX!=null?q.srcX:0,q.srcY!=null?q.srcY:0,q.srcWidth,q.srcHeight,q.trgX!=null?q.trgX:0,q.trgY!=null?q.trgY:0,q.trgWidth,q.trgHeight);var Ne=ue.toDataURL("image/png");if(L!=null)return L(Ne,ue)})},L!=null&&(U.onerror=L),U.src=y.dataURL}},{key:"processQueue",value:function(){var y=this.options.parallelUploads,E=this.getUploadingFiles().length,N=E;if(!(E>=y)){var I=this.getQueuedFiles();if(I.length>0){if(this.options.uploadMultiple)return this.processFiles(I.slice(0,y-E));for(;N<y;){if(!I.length)return;this.processFile(I.shift()),N++}}}}},{key:"processFile",value:function(y){return this.processFiles([y])}},{key:"processFiles",value:function(y){var E=D(y,!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value;I.processing=!0,I.status=w.UPLOADING,this.emit("processing",I)}}catch(_){E.e(_)}finally{E.f()}return this.options.uploadMultiple&&this.emit("processingmultiple",y),this.uploadFiles(y)}},{key:"_getFilesWithXhr",value:function(y){return this.files.filter(function(E){return E.xhr===y}).map(function(E){return E})}},{key:"cancelUpload",value:function(y){if(y.status===w.UPLOADING){var E=this._getFilesWithXhr(y.xhr),N=D(E,!0),I;try{for(N.s();!(I=N.n()).done;){var _=I.value;_.status=w.CANCELED}}catch(U){N.e(U)}finally{N.f()}typeof y.xhr<"u"&&y.xhr.abort();var L=D(E,!0),z;try{for(L.s();!(z=L.n()).done;){var W=z.value;this.emit("canceled",W)}}catch(U){L.e(U)}finally{L.f()}this.options.uploadMultiple&&this.emit("canceledmultiple",E)}else(y.status===w.ADDED||y.status===w.QUEUED)&&(y.status=w.CANCELED,this.emit("canceled",y),this.options.uploadMultiple&&this.emit("canceledmultiple",[y]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(y){if(typeof y=="function"){for(var E=arguments.length,N=new Array(E>1?E-1:0),I=1;I<E;I++)N[I-1]=arguments[I];return y.apply(this,N)}return y}},{key:"uploadFile",value:function(y){return this.uploadFiles([y])}},{key:"uploadFiles",value:function(y){var E=this;this._transformFiles(y,function(N){if(E.options.chunking){var I=N[0];y[0].upload.chunked=E.options.chunking&&(E.options.forceChunking||I.size>E.options.chunkSize),y[0].upload.totalChunkCount=Math.ceil(I.size/E.options.chunkSize)}if(y[0].upload.chunked){var _=y[0],L=N[0];_.upload.chunks=[];var z=function(){for(var q=0;_.upload.chunks[q]!==void 0;)q++;if(!(q>=_.upload.totalChunkCount)){var ue=q*E.options.chunkSize,ge=Math.min(ue+E.options.chunkSize,L.size),Ne={name:E._getParamName(0),data:L.webkitSlice?L.webkitSlice(ue,ge):L.slice(ue,ge),filename:_.upload.filename,chunkIndex:q};_.upload.chunks[q]={file:_,index:q,dataBlock:Ne,status:w.UPLOADING,progress:0,retries:0},E._uploadData(y,[Ne])}};if(_.upload.finishedChunkUpload=function(G,q){var ue=!0;G.status=w.SUCCESS,G.dataBlock=null,G.xhr=null;for(var ge=0;ge<_.upload.totalChunkCount;ge++){if(_.upload.chunks[ge]===void 0)return z();_.upload.chunks[ge].status!==w.SUCCESS&&(ue=!1)}ue&&E.options.chunksUploaded(_,function(){E._finished(y,q,null)})},E.options.parallelChunkUploads)for(var W=0;W<_.upload.totalChunkCount;W++)z();else z()}else{for(var U=[],K=0;K<y.length;K++)U[K]={name:E._getParamName(K),data:N[K],filename:y[K].upload.filename};E._uploadData(y,U)}})}},{key:"_getChunk",value:function(y,E){for(var N=0;N<y.upload.totalChunkCount;N++)if(y.upload.chunks[N]!==void 0&&y.upload.chunks[N].xhr===E)return y.upload.chunks[N]}},{key:"_uploadData",value:function(y,E){var N=this,I=new XMLHttpRequest,_=D(y,!0),L;try{for(_.s();!(L=_.n()).done;){var z=L.value;z.xhr=I}}catch(le){_.e(le)}finally{_.f()}y[0].upload.chunked&&(y[0].upload.chunks[E[0].chunkIndex].xhr=I);var W=this.resolveOption(this.options.method,y),U=this.resolveOption(this.options.url,y);I.open(W,U,!0);var K=this.resolveOption(this.options.timeout,y);K&&(I.timeout=this.resolveOption(this.options.timeout,y)),I.withCredentials=!!this.options.withCredentials,I.onload=function(le){N._finishedUploading(y,I,le)},I.ontimeout=function(){N._handleUploadError(y,I,"Request timedout after ".concat(N.options.timeout/1e3," seconds"))},I.onerror=function(){N._handleUploadError(y,I)};var G=I.upload!=null?I.upload:I;G.onprogress=function(le){return N._updateFilesUploadProgress(y,I,le)};var q={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&w.extend(q,this.options.headers);for(var ue in q){var ge=q[ue];ge&&I.setRequestHeader(ue,ge)}var Ne=new FormData;if(this.options.params){var Fe=this.options.params;typeof Fe=="function"&&(Fe=Fe.call(this,y,I,y[0].upload.chunked?this._getChunk(y[0],I):null));for(var $e in Fe){var Ie=Fe[$e];if(Array.isArray(Ie))for(var Ke=0;Ke<Ie.length;Ke++)Ne.append($e,Ie[Ke]);else Ne.append($e,Ie)}}var gt=D(y,!0),tt;try{for(gt.s();!(tt=gt.n()).done;){var Cn=tt.value;this.emit("sending",Cn,I,Ne)}}catch(le){gt.e(le)}finally{gt.f()}this.options.uploadMultiple&&this.emit("sendingmultiple",y,I,Ne),this._addFormElementData(Ne);for(var J=0;J<E.length;J++){var ae=E[J];Ne.append(ae.name,ae.data,ae.filename)}this.submitRequest(I,Ne,y)}},{key:"_transformFiles",value:function(y,E){for(var N=this,I=[],_=0,L=function(U){N.options.transformFile.call(N,y[U],function(K){I[U]=K,++_===y.length&&E(I)})},z=0;z<y.length;z++)L(z)}},{key:"_addFormElementData",value:function(y){if(this.element.tagName==="FORM"){var E=D(this.element.querySelectorAll("input, textarea, select, button"),!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value,_=I.getAttribute("name"),L=I.getAttribute("type");if(L&&(L=L.toLowerCase()),!(typeof _>"u"||_===null))if(I.tagName==="SELECT"&&I.hasAttribute("multiple")){var z=D(I.options,!0),W;try{for(z.s();!(W=z.n()).done;){var U=W.value;U.selected&&y.append(_,U.value)}}catch(K){z.e(K)}finally{z.f()}}else(!L||L!=="checkbox"&&L!=="radio"||I.checked)&&y.append(_,I.value)}}catch(K){E.e(K)}finally{E.f()}}}},{key:"_updateFilesUploadProgress",value:function(y,E,N){if(y[0].upload.chunked){var z=y[0],W=this._getChunk(z,E);N?(W.progress=100*N.loaded/N.total,W.total=N.total,W.bytesSent=N.loaded):(W.progress=100,W.bytesSent=W.total),z.upload.progress=0,z.upload.total=0,z.upload.bytesSent=0;for(var U=0;U<z.upload.totalChunkCount;U++)z.upload.chunks[U]&&typeof z.upload.chunks[U].progress<"u"&&(z.upload.progress+=z.upload.chunks[U].progress,z.upload.total+=z.upload.chunks[U].total,z.upload.bytesSent+=z.upload.chunks[U].bytesSent);z.upload.progress=z.upload.progress/z.upload.totalChunkCount,this.emit("uploadprogress",z,z.upload.progress,z.upload.bytesSent)}else{var I=D(y,!0),_;try{for(I.s();!(_=I.n()).done;){var L=_.value;L.upload.total&&L.upload.bytesSent&&L.upload.bytesSent==L.upload.total||(N?(L.upload.progress=100*N.loaded/N.total,L.upload.total=N.total,L.upload.bytesSent=N.loaded):(L.upload.progress=100,L.upload.bytesSent=L.upload.total),this.emit("uploadprogress",L,L.upload.progress,L.upload.bytesSent))}}catch(K){I.e(K)}finally{I.f()}}}},{key:"_finishedUploading",value:function(y,E,N){var I;if(y[0].status!==w.CANCELED&&E.readyState===4){if(E.responseType!=="arraybuffer"&&E.responseType!=="blob"&&(I=E.responseText,E.getResponseHeader("content-type")&&~E.getResponseHeader("content-type").indexOf("application/json")))try{I=JSON.parse(I)}catch(_){N=_,I="Invalid JSON response from server."}this._updateFilesUploadProgress(y,E),200<=E.status&&E.status<300?y[0].upload.chunked?y[0].upload.finishedChunkUpload(this._getChunk(y[0],E),I):this._finished(y,I,N):this._handleUploadError(y,E,I)}}},{key:"_handleUploadError",value:function(y,E,N){if(y[0].status!==w.CANCELED){if(y[0].upload.chunked&&this.options.retryChunks){var I=this._getChunk(y[0],E);if(I.retries++<this.options.retryChunksLimit){this._uploadData(y,[I.dataBlock]);return}else console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(y,N||this.options.dictResponseError.replace("{{statusCode}}",E.status),E)}}},{key:"submitRequest",value:function(y,E,N){if(y.readyState!=1){console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");return}y.send(E)}},{key:"_finished",value:function(y,E,N){var I=D(y,!0),_;try{for(I.s();!(_=I.n()).done;){var L=_.value;L.status=w.SUCCESS,this.emit("success",L,E,N),this.emit("complete",L)}}catch(z){I.e(z)}finally{I.f()}if(this.options.uploadMultiple&&(this.emit("successmultiple",y,E,N),this.emit("completemultiple",y)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(y,E,N){var I=D(y,!0),_;try{for(I.s();!(_=I.n()).done;){var L=_.value;L.status=w.ERROR,this.emit("error",L,E,N),this.emit("complete",L)}}catch(z){I.e(z)}finally{I.f()}if(this.options.uploadMultiple&&(this.emit("errormultiple",y,E,N),this.emit("completemultiple",y)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"initClass",value:function(){this.prototype.Emitter=h,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(y){for(var E=arguments.length,N=new Array(E>1?E-1:0),I=1;I<E;I++)N[I-1]=arguments[I];for(var _=0,L=N;_<L.length;_++){var z=L[_];for(var W in z){var U=z[W];y[W]=U}}return y}},{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(y){var E=Math.random()*16|0,N=y==="x"?E:E&3|8;return N.toString(16)})}}]),w}(h);j.initClass(),j.version="5.9.3",j.options={},j.optionsForElement=function(A){if(A.getAttribute("id"))return j.options[fe(A.getAttribute("id"))]},j.instances=[],j.forElement=function(A){if(typeof A=="string"&&(A=document.querySelector(A)),(A!=null?A.dropzone:void 0)==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return A.dropzone},j.autoDiscover=!0,j.discover=function(){var A;if(document.querySelectorAll)A=document.querySelectorAll(".dropzone");else{A=[];var M=function(O){return function(){var y=[],E=D(O,!0),N;try{for(E.s();!(N=E.n()).done;){var I=N.value;/(^| )dropzone($| )/.test(I.className)?y.push(A.push(I)):y.push(void 0)}}catch(_){E.e(_)}finally{E.f()}return y}()};M(document.getElementsByTagName("div")),M(document.getElementsByTagName("form"))}return function(){var w=[],O=D(A,!0),y;try{for(O.s();!(y=O.n()).done;){var E=y.value;j.optionsForElement(E)!==!1?w.push(new j(E)):w.push(void 0)}}catch(N){O.e(N)}finally{O.f()}return w}()},j.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],j.isBrowserSupported=function(){var A=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if(!("classList"in document.createElement("a")))A=!1;else{j.blacklistedBrowsers!==void 0&&(j.blockedBrowsers=j.blacklistedBrowsers);var M=D(j.blockedBrowsers,!0),w;try{for(M.s();!(w=M.n()).done;){var O=w.value;if(O.test(navigator.userAgent)){A=!1;continue}}}catch(y){M.e(y)}finally{M.f()}}else A=!1;return A},j.dataURItoBlob=function(A){for(var M=atob(A.split(",")[1]),w=A.split(",")[0].split(":")[1].split(";")[0],O=new ArrayBuffer(M.length),y=new Uint8Array(O),E=0,N=M.length,I=0<=N;I?E<=N:E>=N;I?E++:E--)y[E]=M.charCodeAt(E);return new Blob([O],{type:w})};var ce=function(M,w){return M.filter(function(O){return O!==w}).map(function(O){return O})},fe=function(M){return M.replace(/[\-_](\w)/g,function(w){return w.charAt(1).toUpperCase()})};j.createElement=function(A){var M=document.createElement("div");return M.innerHTML=A,M.childNodes[0]},j.elementInside=function(A,M){if(A===M)return!0;for(;A=A.parentNode;)if(A===M)return!0;return!1},j.getElement=function(A,M){var w;if(typeof A=="string"?w=document.querySelector(A):A.nodeType!=null&&(w=A),w==null)throw new Error("Invalid `".concat(M,"` option provided. Please provide a CSS selector or a plain HTML element."));return w},j.getElements=function(A,M){var w,O;if(A instanceof Array){O=[];try{var y=D(A,!0),E;try{for(y.s();!(E=y.n()).done;)w=E.value,O.push(this.getElement(w,M))}catch(_){y.e(_)}finally{y.f()}}catch{O=null}}else if(typeof A=="string"){O=[];var N=D(document.querySelectorAll(A),!0),I;try{for(N.s();!(I=N.n()).done;)w=I.value,O.push(w)}catch(_){N.e(_)}finally{N.f()}}else A.nodeType!=null&&(O=[A]);if(O==null||!O.length)throw new Error("Invalid `".concat(M,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return O},j.confirm=function(A,M,w){if(window.confirm(A))return M();if(w!=null)return w()},j.isValidFile=function(A,M){if(!M)return!0;M=M.split(",");var w=A.type,O=w.replace(/\/.*$/,""),y=D(M,!0),E;try{for(y.s();!(E=y.n()).done;){var N=E.value;if(N=N.trim(),N.charAt(0)==="."){if(A.name.toLowerCase().indexOf(N.toLowerCase(),A.name.length-N.length)!==-1)return!0}else if(/\/\*$/.test(N)){if(O===N.replace(/\/.*$/,""))return!0}else if(w===N)return!0}}catch(I){y.e(I)}finally{y.f()}return!1},typeof jQuery<"u"&&jQuery!==null&&(jQuery.fn.dropzone=function(A){return this.each(function(){return new j(this,A)})}),j.ADDED="added",j.QUEUED="queued",j.ACCEPTED=j.QUEUED,j.UPLOADING="uploading",j.PROCESSING=j.UPLOADING,j.CANCELED="canceled",j.ERROR="error",j.SUCCESS="success";var be=function(M){M.naturalWidth;var w=M.naturalHeight,O=document.createElement("canvas");O.width=1,O.height=w;var y=O.getContext("2d");y.drawImage(M,0,0);for(var E=y.getImageData(1,0,1,w),N=E.data,I=0,_=w,L=w;L>I;){var z=N[(L-1)*4+3];z===0?_=L:I=L,L=_+I>>1}var W=L/w;return W===0?1:W},we=function(M,w,O,y,E,N,I,_,L,z){var W=be(w);return M.drawImage(w,O,y,E,N,I,_,L,z/W)},Ee=function(){function A(){F(this,A)}return $(A,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(w){for(var O="",y=void 0,E=void 0,N="",I=void 0,_=void 0,L=void 0,z="",W=0;y=w[W++],E=w[W++],N=w[W++],I=y>>2,_=(y&3)<<4|E>>4,L=(E&15)<<2|N>>6,z=N&63,isNaN(E)?L=z=64:isNaN(N)&&(z=64),O=O+this.KEY_STR.charAt(I)+this.KEY_STR.charAt(_)+this.KEY_STR.charAt(L)+this.KEY_STR.charAt(z),y=E=N="",I=_=L=z="",W<w.length;);return O}},{key:"restore",value:function(w,O){if(!w.match("data:image/jpeg;base64,"))return O;var y=this.decode64(w.replace("data:image/jpeg;base64,","")),E=this.slice2Segments(y),N=this.exifManipulation(O,E);return"data:image/jpeg;base64,".concat(this.encode64(N))}},{key:"exifManipulation",value:function(w,O){var y=this.getExifArray(O),E=this.insertExif(w,y),N=new Uint8Array(E);return N}},{key:"getExifArray",value:function(w){for(var O=void 0,y=0;y<w.length;){if(O=w[y],O[0]===255&O[1]===225)return O;y++}return[]}},{key:"insertExif",value:function(w,O){var y=w.replace("data:image/jpeg;base64,",""),E=this.decode64(y),N=E.indexOf(255,3),I=E.slice(0,N),_=E.slice(N),L=I;return L=L.concat(O),L=L.concat(_),L}},{key:"slice2Segments",value:function(w){for(var O=0,y=[];;){var E;if(w[O]===255&w[O+1]===218)break;if(w[O]===255&w[O+1]===216)O+=2;else{E=w[O+2]*256+w[O+3];var N=O+E+2,I=w.slice(O,N);y.push(I),O=N}if(O>w.length)break}return y}},{key:"decode64",value:function(w){var O=void 0,y=void 0,E="",N=void 0,I=void 0,_=void 0,L="",z=0,W=[],U=/[^A-Za-z0-9\+\/\=]/g;for(U.exec(w)&&console.warn(`There were invalid base64 characters in the input text.
10
10
  Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='
11
- Expect errors in decoding.`),w=w.replace(/[^A-Za-z0-9\+\/\=]/g,"");N=this.KEY_STR.indexOf(w.charAt(z++)),I=this.KEY_STR.indexOf(w.charAt(z++)),_=this.KEY_STR.indexOf(w.charAt(z++)),L=this.KEY_STR.indexOf(w.charAt(z++)),O=N<<2|I>>4,y=(I&15)<<4|_>>2,E=(_&3)<<6|L,W.push(O),_!==64&&W.push(y),L!==64&&W.push(E),O=y=E="",N=I=_=L="",z<w.length;);return W}}]),A}();Ee.initClass();var Ae=function(M,w){var O=!1,y=!0,E=M.document,N=E.documentElement,I=E.addEventListener?"addEventListener":"attachEvent",_=E.addEventListener?"removeEventListener":"detachEvent",L=E.addEventListener?"":"on",z=function U(K){if(!(K.type==="readystatechange"&&E.readyState!=="complete")&&((K.type==="load"?M:E)[_](L+K.type,U,!1),!O&&(O=!0)))return w.call(M,K.type||K)},W=function U(){try{N.doScroll("left")}catch{setTimeout(U,50);return}return z("poll")};if(E.readyState!=="complete"){if(E.createEventObject&&N.doScroll){try{y=!M.frameElement}catch{}y&&W()}return E[I](L+"DOMContentLoaded",z,!1),E[I](L+"readystatechange",z,!1),M[I](L+"load",z,!1)}};j._autoDiscoverFunction=function(){if(j.autoDiscover)return j.discover()},Ae(window,j._autoDiscoverFunction);function xe(A,M){return typeof A<"u"&&A!==null?M(A):void 0}function Oe(A,M,w){if(typeof A<"u"&&A!==null&&typeof A[M]=="function")return w(A,M)}window.Dropzone=j;var ve=j}(),i}()})})(Yf);var Yv=Yf.exports;const au=Gv(Yv),Jv={class:"fallback"},Zv=f.createElementVNode("input",{id:"file",type:"file",name:"file",multiple:""},null,-1),Xv={for:"file"},Qv={class:"dz-message","data-dz-message":""},qv={id:"bd-dropzone-theme",style:{display:"none"}},e2={class:"dz-preview dz-file-preview"},t2={class:"dz-details"},n2=f.createElementVNode("img",{"data-dz-thumbnail":"",class:"dz-image"},null,-1),r2=f.createElementVNode("div",{class:"dz-filename"},[f.createElementVNode("small",{"data-dz-name":""})],-1),o2=f.createElementVNode("div",{class:"dz-progress"},[f.createElementVNode("div",{class:"spinner-border text-primary spinner-border-sm",role:"status"},[f.createElementVNode("span",{class:"visually-hidden"},"Loading...")])],-1),i2={class:"dz-success-mark"},s2={class:"dz-error-message text-danger"},a2=f.createElementVNode("small",{"data-dz-errormessage":""},null,-1),Jf=f.defineComponent({__name:"BDDropzone",props:{modelValue:{default:[]},buttonText:{default:void 0},multiple:{type:Boolean,default:!1},errorMessage:{default:void 0},fileSizeExceededMessage:{default:void 0},acceptedFiles:{default:".jpg"},url:{default:""},tag:{default:"form"},token:{default:""}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=f.computed(()=>({variant:As.PRIMARY,size:at.SM})),o=gr(t,"modelValue",e);let i=null;au.autoDiscover=!1,f.watch(()=>t.modelValue,()=>{s()}),f.onMounted(()=>{document.getElementById("dropzone")&&l()});const s=()=>{i&&(i.destroy(),l())},l=()=>{var p;i=new au("#dropzone",{url:t.url,method:"post",acceptedFiles:t.acceptedFiles,addRemoveLinks:!1,maxFilesize:10,maxFiles:t.multiple?3:1,headers:{RequestVerificationToken:t.token},dictResponseError:t.errorMessage,dictFileTooBig:t.fileSizeExceededMessage,previewTemplate:(p=document.querySelector("#bd-dropzone-theme"))==null?void 0:p.innerHTML}),i.on("error",c),i.on("success",a),i.on("removedfile",d)},a=function(p,m){var g;o.value.push({UUID:(g=p.upload)==null?void 0:g.uuid,CorrelationId:m.CorrelationId,Naam:m.Naam}),u(p)},c=function(p){u(p)},u=function(p){const m=p.name;if(!(m.endsWith(".png")||m.endsWith(".jpg")||m.endsWith(".jpeg")||m.endsWith(".gif"))){const g=p.previewElement.getElementsByClassName("icon-file"),v=p.previewElement.getElementsByClassName("dz-image");g[0].classList.remove("d-none"),v[0].classList.add("d-none")}},d=function(p){const m=o.value.findIndex(g=>{var v,C;return((v=g.upload)==null?void 0:v.uuid)===((C=p.upload)==null?void 0:C.uuid)});m!==-1&&o.value.splice(m,1)},h=f.computed(()=>t.tag??"form");return(p,m)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(h.value),{id:"dropzone",class:"dropzone bd-dropzone",enctype:"multipart/form-data"},{default:f.withCtx(()=>[f.createElementVNode("div",Jv,[Zv,f.createTextVNode(" test "),f.createElementVNode("label",Xv,[f.createVNode(f.unref(cr)),f.createTextVNode(" "+f.toDisplayString(t.buttonText),1)])]),f.createElementVNode("div",Qv,[f.createVNode(f.unref(lt),f.normalizeProps(f.guardReactiveProps(r.value)),{default:f.withCtx(()=>[f.createVNode(f.unref(cr)),f.createTextVNode(" "+f.toDisplayString(t.buttonText),1)]),_:1},16)])]),_:1})),f.createElementVNode("div",qv,[f.createElementVNode("div",e2,[f.createElementVNode("div",t2,[n2,f.createVNode(f.unref(Pl),{"data-dz-thumbnail":"",class:"d-none"}),r2,f.createVNode(f.unref(lt),{class:"dz-remove",alt:"Click me to remove the file.","data-dz-remove":""},{default:f.withCtx(()=>[f.createVNode(f.unref($o))]),_:1})]),o2,f.createElementVNode("div",i2,[f.createVNode(f.unref(Po))]),f.createElementVNode("div",s2,[f.createVNode(f.unref(xs)),a2])])])],64))}});function Qe(n){this.content=n}Qe.prototype={constructor:Qe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,o=r.find(n),i=r.content.slice();return o==-1?i.push(t||n,e):(i[o+1]=e,t&&(i[o]=t)),new Qe(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Qe(t)},addToStart:function(n,e){return new Qe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Qe(t)},addBefore:function(n,e,t){var r=this.remove(e),o=r.content.slice(),i=r.find(n);return o.splice(i==-1?o.length:i,0,e,t),new Qe(o)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Qe.from(n),n.size?new Qe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Qe.from(n),n.size?new Qe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Qe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Qe.from=function(n){if(n instanceof Qe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Qe(e)};function Zf(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=Zf(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function Xf(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),l=e.child(--i),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let c=Xf(s.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class se{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,o=0,i){for(let s=0,l=0;l<t;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,o+l,i||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(i+=l.text.slice(Math.max(e,a)-a,t-a),s=!r):l.isLeaf?(o?i+=typeof o=="function"?o(l):o:l.type.spec.leafText&&(i+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(i+=r,s=!0)},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new se(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],o=0;if(t>e)for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),o+=l.nodeSize),s=a}return new se(r,o)}cutByIndex(e,t){return e==t?se.empty:e==0&&t==this.content.length?this:new se(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new se(o,i)}addToStart(e){return new se([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new se(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let o=this.content[t];e(o,r,t),r+=o.nodeSize}}findDiffStart(e,t=0){return Zf(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xf(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Qo(0,e);if(e==this.size)return Qo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||t>0?Qo(r+1,s):Qo(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return se.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return se.empty;let t,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(t||(t=e.slice(0,o)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new se(t||e,r)}static from(e){if(!e)return se.empty;if(e instanceof se)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new se([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}se.empty=new se([],0);const na={index:0,offset:0};function Qo(n,e){return na.index=n,na.offset=e,na}function xi(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!xi(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!xi(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Pe=class Ja{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ja.none;if(e instanceof Ja)return[e];let t=e.slice();return t.sort((r,o)=>r.type.rank-o.type.rank),t}};Pe.none=[];class Ti extends Error{}class he{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=qf(this.content,e+this.openStart,t);return r&&new he(r,this.openStart,this.openEnd)}removeBetween(e,t){return new he(Qf(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return he.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new he(se.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new he(e,r,o)}}he.empty=new he(se.empty,0,0);function Qf(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(o==e||i.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Qf(i.content,e-o-1,t-o-1)))}function qf(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=qf(s.content,e-i-1,t);return l&&n.replaceChild(o,s.copy(l))}function l2(n,e,t){if(t.openStart>n.depth)throw new Ti("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Ti("Inconsistent open depths");return eh(n,e,t,0)}function eh(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r<n.depth-t.openStart){let s=eh(n,e,t,r+1);return i.copy(i.content.replaceChild(o,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return or(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=c2(t,n);return or(i,nh(n,s,l,e,r))}else return or(i,Ai(n,e,r))}function th(n,e){if(!e.type.compatibleContent(n.type))throw new Ti("Cannot join "+e.type.name+" onto "+n.type.name)}function Za(n,e,t){let r=n.node(t);return th(r,e.node(t)),r}function rr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ho(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(rr(n.nodeAfter,r),i++));for(let l=i;l<s;l++)rr(o.child(l),r);e&&e.depth==t&&e.textOffset&&rr(e.nodeBefore,r)}function or(n,e){return n.type.checkContent(e),n.copy(e)}function nh(n,e,t,r,o){let i=n.depth>o&&Za(n,e,o+1),s=r.depth>o&&Za(t,r,o+1),l=[];return ho(null,n,o,l),i&&s&&e.index(o)==t.index(o)?(th(i,s),rr(or(i,nh(n,e,t,r,o+1)),l)):(i&&rr(or(i,Ai(n,e,o+1)),l),ho(e,t,o,l),s&&rr(or(s,Ai(t,r,o+1)),l)),ho(r,null,o,l),new se(l)}function Ai(n,e,t){let r=[];if(ho(null,n,t,r),n.depth>t){let o=Za(n,e,t+1);rr(or(o,Ai(n,e,t+1)),r)}return ho(e,null,t,r),new se(r)}function c2(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(se.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class ko{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),o=e.maybeChild(t);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Oi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(i),c=i-a;if(r.push(s,l,o+a),!c||(s=s.child(l),s.isText))break;i=c-1,o+=a+1}return new ko(t,r,i)}static resolveCached(e,t){for(let o=0;o<ra.length;o++){let i=ra[o];if(i.pos==t&&i.doc==e)return i}let r=ra[oa]=ko.resolve(e,t);return oa=(oa+1)%u2,r}}let ra=[],oa=0,u2=12;class Oi{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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 d2=Object.create(null);let ir=class Xa{constructor(e,t,r,o=Pe.none){this.type=e,this.attrs=t,this.marks=o,this.content=r||se.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,o=0){this.content.nodesBetween(e,t,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,o){return this.content.textBetween(e,t,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&xi(this.attrs,t||e.defaultAttrs||d2)&&Pe.sameSet(this.marks,r||Pe.none)}copy(e=null){return e==this.content?this:new Xa(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xa(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return he.empty;let o=this.resolve(e),i=this.resolve(t),s=r?0:o.sharedDepth(t),l=o.start(s),c=o.node(s).content.cut(o.pos-l,i.pos-l);return new he(c,o.depth-s,i.depth-s)}replace(e,t,r){return l2(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:o}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(o==e||t.isText)return t;e-=o+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let o=this.content.child(t-1);return{node:o,index:t-1,offset:r-o.nodeSize}}resolve(e){return ko.resolveCached(this,e)}resolveNoCache(e){return ko.resolve(this,e)}rangeHasMark(e,t,r){let o=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),rh(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=se.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=o;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Pe.sameSet(e,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 e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=se.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,o,r)}};ir.prototype.text=void 0;class Mi extends ir{constructor(e,t,r,o){if(super(e,t,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):rh(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Mi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Mi(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function rh(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ur{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new f2(e,t);if(r.next==null)return ur.empty;let o=oh(r);r.next&&r.err("Unexpected trailing text");let i=b2(y2(o));return E2(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let o=this;for(let i=t;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let o=[this];function i(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return se.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:a}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&t(r.next[o].next)}return t(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
11
+ Expect errors in decoding.`),w=w.replace(/[^A-Za-z0-9\+\/\=]/g,"");N=this.KEY_STR.indexOf(w.charAt(z++)),I=this.KEY_STR.indexOf(w.charAt(z++)),_=this.KEY_STR.indexOf(w.charAt(z++)),L=this.KEY_STR.indexOf(w.charAt(z++)),O=N<<2|I>>4,y=(I&15)<<4|_>>2,E=(_&3)<<6|L,W.push(O),_!==64&&W.push(y),L!==64&&W.push(E),O=y=E="",N=I=_=L="",z<w.length;);return W}}]),A}();Ee.initClass();var Ae=function(M,w){var O=!1,y=!0,E=M.document,N=E.documentElement,I=E.addEventListener?"addEventListener":"attachEvent",_=E.addEventListener?"removeEventListener":"detachEvent",L=E.addEventListener?"":"on",z=function U(K){if(!(K.type==="readystatechange"&&E.readyState!=="complete")&&((K.type==="load"?M:E)[_](L+K.type,U,!1),!O&&(O=!0)))return w.call(M,K.type||K)},W=function U(){try{N.doScroll("left")}catch{setTimeout(U,50);return}return z("poll")};if(E.readyState!=="complete"){if(E.createEventObject&&N.doScroll){try{y=!M.frameElement}catch{}y&&W()}return E[I](L+"DOMContentLoaded",z,!1),E[I](L+"readystatechange",z,!1),M[I](L+"load",z,!1)}};j._autoDiscoverFunction=function(){if(j.autoDiscover)return j.discover()},Ae(window,j._autoDiscoverFunction);function xe(A,M){return typeof A<"u"&&A!==null?M(A):void 0}function Oe(A,M,w){if(typeof A<"u"&&A!==null&&typeof A[M]=="function")return w(A,M)}window.Dropzone=j;var ve=j}(),i}()})})(Yf);var Yv=Yf.exports;const au=Gv(Yv),Jv={class:"fallback"},Zv=f.createElementVNode("input",{id:"file",type:"file",name:"file",multiple:""},null,-1),Xv={for:"file"},Qv={class:"dz-message","data-dz-message":""},qv={id:"bd-dropzone-theme",style:{display:"none"}},e2={class:"dz-preview dz-file-preview"},t2={class:"dz-details"},n2=f.createElementVNode("img",{"data-dz-thumbnail":"",class:"dz-image"},null,-1),r2=f.createElementVNode("div",{class:"dz-filename"},[f.createElementVNode("small",{"data-dz-name":""})],-1),o2=f.createElementVNode("div",{class:"dz-progress"},[f.createElementVNode("div",{class:"spinner-border text-primary spinner-border-sm",role:"status"},[f.createElementVNode("span",{class:"visually-hidden"},"Loading...")])],-1),i2={class:"dz-success-mark"},s2={class:"dz-error-message text-danger"},a2=f.createElementVNode("small",{"data-dz-errormessage":""},null,-1),Jf=f.defineComponent({__name:"BDDropzone",props:{modelValue:{default:[]},buttonText:{default:void 0},multiple:{type:Boolean,default:!1},errorMessage:{default:void 0},fileSizeExceededMessage:{default:void 0},acceptedFiles:{default:".jpg"},url:{default:""},tag:{default:"form"},token:{default:""}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=f.computed(()=>({variant:As.PRIMARY,size:at.SM})),o=gr(t,"modelValue",e);let i=null;au.autoDiscover=!1,f.watch(()=>t.modelValue,()=>{s()}),f.onMounted(()=>{document.getElementById("dropzone")&&l()});const s=()=>{i&&(i.destroy(),l())},l=()=>{var p;i=new au("#dropzone",{url:t.url,method:"post",acceptedFiles:t.acceptedFiles,addRemoveLinks:!1,maxFilesize:10,maxFiles:t.multiple?3:1,headers:{RequestVerificationToken:t.token},dictResponseError:t.errorMessage,dictFileTooBig:t.fileSizeExceededMessage,previewTemplate:(p=document.querySelector("#bd-dropzone-theme"))==null?void 0:p.innerHTML}),i.on("error",c),i.on("success",a),i.on("removedfile",d)},a=function(p,m){var g;o.value.push({UUID:(g=p.upload)==null?void 0:g.uuid,CorrelationId:m.CorrelationId,Naam:m.Naam}),u(p)},c=function(p){u(p)},u=function(p){const m=p.name;if(!(m.endsWith(".png")||m.endsWith(".jpg")||m.endsWith(".jpeg")||m.endsWith(".gif"))){const g=p.previewElement.getElementsByClassName("icon-file"),v=p.previewElement.getElementsByClassName("dz-image");g[0].classList.remove("d-none"),v[0].classList.add("d-none")}},d=function(p){const m=o.value.findIndex(g=>{var v;return(g==null?void 0:g.UUID)===((v=p.upload)==null?void 0:v.uuid)});m!==-1&&o.value.splice(m,1)},h=f.computed(()=>t.tag??"form");return(p,m)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(h.value),{id:"dropzone",class:"dropzone bd-dropzone",enctype:"multipart/form-data"},{default:f.withCtx(()=>[f.createElementVNode("div",Jv,[Zv,f.createTextVNode(" test "),f.createElementVNode("label",Xv,[f.createVNode(f.unref(cr)),f.createTextVNode(" "+f.toDisplayString(t.buttonText),1)])]),f.createElementVNode("div",Qv,[f.createVNode(f.unref(lt),f.normalizeProps(f.guardReactiveProps(r.value)),{default:f.withCtx(()=>[f.createVNode(f.unref(cr)),f.createTextVNode(" "+f.toDisplayString(t.buttonText),1)]),_:1},16)])]),_:1})),f.createElementVNode("div",qv,[f.createElementVNode("div",e2,[f.createElementVNode("div",t2,[n2,f.createVNode(f.unref(Pl),{"data-dz-thumbnail":"",class:"d-none"}),r2,f.createVNode(f.unref(lt),{class:"dz-remove",alt:"Click me to remove the file.","data-dz-remove":""},{default:f.withCtx(()=>[f.createVNode(f.unref($o))]),_:1})]),o2,f.createElementVNode("div",i2,[f.createVNode(f.unref(Po))]),f.createElementVNode("div",s2,[f.createVNode(f.unref(xs)),a2])])])],64))}});function Qe(n){this.content=n}Qe.prototype={constructor:Qe,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,o=r.find(n),i=r.content.slice();return o==-1?i.push(t||n,e):(i[o+1]=e,t&&(i[o]=t)),new Qe(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Qe(t)},addToStart:function(n,e){return new Qe([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Qe(t)},addBefore:function(n,e,t){var r=this.remove(e),o=r.content.slice(),i=r.find(n);return o.splice(i==-1?o.length:i,0,e,t),new Qe(o)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Qe.from(n),n.size?new Qe(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Qe.from(n),n.size?new Qe(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Qe.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Qe.from=function(n){if(n instanceof Qe)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Qe(e)};function Zf(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=Zf(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function Xf(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),l=e.child(--i),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let c=Xf(s.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class se{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,o=0,i){for(let s=0,l=0;l<t;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,o+l,i||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(i+=l.text.slice(Math.max(e,a)-a,t-a),s=!r):l.isLeaf?(o?i+=typeof o=="function"?o(l):o:l.type.spec.leafText&&(i+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(i+=r,s=!0)},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new se(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],o=0;if(t>e)for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),o+=l.nodeSize),s=a}return new se(r,o)}cutByIndex(e,t){return e==t?se.empty:e==0&&t==this.content.length?this:new se(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new se(o,i)}addToStart(e){return new se([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new se(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let o=this.content[t];e(o,r,t),r+=o.nodeSize}}findDiffStart(e,t=0){return Zf(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xf(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Qo(0,e);if(e==this.size)return Qo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||t>0?Qo(r+1,s):Qo(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return se.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return se.empty;let t,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(t||(t=e.slice(0,o)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new se(t||e,r)}static from(e){if(!e)return se.empty;if(e instanceof se)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new se([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}se.empty=new se([],0);const na={index:0,offset:0};function Qo(n,e){return na.index=n,na.offset=e,na}function xi(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!xi(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!xi(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Pe=class Ja{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&xi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ja.none;if(e instanceof Ja)return[e];let t=e.slice();return t.sort((r,o)=>r.type.rank-o.type.rank),t}};Pe.none=[];class Ti extends Error{}class he{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=qf(this.content,e+this.openStart,t);return r&&new he(r,this.openStart,this.openEnd)}removeBetween(e,t){return new he(Qf(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return he.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new he(se.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new he(e,r,o)}}he.empty=new he(se.empty,0,0);function Qf(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(o==e||i.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Qf(i.content,e-o-1,t-o-1)))}function qf(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=qf(s.content,e-i-1,t);return l&&n.replaceChild(o,s.copy(l))}function l2(n,e,t){if(t.openStart>n.depth)throw new Ti("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Ti("Inconsistent open depths");return eh(n,e,t,0)}function eh(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r<n.depth-t.openStart){let s=eh(n,e,t,r+1);return i.copy(i.content.replaceChild(o,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return or(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=c2(t,n);return or(i,nh(n,s,l,e,r))}else return or(i,Ai(n,e,r))}function th(n,e){if(!e.type.compatibleContent(n.type))throw new Ti("Cannot join "+e.type.name+" onto "+n.type.name)}function Za(n,e,t){let r=n.node(t);return th(r,e.node(t)),r}function rr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ho(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(rr(n.nodeAfter,r),i++));for(let l=i;l<s;l++)rr(o.child(l),r);e&&e.depth==t&&e.textOffset&&rr(e.nodeBefore,r)}function or(n,e){return n.type.checkContent(e),n.copy(e)}function nh(n,e,t,r,o){let i=n.depth>o&&Za(n,e,o+1),s=r.depth>o&&Za(t,r,o+1),l=[];return ho(null,n,o,l),i&&s&&e.index(o)==t.index(o)?(th(i,s),rr(or(i,nh(n,e,t,r,o+1)),l)):(i&&rr(or(i,Ai(n,e,o+1)),l),ho(e,t,o,l),s&&rr(or(s,Ai(t,r,o+1)),l)),ho(r,null,o,l),new se(l)}function Ai(n,e,t){let r=[];if(ho(null,n,t,r),n.depth>t){let o=Za(n,e,t+1);rr(or(o,Ai(n,e,t+1)),r)}return ho(e,null,t,r),new se(r)}function c2(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(se.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class ko{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),o=e.maybeChild(t);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Oi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(i),c=i-a;if(r.push(s,l,o+a),!c||(s=s.child(l),s.isText))break;i=c-1,o+=a+1}return new ko(t,r,i)}static resolveCached(e,t){for(let o=0;o<ra.length;o++){let i=ra[o];if(i.pos==t&&i.doc==e)return i}let r=ra[oa]=ko.resolve(e,t);return oa=(oa+1)%u2,r}}let ra=[],oa=0,u2=12;class Oi{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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 d2=Object.create(null);let ir=class Xa{constructor(e,t,r,o=Pe.none){this.type=e,this.attrs=t,this.marks=o,this.content=r||se.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,o=0){this.content.nodesBetween(e,t,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,o){return this.content.textBetween(e,t,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&xi(this.attrs,t||e.defaultAttrs||d2)&&Pe.sameSet(this.marks,r||Pe.none)}copy(e=null){return e==this.content?this:new Xa(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xa(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return he.empty;let o=this.resolve(e),i=this.resolve(t),s=r?0:o.sharedDepth(t),l=o.start(s),c=o.node(s).content.cut(o.pos-l,i.pos-l);return new he(c,o.depth-s,i.depth-s)}replace(e,t,r){return l2(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:o}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(o==e||t.isText)return t;e-=o+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let o=this.content.child(t-1);return{node:o,index:t-1,offset:r-o.nodeSize}}resolve(e){return ko.resolveCached(this,e)}resolveNoCache(e){return ko.resolve(this,e)}rangeHasMark(e,t,r){let o=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),rh(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=se.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=o;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Pe.sameSet(e,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 e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=se.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,o,r)}};ir.prototype.text=void 0;class Mi extends ir{constructor(e,t,r,o){if(super(e,t,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):rh(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Mi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Mi(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function rh(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ur{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new f2(e,t);if(r.next==null)return ur.empty;let o=oh(r);r.next&&r.err("Unexpected trailing text");let i=b2(y2(o));return E2(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let o=this;for(let i=t;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let o=[this];function i(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return se.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:a}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&t(r.next[o].next)}return t(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
12
12
  `)}}ur.empty=new ur(!0);class f2{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function oh(n){let e=[];do e.push(h2(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function h2(n){let e=[];do e.push(p2(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function p2(n){let e=v2(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=m2(n,e);else break;return e}function lu(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function m2(n,e){let t=lu(n),r=t;return n.eat(",")&&(n.next!="}"?r=lu(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function g2(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function v2(n){if(n.eat("(")){let e=oh(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=g2(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function y2(n){let e=[[]];return o(i(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=t())}else if(s.type=="star"){let a=t();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let u=t();o(i(s.expr,a),u),a=u}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let u=t();r(a,u),o(i(s.expr,a),u),a=u}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function ih(n,e){return e-n}function cu(n,e){let t=[];return r(e),t.sort(ih);function r(o){let i=n[o];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&t.indexOf(a)==-1&&r(a)}}}function b2(n){let e=Object.create(null);return t(cu(n,0));function t(r){let o=[];r.forEach(s=>{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);cu(n,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new ur(r.indexOf(n.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(ih);i.next.push({type:o[s][0],next:e[l.join(",")]||t(l)})}return i}}function E2(n,e){for(let t=0,r=[n];t<r.length;t++){let o=r[t],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sh(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ah(n,e){let t=Object.create(null);for(let r in n){let o=e&&e[r];if(o===void 0){let i=n[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=o}return t}function lh(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new C2(n[t]);return e}let uu=class ch{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=lh(r.attrs),this.defaultAttrs=sh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ur.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ah(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ir(this,this.computeAttrs(e),se.from(t),Pe.setFrom(r))}createChecked(e=null,t,r){return t=se.from(t),this.checkContent(t),new ir(this,this.computeAttrs(e),t,Pe.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=se.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(se.empty,!0);return i?new ir(this,e,t.append(i),Pe.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Pe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,s)=>r[i]=new ch(i,t,s));let o=t.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class C2{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ms{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=lh(o.attrs),this.excluded=null;let i=sh(this.attrs);this.instance=i?new Pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Pe(this,ah(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ms(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class S2{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=Qe.from(e.nodes),t.marks=Qe.from(e.marks||{}),this.nodes=uu.compile(this.spec.nodes,this),this.marks=Ms.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",l=i.spec.marks;i.contentMatch=r[s]||(r[s]=ur.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=l=="_"?null:l?du(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:du(this,s.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(e,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof uu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,o)}text(e,t){let r=this.nodes.text;return new Mi(r,r.defaultAttrs,e,Pe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ir.fromJSON(this,e)}markFromJSON(e){return Pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function du(n,e){let t=[];for(let r=0;r<e.length;r++){let o=e[r],i=n.marks[o],s=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Hr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new hu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new hu(this,t,!0);return r.addAll(e,t.from,t.to),he.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(x2(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,t,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<t.length;s++){let l=t[s];if((l.priority==null?50:l.priority)<i)break}t.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=pu(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=pu(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Hr(e,Hr.schemaRules(e)))}}const uh={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},w2={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},dh={ol:!0,ul:!0},Ni=1,Ii=2,po=4;function fu(n,e,t){return e!=null?(e?Ni:0)|(e==="full"?Ii:0):n&&n.whitespace=="pre"?Ni|Ii:t&~po}class qo{constructor(e,t,r,o,i,s,l){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=l,this.content=[],this.activeMarks=Pe.none,this.stashMarks=[],this.match=s||(l&po?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(se.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ni)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let t=se.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(se.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let o=r[t];(this.type?this.type.allowsMarkType(o.type):A2(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!uh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let o=t.topNode,i,s=fu(null,t.preserveWhitespace,0)|(r?po:0);o?i=new qo(o.type,o.attrs,Pe.none,Pe.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new qo(null,null,Pe.none,Pe.none,!0,null,s):i=new qo(e.schema.topNodeType,null,Pe.none,Pe.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let o=this.readStyles(T2(r));if(!o)return;let[i,s]=o,l=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);t();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Ii||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Ni)r.options&Ii?t=t.replace(/\r\n?/g,`
13
13
  `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),o;dh.hasOwnProperty(r)&&this.parser.normalizeLists&&k2(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,t));if(i?i.ignore:w2.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let s,l=this.top,a=this.needsBlock;if(uh.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),s=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?o:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
14
14
  `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Pe.none,r=Pe.none;for(let o=0;o<e.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(e[o],e[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(l=>{s.clearMark(l)&&(r=l.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)i=s;else break}return[t,r]}addElementByRule(e,t,r){let o,i,s;t.node?(i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):o=this.enter(i,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}o&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,t,r){let o=t||0;for(let i=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let t,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=i,!s.length)||i.solid)break}if(!t)return!1;this.sync(r);for(let o=0;o<t.length;o++)this.enterInner(t[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let o=0;o<e.marks.length;o++)(!t.type||t.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let o=this.findPlace(e.create(t));return o&&this.enterInner(e,t,!0,r),o}enterInner(e,t=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=fu(e,o,i.options);i.options&po&&i.content.length==0&&(s|=po),this.nodes.push(new qo(e,t,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&t.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=O2(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==t)break}}}function k2(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&dh.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function x2(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function T2(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function pu(n){let e={};for(let t in n)e[t]=n[t];return e}function A2(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))continue;let i=[],s=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function O2(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class tn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=ia(t).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let l=0,a=0;for(;l<i.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)o=i.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],u=this.serializeMark(c,s.isInline,t);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:o}=tn.renderSpec(ia(t),this.nodes[e.type.name](e));if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,o)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&tn.renderSpec(ia(r),o(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let o=t[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,l=r?e.createElementNS(r,o):e.createElement(o),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;u<t.length;u++){let d=t[u];if(d===0){if(u<t.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=tn.renderSpec(e,d,r);if(l.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=mu(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return mu(e.marks)}}function mu(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ia(n){return n.document||window.document}const fh=65535,hh=Math.pow(2,16);function M2(n,e){return n+e*hh}function gu(n){return n&fh}function N2(n){return(n-(n&fh))/hh}const ph=1,mh=2,pi=4,gh=8;class Qa{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&gh)>0}get deletedBefore(){return(this.delInfo&(ph|pi))>0}get deletedAfter(){return(this.delInfo&(mh|pi))>0}get deletedAcross(){return(this.delInfo&pi)>0}}class St{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&St.empty)return St.empty}recover(e){let t=0,r=gu(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+N2(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+s],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,p=a+o+(h<0?0:u);if(r)return p;let m=e==(t<0?a:d)?null:M2(l/3,e-a),g=e==a?mh:e==d?ph:pi;return(t<0?e!=a:e!=d)&&(g|=gh),new Qa(p,g,m)}o+=u-c}return r?e+o:new Qa(e+o,0,null)}touches(e,t){let r=0,o=gu(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],l=s-(this.inverted?i:0),a=s+(this.inverted?0:i),c=this.ranges[o+t],u=this.ranges[o+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new St(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?St.empty:new St(e<0?[0,-e,0]:[0,0,e])}}St.empty=new St([]);class mo{constructor(e=[],t,r=0,o=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=o}slice(e=0,t=this.maps.length){return new mo(this.maps,this.mirror,e,t)}copy(){return new mo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let o=e.getMirror(t);this.appendMap(e.maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new mo;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],l=s.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this.maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new Qa(e,o,null)}}const sa=Object.create(null);class ot{getMap(){return St.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=sa[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in sa)throw new RangeError("Duplicate use of step JSON ID "+e);return sa[e]=t,t.prototype.jsonID=e,t}}class We{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new We(e,null)}static fail(e){return new We(null,e)}static fromReplace(e,t,r,o){try{return We.ok(e.replace(t,r,o))}catch(i){if(i instanceof Ti)return We.fail(i.message);throw i}}}function Yl(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(Yl(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return se.fromArray(r)}class In extends ot{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new he(Yl(t.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return We.fromReplace(e,this.from,this.to,i)}invert(){return new nn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new In(t.pos,r.pos,this.mark)}merge(e){return e instanceof In&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new In(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new In(t.from,t.to,e.markFromJSON(t.mark))}}ot.jsonID("addMark",In);class nn extends ot{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new he(Yl(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return We.fromReplace(e,this.from,this.to,r)}invert(){return new In(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new nn(t.pos,r.pos,this.mark)}merge(e){return e instanceof nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new nn(t.from,t.to,e.markFromJSON(t.mark))}}ot.jsonID("removeMark",nn);class Dn extends ot{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return We.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return We.fromReplace(e,this.pos,this.pos+1,new he(se.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new Dn(this.pos,t.marks[o]);return new Dn(this.pos,this.mark)}}return new Ur(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Dn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Dn(t.pos,e.markFromJSON(t.mark))}}ot.jsonID("addNodeMark",Dn);class Ur extends ot{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return We.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return We.fromReplace(e,this.pos,this.pos+1,new he(se.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Dn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ur(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ur(t.pos,e.markFromJSON(t.mark))}}ot.jsonID("removeNodeMark",Ur);class qe extends ot{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&qa(e,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new St([this.from,this.to-this.from,this.slice.size])}invert(e){return new qe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new qe(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof qe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?he.empty:new he(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new qe(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?he.empty:new he(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new qe(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qe(t.from,t.to,he.fromJSON(e,t.slice),!!t.structure)}}ot.jsonID("replace",qe);class Je extends ot{constructor(e,t,r,o,i,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=l}apply(e){if(this.structure&&(qa(e,this.from,this.gapFrom)||qa(e,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return We.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?We.fromReplace(e,this.from,this.to,r):We.fail("Content does not fit in gap")}getMap(){return new St([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Je(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new Je(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Je(t.from,t.to,t.gapFrom,t.gapTo,he.fromJSON(e,t.slice),t.insert,!!t.structure)}}ot.jsonID("replaceAround",Je);function qa(n,e,t){let r=n.resolve(e),o=t-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function I2(n,e,t,r){let o=[],i=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+a.nodeSize,t),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(d[g])?s.to=p:o.push(s=new nn(h,p,d[g])));l&&l.to==h?l.to=p:i.push(l=new In(h,p,r))}}),o.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function D2(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;i++;let a=null;if(r instanceof Ms){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],h;for(let p=0;p<o.length;p++){let m=o[p];m.step==i-1&&d.eq(o[p].style)&&(h=m)}h?(h.to=c,h.step=i):o.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),o.forEach(s=>n.step(new nn(s.from,s.to,s.style)))}function _2(n,e,t,r=t.contentMatch){let o=n.doc.nodeAt(e),i=[],s=e+1;for(let l=0;l<o.childCount;l++){let a=o.child(l),c=s+a.nodeSize,u=r.matchType(a.type);if(!u)i.push(new qe(s,c,he.empty));else{r=u;for(let d=0;d<a.marks.length;d++)t.allowsMarkType(a.marks[d].type)||n.step(new nn(s,c,a.marks[d]));if(a.isText&&!t.spec.code){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(a.text);)p||(p=new he(se.from(t.schema.text(" ",t.allowedMarks(a.marks))),0,0)),i.push(new qe(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!r.validEnd){let l=r.fillBefore(se.empty,!0);n.replace(s,s,new he(l,0,0))}for(let l=i.length-1;l>=0;l--)n.step(i[l])}function L2(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function eo(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(r<n.depth&&o.canReplace(i,s,t))return r;if(r==0||o.type.spec.isolating||!L2(o,i,s))break}return null}function R2(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=se.empty,d=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=se.from(r.node(m).copy(u)),d++):a--;let h=se.empty,p=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,h=se.from(o.node(m).copy(h)),p++):c++;n.step(new Je(a,c,s,l,new he(u.append(h),d,p),u.size-d,!0))}function Jl(n,e,t=null,r=n){let o=B2(n,e),i=o&&P2(r,e);return i?o.map(vu).concat({type:e,attrs:t}).concat(i.map(vu)):null}function vu(n){return{type:n,attrs:null}}function B2(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return t.canReplaceWith(r,o,s)?i:null}function P2(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<o;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:s}function $2(n,e,t){let r=se.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=se.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new Je(o,i,o,i,new he(r,0,0),t.length,!0))}function F2(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&V2(n.doc,n.mapping.slice(i).map(l),r)){n.clearIncompatible(n.mapping.slice(i).map(l,1),r);let a=n.mapping.slice(i),c=a.map(l,1),u=a.map(l+s.nodeSize,1);return n.step(new Je(c,u,c+1,u-1,new he(se.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function V2(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function z2(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Je(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new he(se.from(s),0,0),1,!0))}function $r(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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 c=o.depth-1,u=t-2;c>i;c--,u--){let d=o.node(c),h=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!g.type.validContent(p))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function H2(n,e,t=1,r){let o=n.doc.resolve(e),i=se.empty,s=se.empty;for(let l=o.depth,a=o.depth-t,c=t-1;l>a;l--,c--){i=se.from(o.node(l).copy(i));let u=r&&r[c];s=se.from(u?u.type.create(u.attrs,s):o.node(l).copy(s))}n.step(new qe(e,e,new he(i.append(s),t,t),!0))}function zn(n,e){let t=n.resolve(e),r=t.index();return vh(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function vh(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Ns(n,e,t=-1){let r=n.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):t>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&vh(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function U2(n,e,t){let r=new qe(e-t,e+t,he.empty,!0);n.step(r)}function j2(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,t))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function W2(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Zl(n,e,t=e,r=he.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return yh(o,i,r)?new qe(e,t,r):new K2(o,i,r).fit()}function yh(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class K2{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=se.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=se.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new he(i,s,l);return e>-1?new Je(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new qe(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=aa(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(se.from(s),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=aa(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new he(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=aa(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new he(lo(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new he(lo(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,u=[],{match:d,type:h}=this.frontier[t];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let p=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let g=l.child(c),v=d.matchType(g.type);if(!v)break;c++,(c>1||a==0||g.content.size)&&(d=v,u.push(bh(g.mark(h.allowedMarks(g.marks)),c==1?a:0,c==l.childCount?p:-1)))}let m=c==l.childCount;m||(p=-1),this.placed=co(this.placed,t,se.from(u)),this.frontier[t].match=d,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g<p;g++){let C=v.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),v=C.content}this.unplaced=m?e==0?he.empty:new he(lo(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new he(lo(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!la(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:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=la(e,t,o,r,i);if(s){for(let l=t-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=la(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=co(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=co(this.placed,this.depth,se.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(se.empty,!0);t.childCount&&(this.placed=co(this.placed,this.frontier.length,t))}}function lo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(lo(n.firstChild.content,e-1,t)))}function co(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(co(n.lastChild.content,e-1,t)))}function aa(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function bh(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,bh(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(se.empty,!0)))),n.copy(r)}function la(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!G2(t,i.content,s)?l:null}function G2(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Y2(n){return n.spec.defining||n.spec.definingForContent}function J2(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(yh(o,i,r))return n.step(new qe(e,t,r));let s=Ch(o,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let h=o.depth,p=o.pos-1;h>0;h--,p--){let m=o.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:o.before(h)==p&&s.splice(1,0,-h)}let a=s.indexOf(l),c=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(c.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=c[h],m=Y2(p.type);if(m&&!p.sameMarkup(o.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<s.length;g++){let v=s[(g+a)%s.length],C=!0;v<0&&(C=!1,v=-v);let S=o.node(v-1),k=o.index(v-1);if(S.canReplaceWith(k,k,m.type,m.marks))return n.replace(o.before(v),C?i.after(v):t,new he(Eh(r.content,0,r.openStart,p),p,r.openEnd))}}let d=n.steps.length;for(let h=s.length-1;h>=0&&(n.replace(e,t,r),!(n.steps.length>d));h--){let p=s[h];p<0||(e=o.before(p),t=i.after(p))}}function Eh(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy(Eh(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(se.empty,!0))}return n}function Z2(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=j2(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new he(se.from(r),0,0))}function X2(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=Ch(r,o);for(let s=0;s<i.length;s++){let l=i[s],a=s==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return n.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return n.delete(r.before(l),o.after(l))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&o.end(s)-t!=o.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Ch(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}class Fr extends ot{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return We.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return We.fromReplace(e,this.pos,this.pos+1,new he(se.from(o),0,t.isLeaf?0:1))}getMap(){return St.empty}invert(e){return new Fr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Fr(t.pos,t.attr,t.value)}}ot.jsonID("attr",Fr);class xo extends ot{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return We.ok(r)}getMap(){return St.empty}invert(e){return new xo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new xo(t.attr,t.value)}}ot.jsonID("docAttr",xo);let jr=class extends Error{};jr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};jr.prototype=Object.create(Error.prototype);jr.prototype.constructor=jr;jr.prototype.name="TransformError";class Sh{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new jr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=he.empty){let o=Zl(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new he(se.from(r),0,0))}delete(e,t){return this.replace(e,t,he.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return J2(this,e,t,r),this}replaceRangeWith(e,t,r){return Z2(this,e,t,r),this}deleteRange(e,t){return X2(this,e,t),this}lift(e,t){return R2(this,e,t),this}join(e,t=1){return U2(this,e,t),this}wrap(e,t){return $2(this,e,t),this}setBlockType(e,t=e,r,o=null){return F2(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return z2(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new Fr(e,t,r)),this}setDocAttribute(e,t){return this.step(new xo(e,t)),this}addNodeMark(e,t){return this.step(new Dn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Pe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Ur(e,t)),this}split(e,t=1,r){return H2(this,e,t,r),this}addMark(e,t,r){return I2(this,e,t,r),this}removeMark(e,t,r){return D2(this,e,t,r),this}clearIncompatible(e,t,r){return _2(this,e,t,r),this}}const ca=Object.create(null);class _e{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Q2(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=he.empty){let r=t.content.lastChild,o=null;for(let l=0;l<t.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?he.empty:t),l==0&&Eu(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:l}=o[i],a=e.mapping.slice(r),c=a.map(s.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),Eu(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let o=e.parent.inlineContent?new Le(e):Ar(e.node(0),e.parent,e.pos,e.index(),t,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=t<0?Ar(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):Ar(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ht(e.node(0))}static atStart(e){return Ar(e,e,0,0,1)||new Ht(e)}static atEnd(e){return Ar(e,e,e.content.size,e.childCount,-1)||new Ht(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ca[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return ca[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Le.between(this.$anchor,this.$head).getBookmark()}}_e.prototype.visible=!0;class Q2{constructor(e,t){this.$from=e,this.$to=t}}let yu=!1;function bu(n){!yu&&!n.parent.inlineContent&&(yu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Le extends _e{constructor(e,t=e){bu(e),bu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return _e.near(r);let o=e.resolve(t.map(this.anchor));return new Le(o.parent.inlineContent?o:r,r)}replace(e,t=he.empty){if(super.replace(e,t),t==he.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Is(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Le(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=_e.findFrom(t,r,!0)||_e.findFrom(t,-r,!0);if(i)t=i.$head;else return _e.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(e=(_e.findFrom(e,-r,!0)||_e.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=o<0&&(e=t))),new Le(e,t)}}_e.jsonID("text",Le);class Is{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Is(e.map(this.anchor),e.map(this.head))}resolve(e){return Le.between(e.resolve(this.anchor),e.resolve(this.head))}}class Se extends _e{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:o}=t.mapResult(this.anchor),i=e.resolve(o);return r?_e.near(i):new Se(i)}content(){return new he(se.from(this.node),0,0)}eq(e){return e instanceof Se&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Xl(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(e.resolve(t.anchor))}static create(e,t){return new Se(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Se.prototype.visible=!1;_e.jsonID("node",Se);class Xl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Is(r,r):new Xl(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Se.isSelectable(r)?new Se(t):_e.near(t)}}class Ht extends _e{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=he.empty){if(t==he.empty){e.delete(0,e.doc.content.size);let r=_e.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ht(e)}map(e){return new Ht(e)}eq(e){return e instanceof Ht}getBookmark(){return q2}}_e.jsonID("all",Ht);const q2={map(){return this},resolve(n){return new Ht(n)}};function Ar(n,e,t,r,o,i=!1){if(e.inlineContent)return Le.create(n,t);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let l=e.child(s);if(l.isAtom){if(!i&&Se.isSelectable(l))return Se.create(n,t-(o<0?l.nodeSize:0))}else{let a=Ar(n,l,t+o,o<0?l.childCount:0,o,i);if(a)return a}t+=l.nodeSize*o}return null}function Eu(n,e,t){let r=n.steps.length-1;if(r<e)return;let o=n.steps[r];if(!(o instanceof qe||o instanceof Je))return;let i=n.mapping.maps[r],s;i.forEach((l,a,c,u)=>{s==null&&(s=u)}),n.setSelection(_e.near(n.doc.resolve(s),t))}const Cu=1,ei=2,Su=4;class ey extends Sh{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.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(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Cu)&~ei,this.storedMarks=null,this}get selectionSet(){return(this.updated&Cu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ei,this}ensureMarks(e){return Pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ei)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ei,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Pe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),this.selection.empty||this.setSelection(_e.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Su,this}get scrolledIntoView(){return(this.updated&Su)>0}}function wu(n,e){return!e||!n?n:n.bind(e)}class uo{constructor(e,t,r){this.name=e,this.init=wu(t.init,r),this.apply=wu(t.apply,r)}}const ty=[new uo("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new uo("selection",{init(n,e){return n.selection||_e.atStart(e.doc)},apply(n){return n.selection}}),new uo("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new uo("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class ua{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ty.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new uo(r.key,r.spec.state,r))})}}class Rr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=o?o[s].n:0,c=o?o[s].state:this,u=a<t.length&&l.spec.appendTransaction.call(l,a?t.slice(a):t,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:t.length})}}if(!i)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Rr(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new ey(this)}static create(e){let t=new ua(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Rr(t);for(let o=0;o<t.fields.length;o++)r[t.fields[o].name]=t.fields[o].init(e,r);return r}reconfigure(e){let t=new ua(this.schema,e.plugins),r=t.fields,o=new Rr(t);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new ua(e.schema,e.plugins),i=new Rr(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=ir.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=_e.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){i[s.name]=c.fromJSON.call(a,e,t[l],i);return}}i[s.name]=s.init(e,i)}}),i}}function wh(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=wh(o,e,{})),t[r]=o}return t}class Et{constructor(e){this.spec=e,this.props={},e.props&&wh(e.props,this,this.props),this.key=e.key?e.key.key:kh("plugin")}getState(e){return e[this.key]}}const da=Object.create(null);function kh(n){return n in da?n+"$"+ ++da[n]:(da[n]=0,n+"$")}class Kt{constructor(e="key"){this.key=kh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ct=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},To=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let ku=null;const hn=function(n,e,t){let r=ku||(ku=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},dr=function(n,e,t,r){return t&&(xu(n,e,t,r,-1)||xu(n,e,t,r,1))},ny=/^(img|br|input|textarea|hr)$/i;function xu(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:en(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Ql(n)||ny.test(n.nodeName)||n.contentEditable=="false")return!1;e=ct(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.contentEditable=="false")return!1;e=o<0?en(n):0}else return!1}}function en(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ry(n,e,t){for(let r=e==0,o=e==en(n);r||o;){if(n==t)return!0;let i=ct(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==en(n)}}function Ql(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Ds=function(n){return n.focusNode&&dr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Zn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function oy(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function iy(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const on=typeof navigator<"u"?navigator:null,Tu=typeof document<"u"?document:null,Hn=on&&on.userAgent||"",el=/Edge\/(\d+)/.exec(Hn),xh=/MSIE \d/.exec(Hn),tl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hn),bt=!!(xh||tl||el),Ln=xh?document.documentMode:tl?+tl[1]:el?+el[1]:0,jt=!bt&&/gecko\/(\d+)/i.test(Hn);jt&&+(/Firefox\/(\d+)/.exec(Hn)||[0,0])[1];const nl=!bt&&/Chrome\/(\d+)/.exec(Hn),rt=!!nl,sy=nl?+nl[1]:0,ft=!bt&&!!on&&/Apple Computer/.test(on.vendor),Wr=ft&&(/Mobile\/\w+/.test(Hn)||!!on&&on.maxTouchPoints>2),Lt=Wr||(on?/Mac/.test(on.platform):!1),ay=on?/Win/.test(on.platform):!1,zt=/Android \d/.test(Hn),zo=!!Tu&&"webkitFontSmoothing"in Tu.documentElement.style,ly=zo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function cy(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function dn(n,e){return typeof n=="number"?n:n[e]}function uy(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Au(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;s=To(s)){if(s.nodeType!=1)continue;let l=s,a=l==i.body,c=a?cy(i):uy(l),u=0,d=0;if(e.top<c.top+dn(r,"top")?d=-(c.top-e.top+dn(o,"top")):e.bottom>c.bottom-dn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+dn(o,"top")-c.top:e.bottom-c.bottom+dn(o,"bottom")),e.left<c.left+dn(r,"left")?u=-(c.left-e.left+dn(o,"left")):e.right>c.right-dn(r,"right")&&(u=e.right-c.right+dn(o,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let h=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function dy(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=n.root.elementFromPoint(i,s);if(!l||l==n.dom||!n.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=t-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:Th(n.dom)}}function Th(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=To(r));return e}function fy({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Ah(t,r==0?0:r-e)}function Ah(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:o,left:i}=n[t];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Cr=null;function hy(n){if(n.setActive)return n.setActive();if(Cr)return n.focus(Cr);let e=Th(n);n.focus(Cr==null?{get preventScroll(){return Cr={preventScroll:!0},!0}}:void 0),Cr||(Cr=!1,Ah(e,0))}function Oh(n,e){let t,r=2e8,o,i=0,s=e.top,l=e.top,a,c;for(let u=n.firstChild,d=0;u;u=u.nextSibling,d++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=hn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){t=u,r=g,o=g&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!t&&a&&(t=a,o=c,r=0),t&&t.nodeType==3?py(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:Oh(t,o)}function py(n,e){let t=n.nodeValue.length,r=document.createRange();for(let o=0;o<t;o++){r.setEnd(n,o+1),r.setStart(n,o);let i=Tn(r,1);if(i.top!=i.bottom&&ql(e,i))return{node:n,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function ql(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function my(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function gy(n,e,t){let{node:r,offset:o}=Oh(e,t),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function vy(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let l=n.docView.nearestDesc(i,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?o=l.posBefore:(a.right<r.left||a.bottom<r.top)&&(o=l.posAfter)),!l.contentDOM&&o<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}i=l.dom.parentNode}return o>-1?o:n.docView.posFromDOM(e,t,-1)}function Mh(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),i=o;;){let s=n.childNodes[i];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(ql(e,c))return Mh(s,e,c)}}if((i=(i+1)%r)==o)break}return n}function yy(n,e){let t=n.dom.ownerDocument,r,o=0,i=iy(t,e.left,e.top);i&&({node:r,offset:o}=i);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),l;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=n.dom.getBoundingClientRect();if(!ql(e,c)||(s=Mh(n.dom,e,c),!s))return null}if(ft)for(let c=s;r&&c;c=To(c))c.draggable&&(r=void 0);if(s=my(s,e),r){if(jt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;zo&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=vy(n,r,o,e))}l==null&&(l=gy(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ou(n){return n.top<n.bottom||n.left<n.right}function Tn(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Ou(r))return r}return Array.prototype.find.call(t,Ou)||n.getBoundingClientRect()}const by=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Nh(n,e,t){let{node:r,offset:o,atom:i}=n.docView.domFromPos(e,t<0?-1:1),s=zo||jt;if(r.nodeType==3)if(s&&(by.test(r.nodeValue)||(t<0?!o:o==r.nodeValue.length))){let a=Tn(hn(r,o,o),t);if(jt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Tn(hn(r,o-1,o-1),-1);if(c.top==a.top){let u=Tn(hn(r,o,o+1),-1);if(u.top!=a.top)return io(u,u.left<c.left)}}return a}else{let a=o,c=o,u=t<0?1:-1;return t<0&&!o?(c++,u=-1):t>=0&&o==r.nodeValue.length?(a--,u=1):t<0?a--:c++,io(Tn(hn(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==en(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return fa(a.getBoundingClientRect(),!1)}if(i==null&&o<en(r)){let a=r.childNodes[o];if(a.nodeType==1)return fa(a.getBoundingClientRect(),!0)}return fa(r.getBoundingClientRect(),t>=0)}if(i==null&&o&&(t<0||o==en(r))){let a=r.childNodes[o-1],c=a.nodeType==3?hn(a,en(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return io(Tn(c,1),!1)}if(i==null&&o<en(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?hn(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return io(Tn(c,-1),!0)}return io(Tn(r.nodeType==3?hn(r):r,-t),t>=0)}function io(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function fa(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Ih(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function Ey(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return Ih(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let s=Nh(n,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=hn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Cy=/[\u0590-\u08ac]/;function Sy(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=n.domSelection();return!Cy.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?i:s:Ih(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),v=m&&!p.contains(m.nodeType==1?m:m.parentNode)||a==m&&c==g;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return h!=null&&(l.caretBidiLevel=h),v})}let Mu=null,Nu=null,Iu=!1;function wy(n,e,t){return Mu==e&&Nu==t?Iu:(Mu=e,Nu=t,Iu=t=="up"||t=="down"?Ey(n,e,t):Sy(n,e,t))}const Bt=0,Du=1,Qn=2,sn=3;class Ho{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=Bt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let o=this.children[t];if(o==e)return r;r+=o.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(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=t>ct(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let o=this.children[t],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(l>e||s instanceof _h){o=e-i;break}i=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Dh&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?ct(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,t):{node:this.contentDOM,offset:i?ct(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,l=0;;l++){let a=this.children[l],c=s+a.size;if(o==-1&&e<=c){let u=s+a.border;if(e>=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let d=l;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=ct(h.dom)+1;break}e-=h.size}o==-1&&(o=0)}if(o>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=ct(d.dom);break}t+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],g=p+m.size;if(i>p&&s<g)return m.setSelection(e-p-m.border,t-p-m.border,r,o);p=g}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),c=r.getSelection(),u=!1;if((jt||ft)&&e==t){let{node:h,offset:p}=l;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
@@ -128,4 +128,4 @@ img.ProseMirror-separator {
128
128
  * Bootstrap v5.3.0 (https://getbootstrap.com/)
129
129
  * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
130
130
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
131
- */const xn=new Map,Da={set(n,e,t){xn.has(n)||xn.set(n,new Map);const r=xn.get(n);if(!r.has(e)&&r.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`);return}r.set(e,t)},get(n,e){return xn.has(n)&&xn.get(n).get(e)||null},remove(n,e){if(!xn.has(n))return;const t=xn.get(n);t.delete(e),t.size===0&&xn.delete(n)}},E4=1e6,C4=1e3,Ol="transitionend",hm=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),S4=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),w4=n=>{do n+=Math.floor(Math.random()*E4);while(document.getElementById(n));return n},k4=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n);const r=Number.parseFloat(e),o=Number.parseFloat(t);return!r&&!o?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*C4)},pm=n=>{n.dispatchEvent(new Event(Ol))},vn=n=>!n||typeof n!="object"?!1:(typeof n.jquery<"u"&&(n=n[0]),typeof n.nodeType<"u"),$n=n=>vn(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(hm(n)):null,ro=n=>{if(!vn(n)||n.getClientRects().length===0)return!1;const e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){const r=n.closest("summary");if(r&&r.parentNode!==t||r===null)return!1}return e},Fn=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled<"u"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",mm=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){const e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?mm(n.parentNode):null},Cs=()=>{},Wo=n=>{n.offsetHeight},gm=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,_a=[],x4=n=>{document.readyState==="loading"?(_a.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of _a)e()}),_a.push(n)):n()},$t=()=>document.documentElement.dir==="rtl",Vt=n=>{x4(()=>{const e=gm();if(e){const t=n.NAME,r=e.fn[t];e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=r,n.jQueryInterface)}})},yt=(n,e=[],t=n)=>typeof n=="function"?n(...e):t,vm=(n,e,t=!0)=>{if(!t){yt(n);return}const r=5,o=k4(e)+r;let i=!1;const s=({target:l})=>{l===e&&(i=!0,e.removeEventListener(Ol,s),yt(n))};e.addEventListener(Ol,s),setTimeout(()=>{i||pm(e)},o)},Rc=(n,e,t,r)=>{const o=n.length;let i=n.indexOf(e);return i===-1?!t&&r?n[o-1]:n[0]:(i+=t?1:-1,r&&(i=(i+o)%o),n[Math.max(0,Math.min(i,o-1))])},T4=/[^.]*(?=\..*)\.|.*/,A4=/\..*/,O4=/::\d+$/,La={};let Kd=1;const ym={mouseenter:"mouseover",mouseleave:"mouseout"},M4=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function bm(n,e){return e&&`${e}::${Kd++}`||n.uidEvent||Kd++}function Em(n){const e=bm(n);return n.uidEvent=e,La[e]=La[e]||{},La[e]}function N4(n,e){return function t(r){return Bc(r,{delegateTarget:n}),t.oneOff&&ne.off(n,r.type,e),e.apply(n,[r])}}function I4(n,e,t){return function r(o){const i=n.querySelectorAll(e);for(let{target:s}=o;s&&s!==this;s=s.parentNode)for(const l of i)if(l===s)return Bc(o,{delegateTarget:s}),r.oneOff&&ne.off(n,o.type,e,t),t.apply(s,[o])}}function Cm(n,e,t=null){return Object.values(n).find(r=>r.callable===e&&r.delegationSelector===t)}function Sm(n,e,t){const r=typeof e=="string",o=r?t:e||t;let i=wm(n);return M4.has(i)||(i=n),[r,o,i]}function Gd(n,e,t,r,o){if(typeof e!="string"||!n)return;let[i,s,l]=Sm(e,t,r);e in ym&&(s=(m=>function(g){if(!g.relatedTarget||g.relatedTarget!==g.delegateTarget&&!g.delegateTarget.contains(g.relatedTarget))return m.call(this,g)})(s));const a=Em(n),c=a[l]||(a[l]={}),u=Cm(c,s,i?t:null);if(u){u.oneOff=u.oneOff&&o;return}const d=bm(s,e.replace(T4,"")),h=i?I4(n,t,s):N4(n,s);h.delegationSelector=i?t:null,h.callable=s,h.oneOff=o,h.uidEvent=d,c[d]=h,n.addEventListener(l,h,i)}function Ml(n,e,t,r,o){const i=Cm(e[t],r,o);i&&(n.removeEventListener(t,i,!!o),delete e[t][i.uidEvent])}function D4(n,e,t,r){const o=e[t]||{};for(const[i,s]of Object.entries(o))i.includes(r)&&Ml(n,e,t,s.callable,s.delegationSelector)}function wm(n){return n=n.replace(A4,""),ym[n]||n}const ne={on(n,e,t,r){Gd(n,e,t,r,!1)},one(n,e,t,r){Gd(n,e,t,r,!0)},off(n,e,t,r){if(typeof e!="string"||!n)return;const[o,i,s]=Sm(e,t,r),l=s!==e,a=Em(n),c=a[s]||{},u=e.startsWith(".");if(typeof i<"u"){if(!Object.keys(c).length)return;Ml(n,a,s,i,o?t:null);return}if(u)for(const d of Object.keys(a))D4(n,a,d,e.slice(1));for(const[d,h]of Object.entries(c)){const p=d.replace(O4,"");(!l||e.includes(p))&&Ml(n,a,s,h.callable,h.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;const r=gm(),o=wm(e),i=e!==o;let s=null,l=!0,a=!0,c=!1;i&&r&&(s=r.Event(e,t),r(n).trigger(s),l=!s.isPropagationStopped(),a=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());const u=Bc(new Event(e,{bubbles:l,cancelable:!0}),t);return c&&u.preventDefault(),a&&n.dispatchEvent(u),u.defaultPrevented&&s&&s.preventDefault(),u}};function Bc(n,e={}){for(const[t,r]of Object.entries(e))try{n[t]=r}catch{Object.defineProperty(n,t,{configurable:!0,get(){return r}})}return n}function Yd(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch{return n}}function Ra(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const yn={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${Ra(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${Ra(e)}`)},getDataAttributes(n){if(!n)return{};const e={},t=Object.keys(n.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of t){let o=r.replace(/^bs/,"");o=o.charAt(0).toLowerCase()+o.slice(1,o.length),e[o]=Yd(n.dataset[r])}return e},getDataAttribute(n,e){return Yd(n.getAttribute(`data-bs-${Ra(e)}`))}};class Ko{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=vn(t)?yn.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof r=="object"?r:{},...vn(t)?yn.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[r,o]of Object.entries(t)){const i=e[r],s=vn(i)?"element":S4(i);if(!new RegExp(o).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${o}".`)}}}const _4="5.3.0";class Gt extends Ko{constructor(e,t){super(),e=$n(e),e&&(this._element=e,this._config=this._getConfig(t),Da.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Da.remove(this._element,this.constructor.DATA_KEY),ne.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){vm(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Da.get($n(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return _4}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Ba=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return hm(e)},ye={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){const t=[];let r=n.parentNode.closest(e);for(;r;)t.push(r),r=r.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Fn(t)&&ro(t))},getSelectorFromElement(n){const e=Ba(n);return e&&ye.findOne(e)?e:null},getElementFromSelector(n){const e=Ba(n);return e?ye.findOne(e):null},getMultipleElementsFromSelector(n){const e=Ba(n);return e?ye.find(e):[]}},Ys=(n,e="hide")=>{const t=`click.dismiss${n.EVENT_KEY}`,r=n.NAME;ne.on(document,t,`[data-bs-dismiss="${r}"]`,function(o){if(["A","AREA"].includes(this.tagName)&&o.preventDefault(),Fn(this))return;const i=ye.getElementFromSelector(this)||this.closest(`.${r}`);n.getOrCreateInstance(i)[e]()})},L4="alert",R4="bs.alert",km=`.${R4}`,B4=`close${km}`,P4=`closed${km}`,$4="fade",F4="show";class Js extends Gt{static get NAME(){return L4}close(){if(ne.trigger(this._element,B4).defaultPrevented)return;this._element.classList.remove(F4);const t=this._element.classList.contains($4);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),ne.trigger(this._element,P4),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Js.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ys(Js,"close");Vt(Js);const V4="button",z4="bs.button",H4=`.${z4}`,U4=".data-api",j4="active",Jd='[data-bs-toggle="button"]',W4=`click${H4}${U4}`;class Zs extends Gt{static get NAME(){return V4}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(j4))}static jQueryInterface(e){return this.each(function(){const t=Zs.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}ne.on(document,W4,Jd,n=>{n.preventDefault();const e=n.target.closest(Jd);Zs.getOrCreateInstance(e).toggle()});Vt(Zs);const K4="swipe",oo=".bs.swipe",G4=`touchstart${oo}`,Y4=`touchmove${oo}`,J4=`touchend${oo}`,Z4=`pointerdown${oo}`,X4=`pointerup${oo}`,Q4="touch",q4="pen",eC="pointer-event",tC=40,nC={endCallback:null,leftCallback:null,rightCallback:null},rC={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ss extends Ko{constructor(e,t){super(),this._element=e,!(!e||!Ss.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return nC}static get DefaultType(){return rC}static get NAME(){return K4}dispose(){ne.off(this._element,oo)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),yt(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=tC)return;const t=e/this._deltaX;this._deltaX=0,t&&yt(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(ne.on(this._element,Z4,e=>this._start(e)),ne.on(this._element,X4,e=>this._end(e)),this._element.classList.add(eC)):(ne.on(this._element,G4,e=>this._start(e)),ne.on(this._element,Y4,e=>this._move(e)),ne.on(this._element,J4,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===q4||e.pointerType===Q4)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const oC="carousel",iC="bs.carousel",Wn=`.${iC}`,xm=".data-api",sC="ArrowLeft",aC="ArrowRight",lC=500,so="next",xr="prev",Dr="left",bi="right",cC=`slide${Wn}`,Pa=`slid${Wn}`,uC=`keydown${Wn}`,dC=`mouseenter${Wn}`,fC=`mouseleave${Wn}`,hC=`dragstart${Wn}`,pC=`load${Wn}${xm}`,mC=`click${Wn}${xm}`,Tm="carousel",li="active",gC="slide",vC="carousel-item-end",yC="carousel-item-start",bC="carousel-item-next",EC="carousel-item-prev",Am=".active",Om=".carousel-item",CC=Am+Om,SC=".carousel-item img",wC=".carousel-indicators",kC="[data-bs-slide], [data-bs-slide-to]",xC='[data-bs-ride="carousel"]',TC={[sC]:bi,[aC]:Dr},AC={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},OC={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Go extends Gt{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ye.findOne(wC,this._element),this._addEventListeners(),this._config.ride===Tm&&this.cycle()}static get Default(){return AC}static get DefaultType(){return OC}static get NAME(){return oC}next(){this._slide(so)}nextWhenVisible(){!document.hidden&&ro(this._element)&&this.next()}prev(){this._slide(xr)}pause(){this._isSliding&&pm(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){ne.one(this._element,Pa,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){ne.one(this._element,Pa,()=>this.to(e));return}const r=this._getItemIndex(this._getActive());if(r===e)return;const o=e>r?so:xr;this._slide(o,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&ne.on(this._element,uC,e=>this._keydown(e)),this._config.pause==="hover"&&(ne.on(this._element,dC,()=>this.pause()),ne.on(this._element,fC,()=>this._maybeEnableCycle())),this._config.touch&&Ss.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of ye.find(SC,this._element))ne.on(r,hC,o=>o.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(Dr)),rightCallback:()=>this._slide(this._directionToOrder(bi)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),lC+this._config.interval))}};this._swipeHelper=new Ss(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=TC[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=ye.findOne(Am,this._indicatorsElement);t.classList.remove(li),t.removeAttribute("aria-current");const r=ye.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(li),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),o=e===so,i=t||Rc(this._getItems(),r,o,this._config.wrap);if(i===r)return;const s=this._getItemIndex(i),l=p=>ne.trigger(this._element,p,{relatedTarget:i,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:s});if(l(cC).defaultPrevented||!r||!i)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=i;const u=o?yC:vC,d=o?bC:EC;i.classList.add(d),Wo(i),r.classList.add(u),i.classList.add(u);const h=()=>{i.classList.remove(u,d),i.classList.add(li),r.classList.remove(li,d,u),this._isSliding=!1,l(Pa)};this._queueCallback(h,r,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(gC)}_getActive(){return ye.findOne(CC,this._element)}_getItems(){return ye.find(Om,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return $t()?e===Dr?xr:so:e===Dr?so:xr}_orderToDirection(e){return $t()?e===xr?Dr:bi:e===xr?bi:Dr}static jQueryInterface(e){return this.each(function(){const t=Go.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(document,mC,kC,function(n){const e=ye.getElementFromSelector(this);if(!e||!e.classList.contains(Tm))return;n.preventDefault();const t=Go.getOrCreateInstance(e),r=this.getAttribute("data-bs-slide-to");if(r){t.to(r),t._maybeEnableCycle();return}if(yn.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});ne.on(window,pC,()=>{const n=ye.find(xC);for(const e of n)Go.getOrCreateInstance(e)});Vt(Go);const MC="collapse",NC="bs.collapse",Yo=`.${NC}`,IC=".data-api",DC=`show${Yo}`,_C=`shown${Yo}`,LC=`hide${Yo}`,RC=`hidden${Yo}`,BC=`click${Yo}${IC}`,$a="show",Pr="collapse",ci="collapsing",PC="collapsed",$C=`:scope .${Pr} .${Pr}`,FC="collapse-horizontal",VC="width",zC="height",HC=".collapse.show, .collapse.collapsing",Nl='[data-bs-toggle="collapse"]',UC={parent:null,toggle:!0},jC={parent:"(null|element)",toggle:"boolean"};class Bo extends Gt{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=ye.find(Nl);for(const o of r){const i=ye.getSelectorFromElement(o),s=ye.find(i).filter(l=>l===this._element);i!==null&&s.length&&this._triggerArray.push(o)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return UC}static get DefaultType(){return jC}static get NAME(){return MC}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(HC).filter(l=>l!==this._element).map(l=>Bo.getOrCreateInstance(l,{toggle:!1}))),e.length&&e[0]._isTransitioning||ne.trigger(this._element,DC).defaultPrevented)return;for(const l of e)l.hide();const r=this._getDimension();this._element.classList.remove(Pr),this._element.classList.add(ci),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const o=()=>{this._isTransitioning=!1,this._element.classList.remove(ci),this._element.classList.add(Pr,$a),this._element.style[r]="",ne.trigger(this._element,_C)},s=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(o,this._element,!0),this._element.style[r]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||ne.trigger(this._element,LC).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Wo(this._element),this._element.classList.add(ci),this._element.classList.remove(Pr,$a);for(const o of this._triggerArray){const i=ye.getElementFromSelector(o);i&&!this._isShown(i)&&this._addAriaAndCollapsedClass([o],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(ci),this._element.classList.add(Pr),ne.trigger(this._element,RC)};this._element.style[t]="",this._queueCallback(r,this._element,!0)}_isShown(e=this._element){return e.classList.contains($a)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=$n(e.parent),e}_getDimension(){return this._element.classList.contains(FC)?VC:zC}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Nl);for(const t of e){const r=ye.getElementFromSelector(t);r&&this._addAriaAndCollapsedClass([t],this._isShown(r))}}_getFirstLevelChildren(e){const t=ye.find($C,this._config.parent);return ye.find(e,this._config.parent).filter(r=>!t.includes(r))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const r of e)r.classList.toggle(PC,!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const r=Bo.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e]()}})}}ne.on(document,BC,Nl,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(const e of ye.getMultipleElementsFromSelector(this))Bo.getOrCreateInstance(e,{toggle:!1}).toggle()});Vt(Bo);const Zd="dropdown",WC="bs.dropdown",vr=`.${WC}`,Pc=".data-api",KC="Escape",Xd="Tab",GC="ArrowUp",Qd="ArrowDown",YC=2,JC=`hide${vr}`,ZC=`hidden${vr}`,XC=`show${vr}`,QC=`shown${vr}`,Mm=`click${vr}${Pc}`,Nm=`keydown${vr}${Pc}`,qC=`keyup${vr}${Pc}`,_r="show",eS="dropup",tS="dropend",nS="dropstart",rS="dropup-center",oS="dropdown-center",tr='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',iS=`${tr}.${_r}`,Ei=".dropdown-menu",sS=".navbar",aS=".navbar-nav",lS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",cS=$t()?"top-end":"top-start",uS=$t()?"top-start":"top-end",dS=$t()?"bottom-end":"bottom-start",fS=$t()?"bottom-start":"bottom-end",hS=$t()?"left-start":"right-start",pS=$t()?"right-start":"left-start",mS="top",gS="bottom",vS={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},yS={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class rn extends Gt{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=ye.next(this._element,Ei)[0]||ye.prev(this._element,Ei)[0]||ye.findOne(Ei,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return vS}static get DefaultType(){return yS}static get NAME(){return Zd}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Fn(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!ne.trigger(this._element,XC,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(aS))for(const r of[].concat(...document.body.children))ne.on(r,"mouseover",Cs);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(_r),this._element.classList.add(_r),ne.trigger(this._element,QC,e)}}hide(){if(Fn(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!ne.trigger(this._element,JC,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))ne.off(r,"mouseover",Cs);this._popper&&this._popper.destroy(),this._menu.classList.remove(_r),this._element.classList.remove(_r),this._element.setAttribute("aria-expanded","false"),yn.removeDataAttribute(this._menu,"popper"),ne.trigger(this._element,ZC,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!vn(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Zd.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Hp>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:vn(this._config.reference)?e=$n(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=js(e,this._menu,t)}_isShown(){return this._menu.classList.contains(_r)}_getPlacement(){const e=this._parent;if(e.classList.contains(tS))return hS;if(e.classList.contains(nS))return pS;if(e.classList.contains(rS))return mS;if(e.classList.contains(oS))return gS;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(eS)?t?uS:cS:t?fS:dS}_detectNavbar(){return this._element.closest(sS)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(yn.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...yt(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const r=ye.find(lS,this._menu).filter(o=>ro(o));r.length&&Rc(r,t,e===Qd,!r.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=rn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===YC||e.type==="keyup"&&e.key!==Xd)return;const t=ye.find(iS);for(const r of t){const o=rn.getInstance(r);if(!o||o._config.autoClose===!1)continue;const i=e.composedPath(),s=i.includes(o._menu);if(i.includes(o._element)||o._config.autoClose==="inside"&&!s||o._config.autoClose==="outside"&&s||o._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Xd||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const l={relatedTarget:o._element};e.type==="click"&&(l.clickEvent=e),o._completeHide(l)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r=e.key===KC,o=[GC,Qd].includes(e.key);if(!o&&!r||t&&!r)return;e.preventDefault();const i=this.matches(tr)?this:ye.prev(this,tr)[0]||ye.next(this,tr)[0]||ye.findOne(tr,e.delegateTarget.parentNode),s=rn.getOrCreateInstance(i);if(o){e.stopPropagation(),s.show(),s._selectMenuItem(e);return}s._isShown()&&(e.stopPropagation(),s.hide(),i.focus())}}ne.on(document,Nm,tr,rn.dataApiKeydownHandler);ne.on(document,Nm,Ei,rn.dataApiKeydownHandler);ne.on(document,Mm,rn.clearMenus);ne.on(document,qC,rn.clearMenus);ne.on(document,Mm,tr,function(n){n.preventDefault(),rn.getOrCreateInstance(this).toggle()});Vt(rn);const Im="backdrop",bS="fade",qd="show",ef=`mousedown.bs.${Im}`,ES={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},CS={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Dm extends Ko{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return ES}static get DefaultType(){return CS}static get NAME(){return Im}show(e){if(!this._config.isVisible){yt(e);return}this._append();const t=this._getElement();this._config.isAnimated&&Wo(t),t.classList.add(qd),this._emulateAnimation(()=>{yt(e)})}hide(e){if(!this._config.isVisible){yt(e);return}this._getElement().classList.remove(qd),this._emulateAnimation(()=>{this.dispose(),yt(e)})}dispose(){this._isAppended&&(ne.off(this._element,ef),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(bS),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=$n(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),ne.on(e,ef,()=>{yt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){vm(e,this._getElement(),this._config.isAnimated)}}const SS="focustrap",wS="bs.focustrap",ws=`.${wS}`,kS=`focusin${ws}`,xS=`keydown.tab${ws}`,TS="Tab",AS="forward",tf="backward",OS={autofocus:!0,trapElement:null},MS={autofocus:"boolean",trapElement:"element"};class _m extends Ko{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return OS}static get DefaultType(){return MS}static get NAME(){return SS}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),ne.off(document,ws),ne.on(document,kS,e=>this._handleFocusin(e)),ne.on(document,xS,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,ne.off(document,ws))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=ye.focusableChildren(t);r.length===0?t.focus():this._lastTabNavDirection===tf?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){e.key===TS&&(this._lastTabNavDirection=e.shiftKey?tf:AS)}}const nf=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rf=".sticky-top",ui="padding-right",of="margin-right";class Il{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ui,t=>t+e),this._setElementAttributes(nf,ui,t=>t+e),this._setElementAttributes(rf,of,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ui),this._resetElementAttributes(nf,ui),this._resetElementAttributes(rf,of)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const o=this.getWidth(),i=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+o)return;this._saveInitialAttribute(s,t);const l=window.getComputedStyle(s).getPropertyValue(t);s.style.setProperty(t,`${r(Number.parseFloat(l))}px`)};this._applyManipulationCallback(e,i)}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&yn.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){const r=o=>{const i=yn.getDataAttribute(o,t);if(i===null){o.style.removeProperty(t);return}yn.removeDataAttribute(o,t),o.style.setProperty(t,i)};this._applyManipulationCallback(e,r)}_applyManipulationCallback(e,t){if(vn(e)){t(e);return}for(const r of ye.find(e,this._element))t(r)}}const NS="modal",IS="bs.modal",Ft=`.${IS}`,DS=".data-api",_S="Escape",LS=`hide${Ft}`,RS=`hidePrevented${Ft}`,Lm=`hidden${Ft}`,Rm=`show${Ft}`,BS=`shown${Ft}`,PS=`resize${Ft}`,$S=`click.dismiss${Ft}`,FS=`mousedown.dismiss${Ft}`,VS=`keydown.dismiss${Ft}`,zS=`click${Ft}${DS}`,sf="modal-open",HS="fade",af="show",Fa="modal-static",US=".modal.show",jS=".modal-dialog",WS=".modal-body",KS='[data-bs-toggle="modal"]',GS={backdrop:!0,focus:!0,keyboard:!0},YS={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class mr extends Gt{constructor(e,t){super(e,t),this._dialog=ye.findOne(jS,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Il,this._addEventListeners()}static get Default(){return GS}static get DefaultType(){return YS}static get NAME(){return NS}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||ne.trigger(this._element,Rm,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(sf),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||ne.trigger(this._element,LS).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(af),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){ne.off(window,Ft),ne.off(this._dialog,Ft),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Dm({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new _m({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=ye.findOne(WS,this._dialog);t&&(t.scrollTop=0),Wo(this._element),this._element.classList.add(af);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,ne.trigger(this._element,BS,{relatedTarget:e})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){ne.on(this._element,VS,e=>{if(e.key===_S){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),ne.on(window,PS,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),ne.on(this._element,FS,e=>{ne.one(this._element,$S,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(sf),this._resetAdjustments(),this._scrollBar.reset(),ne.trigger(this._element,Lm)})}_isAnimated(){return this._element.classList.contains(HS)}_triggerBackdropTransition(){if(ne.trigger(this._element,RS).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(Fa)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Fa),this._queueCallback(()=>{this._element.classList.remove(Fa),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const o=$t()?"paddingLeft":"paddingRight";this._element.style[o]=`${t}px`}if(!r&&e){const o=$t()?"paddingRight":"paddingLeft";this._element.style[o]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const r=mr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e](t)}})}}ne.on(document,zS,KS,function(n){const e=ye.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),ne.one(e,Rm,o=>{o.defaultPrevented||ne.one(e,Lm,()=>{ro(this)&&this.focus()})});const t=ye.findOne(US);t&&mr.getInstance(t).hide(),mr.getOrCreateInstance(e).toggle(this)});Ys(mr);Vt(mr);const JS="offcanvas",ZS="bs.offcanvas",En=`.${ZS}`,Bm=".data-api",XS=`load${En}${Bm}`,QS="Escape",lf="show",cf="showing",uf="hiding",qS="offcanvas-backdrop",Pm=".offcanvas.show",e6=`show${En}`,t6=`shown${En}`,n6=`hide${En}`,df=`hidePrevented${En}`,$m=`hidden${En}`,r6=`resize${En}`,o6=`click${En}${Bm}`,i6=`keydown.dismiss${En}`,s6='[data-bs-toggle="offcanvas"]',a6={backdrop:!0,keyboard:!0,scroll:!1},l6={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Vn extends Gt{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return a6}static get DefaultType(){return l6}static get NAME(){return JS}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||ne.trigger(this._element,e6,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Il().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(cf);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(lf),this._element.classList.remove(cf),ne.trigger(this._element,t6,{relatedTarget:e})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||ne.trigger(this._element,n6).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(uf),this._backdrop.hide();const t=()=>{this._element.classList.remove(lf,uf),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Il().reset(),ne.trigger(this._element,$m)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){ne.trigger(this._element,df);return}this.hide()},t=!!this._config.backdrop;return new Dm({className:qS,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new _m({trapElement:this._element})}_addEventListeners(){ne.on(this._element,i6,e=>{if(e.key===QS){if(this._config.keyboard){this.hide();return}ne.trigger(this._element,df)}})}static jQueryInterface(e){return this.each(function(){const t=Vn.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}ne.on(document,o6,s6,function(n){const e=ye.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Fn(this))return;ne.one(e,$m,()=>{ro(this)&&this.focus()});const t=ye.findOne(Pm);t&&t!==e&&Vn.getInstance(t).hide(),Vn.getOrCreateInstance(e).toggle(this)});ne.on(window,XS,()=>{for(const n of ye.find(Pm))Vn.getOrCreateInstance(n).show()});ne.on(window,r6,()=>{for(const n of ye.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&Vn.getOrCreateInstance(n).hide()});Ys(Vn);Vt(Vn);const c6=/^aria-[\w-]*$/i,Fm={"*":["class","dir","id","lang","role",c6],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},u6=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),d6=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,f6=(n,e)=>{const t=n.nodeName.toLowerCase();return e.includes(t)?u6.has(t)?!!d6.test(n.nodeValue):!0:e.filter(r=>r instanceof RegExp).some(r=>r.test(t))};function h6(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);const o=new window.DOMParser().parseFromString(n,"text/html"),i=[].concat(...o.body.querySelectorAll("*"));for(const s of i){const l=s.nodeName.toLowerCase();if(!Object.keys(e).includes(l)){s.remove();continue}const a=[].concat(...s.attributes),c=[].concat(e["*"]||[],e[l]||[]);for(const u of a)f6(u,c)||s.removeAttribute(u.nodeName)}return o.body.innerHTML}const p6="TemplateFactory",m6={allowList:Fm,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},g6={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},v6={entry:"(string|element|function|null)",selector:"(string|element)"};class y6 extends Ko{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return m6}static get DefaultType(){return g6}static get NAME(){return p6}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[o,i]of Object.entries(this._config.content))this._setContent(e,i,o);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},v6)}_setContent(e,t,r){const o=ye.findOne(r,e);if(o){if(t=this._resolvePossibleFunction(t),!t){o.remove();return}if(vn(t)){this._putElementInTemplate($n(t),o);return}if(this._config.html){o.innerHTML=this._maybeSanitize(t);return}o.textContent=t}}_maybeSanitize(e){return this._config.sanitize?h6(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return yt(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const b6="tooltip",E6=new Set(["sanitize","allowList","sanitizeFn"]),Va="fade",C6="modal",di="show",S6=".tooltip-inner",ff=`.${C6}`,hf="hide.bs.modal",ao="hover",za="focus",w6="click",k6="manual",x6="hide",T6="hidden",A6="show",O6="shown",M6="inserted",N6="click",I6="focusin",D6="focusout",_6="mouseenter",L6="mouseleave",R6={AUTO:"auto",TOP:"top",RIGHT:$t()?"left":"right",BOTTOM:"bottom",LEFT:$t()?"right":"left"},B6={allowList:Fm,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},P6={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class yr extends Gt{constructor(e,t){if(typeof Hp>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return B6}static get DefaultType(){return P6}static get NAME(){return b6}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),ne.off(this._element.closest(ff),hf,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=ne.trigger(this._element,this.constructor.eventName(A6)),r=(mm(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!r)return;this._disposePopper();const o=this._getTipElement();this._element.setAttribute("aria-describedby",o.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(o),ne.trigger(this._element,this.constructor.eventName(M6))),this._popper=this._createPopper(o),o.classList.add(di),"ontouchstart"in document.documentElement)for(const l of[].concat(...document.body.children))ne.on(l,"mouseover",Cs);const s=()=>{ne.trigger(this._element,this.constructor.eventName(O6)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||ne.trigger(this._element,this.constructor.eventName(x6)).defaultPrevented)return;if(this._getTipElement().classList.remove(di),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))ne.off(o,"mouseover",Cs);this._activeTrigger[w6]=!1,this._activeTrigger[za]=!1,this._activeTrigger[ao]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),ne.trigger(this._element,this.constructor.eventName(T6)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Va,di),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=w4(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(Va),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new y6({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[S6]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Va)}_isShown(){return this.tip&&this.tip.classList.contains(di)}_createPopper(e){const t=yt(this._config.placement,[this,e,this._element]),r=R6[t.toUpperCase()];return js(this._element,e,this._getPopperConfig(r))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return yt(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...t,...yt(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")ne.on(this._element,this.constructor.eventName(N6),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(t!==k6){const r=t===ao?this.constructor.eventName(_6):this.constructor.eventName(I6),o=t===ao?this.constructor.eventName(L6):this.constructor.eventName(D6);ne.on(this._element,r,this._config.selector,i=>{const s=this._initializeOnDelegatedTarget(i);s._activeTrigger[i.type==="focusin"?za:ao]=!0,s._enter()}),ne.on(this._element,o,this._config.selector,i=>{const s=this._initializeOnDelegatedTarget(i);s._activeTrigger[i.type==="focusout"?za:ao]=s._element.contains(i.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},ne.on(this._element.closest(ff),hf,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=yn.getDataAttributes(this._element);for(const r of Object.keys(t))E6.has(r)&&delete t[r];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:$n(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=yr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Vt(yr);const $6="popover",F6=".popover-header",V6=".popover-body",z6={...yr.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},H6={...yr.DefaultType,content:"(null|string|element|function)"};class $c extends yr{static get Default(){return z6}static get DefaultType(){return H6}static get NAME(){return $6}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[F6]:this._getTitle(),[V6]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=$c.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Vt($c);const U6="scrollspy",j6="bs.scrollspy",Fc=`.${j6}`,W6=".data-api",K6=`activate${Fc}`,pf=`click${Fc}`,G6=`load${Fc}${W6}`,Y6="dropdown-item",Tr="active",J6='[data-bs-spy="scroll"]',Ha="[href]",Z6=".nav, .list-group",mf=".nav-link",X6=".nav-item",Q6=".list-group-item",q6=`${mf}, ${X6} > ${mf}, ${Q6}`,ew=".dropdown",tw=".dropdown-toggle",nw={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},rw={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Xs extends Gt{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return nw}static get DefaultType(){return rw}static get NAME(){return U6}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=$n(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(ne.off(this._config.target,pf),ne.on(this._config.target,pf,Ha,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,o=t.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:o,behavior:"smooth"});return}r.scrollTop=o}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=s=>this._targetLinks.get(`#${s.target.id}`),r=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(t(s))},o=(this._rootElement||document.documentElement).scrollTop,i=o>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=o;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const l=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(i&&l){if(r(s),!o)return;continue}!i&&!l&&r(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=ye.find(Ha,this._config.target);for(const t of e){if(!t.hash||Fn(t))continue;const r=ye.findOne(decodeURI(t.hash),this._element);ro(r)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,r))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Tr),this._activateParents(e),ne.trigger(this._element,K6,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(Y6)){ye.findOne(tw,e.closest(ew)).classList.add(Tr);return}for(const t of ye.parents(e,Z6))for(const r of ye.prev(t,q6))r.classList.add(Tr)}_clearActiveClass(e){e.classList.remove(Tr);const t=ye.find(`${Ha}.${Tr}`,e);for(const r of t)r.classList.remove(Tr)}static jQueryInterface(e){return this.each(function(){const t=Xs.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(window,G6,()=>{for(const n of ye.find(J6))Xs.getOrCreateInstance(n)});Vt(Xs);const ow="tab",iw="bs.tab",br=`.${iw}`,sw=`hide${br}`,aw=`hidden${br}`,lw=`show${br}`,cw=`shown${br}`,uw=`click${br}`,dw=`keydown${br}`,fw=`load${br}`,hw="ArrowLeft",gf="ArrowRight",pw="ArrowUp",vf="ArrowDown",nr="active",yf="fade",Ua="show",mw="dropdown",gw=".dropdown-toggle",vw=".dropdown-menu",ja=":not(.dropdown-toggle)",yw='.list-group, .nav, [role="tablist"]',bw=".nav-item, .list-group-item",Ew=`.nav-link${ja}, .list-group-item${ja}, [role="tab"]${ja}`,Vm='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Wa=`${Ew}, ${Vm}`,Cw=`.${nr}[data-bs-toggle="tab"], .${nr}[data-bs-toggle="pill"], .${nr}[data-bs-toggle="list"]`;class qr extends Gt{constructor(e){super(e),this._parent=this._element.closest(yw),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),ne.on(this._element,dw,t=>this._keydown(t)))}static get NAME(){return ow}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?ne.trigger(t,sw,{relatedTarget:e}):null;ne.trigger(e,lw,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(nr),this._activate(ye.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(Ua);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),ne.trigger(e,cw,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(yf))}_deactivate(e,t){if(!e)return;e.classList.remove(nr),e.blur(),this._deactivate(ye.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(Ua);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),ne.trigger(e,aw,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(yf))}_keydown(e){if(![hw,gf,pw,vf].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[gf,vf].includes(e.key),r=Rc(this._getChildren().filter(o=>!Fn(o)),e.target,t,!0);r&&(r.focus({preventScroll:!0}),qr.getOrCreateInstance(r).show())}_getChildren(){return ye.find(Wa,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const r of t)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=ye.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains(mw))return;const o=(i,s)=>{const l=ye.findOne(i,r);l&&l.classList.toggle(s,t)};o(gw,nr),o(vw,Ua),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(nr)}_getInnerElement(e){return e.matches(Wa)?e:ye.findOne(Wa,e)}_getOuterElement(e){return e.closest(bw)||e}static jQueryInterface(e){return this.each(function(){const t=qr.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(document,uw,Vm,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Fn(this)&&qr.getOrCreateInstance(this).show()});ne.on(window,fw,()=>{for(const n of ye.find(Cw))qr.getOrCreateInstance(n)});Vt(qr);const Sw="toast",ww="bs.toast",Kn=`.${ww}`,kw=`mouseover${Kn}`,xw=`mouseout${Kn}`,Tw=`focusin${Kn}`,Aw=`focusout${Kn}`,Ow=`hide${Kn}`,Mw=`hidden${Kn}`,Nw=`show${Kn}`,Iw=`shown${Kn}`,Dw="fade",bf="hide",fi="show",hi="showing",_w={animation:"boolean",autohide:"boolean",delay:"number"},Lw={animation:!0,autohide:!0,delay:5e3};class Jo extends Gt{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Lw}static get DefaultType(){return _w}static get NAME(){return Sw}show(){if(ne.trigger(this._element,Nw).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Dw);const t=()=>{this._element.classList.remove(hi),ne.trigger(this._element,Iw),this._maybeScheduleHide()};this._element.classList.remove(bf),Wo(this._element),this._element.classList.add(fi,hi),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||ne.trigger(this._element,Ow).defaultPrevented)return;const t=()=>{this._element.classList.add(bf),this._element.classList.remove(hi,fi),ne.trigger(this._element,Mw)};this._element.classList.add(hi),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(fi),super.dispose()}isShown(){return this._element.classList.contains(fi)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){ne.on(this._element,kw,e=>this._onInteraction(e,!0)),ne.on(this._element,xw,e=>this._onInteraction(e,!1)),ne.on(this._element,Tw,e=>this._onInteraction(e,!0)),ne.on(this._element,Aw,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Jo.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ys(Jo);Vt(Jo);const Rw=n=>{const e=f.ref(null);return{showModal:()=>{const o=document.getElementById(n);o instanceof HTMLElement?(e.value||(e.value=new mr(o,{})),e.value.show()):console.error(`Modal '${n}' niet gevonden.`)},closeModal:()=>{e.value&&e.value.hide()}}};function zm(n=void 0){const e=l=>i("Succesvol",l,Lr.SUCCESS),t=l=>i("Waarschuwing",l,Lr.WARNING),r=l=>i("Informatie",l,Lr.INFO),o=l=>i("Mislukt",l,Lr.DANGER);function i(l,a,c){const u=`toast-${Pf()}`,d={id:u,variant:c,title:l,text:a},h=document.querySelector(".toast-container");if(!h){console.error("There was no element with class 'toast-container' found, which is required for useToaster.");return}const p=f.h(Gl,d),g=f.createApp({render:()=>p}).mount(document.createElement("div"));h.appendChild(g.$el);const v=document.querySelector(`#${u}`);v&&(Jo.getOrCreateInstance(v,n).show(),s(v))}function s(l){function a(d,h){d.forEach(p=>{if(p.attributeName!="class")return;const m=p.target;if(m.classList.contains("hide")){m.remove(),h.disconnect();return}})}const c=new MutationObserver(a),u={attributes:!0};c.observe(l,u)}return{showSuccessToast:e,showInformationToast:r,showWarningToast:t,showDangerToast:o}}const Bw=n=>Array.isArray(n)&&n.length>0,{showDangerToast:Pw}=zm();function $w(n){const e=f.ref(null),t=(a,c="serverErrors")=>{var d;let u=[];if(Array.isArray((d=a==null?void 0:a.response)==null?void 0:d.data)?u=a.response.data.filter(h=>ai(h.ErrorMessage)&&h.ErrorMessage!==Al):a.response.data.ErrorMessage?u=[a.response.data.ErrorMessage]:u=null,ai(c))e.value=u;else if(Array.isArray(c)){let h=e.value;for(let p=0;p<c.length;p++)p===c.length-1?h[c[p]]=u:h=h[c[p]]}r(a),s(e)},r=a=>{const u=new URL(a.request.responseURL).pathname;if(u in n.error){const d=n.error[u];d&&Pw(d)}},o=f.ref(null),i=f.ref(""),s=a=>{Bw(a.value)?o.value=a.value.map(c=>ai(c)?c:c.ErrorMessage):ai(a.value)&&(i.value=a.value)};function l(){e.value=null,o.value=null,i.value=Al}return{serverErrors:e,errorMessages:o,errorMessageText:i,MapErrors:s,MapServerErrors:t,ResetServerErrors:l}}const Hm={mounted:n=>{new yr(n)}},Fw={PRIMARY:"primary",SECONDARY:"secondary",COLLEAGUE:"colleague",DANGER:"danger",OUT_PRIMARY:"outline-primary",OUT_PRIMARY_DARK:"outline-primary-dark",OUT_TERTIARY:"outline-tertiary",OUT_LINK:"link",LIGHT:"light",DARK:"dark",REMOVE:"remove"},lt=f.defineComponent({__name:"BDButton",props:{size:{default:at.MD},variant:{default:Fw.PRIMARY},blockElement:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},to:{},target:{},text:{},rel:{}},emits:["click"],setup(n,{emit:e}){const t=n,r=f.computed(()=>({btn:!0,[`btn-${t.variant}`]:t.variant,[`btn-${t.size}`]:!0,"d-grid":t.blockElement&&typeof t.to=="string",[`${t.class}`]:t.class,disabled:t.disabled})),o=f.computed(()=>t.to?zr:"button"),i=f.computed(()=>{const l={};return t.to?(l.to=t.to,l.role="button"):l.type="submit",l}),s=l=>{e("click",l)};return(l,a)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(o.value),f.mergeProps({class:["bd-btn",r.value]},i.value,{onClick:s}),{default:f.withCtx(()=>[f.renderSlot(l.$slots,"default",{},()=>[f.createTextVNode(f.toDisplayString(t.text),1)])]),_:3},16,["class"]))}}),Vw={install:n=>{n.component("BDCol",Ef),n.component("BDContainer",Cf),n.component("BDRow",Sf),n.component("BDButton",lt),n.component("BDLogo",Wl),n.component("BDLink",zr),n.component("BDDropdownItem",ki),n.component("BDDropdown",Lc),n.component("BDAlert",_f),n.component("BDProfileImage",Fo),n.component("BDZoomslider",Rf),n.component("BDCard",Kl),n.component("BDCollapsableCard",$f),n.component("BDFormInput",Vf),n.component("BDInputGroup",zf),n.component("BDFormInvalidFeedback",Os),n.component("BDBadge",Hf),n.component("BDForm",Uf),n.component("BDPagination",jf),n.component("BDDropzone",Jf),n.component("BDMarkdownEditor",am),n.component("BDModal",fm),n.component("BDFormSelect",Wf),n.component("BDUser",lm),n.component("BDArticle",Gf),n.component("BDFormCheckbox",Kf),n.component("BDToast",Gl),n.component("BDAttachmentPreviewList",Ks),n.component("BDImageAttachmentPreviewList",Gs),n.component("BDHeader",dm),n.component("BDMobileMenu",_c),n.component("BDChatCloud",cm),n.component("BDTable",um),n.component("IconAcademy",wf),n.component("IconArrowDown",kf),n.component("IconArrowUp",xf),n.component("IconAttachment",cr),n.component("IconBold",Dl),n.component("IconBulletList",_l),n.component("IconCalendar",Ka),n.component("IconCalendar",Ka),n.component("IconCardView",Tf),n.component("IconCaretDown",Ll),n.component("IconCaretLeft",Rl),n.component("IconCaretRight",Bl),n.component("IconCheck",Po),n.component("IconClose",ks),n.component("IconDownloadImage",Ci),n.component("IconDownloadImage",Ci),n.component("IconEdit",Af),n.component("IconError",xs),n.component("IconEyeShow",Of),n.component("IconEyeSlash",Mf),n.component("IconFile",Pl),n.component("IconHyperlink",$l),n.component("IconInfo",Ts),n.component("IconItalic",Fl),n.component("IconListView",Nf),n.component("IconMenu",Si),n.component("IconMenu",Si),n.component("IconOrderedList",Vl),n.component("IconRemove",$o),n.component("IconSort",If),n.component("IconSortAsc",zl),n.component("IconSortDesc",Hl),n.component("IconSortNone",Ul),n.component("IconTriangleExclamation",Df),n.component("IconUnderline",jl),n.directive("vBDTooltip",Hm)}};exports.BDAlert=_f;exports.BDArticle=Gf;exports.BDAttachmentPreviewList=Ks;exports.BDBadge=Hf;exports.BDButton=lt;exports.BDCard=Kl;exports.BDChatCloud=cm;exports.BDCol=Ef;exports.BDCollapsableCard=$f;exports.BDContainer=Cf;exports.BDDropdown=Lc;exports.BDDropdownItem=ki;exports.BDDropzone=Jf;exports.BDForm=Uf;exports.BDFormCheckbox=Kf;exports.BDFormInput=Vf;exports.BDFormInvalidFeedback=Os;exports.BDFormSelect=Wf;exports.BDHeader=dm;exports.BDImageAttachmentPreviewList=Gs;exports.BDInputGroup=zf;exports.BDLink=zr;exports.BDLogo=Wl;exports.BDMarkdownEditor=am;exports.BDMobileMenu=_c;exports.BDModal=fm;exports.BDPagination=jf;exports.BDProfileImage=Fo;exports.BDRow=Sf;exports.BDTable=um;exports.BDToast=Gl;exports.BDUser=lm;exports.BDZoomslider=Rf;exports.IconAcademy=wf;exports.IconArrowDown=kf;exports.IconArrowUp=xf;exports.IconAttachment=cr;exports.IconBold=Dl;exports.IconBulletList=_l;exports.IconCalendar=Ka;exports.IconCardView=Tf;exports.IconCaretDown=Ll;exports.IconCaretLeft=Rl;exports.IconCaretRight=Bl;exports.IconCheck=Po;exports.IconClose=ks;exports.IconDownloadImage=Ci;exports.IconEdit=Af;exports.IconError=xs;exports.IconEyeShow=Of;exports.IconEyeSlash=Mf;exports.IconFile=Pl;exports.IconHyperlink=$l;exports.IconInfo=Ts;exports.IconItalic=Fl;exports.IconListView=Nf;exports.IconMenu=Si;exports.IconOrderedList=Vl;exports.IconRemove=$o;exports.IconSort=If;exports.IconSortAsc=zl;exports.IconSortDesc=Hl;exports.IconSortNone=Ul;exports.IconTriangleExclamation=Df;exports.IconUnderline=jl;exports.default=Vw;exports.useModal=Rw;exports.useServerErrors=$w;exports.useToaster=zm;exports.vBdTooltip=Hm;
131
+ */const xn=new Map,Da={set(n,e,t){xn.has(n)||xn.set(n,new Map);const r=xn.get(n);if(!r.has(e)&&r.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`);return}r.set(e,t)},get(n,e){return xn.has(n)&&xn.get(n).get(e)||null},remove(n,e){if(!xn.has(n))return;const t=xn.get(n);t.delete(e),t.size===0&&xn.delete(n)}},E4=1e6,C4=1e3,Ol="transitionend",hm=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),S4=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),w4=n=>{do n+=Math.floor(Math.random()*E4);while(document.getElementById(n));return n},k4=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n);const r=Number.parseFloat(e),o=Number.parseFloat(t);return!r&&!o?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*C4)},pm=n=>{n.dispatchEvent(new Event(Ol))},vn=n=>!n||typeof n!="object"?!1:(typeof n.jquery<"u"&&(n=n[0]),typeof n.nodeType<"u"),$n=n=>vn(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(hm(n)):null,ro=n=>{if(!vn(n)||n.getClientRects().length===0)return!1;const e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){const r=n.closest("summary");if(r&&r.parentNode!==t||r===null)return!1}return e},Fn=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled<"u"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",mm=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){const e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?mm(n.parentNode):null},Cs=()=>{},Wo=n=>{n.offsetHeight},gm=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,_a=[],x4=n=>{document.readyState==="loading"?(_a.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of _a)e()}),_a.push(n)):n()},$t=()=>document.documentElement.dir==="rtl",Vt=n=>{x4(()=>{const e=gm();if(e){const t=n.NAME,r=e.fn[t];e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=r,n.jQueryInterface)}})},yt=(n,e=[],t=n)=>typeof n=="function"?n(...e):t,vm=(n,e,t=!0)=>{if(!t){yt(n);return}const r=5,o=k4(e)+r;let i=!1;const s=({target:l})=>{l===e&&(i=!0,e.removeEventListener(Ol,s),yt(n))};e.addEventListener(Ol,s),setTimeout(()=>{i||pm(e)},o)},Rc=(n,e,t,r)=>{const o=n.length;let i=n.indexOf(e);return i===-1?!t&&r?n[o-1]:n[0]:(i+=t?1:-1,r&&(i=(i+o)%o),n[Math.max(0,Math.min(i,o-1))])},T4=/[^.]*(?=\..*)\.|.*/,A4=/\..*/,O4=/::\d+$/,La={};let Kd=1;const ym={mouseenter:"mouseover",mouseleave:"mouseout"},M4=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function bm(n,e){return e&&`${e}::${Kd++}`||n.uidEvent||Kd++}function Em(n){const e=bm(n);return n.uidEvent=e,La[e]=La[e]||{},La[e]}function N4(n,e){return function t(r){return Bc(r,{delegateTarget:n}),t.oneOff&&ne.off(n,r.type,e),e.apply(n,[r])}}function I4(n,e,t){return function r(o){const i=n.querySelectorAll(e);for(let{target:s}=o;s&&s!==this;s=s.parentNode)for(const l of i)if(l===s)return Bc(o,{delegateTarget:s}),r.oneOff&&ne.off(n,o.type,e,t),t.apply(s,[o])}}function Cm(n,e,t=null){return Object.values(n).find(r=>r.callable===e&&r.delegationSelector===t)}function Sm(n,e,t){const r=typeof e=="string",o=r?t:e||t;let i=wm(n);return M4.has(i)||(i=n),[r,o,i]}function Gd(n,e,t,r,o){if(typeof e!="string"||!n)return;let[i,s,l]=Sm(e,t,r);e in ym&&(s=(m=>function(g){if(!g.relatedTarget||g.relatedTarget!==g.delegateTarget&&!g.delegateTarget.contains(g.relatedTarget))return m.call(this,g)})(s));const a=Em(n),c=a[l]||(a[l]={}),u=Cm(c,s,i?t:null);if(u){u.oneOff=u.oneOff&&o;return}const d=bm(s,e.replace(T4,"")),h=i?I4(n,t,s):N4(n,s);h.delegationSelector=i?t:null,h.callable=s,h.oneOff=o,h.uidEvent=d,c[d]=h,n.addEventListener(l,h,i)}function Ml(n,e,t,r,o){const i=Cm(e[t],r,o);i&&(n.removeEventListener(t,i,!!o),delete e[t][i.uidEvent])}function D4(n,e,t,r){const o=e[t]||{};for(const[i,s]of Object.entries(o))i.includes(r)&&Ml(n,e,t,s.callable,s.delegationSelector)}function wm(n){return n=n.replace(A4,""),ym[n]||n}const ne={on(n,e,t,r){Gd(n,e,t,r,!1)},one(n,e,t,r){Gd(n,e,t,r,!0)},off(n,e,t,r){if(typeof e!="string"||!n)return;const[o,i,s]=Sm(e,t,r),l=s!==e,a=Em(n),c=a[s]||{},u=e.startsWith(".");if(typeof i<"u"){if(!Object.keys(c).length)return;Ml(n,a,s,i,o?t:null);return}if(u)for(const d of Object.keys(a))D4(n,a,d,e.slice(1));for(const[d,h]of Object.entries(c)){const p=d.replace(O4,"");(!l||e.includes(p))&&Ml(n,a,s,h.callable,h.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;const r=gm(),o=wm(e),i=e!==o;let s=null,l=!0,a=!0,c=!1;i&&r&&(s=r.Event(e,t),r(n).trigger(s),l=!s.isPropagationStopped(),a=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());const u=Bc(new Event(e,{bubbles:l,cancelable:!0}),t);return c&&u.preventDefault(),a&&n.dispatchEvent(u),u.defaultPrevented&&s&&s.preventDefault(),u}};function Bc(n,e={}){for(const[t,r]of Object.entries(e))try{n[t]=r}catch{Object.defineProperty(n,t,{configurable:!0,get(){return r}})}return n}function Yd(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch{return n}}function Ra(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const yn={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${Ra(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${Ra(e)}`)},getDataAttributes(n){if(!n)return{};const e={},t=Object.keys(n.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of t){let o=r.replace(/^bs/,"");o=o.charAt(0).toLowerCase()+o.slice(1,o.length),e[o]=Yd(n.dataset[r])}return e},getDataAttribute(n,e){return Yd(n.getAttribute(`data-bs-${Ra(e)}`))}};class Ko{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=vn(t)?yn.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof r=="object"?r:{},...vn(t)?yn.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[r,o]of Object.entries(t)){const i=e[r],s=vn(i)?"element":S4(i);if(!new RegExp(o).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${o}".`)}}}const _4="5.3.0";class Gt extends Ko{constructor(e,t){super(),e=$n(e),e&&(this._element=e,this._config=this._getConfig(t),Da.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Da.remove(this._element,this.constructor.DATA_KEY),ne.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){vm(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Da.get($n(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return _4}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Ba=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return hm(e)},ye={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){const t=[];let r=n.parentNode.closest(e);for(;r;)t.push(r),r=r.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Fn(t)&&ro(t))},getSelectorFromElement(n){const e=Ba(n);return e&&ye.findOne(e)?e:null},getElementFromSelector(n){const e=Ba(n);return e?ye.findOne(e):null},getMultipleElementsFromSelector(n){const e=Ba(n);return e?ye.find(e):[]}},Ys=(n,e="hide")=>{const t=`click.dismiss${n.EVENT_KEY}`,r=n.NAME;ne.on(document,t,`[data-bs-dismiss="${r}"]`,function(o){if(["A","AREA"].includes(this.tagName)&&o.preventDefault(),Fn(this))return;const i=ye.getElementFromSelector(this)||this.closest(`.${r}`);n.getOrCreateInstance(i)[e]()})},L4="alert",R4="bs.alert",km=`.${R4}`,B4=`close${km}`,P4=`closed${km}`,$4="fade",F4="show";class Js extends Gt{static get NAME(){return L4}close(){if(ne.trigger(this._element,B4).defaultPrevented)return;this._element.classList.remove(F4);const t=this._element.classList.contains($4);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),ne.trigger(this._element,P4),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Js.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ys(Js,"close");Vt(Js);const V4="button",z4="bs.button",H4=`.${z4}`,U4=".data-api",j4="active",Jd='[data-bs-toggle="button"]',W4=`click${H4}${U4}`;class Zs extends Gt{static get NAME(){return V4}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(j4))}static jQueryInterface(e){return this.each(function(){const t=Zs.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}ne.on(document,W4,Jd,n=>{n.preventDefault();const e=n.target.closest(Jd);Zs.getOrCreateInstance(e).toggle()});Vt(Zs);const K4="swipe",oo=".bs.swipe",G4=`touchstart${oo}`,Y4=`touchmove${oo}`,J4=`touchend${oo}`,Z4=`pointerdown${oo}`,X4=`pointerup${oo}`,Q4="touch",q4="pen",eC="pointer-event",tC=40,nC={endCallback:null,leftCallback:null,rightCallback:null},rC={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Ss extends Ko{constructor(e,t){super(),this._element=e,!(!e||!Ss.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return nC}static get DefaultType(){return rC}static get NAME(){return K4}dispose(){ne.off(this._element,oo)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),yt(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=tC)return;const t=e/this._deltaX;this._deltaX=0,t&&yt(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(ne.on(this._element,Z4,e=>this._start(e)),ne.on(this._element,X4,e=>this._end(e)),this._element.classList.add(eC)):(ne.on(this._element,G4,e=>this._start(e)),ne.on(this._element,Y4,e=>this._move(e)),ne.on(this._element,J4,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===q4||e.pointerType===Q4)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const oC="carousel",iC="bs.carousel",Wn=`.${iC}`,xm=".data-api",sC="ArrowLeft",aC="ArrowRight",lC=500,so="next",xr="prev",Dr="left",bi="right",cC=`slide${Wn}`,Pa=`slid${Wn}`,uC=`keydown${Wn}`,dC=`mouseenter${Wn}`,fC=`mouseleave${Wn}`,hC=`dragstart${Wn}`,pC=`load${Wn}${xm}`,mC=`click${Wn}${xm}`,Tm="carousel",li="active",gC="slide",vC="carousel-item-end",yC="carousel-item-start",bC="carousel-item-next",EC="carousel-item-prev",Am=".active",Om=".carousel-item",CC=Am+Om,SC=".carousel-item img",wC=".carousel-indicators",kC="[data-bs-slide], [data-bs-slide-to]",xC='[data-bs-ride="carousel"]',TC={[sC]:bi,[aC]:Dr},AC={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},OC={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Go extends Gt{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ye.findOne(wC,this._element),this._addEventListeners(),this._config.ride===Tm&&this.cycle()}static get Default(){return AC}static get DefaultType(){return OC}static get NAME(){return oC}next(){this._slide(so)}nextWhenVisible(){!document.hidden&&ro(this._element)&&this.next()}prev(){this._slide(xr)}pause(){this._isSliding&&pm(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){ne.one(this._element,Pa,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){ne.one(this._element,Pa,()=>this.to(e));return}const r=this._getItemIndex(this._getActive());if(r===e)return;const o=e>r?so:xr;this._slide(o,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&ne.on(this._element,uC,e=>this._keydown(e)),this._config.pause==="hover"&&(ne.on(this._element,dC,()=>this.pause()),ne.on(this._element,fC,()=>this._maybeEnableCycle())),this._config.touch&&Ss.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of ye.find(SC,this._element))ne.on(r,hC,o=>o.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(Dr)),rightCallback:()=>this._slide(this._directionToOrder(bi)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),lC+this._config.interval))}};this._swipeHelper=new Ss(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=TC[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=ye.findOne(Am,this._indicatorsElement);t.classList.remove(li),t.removeAttribute("aria-current");const r=ye.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(li),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),o=e===so,i=t||Rc(this._getItems(),r,o,this._config.wrap);if(i===r)return;const s=this._getItemIndex(i),l=p=>ne.trigger(this._element,p,{relatedTarget:i,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:s});if(l(cC).defaultPrevented||!r||!i)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=i;const u=o?yC:vC,d=o?bC:EC;i.classList.add(d),Wo(i),r.classList.add(u),i.classList.add(u);const h=()=>{i.classList.remove(u,d),i.classList.add(li),r.classList.remove(li,d,u),this._isSliding=!1,l(Pa)};this._queueCallback(h,r,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(gC)}_getActive(){return ye.findOne(CC,this._element)}_getItems(){return ye.find(Om,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return $t()?e===Dr?xr:so:e===Dr?so:xr}_orderToDirection(e){return $t()?e===xr?Dr:bi:e===xr?bi:Dr}static jQueryInterface(e){return this.each(function(){const t=Go.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(document,mC,kC,function(n){const e=ye.getElementFromSelector(this);if(!e||!e.classList.contains(Tm))return;n.preventDefault();const t=Go.getOrCreateInstance(e),r=this.getAttribute("data-bs-slide-to");if(r){t.to(r),t._maybeEnableCycle();return}if(yn.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});ne.on(window,pC,()=>{const n=ye.find(xC);for(const e of n)Go.getOrCreateInstance(e)});Vt(Go);const MC="collapse",NC="bs.collapse",Yo=`.${NC}`,IC=".data-api",DC=`show${Yo}`,_C=`shown${Yo}`,LC=`hide${Yo}`,RC=`hidden${Yo}`,BC=`click${Yo}${IC}`,$a="show",Pr="collapse",ci="collapsing",PC="collapsed",$C=`:scope .${Pr} .${Pr}`,FC="collapse-horizontal",VC="width",zC="height",HC=".collapse.show, .collapse.collapsing",Nl='[data-bs-toggle="collapse"]',UC={parent:null,toggle:!0},jC={parent:"(null|element)",toggle:"boolean"};class Bo extends Gt{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=ye.find(Nl);for(const o of r){const i=ye.getSelectorFromElement(o),s=ye.find(i).filter(l=>l===this._element);i!==null&&s.length&&this._triggerArray.push(o)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return UC}static get DefaultType(){return jC}static get NAME(){return MC}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(HC).filter(l=>l!==this._element).map(l=>Bo.getOrCreateInstance(l,{toggle:!1}))),e.length&&e[0]._isTransitioning||ne.trigger(this._element,DC).defaultPrevented)return;for(const l of e)l.hide();const r=this._getDimension();this._element.classList.remove(Pr),this._element.classList.add(ci),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const o=()=>{this._isTransitioning=!1,this._element.classList.remove(ci),this._element.classList.add(Pr,$a),this._element.style[r]="",ne.trigger(this._element,_C)},s=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(o,this._element,!0),this._element.style[r]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||ne.trigger(this._element,LC).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Wo(this._element),this._element.classList.add(ci),this._element.classList.remove(Pr,$a);for(const o of this._triggerArray){const i=ye.getElementFromSelector(o);i&&!this._isShown(i)&&this._addAriaAndCollapsedClass([o],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(ci),this._element.classList.add(Pr),ne.trigger(this._element,RC)};this._element.style[t]="",this._queueCallback(r,this._element,!0)}_isShown(e=this._element){return e.classList.contains($a)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=$n(e.parent),e}_getDimension(){return this._element.classList.contains(FC)?VC:zC}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Nl);for(const t of e){const r=ye.getElementFromSelector(t);r&&this._addAriaAndCollapsedClass([t],this._isShown(r))}}_getFirstLevelChildren(e){const t=ye.find($C,this._config.parent);return ye.find(e,this._config.parent).filter(r=>!t.includes(r))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const r of e)r.classList.toggle(PC,!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const r=Bo.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e]()}})}}ne.on(document,BC,Nl,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(const e of ye.getMultipleElementsFromSelector(this))Bo.getOrCreateInstance(e,{toggle:!1}).toggle()});Vt(Bo);const Zd="dropdown",WC="bs.dropdown",vr=`.${WC}`,Pc=".data-api",KC="Escape",Xd="Tab",GC="ArrowUp",Qd="ArrowDown",YC=2,JC=`hide${vr}`,ZC=`hidden${vr}`,XC=`show${vr}`,QC=`shown${vr}`,Mm=`click${vr}${Pc}`,Nm=`keydown${vr}${Pc}`,qC=`keyup${vr}${Pc}`,_r="show",eS="dropup",tS="dropend",nS="dropstart",rS="dropup-center",oS="dropdown-center",tr='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',iS=`${tr}.${_r}`,Ei=".dropdown-menu",sS=".navbar",aS=".navbar-nav",lS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",cS=$t()?"top-end":"top-start",uS=$t()?"top-start":"top-end",dS=$t()?"bottom-end":"bottom-start",fS=$t()?"bottom-start":"bottom-end",hS=$t()?"left-start":"right-start",pS=$t()?"right-start":"left-start",mS="top",gS="bottom",vS={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},yS={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class rn extends Gt{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=ye.next(this._element,Ei)[0]||ye.prev(this._element,Ei)[0]||ye.findOne(Ei,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return vS}static get DefaultType(){return yS}static get NAME(){return Zd}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Fn(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!ne.trigger(this._element,XC,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(aS))for(const r of[].concat(...document.body.children))ne.on(r,"mouseover",Cs);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(_r),this._element.classList.add(_r),ne.trigger(this._element,QC,e)}}hide(){if(Fn(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!ne.trigger(this._element,JC,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))ne.off(r,"mouseover",Cs);this._popper&&this._popper.destroy(),this._menu.classList.remove(_r),this._element.classList.remove(_r),this._element.setAttribute("aria-expanded","false"),yn.removeDataAttribute(this._menu,"popper"),ne.trigger(this._element,ZC,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!vn(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Zd.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Hp>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:vn(this._config.reference)?e=$n(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=js(e,this._menu,t)}_isShown(){return this._menu.classList.contains(_r)}_getPlacement(){const e=this._parent;if(e.classList.contains(tS))return hS;if(e.classList.contains(nS))return pS;if(e.classList.contains(rS))return mS;if(e.classList.contains(oS))return gS;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(eS)?t?uS:cS:t?fS:dS}_detectNavbar(){return this._element.closest(sS)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(yn.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...yt(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const r=ye.find(lS,this._menu).filter(o=>ro(o));r.length&&Rc(r,t,e===Qd,!r.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=rn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===YC||e.type==="keyup"&&e.key!==Xd)return;const t=ye.find(iS);for(const r of t){const o=rn.getInstance(r);if(!o||o._config.autoClose===!1)continue;const i=e.composedPath(),s=i.includes(o._menu);if(i.includes(o._element)||o._config.autoClose==="inside"&&!s||o._config.autoClose==="outside"&&s||o._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Xd||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const l={relatedTarget:o._element};e.type==="click"&&(l.clickEvent=e),o._completeHide(l)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r=e.key===KC,o=[GC,Qd].includes(e.key);if(!o&&!r||t&&!r)return;e.preventDefault();const i=this.matches(tr)?this:ye.prev(this,tr)[0]||ye.next(this,tr)[0]||ye.findOne(tr,e.delegateTarget.parentNode),s=rn.getOrCreateInstance(i);if(o){e.stopPropagation(),s.show(),s._selectMenuItem(e);return}s._isShown()&&(e.stopPropagation(),s.hide(),i.focus())}}ne.on(document,Nm,tr,rn.dataApiKeydownHandler);ne.on(document,Nm,Ei,rn.dataApiKeydownHandler);ne.on(document,Mm,rn.clearMenus);ne.on(document,qC,rn.clearMenus);ne.on(document,Mm,tr,function(n){n.preventDefault(),rn.getOrCreateInstance(this).toggle()});Vt(rn);const Im="backdrop",bS="fade",qd="show",ef=`mousedown.bs.${Im}`,ES={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},CS={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Dm extends Ko{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return ES}static get DefaultType(){return CS}static get NAME(){return Im}show(e){if(!this._config.isVisible){yt(e);return}this._append();const t=this._getElement();this._config.isAnimated&&Wo(t),t.classList.add(qd),this._emulateAnimation(()=>{yt(e)})}hide(e){if(!this._config.isVisible){yt(e);return}this._getElement().classList.remove(qd),this._emulateAnimation(()=>{this.dispose(),yt(e)})}dispose(){this._isAppended&&(ne.off(this._element,ef),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(bS),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=$n(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),ne.on(e,ef,()=>{yt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){vm(e,this._getElement(),this._config.isAnimated)}}const SS="focustrap",wS="bs.focustrap",ws=`.${wS}`,kS=`focusin${ws}`,xS=`keydown.tab${ws}`,TS="Tab",AS="forward",tf="backward",OS={autofocus:!0,trapElement:null},MS={autofocus:"boolean",trapElement:"element"};class _m extends Ko{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return OS}static get DefaultType(){return MS}static get NAME(){return SS}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),ne.off(document,ws),ne.on(document,kS,e=>this._handleFocusin(e)),ne.on(document,xS,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,ne.off(document,ws))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=ye.focusableChildren(t);r.length===0?t.focus():this._lastTabNavDirection===tf?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){e.key===TS&&(this._lastTabNavDirection=e.shiftKey?tf:AS)}}const nf=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rf=".sticky-top",ui="padding-right",of="margin-right";class Il{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ui,t=>t+e),this._setElementAttributes(nf,ui,t=>t+e),this._setElementAttributes(rf,of,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ui),this._resetElementAttributes(nf,ui),this._resetElementAttributes(rf,of)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const o=this.getWidth(),i=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+o)return;this._saveInitialAttribute(s,t);const l=window.getComputedStyle(s).getPropertyValue(t);s.style.setProperty(t,`${r(Number.parseFloat(l))}px`)};this._applyManipulationCallback(e,i)}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&yn.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){const r=o=>{const i=yn.getDataAttribute(o,t);if(i===null){o.style.removeProperty(t);return}yn.removeDataAttribute(o,t),o.style.setProperty(t,i)};this._applyManipulationCallback(e,r)}_applyManipulationCallback(e,t){if(vn(e)){t(e);return}for(const r of ye.find(e,this._element))t(r)}}const NS="modal",IS="bs.modal",Ft=`.${IS}`,DS=".data-api",_S="Escape",LS=`hide${Ft}`,RS=`hidePrevented${Ft}`,Lm=`hidden${Ft}`,Rm=`show${Ft}`,BS=`shown${Ft}`,PS=`resize${Ft}`,$S=`click.dismiss${Ft}`,FS=`mousedown.dismiss${Ft}`,VS=`keydown.dismiss${Ft}`,zS=`click${Ft}${DS}`,sf="modal-open",HS="fade",af="show",Fa="modal-static",US=".modal.show",jS=".modal-dialog",WS=".modal-body",KS='[data-bs-toggle="modal"]',GS={backdrop:!0,focus:!0,keyboard:!0},YS={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class mr extends Gt{constructor(e,t){super(e,t),this._dialog=ye.findOne(jS,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Il,this._addEventListeners()}static get Default(){return GS}static get DefaultType(){return YS}static get NAME(){return NS}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||ne.trigger(this._element,Rm,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(sf),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||ne.trigger(this._element,LS).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(af),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){ne.off(window,Ft),ne.off(this._dialog,Ft),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Dm({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new _m({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=ye.findOne(WS,this._dialog);t&&(t.scrollTop=0),Wo(this._element),this._element.classList.add(af);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,ne.trigger(this._element,BS,{relatedTarget:e})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){ne.on(this._element,VS,e=>{if(e.key===_S){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),ne.on(window,PS,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),ne.on(this._element,FS,e=>{ne.one(this._element,$S,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(sf),this._resetAdjustments(),this._scrollBar.reset(),ne.trigger(this._element,Lm)})}_isAnimated(){return this._element.classList.contains(HS)}_triggerBackdropTransition(){if(ne.trigger(this._element,RS).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(Fa)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Fa),this._queueCallback(()=>{this._element.classList.remove(Fa),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const o=$t()?"paddingLeft":"paddingRight";this._element.style[o]=`${t}px`}if(!r&&e){const o=$t()?"paddingRight":"paddingLeft";this._element.style[o]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const r=mr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e](t)}})}}ne.on(document,zS,KS,function(n){const e=ye.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),ne.one(e,Rm,o=>{o.defaultPrevented||ne.one(e,Lm,()=>{ro(this)&&this.focus()})});const t=ye.findOne(US);t&&mr.getInstance(t).hide(),mr.getOrCreateInstance(e).toggle(this)});Ys(mr);Vt(mr);const JS="offcanvas",ZS="bs.offcanvas",En=`.${ZS}`,Bm=".data-api",XS=`load${En}${Bm}`,QS="Escape",lf="show",cf="showing",uf="hiding",qS="offcanvas-backdrop",Pm=".offcanvas.show",e6=`show${En}`,t6=`shown${En}`,n6=`hide${En}`,df=`hidePrevented${En}`,$m=`hidden${En}`,r6=`resize${En}`,o6=`click${En}${Bm}`,i6=`keydown.dismiss${En}`,s6='[data-bs-toggle="offcanvas"]',a6={backdrop:!0,keyboard:!0,scroll:!1},l6={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Vn extends Gt{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return a6}static get DefaultType(){return l6}static get NAME(){return JS}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||ne.trigger(this._element,e6,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Il().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(cf);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(lf),this._element.classList.remove(cf),ne.trigger(this._element,t6,{relatedTarget:e})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||ne.trigger(this._element,n6).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(uf),this._backdrop.hide();const t=()=>{this._element.classList.remove(lf,uf),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Il().reset(),ne.trigger(this._element,$m)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){ne.trigger(this._element,df);return}this.hide()},t=!!this._config.backdrop;return new Dm({className:qS,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new _m({trapElement:this._element})}_addEventListeners(){ne.on(this._element,i6,e=>{if(e.key===QS){if(this._config.keyboard){this.hide();return}ne.trigger(this._element,df)}})}static jQueryInterface(e){return this.each(function(){const t=Vn.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}ne.on(document,o6,s6,function(n){const e=ye.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Fn(this))return;ne.one(e,$m,()=>{ro(this)&&this.focus()});const t=ye.findOne(Pm);t&&t!==e&&Vn.getInstance(t).hide(),Vn.getOrCreateInstance(e).toggle(this)});ne.on(window,XS,()=>{for(const n of ye.find(Pm))Vn.getOrCreateInstance(n).show()});ne.on(window,r6,()=>{for(const n of ye.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&Vn.getOrCreateInstance(n).hide()});Ys(Vn);Vt(Vn);const c6=/^aria-[\w-]*$/i,Fm={"*":["class","dir","id","lang","role",c6],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},u6=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),d6=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,f6=(n,e)=>{const t=n.nodeName.toLowerCase();return e.includes(t)?u6.has(t)?!!d6.test(n.nodeValue):!0:e.filter(r=>r instanceof RegExp).some(r=>r.test(t))};function h6(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);const o=new window.DOMParser().parseFromString(n,"text/html"),i=[].concat(...o.body.querySelectorAll("*"));for(const s of i){const l=s.nodeName.toLowerCase();if(!Object.keys(e).includes(l)){s.remove();continue}const a=[].concat(...s.attributes),c=[].concat(e["*"]||[],e[l]||[]);for(const u of a)f6(u,c)||s.removeAttribute(u.nodeName)}return o.body.innerHTML}const p6="TemplateFactory",m6={allowList:Fm,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},g6={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},v6={entry:"(string|element|function|null)",selector:"(string|element)"};class y6 extends Ko{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return m6}static get DefaultType(){return g6}static get NAME(){return p6}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[o,i]of Object.entries(this._config.content))this._setContent(e,i,o);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},v6)}_setContent(e,t,r){const o=ye.findOne(r,e);if(o){if(t=this._resolvePossibleFunction(t),!t){o.remove();return}if(vn(t)){this._putElementInTemplate($n(t),o);return}if(this._config.html){o.innerHTML=this._maybeSanitize(t);return}o.textContent=t}}_maybeSanitize(e){return this._config.sanitize?h6(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return yt(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const b6="tooltip",E6=new Set(["sanitize","allowList","sanitizeFn"]),Va="fade",C6="modal",di="show",S6=".tooltip-inner",ff=`.${C6}`,hf="hide.bs.modal",ao="hover",za="focus",w6="click",k6="manual",x6="hide",T6="hidden",A6="show",O6="shown",M6="inserted",N6="click",I6="focusin",D6="focusout",_6="mouseenter",L6="mouseleave",R6={AUTO:"auto",TOP:"top",RIGHT:$t()?"left":"right",BOTTOM:"bottom",LEFT:$t()?"right":"left"},B6={allowList:Fm,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},P6={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class yr extends Gt{constructor(e,t){if(typeof Hp>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return B6}static get DefaultType(){return P6}static get NAME(){return b6}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),ne.off(this._element.closest(ff),hf,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=ne.trigger(this._element,this.constructor.eventName(A6)),r=(mm(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!r)return;this._disposePopper();const o=this._getTipElement();this._element.setAttribute("aria-describedby",o.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(o),ne.trigger(this._element,this.constructor.eventName(M6))),this._popper=this._createPopper(o),o.classList.add(di),"ontouchstart"in document.documentElement)for(const l of[].concat(...document.body.children))ne.on(l,"mouseover",Cs);const s=()=>{ne.trigger(this._element,this.constructor.eventName(O6)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||ne.trigger(this._element,this.constructor.eventName(x6)).defaultPrevented)return;if(this._getTipElement().classList.remove(di),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))ne.off(o,"mouseover",Cs);this._activeTrigger[w6]=!1,this._activeTrigger[za]=!1,this._activeTrigger[ao]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),ne.trigger(this._element,this.constructor.eventName(T6)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Va,di),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=w4(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(Va),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new y6({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[S6]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Va)}_isShown(){return this.tip&&this.tip.classList.contains(di)}_createPopper(e){const t=yt(this._config.placement,[this,e,this._element]),r=R6[t.toUpperCase()];return js(this._element,e,this._getPopperConfig(r))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return yt(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...t,...yt(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")ne.on(this._element,this.constructor.eventName(N6),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(t!==k6){const r=t===ao?this.constructor.eventName(_6):this.constructor.eventName(I6),o=t===ao?this.constructor.eventName(L6):this.constructor.eventName(D6);ne.on(this._element,r,this._config.selector,i=>{const s=this._initializeOnDelegatedTarget(i);s._activeTrigger[i.type==="focusin"?za:ao]=!0,s._enter()}),ne.on(this._element,o,this._config.selector,i=>{const s=this._initializeOnDelegatedTarget(i);s._activeTrigger[i.type==="focusout"?za:ao]=s._element.contains(i.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},ne.on(this._element.closest(ff),hf,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=yn.getDataAttributes(this._element);for(const r of Object.keys(t))E6.has(r)&&delete t[r];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:$n(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=yr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Vt(yr);const $6="popover",F6=".popover-header",V6=".popover-body",z6={...yr.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},H6={...yr.DefaultType,content:"(null|string|element|function)"};class $c extends yr{static get Default(){return z6}static get DefaultType(){return H6}static get NAME(){return $6}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[F6]:this._getTitle(),[V6]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=$c.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}Vt($c);const U6="scrollspy",j6="bs.scrollspy",Fc=`.${j6}`,W6=".data-api",K6=`activate${Fc}`,pf=`click${Fc}`,G6=`load${Fc}${W6}`,Y6="dropdown-item",Tr="active",J6='[data-bs-spy="scroll"]',Ha="[href]",Z6=".nav, .list-group",mf=".nav-link",X6=".nav-item",Q6=".list-group-item",q6=`${mf}, ${X6} > ${mf}, ${Q6}`,ew=".dropdown",tw=".dropdown-toggle",nw={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},rw={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Xs extends Gt{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return nw}static get DefaultType(){return rw}static get NAME(){return U6}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=$n(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(ne.off(this._config.target,pf),ne.on(this._config.target,pf,Ha,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,o=t.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:o,behavior:"smooth"});return}r.scrollTop=o}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=s=>this._targetLinks.get(`#${s.target.id}`),r=s=>{this._previousScrollData.visibleEntryTop=s.target.offsetTop,this._process(t(s))},o=(this._rootElement||document.documentElement).scrollTop,i=o>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=o;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const l=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(i&&l){if(r(s),!o)return;continue}!i&&!l&&r(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=ye.find(Ha,this._config.target);for(const t of e){if(!t.hash||Fn(t))continue;const r=ye.findOne(decodeURI(t.hash),this._element);ro(r)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,r))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Tr),this._activateParents(e),ne.trigger(this._element,K6,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(Y6)){ye.findOne(tw,e.closest(ew)).classList.add(Tr);return}for(const t of ye.parents(e,Z6))for(const r of ye.prev(t,q6))r.classList.add(Tr)}_clearActiveClass(e){e.classList.remove(Tr);const t=ye.find(`${Ha}.${Tr}`,e);for(const r of t)r.classList.remove(Tr)}static jQueryInterface(e){return this.each(function(){const t=Xs.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(window,G6,()=>{for(const n of ye.find(J6))Xs.getOrCreateInstance(n)});Vt(Xs);const ow="tab",iw="bs.tab",br=`.${iw}`,sw=`hide${br}`,aw=`hidden${br}`,lw=`show${br}`,cw=`shown${br}`,uw=`click${br}`,dw=`keydown${br}`,fw=`load${br}`,hw="ArrowLeft",gf="ArrowRight",pw="ArrowUp",vf="ArrowDown",nr="active",yf="fade",Ua="show",mw="dropdown",gw=".dropdown-toggle",vw=".dropdown-menu",ja=":not(.dropdown-toggle)",yw='.list-group, .nav, [role="tablist"]',bw=".nav-item, .list-group-item",Ew=`.nav-link${ja}, .list-group-item${ja}, [role="tab"]${ja}`,Vm='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Wa=`${Ew}, ${Vm}`,Cw=`.${nr}[data-bs-toggle="tab"], .${nr}[data-bs-toggle="pill"], .${nr}[data-bs-toggle="list"]`;class qr extends Gt{constructor(e){super(e),this._parent=this._element.closest(yw),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),ne.on(this._element,dw,t=>this._keydown(t)))}static get NAME(){return ow}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?ne.trigger(t,sw,{relatedTarget:e}):null;ne.trigger(e,lw,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(nr),this._activate(ye.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(Ua);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),ne.trigger(e,cw,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(yf))}_deactivate(e,t){if(!e)return;e.classList.remove(nr),e.blur(),this._deactivate(ye.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(Ua);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),ne.trigger(e,aw,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(yf))}_keydown(e){if(![hw,gf,pw,vf].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=[gf,vf].includes(e.key),r=Rc(this._getChildren().filter(o=>!Fn(o)),e.target,t,!0);r&&(r.focus({preventScroll:!0}),qr.getOrCreateInstance(r).show())}_getChildren(){return ye.find(Wa,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const r of t)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=ye.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains(mw))return;const o=(i,s)=>{const l=ye.findOne(i,r);l&&l.classList.toggle(s,t)};o(gw,nr),o(vw,Ua),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(nr)}_getInnerElement(e){return e.matches(Wa)?e:ye.findOne(Wa,e)}_getOuterElement(e){return e.closest(bw)||e}static jQueryInterface(e){return this.each(function(){const t=qr.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}ne.on(document,uw,Vm,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Fn(this)&&qr.getOrCreateInstance(this).show()});ne.on(window,fw,()=>{for(const n of ye.find(Cw))qr.getOrCreateInstance(n)});Vt(qr);const Sw="toast",ww="bs.toast",Kn=`.${ww}`,kw=`mouseover${Kn}`,xw=`mouseout${Kn}`,Tw=`focusin${Kn}`,Aw=`focusout${Kn}`,Ow=`hide${Kn}`,Mw=`hidden${Kn}`,Nw=`show${Kn}`,Iw=`shown${Kn}`,Dw="fade",bf="hide",fi="show",hi="showing",_w={animation:"boolean",autohide:"boolean",delay:"number"},Lw={animation:!0,autohide:!0,delay:5e3};class Jo extends Gt{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Lw}static get DefaultType(){return _w}static get NAME(){return Sw}show(){if(ne.trigger(this._element,Nw).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Dw);const t=()=>{this._element.classList.remove(hi),ne.trigger(this._element,Iw),this._maybeScheduleHide()};this._element.classList.remove(bf),Wo(this._element),this._element.classList.add(fi,hi),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||ne.trigger(this._element,Ow).defaultPrevented)return;const t=()=>{this._element.classList.add(bf),this._element.classList.remove(hi,fi),ne.trigger(this._element,Mw)};this._element.classList.add(hi),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(fi),super.dispose()}isShown(){return this._element.classList.contains(fi)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){ne.on(this._element,kw,e=>this._onInteraction(e,!0)),ne.on(this._element,xw,e=>this._onInteraction(e,!1)),ne.on(this._element,Tw,e=>this._onInteraction(e,!0)),ne.on(this._element,Aw,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Jo.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ys(Jo);Vt(Jo);const Rw=n=>{const e=f.ref(null);return{showModal:()=>{const o=document.getElementById(n);o instanceof HTMLElement?(e.value=mr.getOrCreateInstance(o),e.value.show()):console.error(`Modal '${n}' niet gevonden.`)},closeModal:()=>{e.value&&e.value.hide()}}};function zm(n=void 0){const e=l=>i("Succesvol",l,Lr.SUCCESS),t=l=>i("Waarschuwing",l,Lr.WARNING),r=l=>i("Informatie",l,Lr.INFO),o=l=>i("Mislukt",l,Lr.DANGER);function i(l,a,c){const u=`toast-${Pf()}`,d={id:u,variant:c,title:l,text:a},h=document.querySelector(".toast-container");if(!h){console.error("There was no element with class 'toast-container' found, which is required for useToaster.");return}const p=f.h(Gl,d),g=f.createApp({render:()=>p}).mount(document.createElement("div"));h.appendChild(g.$el);const v=document.querySelector(`#${u}`);v&&(Jo.getOrCreateInstance(v,n).show(),s(v))}function s(l){function a(d,h){d.forEach(p=>{if(p.attributeName!="class")return;const m=p.target;if(m.classList.contains("hide")){m.remove(),h.disconnect();return}})}const c=new MutationObserver(a),u={attributes:!0};c.observe(l,u)}return{showSuccessToast:e,showInformationToast:r,showWarningToast:t,showDangerToast:o}}const Bw=n=>Array.isArray(n)&&n.length>0,{showDangerToast:Pw}=zm();function $w(n){const e=f.ref(null),t=(a,c="serverErrors")=>{var d;let u=[];if(Array.isArray((d=a==null?void 0:a.response)==null?void 0:d.data)?u=a.response.data.filter(h=>ai(h.ErrorMessage)&&h.ErrorMessage!==Al):a.response.data.ErrorMessage?u=[a.response.data.ErrorMessage]:u=null,ai(c))e.value=u;else if(Array.isArray(c)){let h=e.value;for(let p=0;p<c.length;p++)p===c.length-1?h[c[p]]=u:h=h[c[p]]}r(a),s(e)},r=a=>{const u=new URL(a.request.responseURL).pathname;if(u in n.error){const d=n.error[u];d&&Pw(d)}},o=f.ref(null),i=f.ref(""),s=a=>{Bw(a.value)?o.value=a.value.map(c=>ai(c)?c:c.ErrorMessage):ai(a.value)&&(i.value=a.value)};function l(){e.value=null,o.value=null,i.value=Al}return{serverErrors:e,errorMessages:o,errorMessageText:i,MapErrors:s,MapServerErrors:t,ResetServerErrors:l}}const Hm={mounted:n=>{new yr(n)}},Fw={PRIMARY:"primary",SECONDARY:"secondary",COLLEAGUE:"colleague",DANGER:"danger",OUT_PRIMARY:"outline-primary",OUT_PRIMARY_DARK:"outline-primary-dark",OUT_TERTIARY:"outline-tertiary",OUT_LINK:"link",LIGHT:"light",DARK:"dark",REMOVE:"remove"},lt=f.defineComponent({__name:"BDButton",props:{size:{default:at.MD},variant:{default:Fw.PRIMARY},blockElement:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},to:{},target:{},text:{},rel:{}},emits:["click"],setup(n,{emit:e}){const t=n,r=f.computed(()=>({btn:!0,[`btn-${t.variant}`]:t.variant,[`btn-${t.size}`]:!0,"d-grid":t.blockElement&&typeof t.to=="string",[`${t.class}`]:t.class,disabled:t.disabled})),o=f.computed(()=>t.to?zr:"button"),i=f.computed(()=>{const l={};return t.to?(l.to=t.to,l.role="button"):l.type="submit",l}),s=l=>{e("click",l)};return(l,a)=>(f.openBlock(),f.createBlock(f.resolveDynamicComponent(o.value),f.mergeProps({class:["bd-btn",r.value]},i.value,{onClick:s}),{default:f.withCtx(()=>[f.renderSlot(l.$slots,"default",{},()=>[f.createTextVNode(f.toDisplayString(t.text),1)])]),_:3},16,["class"]))}}),Vw={install:n=>{n.component("BDCol",Ef),n.component("BDContainer",Cf),n.component("BDRow",Sf),n.component("BDButton",lt),n.component("BDLogo",Wl),n.component("BDLink",zr),n.component("BDDropdownItem",ki),n.component("BDDropdown",Lc),n.component("BDAlert",_f),n.component("BDProfileImage",Fo),n.component("BDZoomslider",Rf),n.component("BDCard",Kl),n.component("BDCollapsableCard",$f),n.component("BDFormInput",Vf),n.component("BDInputGroup",zf),n.component("BDFormInvalidFeedback",Os),n.component("BDBadge",Hf),n.component("BDForm",Uf),n.component("BDPagination",jf),n.component("BDDropzone",Jf),n.component("BDMarkdownEditor",am),n.component("BDModal",fm),n.component("BDFormSelect",Wf),n.component("BDUser",lm),n.component("BDArticle",Gf),n.component("BDFormCheckbox",Kf),n.component("BDToast",Gl),n.component("BDAttachmentPreviewList",Ks),n.component("BDImageAttachmentPreviewList",Gs),n.component("BDHeader",dm),n.component("BDMobileMenu",_c),n.component("BDChatCloud",cm),n.component("BDTable",um),n.component("IconAcademy",wf),n.component("IconArrowDown",kf),n.component("IconArrowUp",xf),n.component("IconAttachment",cr),n.component("IconBold",Dl),n.component("IconBulletList",_l),n.component("IconCalendar",Ka),n.component("IconCalendar",Ka),n.component("IconCardView",Tf),n.component("IconCaretDown",Ll),n.component("IconCaretLeft",Rl),n.component("IconCaretRight",Bl),n.component("IconCheck",Po),n.component("IconClose",ks),n.component("IconDownloadImage",Ci),n.component("IconDownloadImage",Ci),n.component("IconEdit",Af),n.component("IconError",xs),n.component("IconEyeShow",Of),n.component("IconEyeSlash",Mf),n.component("IconFile",Pl),n.component("IconHyperlink",$l),n.component("IconInfo",Ts),n.component("IconItalic",Fl),n.component("IconListView",Nf),n.component("IconMenu",Si),n.component("IconMenu",Si),n.component("IconOrderedList",Vl),n.component("IconRemove",$o),n.component("IconSort",If),n.component("IconSortAsc",zl),n.component("IconSortDesc",Hl),n.component("IconSortNone",Ul),n.component("IconTriangleExclamation",Df),n.component("IconUnderline",jl),n.directive("vBDTooltip",Hm)}};exports.BDAlert=_f;exports.BDArticle=Gf;exports.BDAttachmentPreviewList=Ks;exports.BDBadge=Hf;exports.BDButton=lt;exports.BDCard=Kl;exports.BDChatCloud=cm;exports.BDCol=Ef;exports.BDCollapsableCard=$f;exports.BDContainer=Cf;exports.BDDropdown=Lc;exports.BDDropdownItem=ki;exports.BDDropzone=Jf;exports.BDForm=Uf;exports.BDFormCheckbox=Kf;exports.BDFormInput=Vf;exports.BDFormInvalidFeedback=Os;exports.BDFormSelect=Wf;exports.BDHeader=dm;exports.BDImageAttachmentPreviewList=Gs;exports.BDInputGroup=zf;exports.BDLink=zr;exports.BDLogo=Wl;exports.BDMarkdownEditor=am;exports.BDMobileMenu=_c;exports.BDModal=fm;exports.BDPagination=jf;exports.BDProfileImage=Fo;exports.BDRow=Sf;exports.BDTable=um;exports.BDToast=Gl;exports.BDUser=lm;exports.BDZoomslider=Rf;exports.IconAcademy=wf;exports.IconArrowDown=kf;exports.IconArrowUp=xf;exports.IconAttachment=cr;exports.IconBold=Dl;exports.IconBulletList=_l;exports.IconCalendar=Ka;exports.IconCardView=Tf;exports.IconCaretDown=Ll;exports.IconCaretLeft=Rl;exports.IconCaretRight=Bl;exports.IconCheck=Po;exports.IconClose=ks;exports.IconDownloadImage=Ci;exports.IconEdit=Af;exports.IconError=xs;exports.IconEyeShow=Of;exports.IconEyeSlash=Mf;exports.IconFile=Pl;exports.IconHyperlink=$l;exports.IconInfo=Ts;exports.IconItalic=Fl;exports.IconListView=Nf;exports.IconMenu=Si;exports.IconOrderedList=Vl;exports.IconRemove=$o;exports.IconSort=If;exports.IconSortAsc=zl;exports.IconSortDesc=Hl;exports.IconSortNone=Ul;exports.IconTriangleExclamation=Df;exports.IconUnderline=jl;exports.default=Vw;exports.useModal=Rw;exports.useServerErrors=$w;exports.useToaster=zm;exports.vBdTooltip=Hm;