@dcrackel/hematournamentui 1.0.710 → 1.0.711

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.
package/README.md CHANGED
@@ -143,6 +143,6 @@ The default `editMode: false` retains creation's Next/Back navigation and one `u
143
143
 
144
144
  ## Tournament and event prices
145
145
 
146
- TournamentManagement's Basic tab edits `tournament.BasePrice`; the event wizard's Basic Info step edits `event.EventPrice`. Both fields support decimal amounts and zero. Missing or null prices show a `0.00` placeholder, and clearing a price saves zero. Negative and nonnumeric prices prevent submission.
146
+ TournamentManagement's Basic tab edits `tournament.BasePrice`; the event wizard's Basic Info step edits `event.EventPrice`. Both fields support decimal amounts and zero. Tournament base prices display two decimal places when loaded and after leaving the input. Missing or null prices show a `0.00` placeholder, and clearing a price saves zero. Negative and nonnumeric prices prevent submission.
147
147
 
148
148
  `submit:tournament` includes numeric `BasePrice`. The wizard includes numeric `EventPrice` in both `update:submit` and `save:step.event`, separate from event rules. The consuming app owns currency, persistence, and supplying refreshed price values through props.
@@ -29671,6 +29671,9 @@ var Nj = {
29671
29671
  TitledInput: Pt,
29672
29672
  TextBoxEditor: vj
29673
29673
  },
29674
+ data() {
29675
+ return { basePriceDraft: null };
29676
+ },
29674
29677
  computed: {
29675
29678
  tournamentImage() {
29676
29679
  return this.tournament.Images && this.tournament.Images.length > 0 ? this.tournament.Images[0].URL : "";
@@ -29679,7 +29682,10 @@ var Nj = {
29679
29682
  return this.tournament?.Name || "";
29680
29683
  },
29681
29684
  basePrice() {
29682
- return this.tournament?.BasePrice ?? "";
29685
+ let e = this.tournament?.BasePrice ?? "";
29686
+ if (e === "" || e === this.basePriceDraft) return e;
29687
+ let t = Number(e);
29688
+ return Number.isFinite(t) ? t.toFixed(2) : e;
29683
29689
  },
29684
29690
  addressName() {
29685
29691
  return this.tournament?.Address?.Name || "";
@@ -29702,6 +29708,12 @@ var Nj = {
29702
29708
  }
29703
29709
  },
29704
29710
  methods: {
29711
+ handleBasePriceUpdate(e) {
29712
+ this.basePriceDraft = e, this.emitUpdate("BasePrice", e);
29713
+ },
29714
+ handleBasePriceBlur() {
29715
+ this.basePriceDraft = null;
29716
+ },
29705
29717
  handleNewImageUrl(e) {
29706
29718
  this.$emit("update:image", { ImageLink: e });
29707
29719
  },
@@ -29793,12 +29805,15 @@ function Wj(e, t, n, r, i, l) {
29793
29805
  invalid: l.isFieldInvalid("BasePrice"),
29794
29806
  title: l.getValidationLabel("BasePrice", "Base Price"),
29795
29807
  placeholder: "0.00",
29796
- "onUpdate:value": t[1] ||= (e) => l.emitUpdate("BasePrice", e),
29808
+ "onUpdate:value": l.handleBasePriceUpdate,
29809
+ onFocusout: l.handleBasePriceBlur,
29797
29810
  class: "mb-4"
29798
29811
  }, null, 8, [
29799
29812
  "inputValue",
29800
29813
  "invalid",
29801
- "title"
29814
+ "title",
29815
+ "onUpdate:value",
29816
+ "onFocusout"
29802
29817
  ]),
29803
29818
  c("div", Rj, [f(u, {
29804
29819
  color: "primaryHighlight",
@@ -29837,7 +29852,7 @@ function Wj(e, t, n, r, i, l) {
29837
29852
  invalid: l.isFieldInvalid("StartDate"),
29838
29853
  setDate: l.startDate,
29839
29854
  userLevel: n.userLevel,
29840
- "onUpdate:selectedDate": t[2] ||= (e) => l.emitUpdate("StartDate", e)
29855
+ "onUpdate:selectedDate": t[1] ||= (e) => l.emitUpdate("StartDate", e)
29841
29856
  }, null, 8, [
29842
29857
  "invalid",
29843
29858
  "setDate",
@@ -29848,7 +29863,7 @@ function Wj(e, t, n, r, i, l) {
29848
29863
  placeholder: "Number of Days",
29849
29864
  inputType: "number",
29850
29865
  title: l.getValidationLabel("TotalDays", "Number of Days"),
29851
- "onUpdate:value": t[3] ||= (e) => l.emitUpdate("TotalDays", e)
29866
+ "onUpdate:value": t[2] ||= (e) => l.emitUpdate("TotalDays", e)
29852
29867
  }, null, 8, [
29853
29868
  "inputValue",
29854
29869
  "invalid",
@@ -29866,7 +29881,7 @@ function Wj(e, t, n, r, i, l) {
29866
29881
  invalid: l.isFieldInvalid("RegistrationCutOff"),
29867
29882
  setDate: l.registrationCutOff,
29868
29883
  userLevel: n.userLevel,
29869
- "onUpdate:selectedDate": t[4] ||= (e) => l.emitUpdate("RegistrationCutOff", e)
29884
+ "onUpdate:selectedDate": t[3] ||= (e) => l.emitUpdate("RegistrationCutOff", e)
29870
29885
  }, null, 8, [
29871
29886
  "invalid",
29872
29887
  "setDate",
@@ -29883,7 +29898,7 @@ function Wj(e, t, n, r, i, l) {
29883
29898
  }, null, 8, ["invalid", "text"]), f(g, {
29884
29899
  invalid: l.isFieldInvalid("Description"),
29885
29900
  initialContent: l.description,
29886
- "onUpdate:editorContent": t[5] ||= (e) => l.emitUpdate("Description", e)
29901
+ "onUpdate:editorContent": t[4] ||= (e) => l.emitUpdate("Description", e)
29887
29902
  }, null, 8, ["invalid", "initialContent"])]),
29888
29903
  c("div", Uj, [f(u, {
29889
29904
  color: "primaryHighlight",
@@ -172,7 +172,7 @@ img.ProseMirror-separator {
172
172
 
173
173
  `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(Y.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[vT({find:QO,type:this.type,getAttributes:e=>({language:e[1]})}),vT({find:$O,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new a_({key:new c_(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
174
174
  `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(X.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),tk=bT.create({name:`doc`,topNode:!0,content:`block+`});function nk(e={}){return new a_({view(t){return new rk(t,e)}})}var rk=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=yg(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},ik=vC.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[nk(this.options)]}}),ak=class e extends Y{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Y.near(r)}content(){return J.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new ok(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!ck(e)||!lk(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Z.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};ak.prototype.visible=!1,ak.findFrom=ak.findGapCursorFrom,Y.jsonID(`gapcursor`,ak);var ok=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ak.valid(t)?new ak(t):Y.near(t)}};function sk(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function ck(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||sk(e.type))return!0;if(e.inlineContent)return!1}}return!0}function lk(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||sk(e.type))return!0;if(e.inlineContent)return!1}}return!0}function uk(){return new a_({props:{decorations:hk,createSelectionBetween(e,t,n){return t.pos==n.pos&&ak.valid(n)?new ak(n):null},handleClick:pk,handleKeyDown:dk,handleDOMEvents:{beforeinput:mk}}})}var dk=Gx({ArrowLeft:fk(`horiz`,-1),ArrowRight:fk(`horiz`,1),ArrowUp:fk(`vert`,-1),ArrowDown:fk(`vert`,1)});function fk(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof X){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=ak.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new ak(c))),!0):!1}}function pk(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!ak.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Z.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new ak(r))),!0)}function mk(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof ak))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=q.empty;for(let e=r.length-1;e>=0;e--)i=q.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new J(i,0,0));return a.setSelection(X.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function hk(e){if(!(e.selection instanceof ak))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Wb.create(e.doc,[Vb.widget(e.selection.head,t,{key:`gapcursor`})])}var gk=vC.create({name:`gapCursor`,addProseMirrorPlugins(){return[uk()]},extendNodeSchema(e){return{allowGapCursor:$(Q(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),_k=bT.create({name:`hardBreak`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,HS(this.options.HTMLAttributes,e)]},renderText(){return`
175
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vk=bT.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,HS(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>vT({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),yk=200,bk=function(){};bk.prototype.append=function(e){return e.length?(e=bk.from(e),!this.length&&e||e.length<yk&&this.leafAppend(e)||this.length<yk&&e.leafPrepend(this)||this.appendInner(e)):this},bk.prototype.prepend=function(e){return e.length?bk.from(e).append(this):this},bk.prototype.appendInner=function(e){return new Sk(this,e)},bk.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?bk.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},bk.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bk.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},bk.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},bk.from=function(e){return e instanceof bk?e:e&&e.length?new xk(e):bk.empty};var xk=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=yk)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=yk)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(bk);bk.empty=new xk([]);var Sk=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(bk),Ck=500,wk=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Ek(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Ek(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Ek(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Ok&&(s=Tk(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Lh;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Ek(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Ek(i,o,l))}else r.push(new Ek(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Ek(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>Ck&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Ek(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(bk.from(i.reverse()),a)}};wk.empty=new wk(bk.empty,0);function Tk(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Ek=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Dk=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Ok=20;function kk(e,t,n,r){let i=n.getMeta(Lk),a;if(i)return i.historyState;n.getMeta(Rk)&&(e=new Dk(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Lk))return o.getMeta(Lk).redo?new Dk(e.done.addTransform(n,void 0,r,Ik(t)),e.undone,jk(n.mapping.maps),e.prevTime,e.prevComposition):new Dk(e.done,e.undone.addTransform(n,void 0,r,Ik(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Ak(n,e.prevRanges)),s=o?Mk(e.prevRanges,n.mapping):jk(n.mapping.maps);return new Dk(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Ik(t)),wk.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new Dk(e.done.rebased(n,a),e.undone.rebased(n,a),Mk(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Dk(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Mk(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Ak(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function jk(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Mk(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Nk(e,t,n){let r=Ik(t),i=Lk.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Dk(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Lk,{redo:n,historyState:c})}var Pk=!1,Fk=null;function Ik(e){let t=e.plugins;if(Fk!=t){Pk=!1,Fk=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Pk=!0;break}}return Pk}var Lk=new c_(`history`),Rk=new c_(`closeHistory`);function zk(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new a_({key:Lk,state:{init(){return new Dk(wk.empty,wk.empty,null,0,-1)},apply(t,n,r){return kk(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Vk:n==`historyRedo`?Hk:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Bk(e,t){return(n,r)=>{let i=Lk.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Nk(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Vk=Bk(!1,!0),Hk=Bk(!0,!0),Uk=vC.create({name:`history`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Vk(e,t),redo:()=>({state:e,dispatch:t})=>Hk(e,t)}},addProseMirrorPlugins(){return[zk(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Wk=bT.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{}}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,HS(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!ST(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$from:r,$to:i}=n,a=e();return r.parentOffset===0?a.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):Uw(n)?a.insertContentAt(i.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:e,dispatch:t})=>{if(t){let{$to:t}=e.selection,n=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(X.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(Z.create(e.doc,t.pos)):e.setSelection(X.create(e.doc,t.pos));else{let r=t.parent.type.contentMatch.defaultType?.create();r&&(e.insert(n,r),e.setSelection(X.create(e.doc,n+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_T({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Gk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,qk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Jk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Yk=cC.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[gT({find:Gk,type:this.type}),gT({find:qk,type:this.type})]},addPasteRules(){return[xT({find:Kk,type:this.type}),xT({find:Jk,type:this.type})]}}),Xk=bT.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,HS(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Zk=`listItem`,Qk=`textStyle`,$k=/^(\d+)\.\s$/,eA=bT.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,HS(this.options.HTMLAttributes,n),0]:[`ol`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Zk,this.editor.getAttributes(Qk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=yT({find:$k,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=yT({find:$k,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Qk)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),tA=bT.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,rA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,iA=cC.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[gT({find:nA,type:this.type})]},addPasteRules(){return[xT({find:rA,type:this.type})]}}),aA=bT.create({name:`text`,group:`inline`}),oA=vC.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(WO.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(zO.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(JO.configure(this.options.bulletList)),this.options.code!==!1&&e.push(ZO.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(ek.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(tk.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(ik.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(gk.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(_k.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(vk.configure(this.options.heading)),this.options.history!==!1&&e.push(Uk.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(Wk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Yk.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Xk.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(eA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(tA.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(iA.configure(this.options.strike)),this.options.text!==!1&&e.push(aA.configure(this.options.text)),e}}),sA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,cA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,lA=cC.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[gT({find:sA,type:this.type})]},addPasteRules(){return[xT({find:cA,type:this.type})]}}),uA=vC.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),dA={components:{EditorContent:IO,BaseButton:B},props:{invalid:{type:Boolean,default:!1},initialContent:{type:String,default:``}},setup(e,{emit:n}){let r=(0,t.ref)(e.initialContent),i=LO({content:e.initialContent,extensions:[oA,lA,uA.configure({types:[`heading`,`paragraph`]})],editorProps:{attributes:{class:`focus:outline-none`}},onUpdate({editor:e}){r.value=e.getHTML(),n(`update:editorContent`,r.value)}});return(0,t.watch)(()=>e.initialContent,e=>{i.value&&e!==i.value.getHTML()&&i.value.commands.setContent(e)}),{editor:i,editorContent:r}},methods:{}},fA={"data-testid":`editor-buttons`,class:`flex flex-row pl-2`},pA={class:`w-1/2 md:w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2`},mA={class:`hidden md:flex w-1/3 border-r border-dropdownSelect flex-row justify-around`},hA={class:`hidden md:flex w-1/3 flex-row justify-between pl-2`},gA={class:`w-36 flex flex-row justify-around ml-4 border-l`},_A={class:`my-4 p-4 rounded-xl h-72 bg-tertiary overflow-auto`};function vA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseButton`),c=(0,t.resolveComponent)(`editor-content`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`border rounded-lg text-secondary text-sm p-4 w-full`,r.invalid?`border-alarm`:`border-dropdownSelect`]),onClick:n[13]||=e=>i.editor&&i.editor.commands.focus()},[(0,t.createElementVNode)(`div`,fA,[(0,t.createElementVNode)(`div`,pA,[(0,t.createVNode)(s,{iconName:`fa-h1`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:1}),onButtonClick:n[0]||=e=>i.editor.chain().toggleHeading({level:1}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-h2`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:2}),onButtonClick:n[1]||=e=>i.editor.chain().toggleHeading({level:2}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-h3`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:3}),onButtonClick:n[2]||=e=>i.editor.chain().toggleHeading({level:3}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-paragraph`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`paragraph`),onButtonClick:n[3]||=e=>i.editor.chain().setParagraph().run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,mA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`bold`),iconName:`fa-bold`,label:``,type:`editor`,onButtonClick:n[4]||=e=>i.editor&&i.editor.chain().toggleBold().run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`italic`),iconName:`fa-italic`,label:``,type:`editor`,onButtonClick:n[5]||=e=>i.editor&&i.editor.chain().toggleItalic().run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`strike`),iconName:`fa-strikethrough`,label:``,type:`editor`,onButtonClick:n[6]||=e=>i.editor&&i.editor.chain().toggleStrike().run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,hA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`left`}),iconName:`fa-align-left`,label:``,type:`editor`,onButtonClick:n[7]||=e=>i.editor.chain().setTextAlign(`left`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`center`}),iconName:`fa-align-center`,label:``,type:`editor`,onButtonClick:n[8]||=e=>i.editor.chain().setTextAlign(`center`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`right`}),iconName:`fa-align-right`,label:``,type:`editor`,onButtonClick:n[9]||=e=>i.editor.chain().setTextAlign(`right`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`justify`}),iconName:`fa-align-justify`,label:``,type:`editor`,onButtonClick:n[10]||=e=>i.editor.chain().setTextAlign(`justify`).run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,gA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`bulletList`),iconName:`fa-list-ul`,type:`editor`,onButtonClick:n[11]||=e=>i.editor.chain().toggleBulletList().run(),label:``},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`orderedList`),iconName:`fa-list-ol`,type:`editor`,onButtonClick:n[12]||=e=>i.editor.chain().toggleOrderedList().run(),label:``},null,8,[`selected`])])]),(0,t.createElementVNode)(`div`,_A,[(0,t.createVNode)(c,{editor:i.editor,class:`focus:shadow-none focus:outline-none`},null,8,[`editor`])])],2)}var yA=p(dA,[[`render`,vA],[`__scopeId`,`data-v-921c1a0e`]]),bA={name:`FindLocation`,components:{BaseText:L,BaseModal:Ae,AddressAutocomplete:Ad,BaseButton:B,BaseIcon:g,BaseInput:x},emits:[`update:location`,`add-new`,`submit:addNewAddress`,`submit:location`],props:{placeholder:{type:String,default:``},locations:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:`Add New`},invalid:{type:Boolean,default:!1}},data(){return{formData:{Name:``,Address1:``,Coordinates:``},locationName:``,validAddress:!1,showNewLocation:!1,filteredLocations:this.locations,inputValue:this.placeholder,backupInputValue:this.inputValue,showDropdown:!1,showAddNew:!0,debouncedTimeout:null}},watch:{inputValue(e){let t=e||``;this.showDropdown=t.length>0,this.debounceSearch()}},mounted(){document.addEventListener(`click`,this.handleClickOutside)},beforeDestroy(){document.removeEventListener(`click`,this.handleClickOutside)},methods:{clearInput(){this.backupInputValue=this.inputValue,this.inputValue=``},restorePreviousValue(){this.inputValue===``&&(this.showAddNew=!1,this.inputValue=this.backupInputValue)},updateInput(e){this.showAddNew=!0,this.inputValue=e.target.value,this.inputValue.trim()===``?this.$emit(`update:location`,null):this.debounceSearch()},selectItem(e){this.showDropdown=!1,this.inputValue=e.Name,this.$emit(`update:location`,e),this.$nextTick(()=>{this.showDropdown=!1})},addNewItem(){this.$emit(`add-new`,this.inputValue),this.showDropdown=!1},onInputChanged(e){if(!this.showDropdown)return;let t=(e||``).toLowerCase();this.filteredLocations=this.locations.filter(e=>(e.Name||``).toLowerCase().includes(t))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleLocationName(e){this.formData.locationName=e,this.locationName=e,e.trim()||this.$emit(`update:location`,null)},handleNewAddress(e){let t=e.address.split(`,`);this.formData.Name=this.locationName,this.formData.Address1=t[0].trim(),this.formData.City=t[1].trim(),this.formData.State=t[2].trim(),this.formData.Coordinates=e.coordinates,this.inputValue=this.locationName,this.$emit(`submit:addNewAddress`,this.formData)},handleSubmit(){this.$emit(`submit:location`,this.formData),this.showNewLocation=!1,this.showDropdown=!1,this.showAddNew=!1},handleClickOutside(e){this.$refs.showNewLocation&&!this.$refs.showNewLocation.contains(e.target)&&this.restorePreviousValue()}}},xA={key:0,class:`relative`,ref:`showNewLocation`},SA={key:0,class:`absolute z-10 w-full bg-white border rounded-md mt-1 max-h-60 overflow-y-auto`},CA=[`onClick`],wA={key:1};function TA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseInput`),c=(0,t.resolveComponent)(`base-button`),l=(0,t.resolveComponent)(`AddressAutocomplete`),u=(0,t.resolveComponent)(`BaseModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,null,[a.showNewLocation?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xA,[(0,t.createVNode)(s,{addBorder:r.addBorder,value:a.inputValue,invalid:r.invalid,placeholder:`Enter Location Name`,onClick:o.clearInput,onInput:o.updateInput},null,8,[`addBorder`,`value`,`invalid`,`onClick`,`onInput`]),a.showDropdown&&a.showAddNew?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SA,[(0,t.createElementVNode)(`ul`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.filteredLocations,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n,class:`p-2 hover:bg-gray-100 cursor-pointer`,onClick:t=>o.selectItem(e)},(0,t.toDisplayString)(e.Name),9,CA))),128))]),(0,t.createElementVNode)(`div`,{class:`p-2 hover:bg-gray-100 cursor-pointer`,onClick:n[1]||=(...e)=>o.addNewItem&&o.addNewItem(...e)},[(0,t.createVNode)(c,{iconName:`fa-location-dot`,label:`Add New Location`,type:`secondary`,onClick:n[0]||=e=>a.showNewLocation=!0})])])):(0,t.createCommentVNode)(``,!0)],512)),a.showNewLocation?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wA,[(0,t.createVNode)(u,{show:a.showNewLocation,buttonText:`Add Location`,iconName:`fa-location-plus`,onSubmitModal:o.handleSubmit,"onUpdate:show":n[3]||=e=>a.showNewLocation=!1},{"modal-content":(0,t.withCtx)(()=>[(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.locationName,class:`pb-2`,placeholder:`Enter Location Name`,type:`formInput`,onFocus:o.clearInput,"onUpdate:value":o.handleLocationName},null,8,[`value`,`onFocus`,`onUpdate:value`]),(0,t.createVNode)(l,{modelValue:a.formData.Address1,"onUpdate:modelValue":n[2]||=e=>a.formData.Address1=e,invalid:a.validAddress,class:`text-lg`,"onUpdate:address":o.handleNewAddress},null,8,[`modelValue`,`invalid`,`onUpdate:address`])]),_:1},8,[`show`,`onSubmitModal`])])):(0,t.createCommentVNode)(``,!0)])}var EA=p(bA,[[`render`,TA]]),DA={name:`FindPerson`,emits:[`add-new-person`,`person-selected`],components:{BaseModal:Ae,BaseText:L,BaseButton:B,BaseInput:x},props:{persons:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:`Add New`},defaultValue:{type:String,default:``}},data(){return{personEmail:``,personName:``,personPronouns:``,showNewPerson:!1,filteredPersons:this.persons,inputValue:this.defaultValue,showDropdown:!1,debouncedTimeout:null}},watch:{inputValue(e){e&&(this.showDropdown=e.length>1,this.showAddNew=e.length>1&&this.filteredPersons.length===0,this.debounceSearch())},defaultValue(e){this.inputValue=e}},methods:{updateInput(e){this.inputValue=e.target.value},selectPerson(e){this.showDropdown=!1,this.inputValue=e.DisplayName,this.$emit(`person-selected`,e),this.$nextTick(()=>{this.showDropdown=!1})},addNewPerson(){this.$emit(`add-new-person`,this.inputValue),this.showDropdown=!1},onInputChanged(e){this.showDropdown&&(this.filteredPersons=this.persons.filter(t=>t.DisplayName.toLowerCase().includes(e.toLowerCase())))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleSubmit(){console.log(`submitting person`)}}},OA={key:0,class:`relative`},kA={key:0,class:`absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1`},AA=[`onClick`],jA={class:`grid w-full`,style:{"grid-template-columns":`1fr 2fr`}},MA={key:1};function NA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseInput`),c=(0,t.resolveComponent)(`BaseText`),l=(0,t.resolveComponent)(`base-button`),u=(0,t.resolveComponent)(`BaseModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,null,[a.showNewPerson?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OA,[(0,t.createVNode)(s,{addBorder:r.addBorder,value:a.inputValue,onInput:o.updateInput,placeholder:`Type to search person...`},null,8,[`addBorder`,`value`,`onInput`]),a.showDropdown?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,kA,[(0,t.createElementVNode)(`ul`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.filteredPersons,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n,onClick:t=>o.selectPerson(e),class:`p-2 hover:bg-gridBoxHeader cursor-pointer even:bg-eventBoxBlue`},[(0,t.createElementVNode)(`div`,jA,[(0,t.createVNode)(c,{text:e.DisplayName,size:`md`},null,8,[`text`]),(0,t.createVNode)(c,{text:e.Club.Name,size:`md`,class:`ml-4`},null,8,[`text`])])],8,AA))),128))]),(0,t.createElementVNode)(`div`,{onClick:n[1]||=(...e)=>o.addNewPerson&&o.addNewPerson(...e),class:`p-2 hover:bg-gray-100 cursor-pointer`},[(0,t.createVNode)(l,{type:`secondary`,label:`Add New Person`,iconName:`fa-user-plus`,onClick:n[0]||=e=>a.showNewPerson=!0})])])):(0,t.createCommentVNode)(``,!0)])),a.showNewPerson?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MA,[(0,t.createVNode)(u,{show:a.showNewPerson,iconName:`fa-user`,buttonText:`Add Person`,onSubmitModal:o.handleSubmit,"onUpdate:show":n[6]||=e=>a.showNewPerson=!1},{"modal-content":(0,t.withCtx)(()=>[(0,t.createVNode)(c,{class:`pb-2`,text:`Enter Primary Contacts Information`}),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personName,class:`pb-2`,placeholder:`Display Name`,type:`formInput`,"onUpdate:value":n[2]||=e=>a.personName=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personName,class:`pb-2`,placeholder:`Legal Name`,type:`formInput`,"onUpdate:value":n[3]||=e=>a.personName=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personEmail,class:`pb-2`,placeholder:`Email`,type:`formInput`,"onUpdate:value":n[4]||=e=>a.personEmail=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personPronouns,class:`pb-2`,placeholder:`Pronouns`,type:`formInput`,"onUpdate:value":n[5]||=e=>a.personPronouns=e},null,8,[`value`])]),_:1},8,[`show`,`onSubmitModal`])])):(0,t.createCommentVNode)(``,!0)])}var PA={name:`TournamentPageOne`,emits:[`update:tournament`,`update:image`,`update:address`,`add:newAddress`,`add:newPerson`],props:{tournament:{type:Object,required:!0},locations:{type:Array,required:!0},persons:{type:Array,required:!0},validation:{type:Object,required:!0},uploadImageName:{type:String,default:`t-default-image`},uploadServer:{type:String,default:``},imageServer:{type:String,default:``},isNewTournament:{type:Boolean,default:!0},userLevel:{type:String,default:`Club`}},components:{FindPerson:p(DA,[[`render`,NA]]),ImageCropper:rm,BaseText:L,DatePicker:ol,FindLocation:EA,TitledInput:Ue,TextBoxEditor:yA},computed:{tournamentImage(){return this.tournament.Images&&this.tournament.Images.length>0?this.tournament.Images[0].URL:``},tournamentName(){return this.tournament?.Name||``},basePrice(){return this.tournament?.BasePrice??``},addressName(){return this.tournament?.Address?.Name||``},startDate(){return this.tournament?.StartDate||new Date},totalDays(){return this.tournament?.TotalDays||1},registrationCutOff(){return this.tournament?.RegistrationCutOff||new Date},description(){return this.tournament?.Description||``},getDefaultPerson:function(){let e=this.persons.find(e=>e.PersonId===this.tournament?.PrimaryContactId);return e?e.DisplayName:``}},methods:{handleNewImageUrl(e){this.$emit(`update:image`,{ImageLink:e})},handleAddNewAddress(e){this.$emit(`add:newAddress`,e)},handleAddressUpdate(e){this.$emit(`update:address`,e)},handleAddNewPerson(e){this.$emit(`add:newPerson`,e)},handlePrimaryContactUpdate(e){e&&this.$emit(`update:tournament`,{PrimaryContactId:e.PersonId})},emitUpdate(e,t){this.$emit(`update:tournament`,{[e]:t})},getFieldValidation(e){return this.validation?.[e]||{invalid:!1,message:``}},isFieldInvalid(e){return this.getFieldValidation(e).invalid},getValidationLabel(e,t){let n=this.getFieldValidation(e);return n.invalid?`${t} - ${n.message}`:t}}},FA={class:`w-full`},IA={key:0,class:`w-full flex flex-row justify-center`},LA={class:`w-full flex flex-row justify-center my-4`},RA={class:`w-full flex flex-row justify-center my-4`},zA={class:`flex flex-col mb-4`},BA={class:`flex flex-row mb-4`},VA={class:`w-3/4 mr-1`},HA={class:`w-full mr-1 mb-4`},UA={class:`flex flex-col mb-4`},WA={class:`flex flex-col pb-4 mr-4`};function GA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseText`),c=(0,t.resolveComponent)(`ImageCropper`),l=(0,t.resolveComponent)(`TitledInput`),u=(0,t.resolveComponent)(`FindLocation`),d=(0,t.resolveComponent)(`DatePicker`),f=(0,t.resolveComponent)(`TextBoxEditor`),p=(0,t.resolveComponent)(`FindPerson`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,FA,[r.isNewTournament?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,IA,[(0,t.createVNode)(s,{color:`quaternary`,size:`sm`,text:`Step 1 out of 2`,weight:`normal`,"data-testid":`text-step`})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,LA,[r.isNewTournament?((0,t.openBlock)(),(0,t.createBlock)(s,{key:0,color:`primaryHighlight`,size:`2xl`,text:`Add New Tournament`,weight:`normal`,"data-testid":`text-add-tournament`})):(0,t.createCommentVNode)(``,!0),r.isNewTournament?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(s,{key:1,color:`primaryHighlight`,size:`2xl`,text:`Basic Tournament Information`,weight:`normal`,"data-testid":`text-add-tournament`}))]),(0,t.createElementVNode)(`div`,RA,[(0,t.createVNode)(c,{urlToImage:o.tournamentImage,uploadImageName:r.uploadImageName,uploadServer:r.uploadServer,imageServer:r.imageServer,"onUpdate:url":o.handleNewImageUrl},null,8,[`urlToImage`,`uploadImageName`,`uploadServer`,`imageServer`,`onUpdate:url`])]),(0,t.createVNode)(l,{inputValue:o.tournamentName,invalid:o.isFieldInvalid(`Name`),title:o.getValidationLabel(`Name`,`Tournament Name`),placeholder:`Enter Tournament Name`,"onUpdate:value":n[0]||=e=>o.emitUpdate(`Name`,e),class:`mb-4`},null,8,[`inputValue`,`invalid`,`title`]),(0,t.createVNode)(l,{inputValue:o.basePrice,invalid:o.isFieldInvalid(`BasePrice`),title:o.getValidationLabel(`BasePrice`,`Base Price`),placeholder:`0.00`,"onUpdate:value":n[1]||=e=>o.emitUpdate(`BasePrice`,e),class:`mb-4`},null,8,[`inputValue`,`invalid`,`title`]),(0,t.createElementVNode)(`div`,zA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`Address`),text:o.getValidationLabel(`Address`,`Location`),size:`sm`,weight:`normal`,class:`mb-1`,"data-testid":`text-address`},null,8,[`invalid`,`text`]),(0,t.createVNode)(u,{placeholder:o.addressName,addBorder:!0,locations:r.locations,invalid:o.isFieldInvalid(`Address`),addNewText:`Add New`,"onUpdate:location":o.handleAddressUpdate,"onSubmit:location":o.handleAddressUpdate,"onSubmit:addNewAddress":o.handleAddNewAddress},null,8,[`placeholder`,`locations`,`invalid`,`onUpdate:location`,`onSubmit:location`,`onSubmit:addNewAddress`])]),(0,t.createElementVNode)(`div`,BA,[(0,t.createElementVNode)(`div`,VA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`StartDate`),size:`sm`,text:o.getValidationLabel(`StartDate`,`Start Date`),weight:`normal`,class:`mb-1`,"data-testid":`text-start-date`},null,8,[`invalid`,`text`]),(0,t.createVNode)(d,{invalid:o.isFieldInvalid(`StartDate`),setDate:o.startDate,userLevel:r.userLevel,"onUpdate:selectedDate":n[2]||=e=>o.emitUpdate(`StartDate`,e)},null,8,[`invalid`,`setDate`,`userLevel`])]),(0,t.createElementVNode)(`div`,null,[(0,t.createVNode)(l,{inputValue:o.totalDays,invalid:o.isFieldInvalid(`TotalDays`),placeholder:`Number of Days`,inputType:`number`,title:o.getValidationLabel(`TotalDays`,`Number of Days`),"onUpdate:value":n[3]||=e=>o.emitUpdate(`TotalDays`,e)},null,8,[`inputValue`,`invalid`,`title`])])]),(0,t.createElementVNode)(`div`,HA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`RegistrationCutOff`),size:`sm`,text:o.getValidationLabel(`RegistrationCutOff`,`Registration Cut Off`),weight:`normal`,class:`mb-1`,"data-testid":`text-start-date`},null,8,[`invalid`,`text`]),(0,t.createVNode)(d,{invalid:o.isFieldInvalid(`RegistrationCutOff`),setDate:o.registrationCutOff,userLevel:r.userLevel,"onUpdate:selectedDate":n[4]||=e=>o.emitUpdate(`RegistrationCutOff`,e)},null,8,[`invalid`,`setDate`,`userLevel`])]),(0,t.createElementVNode)(`div`,UA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`Description`),size:`sm`,text:o.getValidationLabel(`Description`,`Description`),weight:`normal`,class:`mb-1`,"data-testid":`text-description`},null,8,[`invalid`,`text`]),(0,t.createVNode)(f,{invalid:o.isFieldInvalid(`Description`),initialContent:o.description,"onUpdate:editorContent":n[5]||=e=>o.emitUpdate(`Description`,e)},null,8,[`invalid`,`initialContent`])]),(0,t.createElementVNode)(`div`,WA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:!1,size:`sm`,text:`Primary Contact`,weight:`normal`,class:`mb-1`,"data-testid":`text-primary-contact`}),(0,t.createVNode)(p,{addBorder:!0,persons:r.persons,defaultValue:o.getDefaultPerson,addNewText:`Add New Person`,onAddNewPerson:o.handleAddNewPerson,onPersonSelected:o.handlePrimaryContactUpdate},null,8,[`persons`,`defaultValue`,`onAddNewPerson`,`onPersonSelected`])])])}var KA=p(PA,[[`render`,GA]]),qA={name:`TabBar`,components:{},props:{}},JA={class:`flex flex-row w-full`};function YA(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`nav`,JA,[(0,t.renderSlot)(e.$slots,`default`)])}var XA={components:{BaseIcon:g,BaseText:L,TabBar:p(qA,[[`render`,YA]]),BaseButton:B},emits:[`tabMenuClick`],props:{currentTab:{type:String,default:``},tabs:{type:Array,default:()=>[]}},data(){return{windowWidth:1024,activeDropdown:null}},computed:{isMobile(){return this.windowWidth<=748},selectedDropdownItems(){return this.tabs.find(e=>e.id===this.activeDropdown)?.children||[]}},mounted(){this.handleResize(),window.addEventListener(`resize`,this.handleResize)},beforeUnmount(){window.removeEventListener(`resize`,this.handleResize)},methods:{handleButtonClick(e){let t=this.tabs.find(t=>t.id===e);if(t&&t.children&&this.isMobile){this.activeDropdown=this.activeDropdown===e?null:e;return}this.activeDropdown=null,this.$emit(`tabMenuClick`,e)},getIconName(e){return this.isMobile?e.icon:``},handleResize(){this.windowWidth=window?.innerWidth||1024}}},ZA={class:`flex`},QA={class:`w-full flex md:flex-nowrap flex-wrap justify-between md:justify-start`},$A={key:0,class:`bg-eventBoxBlue rounded w-full -mt-4 grid grid-cols-4 gap-4 pt-3 pb-1`};function ej(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseButton`),c=(0,t.resolveComponent)(`TabBar`),l=(0,t.resolveComponent)(`BaseIcon`),u=(0,t.resolveComponent)(`BaseText`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,null,[(0,t.createElementVNode)(`section`,ZA,[(0,t.createVNode)(c,{class:`border-b border-dropdownSelect mb-5 overflow-auto w-full flex flex-wrap`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,QA,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs,e=>((0,t.openBlock)(),(0,t.createBlock)(s,{key:e.id,selected:r.currentTab===e.id,class:`mx-2.5 md:mx-3 text-xs md:text-sm`,size:`sm`,dropDown:!!e.children,iconName:o.getIconName(e),color:e.color,label:e.label,type:`tabBar`,onButtonClick:t=>o.handleButtonClick(e.id)},null,8,[`selected`,`dropDown`,`iconName`,`color`,`label`,`onButtonClick`]))),128))])]),_:1})]),a.activeDropdown?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,$A,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.selectedDropdownItems,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`flex flex-col items-center justify-center mb-2 mr-2`},[(0,t.createVNode)(l,{size:`md`,iconName:e.icon,color:e.color,class:`w-6 mb-1 text-center`},null,8,[`iconName`,`color`]),(0,t.createVNode)(u,{size:`xs`,color:e.color,text:e.label,onClick:t=>o.handleButtonClick(e.id),class:`text-center`},null,8,[`color`,`text`,`onClick`])]))),128))])):(0,t.createCommentVNode)(``,!0)])}var tj=p(XA,[[`render`,ej]]),nj=(e,t)=>e.toLocaleLowerCase()===`admin`||e.toLocaleLowerCase()===`club`?t?[{id:`Settings`,label:`Settings`,color:`primaryHighlight`,icon:`fa-cog`,group:`Settings`,children:[{id:`Edit`,label:`Edit`,color:`primaryHighlight`,icon:`fa-pencil-alt`},{id:`Staff`,label:`Staff`,color:`primaryHighlight`,icon:`fa-users-cog`},{id:`Displays`,label:`Displays`,color:`primaryHighlight`,icon:`fa-tv`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards-blank`}]},{id:`Checkin`,label:`Checkin`,color:`primaryHighlight`,icon:`fa-clipboard-check`},{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`}]:[{id:`Edit`,label:`Edit`,color:`primaryHighlight`,icon:`fa-pencil-alt`},{id:`Staff`,label:`Staff`,color:`primaryHighlight`,icon:`fa-users-cog`},{id:`Displays`,label:`Displays`,color:`primaryHighlight`,icon:`fa-tv`},{id:`Checkin`,label:`Checkin`,color:`primaryHighlight`,icon:`fa-clipboard-check`},{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards`}]:e.toLocaleLowerCase()===`director`?[{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards-blank`}]:[],rj=e=>e.toLocaleLowerCase()===`admin`||e.toLocaleLowerCase()===`club`?[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Admin`,label:`Administration`,color:`primaryHighlight`,icon:`fa-gear`},{id:`Attendance`,label:`Attendance`,color:`primaryHighlight`,icon:`fa-user-check`}]:[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Attendance`,label:`Attendance`,color:`primaryHighlight`,icon:`fa-user-check`}],ij=()=>[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Hosting`,label:`Hosting`,color:`primaryHighlight`,icon:`fa-globe-pointer`},{id:`Events`,label:`Events`,color:`primaryHighlight`,icon:`fa-swords`},{id:`ResultsImport`,label:`Results`,color:`primaryHighlight`,icon:`fa-swords`}],aj={name:`TournamentPageTwo`,components:{BaseRadioGroup:D,BaseInput:x,BaseButton:B,BaseText:L},emits:[`update:tournament`,`go:results-import`],props:{tournament:{type:Object,required:!0},isNewTournament:{type:Boolean,default:!0}},data(){return{validation:{visibility:!1,waiverScope:!1},visibilityItems:[{label:`Open`,value:`Open`,description:`Viewable to everyone`},{label:`Club`,value:`Club`,description:`Viewable only to members of your club`},{label:`Private`,value:`Private`,description:`Only viewable by you`}],waiverItems:[{label:`No`,value:`None`,description:`No waiver required`},{label:`Club Waiver`,value:`Club`,description:`Sign once, good forever`},{label:`Tournament Waiver`,value:`Tournament`,description:`Only for this tournament`}]}},computed:{isHosted(){return!!this.tournament?.HostedOnM2},resultsEnabled(){return!!this.tournament?.ResultsEnabled},visibility(){return this.tournament?.Visibility||`Open`},waiverScope(){return this.tournament?.WaiverScope||`None`},registrationLink(){return this.tournament?.RegistrationLink||``},rulesLink(){return this.tournament?.RulesLink||``},hostingDescription(){return`If you select 'No', your tournament will be featured on our main calendar and you can link out to your registration page.
175
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vk=bT.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,HS(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>vT({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),yk=200,bk=function(){};bk.prototype.append=function(e){return e.length?(e=bk.from(e),!this.length&&e||e.length<yk&&this.leafAppend(e)||this.length<yk&&e.leafPrepend(this)||this.appendInner(e)):this},bk.prototype.prepend=function(e){return e.length?bk.from(e).append(this):this},bk.prototype.appendInner=function(e){return new Sk(this,e)},bk.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?bk.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},bk.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bk.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},bk.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},bk.from=function(e){return e instanceof bk?e:e&&e.length?new xk(e):bk.empty};var xk=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=yk)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=yk)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(bk);bk.empty=new xk([]);var Sk=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(bk),Ck=500,wk=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Ek(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Ek(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Ek(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Ok&&(s=Tk(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Lh;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Ek(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Ek(i,o,l))}else r.push(new Ek(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Ek(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>Ck&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Ek(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(bk.from(i.reverse()),a)}};wk.empty=new wk(bk.empty,0);function Tk(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Ek=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Dk=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Ok=20;function kk(e,t,n,r){let i=n.getMeta(Lk),a;if(i)return i.historyState;n.getMeta(Rk)&&(e=new Dk(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Lk))return o.getMeta(Lk).redo?new Dk(e.done.addTransform(n,void 0,r,Ik(t)),e.undone,jk(n.mapping.maps),e.prevTime,e.prevComposition):new Dk(e.done,e.undone.addTransform(n,void 0,r,Ik(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Ak(n,e.prevRanges)),s=o?Mk(e.prevRanges,n.mapping):jk(n.mapping.maps);return new Dk(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Ik(t)),wk.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new Dk(e.done.rebased(n,a),e.undone.rebased(n,a),Mk(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Dk(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Mk(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Ak(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function jk(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Mk(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Nk(e,t,n){let r=Ik(t),i=Lk.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Dk(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Lk,{redo:n,historyState:c})}var Pk=!1,Fk=null;function Ik(e){let t=e.plugins;if(Fk!=t){Pk=!1,Fk=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Pk=!0;break}}return Pk}var Lk=new c_(`history`),Rk=new c_(`closeHistory`);function zk(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new a_({key:Lk,state:{init(){return new Dk(wk.empty,wk.empty,null,0,-1)},apply(t,n,r){return kk(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Vk:n==`historyRedo`?Hk:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Bk(e,t){return(n,r)=>{let i=Lk.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Nk(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Vk=Bk(!1,!0),Hk=Bk(!0,!0),Uk=vC.create({name:`history`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Vk(e,t),redo:()=>({state:e,dispatch:t})=>Hk(e,t)}},addProseMirrorPlugins(){return[zk(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Wk=bT.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{}}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,HS(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!ST(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$from:r,$to:i}=n,a=e();return r.parentOffset===0?a.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):Uw(n)?a.insertContentAt(i.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:e,dispatch:t})=>{if(t){let{$to:t}=e.selection,n=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(X.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(Z.create(e.doc,t.pos)):e.setSelection(X.create(e.doc,t.pos));else{let r=t.parent.type.contentMatch.defaultType?.create();r&&(e.insert(n,r),e.setSelection(X.create(e.doc,n+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_T({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Gk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,qk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Jk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Yk=cC.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[gT({find:Gk,type:this.type}),gT({find:qk,type:this.type})]},addPasteRules(){return[xT({find:Kk,type:this.type}),xT({find:Jk,type:this.type})]}}),Xk=bT.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,HS(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Zk=`listItem`,Qk=`textStyle`,$k=/^(\d+)\.\s$/,eA=bT.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,HS(this.options.HTMLAttributes,n),0]:[`ol`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Zk,this.editor.getAttributes(Qk)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=yT({find:$k,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=yT({find:$k,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Qk)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),tA=bT.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),nA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,rA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,iA=cC.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[gT({find:nA,type:this.type})]},addPasteRules(){return[xT({find:rA,type:this.type})]}}),aA=bT.create({name:`text`,group:`inline`}),oA=vC.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(WO.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(zO.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(JO.configure(this.options.bulletList)),this.options.code!==!1&&e.push(ZO.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(ek.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(tk.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(ik.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(gk.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(_k.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(vk.configure(this.options.heading)),this.options.history!==!1&&e.push(Uk.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(Wk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Yk.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Xk.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(eA.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(tA.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(iA.configure(this.options.strike)),this.options.text!==!1&&e.push(aA.configure(this.options.text)),e}}),sA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,cA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,lA=cC.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,HS(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[gT({find:sA,type:this.type})]},addPasteRules(){return[xT({find:cA,type:this.type})]}}),uA=vC.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),dA={components:{EditorContent:IO,BaseButton:B},props:{invalid:{type:Boolean,default:!1},initialContent:{type:String,default:``}},setup(e,{emit:n}){let r=(0,t.ref)(e.initialContent),i=LO({content:e.initialContent,extensions:[oA,lA,uA.configure({types:[`heading`,`paragraph`]})],editorProps:{attributes:{class:`focus:outline-none`}},onUpdate({editor:e}){r.value=e.getHTML(),n(`update:editorContent`,r.value)}});return(0,t.watch)(()=>e.initialContent,e=>{i.value&&e!==i.value.getHTML()&&i.value.commands.setContent(e)}),{editor:i,editorContent:r}},methods:{}},fA={"data-testid":`editor-buttons`,class:`flex flex-row pl-2`},pA={class:`w-1/2 md:w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2`},mA={class:`hidden md:flex w-1/3 border-r border-dropdownSelect flex-row justify-around`},hA={class:`hidden md:flex w-1/3 flex-row justify-between pl-2`},gA={class:`w-36 flex flex-row justify-around ml-4 border-l`},_A={class:`my-4 p-4 rounded-xl h-72 bg-tertiary overflow-auto`};function vA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseButton`),c=(0,t.resolveComponent)(`editor-content`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`border rounded-lg text-secondary text-sm p-4 w-full`,r.invalid?`border-alarm`:`border-dropdownSelect`]),onClick:n[13]||=e=>i.editor&&i.editor.commands.focus()},[(0,t.createElementVNode)(`div`,fA,[(0,t.createElementVNode)(`div`,pA,[(0,t.createVNode)(s,{iconName:`fa-h1`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:1}),onButtonClick:n[0]||=e=>i.editor.chain().toggleHeading({level:1}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-h2`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:2}),onButtonClick:n[1]||=e=>i.editor.chain().toggleHeading({level:2}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-h3`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`heading`,{level:3}),onButtonClick:n[2]||=e=>i.editor.chain().toggleHeading({level:3}).run()},null,8,[`selected`]),(0,t.createVNode)(s,{iconName:`fa-paragraph`,label:``,type:`editor`,selected:i.editor&&i.editor.isActive(`paragraph`),onButtonClick:n[3]||=e=>i.editor.chain().setParagraph().run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,mA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`bold`),iconName:`fa-bold`,label:``,type:`editor`,onButtonClick:n[4]||=e=>i.editor&&i.editor.chain().toggleBold().run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`italic`),iconName:`fa-italic`,label:``,type:`editor`,onButtonClick:n[5]||=e=>i.editor&&i.editor.chain().toggleItalic().run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`strike`),iconName:`fa-strikethrough`,label:``,type:`editor`,onButtonClick:n[6]||=e=>i.editor&&i.editor.chain().toggleStrike().run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,hA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`left`}),iconName:`fa-align-left`,label:``,type:`editor`,onButtonClick:n[7]||=e=>i.editor.chain().setTextAlign(`left`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`center`}),iconName:`fa-align-center`,label:``,type:`editor`,onButtonClick:n[8]||=e=>i.editor.chain().setTextAlign(`center`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`right`}),iconName:`fa-align-right`,label:``,type:`editor`,onButtonClick:n[9]||=e=>i.editor.chain().setTextAlign(`right`).run()},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive({textAlign:`justify`}),iconName:`fa-align-justify`,label:``,type:`editor`,onButtonClick:n[10]||=e=>i.editor.chain().setTextAlign(`justify`).run()},null,8,[`selected`])]),(0,t.createElementVNode)(`div`,gA,[(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`bulletList`),iconName:`fa-list-ul`,type:`editor`,onButtonClick:n[11]||=e=>i.editor.chain().toggleBulletList().run(),label:``},null,8,[`selected`]),(0,t.createVNode)(s,{selected:i.editor&&i.editor.isActive(`orderedList`),iconName:`fa-list-ol`,type:`editor`,onButtonClick:n[12]||=e=>i.editor.chain().toggleOrderedList().run(),label:``},null,8,[`selected`])])]),(0,t.createElementVNode)(`div`,_A,[(0,t.createVNode)(c,{editor:i.editor,class:`focus:shadow-none focus:outline-none`},null,8,[`editor`])])],2)}var yA=p(dA,[[`render`,vA],[`__scopeId`,`data-v-921c1a0e`]]),bA={name:`FindLocation`,components:{BaseText:L,BaseModal:Ae,AddressAutocomplete:Ad,BaseButton:B,BaseIcon:g,BaseInput:x},emits:[`update:location`,`add-new`,`submit:addNewAddress`,`submit:location`],props:{placeholder:{type:String,default:``},locations:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:`Add New`},invalid:{type:Boolean,default:!1}},data(){return{formData:{Name:``,Address1:``,Coordinates:``},locationName:``,validAddress:!1,showNewLocation:!1,filteredLocations:this.locations,inputValue:this.placeholder,backupInputValue:this.inputValue,showDropdown:!1,showAddNew:!0,debouncedTimeout:null}},watch:{inputValue(e){let t=e||``;this.showDropdown=t.length>0,this.debounceSearch()}},mounted(){document.addEventListener(`click`,this.handleClickOutside)},beforeDestroy(){document.removeEventListener(`click`,this.handleClickOutside)},methods:{clearInput(){this.backupInputValue=this.inputValue,this.inputValue=``},restorePreviousValue(){this.inputValue===``&&(this.showAddNew=!1,this.inputValue=this.backupInputValue)},updateInput(e){this.showAddNew=!0,this.inputValue=e.target.value,this.inputValue.trim()===``?this.$emit(`update:location`,null):this.debounceSearch()},selectItem(e){this.showDropdown=!1,this.inputValue=e.Name,this.$emit(`update:location`,e),this.$nextTick(()=>{this.showDropdown=!1})},addNewItem(){this.$emit(`add-new`,this.inputValue),this.showDropdown=!1},onInputChanged(e){if(!this.showDropdown)return;let t=(e||``).toLowerCase();this.filteredLocations=this.locations.filter(e=>(e.Name||``).toLowerCase().includes(t))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleLocationName(e){this.formData.locationName=e,this.locationName=e,e.trim()||this.$emit(`update:location`,null)},handleNewAddress(e){let t=e.address.split(`,`);this.formData.Name=this.locationName,this.formData.Address1=t[0].trim(),this.formData.City=t[1].trim(),this.formData.State=t[2].trim(),this.formData.Coordinates=e.coordinates,this.inputValue=this.locationName,this.$emit(`submit:addNewAddress`,this.formData)},handleSubmit(){this.$emit(`submit:location`,this.formData),this.showNewLocation=!1,this.showDropdown=!1,this.showAddNew=!1},handleClickOutside(e){this.$refs.showNewLocation&&!this.$refs.showNewLocation.contains(e.target)&&this.restorePreviousValue()}}},xA={key:0,class:`relative`,ref:`showNewLocation`},SA={key:0,class:`absolute z-10 w-full bg-white border rounded-md mt-1 max-h-60 overflow-y-auto`},CA=[`onClick`],wA={key:1};function TA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseInput`),c=(0,t.resolveComponent)(`base-button`),l=(0,t.resolveComponent)(`AddressAutocomplete`),u=(0,t.resolveComponent)(`BaseModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,null,[a.showNewLocation?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xA,[(0,t.createVNode)(s,{addBorder:r.addBorder,value:a.inputValue,invalid:r.invalid,placeholder:`Enter Location Name`,onClick:o.clearInput,onInput:o.updateInput},null,8,[`addBorder`,`value`,`invalid`,`onClick`,`onInput`]),a.showDropdown&&a.showAddNew?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SA,[(0,t.createElementVNode)(`ul`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.filteredLocations,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n,class:`p-2 hover:bg-gray-100 cursor-pointer`,onClick:t=>o.selectItem(e)},(0,t.toDisplayString)(e.Name),9,CA))),128))]),(0,t.createElementVNode)(`div`,{class:`p-2 hover:bg-gray-100 cursor-pointer`,onClick:n[1]||=(...e)=>o.addNewItem&&o.addNewItem(...e)},[(0,t.createVNode)(c,{iconName:`fa-location-dot`,label:`Add New Location`,type:`secondary`,onClick:n[0]||=e=>a.showNewLocation=!0})])])):(0,t.createCommentVNode)(``,!0)],512)),a.showNewLocation?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wA,[(0,t.createVNode)(u,{show:a.showNewLocation,buttonText:`Add Location`,iconName:`fa-location-plus`,onSubmitModal:o.handleSubmit,"onUpdate:show":n[3]||=e=>a.showNewLocation=!1},{"modal-content":(0,t.withCtx)(()=>[(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.locationName,class:`pb-2`,placeholder:`Enter Location Name`,type:`formInput`,onFocus:o.clearInput,"onUpdate:value":o.handleLocationName},null,8,[`value`,`onFocus`,`onUpdate:value`]),(0,t.createVNode)(l,{modelValue:a.formData.Address1,"onUpdate:modelValue":n[2]||=e=>a.formData.Address1=e,invalid:a.validAddress,class:`text-lg`,"onUpdate:address":o.handleNewAddress},null,8,[`modelValue`,`invalid`,`onUpdate:address`])]),_:1},8,[`show`,`onSubmitModal`])])):(0,t.createCommentVNode)(``,!0)])}var EA=p(bA,[[`render`,TA]]),DA={name:`FindPerson`,emits:[`add-new-person`,`person-selected`],components:{BaseModal:Ae,BaseText:L,BaseButton:B,BaseInput:x},props:{persons:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:`Add New`},defaultValue:{type:String,default:``}},data(){return{personEmail:``,personName:``,personPronouns:``,showNewPerson:!1,filteredPersons:this.persons,inputValue:this.defaultValue,showDropdown:!1,debouncedTimeout:null}},watch:{inputValue(e){e&&(this.showDropdown=e.length>1,this.showAddNew=e.length>1&&this.filteredPersons.length===0,this.debounceSearch())},defaultValue(e){this.inputValue=e}},methods:{updateInput(e){this.inputValue=e.target.value},selectPerson(e){this.showDropdown=!1,this.inputValue=e.DisplayName,this.$emit(`person-selected`,e),this.$nextTick(()=>{this.showDropdown=!1})},addNewPerson(){this.$emit(`add-new-person`,this.inputValue),this.showDropdown=!1},onInputChanged(e){this.showDropdown&&(this.filteredPersons=this.persons.filter(t=>t.DisplayName.toLowerCase().includes(e.toLowerCase())))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleSubmit(){console.log(`submitting person`)}}},OA={key:0,class:`relative`},kA={key:0,class:`absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1`},AA=[`onClick`],jA={class:`grid w-full`,style:{"grid-template-columns":`1fr 2fr`}},MA={key:1};function NA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseInput`),c=(0,t.resolveComponent)(`BaseText`),l=(0,t.resolveComponent)(`base-button`),u=(0,t.resolveComponent)(`BaseModal`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,null,[a.showNewPerson?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,OA,[(0,t.createVNode)(s,{addBorder:r.addBorder,value:a.inputValue,onInput:o.updateInput,placeholder:`Type to search person...`},null,8,[`addBorder`,`value`,`onInput`]),a.showDropdown?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,kA,[(0,t.createElementVNode)(`ul`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.filteredPersons,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n,onClick:t=>o.selectPerson(e),class:`p-2 hover:bg-gridBoxHeader cursor-pointer even:bg-eventBoxBlue`},[(0,t.createElementVNode)(`div`,jA,[(0,t.createVNode)(c,{text:e.DisplayName,size:`md`},null,8,[`text`]),(0,t.createVNode)(c,{text:e.Club.Name,size:`md`,class:`ml-4`},null,8,[`text`])])],8,AA))),128))]),(0,t.createElementVNode)(`div`,{onClick:n[1]||=(...e)=>o.addNewPerson&&o.addNewPerson(...e),class:`p-2 hover:bg-gray-100 cursor-pointer`},[(0,t.createVNode)(l,{type:`secondary`,label:`Add New Person`,iconName:`fa-user-plus`,onClick:n[0]||=e=>a.showNewPerson=!0})])])):(0,t.createCommentVNode)(``,!0)])),a.showNewPerson?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MA,[(0,t.createVNode)(u,{show:a.showNewPerson,iconName:`fa-user`,buttonText:`Add Person`,onSubmitModal:o.handleSubmit,"onUpdate:show":n[6]||=e=>a.showNewPerson=!1},{"modal-content":(0,t.withCtx)(()=>[(0,t.createVNode)(c,{class:`pb-2`,text:`Enter Primary Contacts Information`}),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personName,class:`pb-2`,placeholder:`Display Name`,type:`formInput`,"onUpdate:value":n[2]||=e=>a.personName=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personName,class:`pb-2`,placeholder:`Legal Name`,type:`formInput`,"onUpdate:value":n[3]||=e=>a.personName=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personEmail,class:`pb-2`,placeholder:`Email`,type:`formInput`,"onUpdate:value":n[4]||=e=>a.personEmail=e},null,8,[`value`]),(0,t.createVNode)(s,{addBorder:!0,invalid:!1,value:a.personPronouns,class:`pb-2`,placeholder:`Pronouns`,type:`formInput`,"onUpdate:value":n[5]||=e=>a.personPronouns=e},null,8,[`value`])]),_:1},8,[`show`,`onSubmitModal`])])):(0,t.createCommentVNode)(``,!0)])}var PA={name:`TournamentPageOne`,emits:[`update:tournament`,`update:image`,`update:address`,`add:newAddress`,`add:newPerson`],props:{tournament:{type:Object,required:!0},locations:{type:Array,required:!0},persons:{type:Array,required:!0},validation:{type:Object,required:!0},uploadImageName:{type:String,default:`t-default-image`},uploadServer:{type:String,default:``},imageServer:{type:String,default:``},isNewTournament:{type:Boolean,default:!0},userLevel:{type:String,default:`Club`}},components:{FindPerson:p(DA,[[`render`,NA]]),ImageCropper:rm,BaseText:L,DatePicker:ol,FindLocation:EA,TitledInput:Ue,TextBoxEditor:yA},data(){return{basePriceDraft:null}},computed:{tournamentImage(){return this.tournament.Images&&this.tournament.Images.length>0?this.tournament.Images[0].URL:``},tournamentName(){return this.tournament?.Name||``},basePrice(){let e=this.tournament?.BasePrice??``;if(e===``||e===this.basePriceDraft)return e;let t=Number(e);return Number.isFinite(t)?t.toFixed(2):e},addressName(){return this.tournament?.Address?.Name||``},startDate(){return this.tournament?.StartDate||new Date},totalDays(){return this.tournament?.TotalDays||1},registrationCutOff(){return this.tournament?.RegistrationCutOff||new Date},description(){return this.tournament?.Description||``},getDefaultPerson:function(){let e=this.persons.find(e=>e.PersonId===this.tournament?.PrimaryContactId);return e?e.DisplayName:``}},methods:{handleBasePriceUpdate(e){this.basePriceDraft=e,this.emitUpdate(`BasePrice`,e)},handleBasePriceBlur(){this.basePriceDraft=null},handleNewImageUrl(e){this.$emit(`update:image`,{ImageLink:e})},handleAddNewAddress(e){this.$emit(`add:newAddress`,e)},handleAddressUpdate(e){this.$emit(`update:address`,e)},handleAddNewPerson(e){this.$emit(`add:newPerson`,e)},handlePrimaryContactUpdate(e){e&&this.$emit(`update:tournament`,{PrimaryContactId:e.PersonId})},emitUpdate(e,t){this.$emit(`update:tournament`,{[e]:t})},getFieldValidation(e){return this.validation?.[e]||{invalid:!1,message:``}},isFieldInvalid(e){return this.getFieldValidation(e).invalid},getValidationLabel(e,t){let n=this.getFieldValidation(e);return n.invalid?`${t} - ${n.message}`:t}}},FA={class:`w-full`},IA={key:0,class:`w-full flex flex-row justify-center`},LA={class:`w-full flex flex-row justify-center my-4`},RA={class:`w-full flex flex-row justify-center my-4`},zA={class:`flex flex-col mb-4`},BA={class:`flex flex-row mb-4`},VA={class:`w-3/4 mr-1`},HA={class:`w-full mr-1 mb-4`},UA={class:`flex flex-col mb-4`},WA={class:`flex flex-col pb-4 mr-4`};function GA(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseText`),c=(0,t.resolveComponent)(`ImageCropper`),l=(0,t.resolveComponent)(`TitledInput`),u=(0,t.resolveComponent)(`FindLocation`),d=(0,t.resolveComponent)(`DatePicker`),f=(0,t.resolveComponent)(`TextBoxEditor`),p=(0,t.resolveComponent)(`FindPerson`);return(0,t.openBlock)(),(0,t.createElementBlock)(`section`,FA,[r.isNewTournament?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,IA,[(0,t.createVNode)(s,{color:`quaternary`,size:`sm`,text:`Step 1 out of 2`,weight:`normal`,"data-testid":`text-step`})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,LA,[r.isNewTournament?((0,t.openBlock)(),(0,t.createBlock)(s,{key:0,color:`primaryHighlight`,size:`2xl`,text:`Add New Tournament`,weight:`normal`,"data-testid":`text-add-tournament`})):(0,t.createCommentVNode)(``,!0),r.isNewTournament?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(s,{key:1,color:`primaryHighlight`,size:`2xl`,text:`Basic Tournament Information`,weight:`normal`,"data-testid":`text-add-tournament`}))]),(0,t.createElementVNode)(`div`,RA,[(0,t.createVNode)(c,{urlToImage:o.tournamentImage,uploadImageName:r.uploadImageName,uploadServer:r.uploadServer,imageServer:r.imageServer,"onUpdate:url":o.handleNewImageUrl},null,8,[`urlToImage`,`uploadImageName`,`uploadServer`,`imageServer`,`onUpdate:url`])]),(0,t.createVNode)(l,{inputValue:o.tournamentName,invalid:o.isFieldInvalid(`Name`),title:o.getValidationLabel(`Name`,`Tournament Name`),placeholder:`Enter Tournament Name`,"onUpdate:value":n[0]||=e=>o.emitUpdate(`Name`,e),class:`mb-4`},null,8,[`inputValue`,`invalid`,`title`]),(0,t.createVNode)(l,{inputValue:o.basePrice,invalid:o.isFieldInvalid(`BasePrice`),title:o.getValidationLabel(`BasePrice`,`Base Price`),placeholder:`0.00`,"onUpdate:value":o.handleBasePriceUpdate,onFocusout:o.handleBasePriceBlur,class:`mb-4`},null,8,[`inputValue`,`invalid`,`title`,`onUpdate:value`,`onFocusout`]),(0,t.createElementVNode)(`div`,zA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`Address`),text:o.getValidationLabel(`Address`,`Location`),size:`sm`,weight:`normal`,class:`mb-1`,"data-testid":`text-address`},null,8,[`invalid`,`text`]),(0,t.createVNode)(u,{placeholder:o.addressName,addBorder:!0,locations:r.locations,invalid:o.isFieldInvalid(`Address`),addNewText:`Add New`,"onUpdate:location":o.handleAddressUpdate,"onSubmit:location":o.handleAddressUpdate,"onSubmit:addNewAddress":o.handleAddNewAddress},null,8,[`placeholder`,`locations`,`invalid`,`onUpdate:location`,`onSubmit:location`,`onSubmit:addNewAddress`])]),(0,t.createElementVNode)(`div`,BA,[(0,t.createElementVNode)(`div`,VA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`StartDate`),size:`sm`,text:o.getValidationLabel(`StartDate`,`Start Date`),weight:`normal`,class:`mb-1`,"data-testid":`text-start-date`},null,8,[`invalid`,`text`]),(0,t.createVNode)(d,{invalid:o.isFieldInvalid(`StartDate`),setDate:o.startDate,userLevel:r.userLevel,"onUpdate:selectedDate":n[1]||=e=>o.emitUpdate(`StartDate`,e)},null,8,[`invalid`,`setDate`,`userLevel`])]),(0,t.createElementVNode)(`div`,null,[(0,t.createVNode)(l,{inputValue:o.totalDays,invalid:o.isFieldInvalid(`TotalDays`),placeholder:`Number of Days`,inputType:`number`,title:o.getValidationLabel(`TotalDays`,`Number of Days`),"onUpdate:value":n[2]||=e=>o.emitUpdate(`TotalDays`,e)},null,8,[`inputValue`,`invalid`,`title`])])]),(0,t.createElementVNode)(`div`,HA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`RegistrationCutOff`),size:`sm`,text:o.getValidationLabel(`RegistrationCutOff`,`Registration Cut Off`),weight:`normal`,class:`mb-1`,"data-testid":`text-start-date`},null,8,[`invalid`,`text`]),(0,t.createVNode)(d,{invalid:o.isFieldInvalid(`RegistrationCutOff`),setDate:o.registrationCutOff,userLevel:r.userLevel,"onUpdate:selectedDate":n[3]||=e=>o.emitUpdate(`RegistrationCutOff`,e)},null,8,[`invalid`,`setDate`,`userLevel`])]),(0,t.createElementVNode)(`div`,UA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:o.isFieldInvalid(`Description`),size:`sm`,text:o.getValidationLabel(`Description`,`Description`),weight:`normal`,class:`mb-1`,"data-testid":`text-description`},null,8,[`invalid`,`text`]),(0,t.createVNode)(f,{invalid:o.isFieldInvalid(`Description`),initialContent:o.description,"onUpdate:editorContent":n[4]||=e=>o.emitUpdate(`Description`,e)},null,8,[`invalid`,`initialContent`])]),(0,t.createElementVNode)(`div`,WA,[(0,t.createVNode)(s,{color:`primaryHighlight`,invalid:!1,size:`sm`,text:`Primary Contact`,weight:`normal`,class:`mb-1`,"data-testid":`text-primary-contact`}),(0,t.createVNode)(p,{addBorder:!0,persons:r.persons,defaultValue:o.getDefaultPerson,addNewText:`Add New Person`,onAddNewPerson:o.handleAddNewPerson,onPersonSelected:o.handlePrimaryContactUpdate},null,8,[`persons`,`defaultValue`,`onAddNewPerson`,`onPersonSelected`])])])}var KA=p(PA,[[`render`,GA]]),qA={name:`TabBar`,components:{},props:{}},JA={class:`flex flex-row w-full`};function YA(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`nav`,JA,[(0,t.renderSlot)(e.$slots,`default`)])}var XA={components:{BaseIcon:g,BaseText:L,TabBar:p(qA,[[`render`,YA]]),BaseButton:B},emits:[`tabMenuClick`],props:{currentTab:{type:String,default:``},tabs:{type:Array,default:()=>[]}},data(){return{windowWidth:1024,activeDropdown:null}},computed:{isMobile(){return this.windowWidth<=748},selectedDropdownItems(){return this.tabs.find(e=>e.id===this.activeDropdown)?.children||[]}},mounted(){this.handleResize(),window.addEventListener(`resize`,this.handleResize)},beforeUnmount(){window.removeEventListener(`resize`,this.handleResize)},methods:{handleButtonClick(e){let t=this.tabs.find(t=>t.id===e);if(t&&t.children&&this.isMobile){this.activeDropdown=this.activeDropdown===e?null:e;return}this.activeDropdown=null,this.$emit(`tabMenuClick`,e)},getIconName(e){return this.isMobile?e.icon:``},handleResize(){this.windowWidth=window?.innerWidth||1024}}},ZA={class:`flex`},QA={class:`w-full flex md:flex-nowrap flex-wrap justify-between md:justify-start`},$A={key:0,class:`bg-eventBoxBlue rounded w-full -mt-4 grid grid-cols-4 gap-4 pt-3 pb-1`};function ej(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`BaseButton`),c=(0,t.resolveComponent)(`TabBar`),l=(0,t.resolveComponent)(`BaseIcon`),u=(0,t.resolveComponent)(`BaseText`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,null,[(0,t.createElementVNode)(`section`,ZA,[(0,t.createVNode)(c,{class:`border-b border-dropdownSelect mb-5 overflow-auto w-full flex flex-wrap`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,QA,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs,e=>((0,t.openBlock)(),(0,t.createBlock)(s,{key:e.id,selected:r.currentTab===e.id,class:`mx-2.5 md:mx-3 text-xs md:text-sm`,size:`sm`,dropDown:!!e.children,iconName:o.getIconName(e),color:e.color,label:e.label,type:`tabBar`,onButtonClick:t=>o.handleButtonClick(e.id)},null,8,[`selected`,`dropDown`,`iconName`,`color`,`label`,`onButtonClick`]))),128))])]),_:1})]),a.activeDropdown?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,$A,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.selectedDropdownItems,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`flex flex-col items-center justify-center mb-2 mr-2`},[(0,t.createVNode)(l,{size:`md`,iconName:e.icon,color:e.color,class:`w-6 mb-1 text-center`},null,8,[`iconName`,`color`]),(0,t.createVNode)(u,{size:`xs`,color:e.color,text:e.label,onClick:t=>o.handleButtonClick(e.id),class:`text-center`},null,8,[`color`,`text`,`onClick`])]))),128))])):(0,t.createCommentVNode)(``,!0)])}var tj=p(XA,[[`render`,ej]]),nj=(e,t)=>e.toLocaleLowerCase()===`admin`||e.toLocaleLowerCase()===`club`?t?[{id:`Settings`,label:`Settings`,color:`primaryHighlight`,icon:`fa-cog`,group:`Settings`,children:[{id:`Edit`,label:`Edit`,color:`primaryHighlight`,icon:`fa-pencil-alt`},{id:`Staff`,label:`Staff`,color:`primaryHighlight`,icon:`fa-users-cog`},{id:`Displays`,label:`Displays`,color:`primaryHighlight`,icon:`fa-tv`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards-blank`}]},{id:`Checkin`,label:`Checkin`,color:`primaryHighlight`,icon:`fa-clipboard-check`},{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`}]:[{id:`Edit`,label:`Edit`,color:`primaryHighlight`,icon:`fa-pencil-alt`},{id:`Staff`,label:`Staff`,color:`primaryHighlight`,icon:`fa-users-cog`},{id:`Displays`,label:`Displays`,color:`primaryHighlight`,icon:`fa-tv`},{id:`Checkin`,label:`Checkin`,color:`primaryHighlight`,icon:`fa-clipboard-check`},{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards`}]:e.toLocaleLowerCase()===`director`?[{id:`Pools`,label:`Pools`,color:`primaryHighlight`,icon:`fa-swords`},{id:`Pool Results`,label:`Pool Results`,color:`primaryHighlight`,icon:`fa-chart-bar`},{id:`Bracket`,label:`Bracket`,color:`primaryHighlight`,icon:`fa-sitemap`},{id:`Final`,label:`Final Results`,color:`primaryHighlight`,icon:`fa-trophy`},{id:`Penalties`,label:`Penalties`,color:`primaryHighlight`,icon:`fa-cards-blank`}]:[],rj=e=>e.toLocaleLowerCase()===`admin`||e.toLocaleLowerCase()===`club`?[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Admin`,label:`Administration`,color:`primaryHighlight`,icon:`fa-gear`},{id:`Attendance`,label:`Attendance`,color:`primaryHighlight`,icon:`fa-user-check`}]:[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Attendance`,label:`Attendance`,color:`primaryHighlight`,icon:`fa-user-check`}],ij=()=>[{id:`Basic`,label:`Basic`,color:`primaryHighlight`,icon:`fa-info-circle`},{id:`Hosting`,label:`Hosting`,color:`primaryHighlight`,icon:`fa-globe-pointer`},{id:`Events`,label:`Events`,color:`primaryHighlight`,icon:`fa-swords`},{id:`ResultsImport`,label:`Results`,color:`primaryHighlight`,icon:`fa-swords`}],aj={name:`TournamentPageTwo`,components:{BaseRadioGroup:D,BaseInput:x,BaseButton:B,BaseText:L},emits:[`update:tournament`,`go:results-import`],props:{tournament:{type:Object,required:!0},isNewTournament:{type:Boolean,default:!0}},data(){return{validation:{visibility:!1,waiverScope:!1},visibilityItems:[{label:`Open`,value:`Open`,description:`Viewable to everyone`},{label:`Club`,value:`Club`,description:`Viewable only to members of your club`},{label:`Private`,value:`Private`,description:`Only viewable by you`}],waiverItems:[{label:`No`,value:`None`,description:`No waiver required`},{label:`Club Waiver`,value:`Club`,description:`Sign once, good forever`},{label:`Tournament Waiver`,value:`Tournament`,description:`Only for this tournament`}]}},computed:{isHosted(){return!!this.tournament?.HostedOnM2},resultsEnabled(){return!!this.tournament?.ResultsEnabled},visibility(){return this.tournament?.Visibility||`Open`},waiverScope(){return this.tournament?.WaiverScope||`None`},registrationLink(){return this.tournament?.RegistrationLink||``},rulesLink(){return this.tournament?.RulesLink||``},hostingDescription(){return`If you select 'No', your tournament will be featured on our main calendar and you can link out to your registration page.
176
176
 
177
177
  You can also publish final results on MeyerSquared later (any time) to support ratings and historical records.
178
178
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.710",
4
+ "version": "1.0.711",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -34,6 +34,31 @@ function existingTournament(BasePrice) {
34
34
  }
35
35
 
36
36
  describe('tournament base price', () => {
37
+ it.each([
38
+ [45, '45.00'],
39
+ ['45', '45.00'],
40
+ [45.5, '45.50'],
41
+ ['45.5', '45.50']
42
+ ])('displays a saved base price of %s as %s', async (value, display) => {
43
+ const wrapper = mountTournament(existingTournament(value));
44
+ await wrapper.vm.$nextTick();
45
+ expect(priceField(wrapper).find('input').element.value).toBe(display);
46
+ });
47
+
48
+ it('formats an entered price on blur and preserves the numeric submit payload', async () => {
49
+ const wrapper = mountTournament();
50
+ await wrapper.vm.$nextTick();
51
+ wrapper.vm.updateTournament({ Name: 'Test Tournament', Address: { Name: 'Test Venue' } });
52
+ const input = priceField(wrapper).find('input');
53
+ await input.setValue('45.');
54
+ expect(input.element.value).toBe('45.');
55
+ await input.setValue('45');
56
+ await input.trigger('focusout');
57
+ expect(input.element.value).toBe('45.00');
58
+ wrapper.vm.handleSubmit();
59
+ expect(wrapper.emitted('submit:tournament')[0][0].BasePrice).toBe(45);
60
+ });
61
+
37
62
  it('retains decimal typing and submits the base price from a new tournament', async () => {
38
63
  const wrapper = mountTournament();
39
64
  await wrapper.vm.$nextTick();
@@ -61,13 +86,13 @@ describe('tournament base price', () => {
61
86
  expect(wrapper.emitted('submit:tournament')[0][0].BasePrice).toBe(80.75);
62
87
  expect(tournament.BasePrice).toBe(50.25);
63
88
  await wrapper.setProps({ tournament: existingTournament(0) });
64
- expect(priceField(wrapper).find('input').element.value).toBe('0');
89
+ expect(priceField(wrapper).find('input').element.value).toBe('0.00');
65
90
  });
66
91
 
67
92
  it.each([undefined, null, 0])('allows free tournaments with an initial price of %s', async value => {
68
93
  const wrapper = mountTournament(existingTournament(value));
69
94
  await wrapper.vm.$nextTick();
70
- expect(priceField(wrapper).find('input').element.value).toBe(value == null ? '' : '0');
95
+ expect(priceField(wrapper).find('input').element.value).toBe(value == null ? '' : '0.00');
71
96
  expect(priceField(wrapper).find('input').attributes('placeholder')).toBe('0.00');
72
97
  await priceField(wrapper).find('input').setValue('');
73
98
  wrapper.vm.handleSubmit();
@@ -89,7 +89,7 @@ export const EmptyTournament = {
89
89
 
90
90
  export const EditMode = {
91
91
  args: {
92
- tournament: { ...mockTournaments[0], BasePrice: 75.5 },
92
+ tournament: { ...mockTournaments[0], BasePrice: 45 },
93
93
  locations: mockLocation,
94
94
  persons: mockPersons,
95
95
  validation: validTournamentFields,
@@ -51,7 +51,8 @@
51
51
  :invalid="isFieldInvalid('BasePrice')"
52
52
  :title="getValidationLabel('BasePrice', 'Base Price')"
53
53
  placeholder="0.00"
54
- @update:value="emitUpdate('BasePrice', $event)"
54
+ @update:value="handleBasePriceUpdate"
55
+ @focusout="handleBasePriceBlur"
55
56
  class="mb-4"
56
57
  />
57
58
 
@@ -223,6 +224,9 @@ export default {
223
224
  TitledInput,
224
225
  TextBoxEditor
225
226
  },
227
+ data() {
228
+ return { basePriceDraft: null };
229
+ },
226
230
  computed: {
227
231
  tournamentImage() {
228
232
  if (this.tournament.Images && this.tournament.Images.length > 0) {
@@ -234,7 +238,11 @@ export default {
234
238
  return this.tournament?.Name || '';
235
239
  },
236
240
  basePrice() {
237
- return this.tournament?.BasePrice ?? '';
241
+ const price = this.tournament?.BasePrice ?? '';
242
+ if (price === '' || price === this.basePriceDraft) return price;
243
+ const amount = Number(price);
244
+ if (!Number.isFinite(amount)) return price;
245
+ return amount.toFixed(2);
238
246
  },
239
247
  addressName() {
240
248
  return this.tournament?.Address?.Name || '';
@@ -257,6 +265,13 @@ export default {
257
265
  }
258
266
  },
259
267
  methods: {
268
+ handleBasePriceUpdate(value) {
269
+ this.basePriceDraft = value;
270
+ this.emitUpdate('BasePrice', value);
271
+ },
272
+ handleBasePriceBlur() {
273
+ this.basePriceDraft = null;
274
+ },
260
275
  handleNewImageUrl(url) {
261
276
  this.$emit('update:image', { ImageLink: url });
262
277
  },