@oneclick.dev/cms-core-modules 0.0.100 → 0.0.102

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.
Files changed (59) hide show
  1. package/dist/Acquisition-Br1Pfny3.js +1 -0
  2. package/dist/{Acquisition-D_Qx7XRY.mjs → Acquisition-CPlZzUBo.mjs} +40 -40
  3. package/dist/Audience-BfkrmBuQ.js +1 -0
  4. package/dist/{Audience-BdlrWkY-.mjs → Audience-DTblSAiL.mjs} +89 -89
  5. package/dist/Content-BHr_rPVY.js +1 -0
  6. package/dist/{Content-DW6xvbUo.mjs → Content-CYOZKvWK.mjs} +56 -56
  7. package/dist/Overview-BrCwozey.js +1 -0
  8. package/dist/{Overview-gJSvftdE.mjs → Overview-kaMhsIUq.mjs} +21 -21
  9. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +2782 -0
  10. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +349 -0
  11. package/dist/SendPush-COns44j7.js +1 -0
  12. package/dist/SendPush-CPIOjVX4.mjs +184 -0
  13. package/dist/SeoHealth-09sEOu3G.js +1 -0
  14. package/dist/SeoHealth-BzcWd_w7.mjs +615 -0
  15. package/dist/{agenda-DMT75Qfo.mjs → agenda-CCOjPiwP.mjs} +1 -1
  16. package/dist/{agenda-DxD4RMsy.js → agenda-CNPQfaIQ.js} +1 -1
  17. package/dist/cms-core-modules.css +1 -1
  18. package/dist/{index-BbqRTXuU.js → index-BOnqrBfY.js} +1 -1
  19. package/dist/{index-D4GsbUId.mjs → index-Bj0qaL1N.mjs} +1 -1
  20. package/dist/index-CJQQBRLY.js +1 -0
  21. package/dist/{index-D7JBu6iT.mjs → index-CZn2nDLv.mjs} +6 -6
  22. package/dist/index-CsVeM3PA.mjs +24 -0
  23. package/dist/index-DjWuIBxh.js +1 -0
  24. package/dist/index.cjs.js +1 -1
  25. package/dist/index.mjs +102 -81
  26. package/dist/{orders-BRfXlWgV.mjs → orders-BJV5vRQr.mjs} +1 -1
  27. package/dist/{orders-CrCz1WTR.js → orders-C1C5IEIP.js} +1 -1
  28. package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +5 -0
  29. package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +5 -0
  30. package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +5 -0
  31. package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +10 -0
  32. package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +5 -0
  33. package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +5 -0
  34. package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +5 -0
  35. package/dist/src/googleAnalytics/components/seo-health/utils.d.ts +6 -0
  36. package/dist/src/index.d.ts +1 -0
  37. package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +28 -0
  38. package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +28 -0
  39. package/dist/src/push-notifications/components/PushPreview.vue.d.ts +28 -0
  40. package/dist/src/push-notifications/config.d.ts +13 -0
  41. package/dist/src/push-notifications/index.d.ts +25 -0
  42. package/dist/src/push-notifications/index.vue.d.ts +22 -0
  43. package/dist/src/push-notifications/metadata.d.ts +2 -0
  44. package/dist/src/push-notifications/pages/SendPush.vue.d.ts +14 -0
  45. package/dist/src/push-notifications/permissions.d.ts +5 -0
  46. package/dist/src/push-notifications/routes.d.ts +5 -0
  47. package/dist/src/push-notifications/tools.d.ts +1 -0
  48. package/dist/src/push-notifications/types.d.ts +0 -0
  49. package/package.json +2 -2
  50. package/src/push-notifications/tools.ts +24 -0
  51. package/dist/Acquisition-_-cq972V.js +0 -1
  52. package/dist/Audience-QnFQs93n.js +0 -1
  53. package/dist/Content-C-4Cdniz.js +0 -1
  54. package/dist/Overview-Da0XexiT.js +0 -1
  55. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +0 -349
  56. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs +0 -2383
  57. package/dist/SeoHealth-Bc5chnaa.mjs +0 -523
  58. package/dist/SeoHealth-BkpJ1F2Y.js +0 -1
  59. package/dist/index-DwHYfZl_.js +0 -1
@@ -1,349 +0,0 @@
1
- "use strict";const e=require("vue"),B=require("lucide-vue-next"),T=require("@oneclick.dev/cms-kit"),H=require("./index-ijdf0d9-.js");function j(o){return Array.isArray?Array.isArray(o):he(o)==="[object Array]"}function Fe(o){if(typeof o=="string")return o;let t=o+"";return t=="0"&&1/o==-1/0?"-0":t}function ce(o){return o==null?"":Fe(o)}function S(o){return typeof o=="string"}function q(o){return typeof o=="number"}function Re(o){return o===!0||o===!1||Te(o)&&he(o)=="[object Boolean]"}function ge(o){return typeof o=="object"}function Te(o){return ge(o)&&o!==null}function $(o){return o!=null}function G(o){return!o.trim().length}function he(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(o)}const Ie="Incorrect 'index' type",je=o=>`Invalid value for key ${o}`,Oe=o=>`Pattern length exceeds max of ${o}.`,Le=o=>`Missing ${o} property in key`,Pe=o=>`Property 'weight' in key '${o}' must be a positive integer`,ue=Object.prototype.hasOwnProperty;class ze{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(s=>{let r=xe(s);this._keys.push(r),this._keyMap[r.id]=r,n+=r.weight}),this._keys.forEach(s=>{s.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function xe(o){let t=null,n=null,s=null,r=1,l=null;if(S(o)||j(o))s=o,t=de(o),n=ee(o);else{if(!ue.call(o,"name"))throw new Error(Le("name"));const i=o.name;if(s=i,ue.call(o,"weight")&&(r=o.weight,r<=0))throw new Error(Pe(i));t=de(i),n=ee(i),l=o.getFn}return{path:t,id:n,weight:r,src:s,getFn:l}}function de(o){return j(o)?o:o.split(".")}function ee(o){return j(o)?o.join("."):o}function Ue(o,t){let n=[],s=!1;const r=(l,i,c,p)=>{if($(l))if(!i[c])n.push(p!==void 0?{v:l,i:p}:l);else{let a=i[c];const u=l[a];if(!$(u))return;if(c===i.length-1&&(S(u)||q(u)||Re(u)))n.push(p!==void 0?{v:ce(u),i:p}:ce(u));else if(j(u)){s=!0;for(let f=0,x=u.length;f<x;f+=1)r(u[f],i,c+1,f)}else i.length&&r(u,i,c+1,p)}};return r(o,S(t)?t.split("."):t,0),s?n:n[0]}const He={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},We={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(o,t)=>o.score===t.score?o.idx<t.idx?-1:1:o.score<t.score?-1:1},Ke={location:0,threshold:.6,distance:100},Ge={useExtendedSearch:!1,getFn:Ue,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var h={...We,...He,...Ke,...Ge};const Ye=/[^ ]+/g;function Qe(o=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(r){const l=r.match(Ye).length;if(n.has(l))return n.get(l);const i=1/Math.pow(l,.5*o),c=parseFloat(Math.round(i*s)/s);return n.set(l,c),c},clear(){n.clear()}}}class re{constructor({getFn:t=h.getFn,fieldNormWeight:n=h.fieldNormWeight}={}){this.norm=Qe(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,s)=>{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,S(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();S(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,s=this.size();n<s;n+=1)this.records[n].i-=1}removeAll(t){for(let n=t.length-1;n>=0;n-=1)this.records.splice(t[n],1);for(let n=0,s=this.records.length;n<s;n+=1)this.records[n].i=n}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!$(t)||G(t))return;let s={v:t,i:n,n:this.norm.get(t)};this.records.push(s)}_addObject(t,n){let s={i:n,$:{}};this.keys.forEach((r,l)=>{let i=r.getFn?r.getFn(t):this.getFn(t,r.path);if($(i)){if(j(i)){let c=[];for(let p=0,a=i.length;p<a;p+=1){const u=i[p];if($(u)){if(S(u)){if(!G(u)){let f={v:u,i:p,n:this.norm.get(u)};c.push(f)}}else if(S(u.v)&&!G(u.v)){let f={v:u.v,i:u.i,n:this.norm.get(u.v)};c.push(f)}}}s.$[l]=c}else if(S(i)&&!G(i)){let c={v:i,n:this.norm.get(i)};s.$[l]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function Ce(o,t,{getFn:n=h.getFn,fieldNormWeight:s=h.fieldNormWeight}={}){const r=new re({getFn:n,fieldNormWeight:s});return r.setKeys(o.map(xe)),r.setSources(t),r.create(),r}function Je(o,{getFn:t=h.getFn,fieldNormWeight:n=h.fieldNormWeight}={}){const{keys:s,records:r}=o,l=new re({getFn:t,fieldNormWeight:n});return l.setKeys(s),l.setIndexRecords(r),l}function Xe(o=[],t=h.minMatchCharLength){let n=[],s=-1,r=-1,l=0;for(let i=o.length;l<i;l+=1){let c=o[l];c&&s===-1?s=l:!c&&s!==-1&&(r=l-1,r-s+1>=t&&n.push([s,r]),s=-1)}return o[l-1]&&l-s>=t&&n.push([s,l-1]),n}const P=32;function Ze(o,t,n,{location:s=h.location,distance:r=h.distance,threshold:l=h.threshold,findAllMatches:i=h.findAllMatches,minMatchCharLength:c=h.minMatchCharLength,includeMatches:p=h.includeMatches,ignoreLocation:a=h.ignoreLocation}={}){if(t.length>P)throw new Error(Oe(P));const u=t.length,f=o.length,x=Math.max(0,Math.min(s,f));let v=l,d=x;const g=(y,E)=>{const C=y/u;if(a)return C;const A=Math.abs(x-E);return r?C+A/r:A?1:C},V=c>1||p,k=V?Array(f):[];let w;for(;(w=o.indexOf(t,d))>-1;){let y=g(0,w);if(v=Math.min(y,v),d=w+u,V){let E=0;for(;E<u;)k[w+E]=1,E+=1}}d=-1;let N=[],b=1,M=u+f;const R=1<<u-1;for(let y=0;y<u;y+=1){let E=0,C=M;for(;E<C;)g(y,x+C)<=v?E=C:M=C,C=Math.floor((M-E)/2+E);M=C;let A=Math.max(1,x-C+1),W=i?f:Math.min(x+C,f)+u,I=Array(W+2);I[W+1]=(1<<y)-1;for(let m=W;m>=A;m-=1){let D=m-1,U=n[o[D]];if(V&&(k[D]=+!!U),I[m]=(I[m+1]<<1|1)&U,y&&(I[m]|=(N[m+1]|N[m])<<1|1|N[m+1]),I[m]&R&&(b=g(y,D),b<=v)){if(v=b,d=D,d<=x)break;A=Math.max(1,2*x-d)}}if(g(y+1,x)>v)break;N=I}const F={isMatch:d>=0,score:Math.max(.001,b)};if(V){const y=Xe(k,c);y.length?p&&(F.indices=y):F.isMatch=!1}return F}function qe(o){let t={};for(let n=0,s=o.length;n<s;n+=1){const r=o.charAt(n);t[r]=(t[r]||0)|1<<s-n-1}return t}const Y=String.prototype.normalize?(o=>o.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(o=>o);function et(o){if(o.length<=1)return o;o.sort((n,s)=>n[0]-s[0]||n[1]-s[1]);const t=[o[0]];for(let n=1,s=o.length;n<s;n+=1){const r=t[t.length-1],l=o[n];l[0]<=r[1]+1?r[1]=Math.max(r[1],l[1]):t.push(l)}return t}class _e{constructor(t,{location:n=h.location,threshold:s=h.threshold,distance:r=h.distance,includeMatches:l=h.includeMatches,findAllMatches:i=h.findAllMatches,minMatchCharLength:c=h.minMatchCharLength,isCaseSensitive:p=h.isCaseSensitive,ignoreDiacritics:a=h.ignoreDiacritics,ignoreLocation:u=h.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:r,includeMatches:l,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:p,ignoreDiacritics:a,ignoreLocation:u},t=p?t:t.toLowerCase(),t=a?Y(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(v,d)=>{this.chunks.push({pattern:v,alphabet:qe(v),startIndex:d})},x=this.pattern.length;if(x>P){let v=0;const d=x%P,g=x-d;for(;v<g;)f(this.pattern.substr(v,P),v),v+=P;if(d){const V=x-P;f(this.pattern.substr(V),V)}}else f(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:s,includeMatches:r}=this.options;if(t=n?t:t.toLowerCase(),t=s?Y(t):t,this.pattern===t){let g={isMatch:!0,score:0};return r&&(g.indices=[[0,t.length-1]]),g}const{location:l,distance:i,threshold:c,findAllMatches:p,minMatchCharLength:a,ignoreLocation:u}=this.options;let f=[],x=0,v=!1;this.chunks.forEach(({pattern:g,alphabet:V,startIndex:k})=>{const{isMatch:w,score:N,indices:b}=Ze(t,g,V,{location:l+k,distance:i,threshold:c,findAllMatches:p,minMatchCharLength:a,includeMatches:r,ignoreLocation:u});w&&(v=!0),x+=N,w&&b&&f.push(...b)});let d={isMatch:v,score:v?x/this.chunks.length:1};return v&&r&&(d.indices=et(f)),d}}class O{constructor(t){this.pattern=t}static isMultiMatch(t){return pe(t,this.multiRegex)}static isSingleMatch(t){return pe(t,this.singleRegex)}search(){}}function pe(o,t){const n=o.match(t);return n?n[1]:null}class tt extends O{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ot extends O{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class nt extends O{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class st extends O{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class at extends O{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class rt extends O{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Ne extends O{constructor(t,{location:n=h.location,threshold:s=h.threshold,distance:r=h.distance,includeMatches:l=h.includeMatches,findAllMatches:i=h.findAllMatches,minMatchCharLength:c=h.minMatchCharLength,isCaseSensitive:p=h.isCaseSensitive,ignoreDiacritics:a=h.ignoreDiacritics,ignoreLocation:u=h.ignoreLocation}={}){super(t),this._bitapSearch=new _e(t,{location:n,threshold:s,distance:r,includeMatches:l,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:p,ignoreDiacritics:a,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class De extends O{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,s;const r=[],l=this.pattern.length;for(;(s=t.indexOf(this.pattern,n))>-1;)n=s+l,r.push([s,n-1]);const i=!!r.length;return{isMatch:i,score:i?0:1,indices:r}}}const te=[tt,De,nt,st,rt,at,ot,Ne],me=te.length,it=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,lt="|";function ct(o,t={}){return o.split(lt).map(n=>{let s=n.trim().split(it).filter(l=>l&&!!l.trim()),r=[];for(let l=0,i=s.length;l<i;l+=1){const c=s[l];let p=!1,a=-1;for(;!p&&++a<me;){const u=te[a];let f=u.isMultiMatch(c);f&&(r.push(new u(f,t)),p=!0)}if(!p)for(a=-1;++a<me;){const u=te[a];let f=u.isSingleMatch(c);if(f){r.push(new u(f,t));break}}}return r})}const ut=new Set([Ne.type,De.type]);class dt{constructor(t,{isCaseSensitive:n=h.isCaseSensitive,ignoreDiacritics:s=h.ignoreDiacritics,includeMatches:r=h.includeMatches,minMatchCharLength:l=h.minMatchCharLength,ignoreLocation:i=h.ignoreLocation,findAllMatches:c=h.findAllMatches,location:p=h.location,threshold:a=h.threshold,distance:u=h.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:l,findAllMatches:c,ignoreLocation:i,location:p,threshold:a,distance:u},t=n?t:t.toLowerCase(),t=s?Y(t):t,this.pattern=t,this.query=ct(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:l}=this.options;t=r?t:t.toLowerCase(),t=l?Y(t):t;let i=0,c=[],p=0;for(let a=0,u=n.length;a<u;a+=1){const f=n[a];c.length=0,i=0;for(let x=0,v=f.length;x<v;x+=1){const d=f[x],{isMatch:g,indices:V,score:k}=d.search(t);if(g){if(i+=1,p+=k,s){const w=d.constructor.type;ut.has(w)?c.push(...V):c.push(V)}}else{p=0,i=0,c.length=0;break}}if(i){let x={isMatch:!0,score:p/i};return s&&(x.indices=c),x}}return{isMatch:!1,score:1}}}const oe=[];function ye(...o){oe.push(...o)}function Ve(o,t){for(let n=0,s=oe.length;n<s;n+=1){let r=oe[n];if(r.condition(o,t))return new r(o,t)}return new _e(o,t)}const Q={AND:"$and",OR:"$or"},ne={PATH:"$path",PATTERN:"$val"},se=o=>!!(o[Q.AND]||o[Q.OR]),pt=o=>!!o[ne.PATH],mt=o=>!j(o)&&ge(o)&&!se(o),fe=o=>({[Q.AND]:Object.keys(o).map(t=>({[t]:o[t]}))});function be(o,t,{auto:n=!0}={}){const s=r=>{let l=Object.keys(r);const i=pt(r);if(!i&&l.length>1&&!se(r))return s(fe(r));if(mt(r)){const p=i?r[ne.PATH]:l[0],a=i?r[ne.PATTERN]:r[p];if(!S(a))throw new Error(je(p));const u={keyId:ee(p),pattern:a};return n&&(u.searcher=Ve(a,t)),u}let c={children:[],operator:l[0]};return l.forEach(p=>{const a=r[p];j(a)&&a.forEach(u=>{c.children.push(s(u))})}),c};return se(o)||(o=fe(o)),s(o)}function ae(o,{ignoreFieldNorm:t=h.ignoreFieldNorm}){let n=1;o.matches.forEach(({key:s,norm:r,score:l})=>{const i=s?s.weight:null;n*=Math.pow(l===0&&i?Number.EPSILON:l,(i||1)*(t?1:r))}),o.score=n}function ft(o,{ignoreFieldNorm:t=h.ignoreFieldNorm}){o.forEach(n=>{ae(n,{ignoreFieldNorm:t})})}class vt{constructor(t){this.limit=t,this.heap=[]}get size(){return this.heap.length}shouldInsert(t){return this.size<this.limit||t<this.heap[0].score}insert(t){this.size<this.limit?(this.heap.push(t),this._bubbleUp(this.size-1)):t.score<this.heap[0].score&&(this.heap[0]=t,this._sinkDown(0))}extractSorted(t){return this.heap.sort(t)}_bubbleUp(t){const n=this.heap;for(;t>0;){const s=t-1>>1;if(n[t].score<=n[s].score)break;const r=n[t];n[t]=n[s],n[s]=r,t=s}}_sinkDown(t){const n=this.heap,s=n.length;let r=t;do{t=r;const l=2*t+1,i=2*t+2;if(l<s&&n[l].score>n[r].score&&(r=l),i<s&&n[i].score>n[r].score&&(r=i),r!==t){const c=n[t];n[t]=n[r],n[r]=c}}while(r!==t)}}function gt(o,t){const n=o.matches;t.matches=[],$(n)&&n.forEach(s=>{if(!$(s.indices)||!s.indices.length)return;const{indices:r,value:l}=s;let i={indices:r,value:l};s.key&&(i.key=s.key.src),s.idx>-1&&(i.refIndex=s.idx),t.matches.push(i)})}function ht(o,t){t.score=o.score}function xt(o,t,{includeMatches:n=h.includeMatches,includeScore:s=h.includeScore}={}){const r=[];return n&&r.push(gt),s&&r.push(ht),o.map(l=>{const{idx:i}=l,c={item:t[i],refIndex:i};return r.length&&r.forEach(p=>{p(l,c)}),c})}class z{constructor(t,n={},s){this.options={...h,...n},this.options.useExtendedSearch,this._keyStore=new ze(this.options.keys),this.setCollection(t,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const n=Ve(t,this.options);return this._lastQuery=t,this._lastSearcher=n,n}setCollection(t,n){if(this._docs=t,n&&!(n instanceof re))throw new Error(Ie);this._myIndex=n||Ce(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){$(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[],s=[];for(let r=0,l=this._docs.length;r<l;r+=1)t(this._docs[r],r)&&(n.push(this._docs[r]),s.push(r));if(s.length){for(let r=s.length-1;r>=0;r-=1)this._docs.splice(s[r],1);this._myIndex.removeAll(s)}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:l,sortFn:i,ignoreFieldNorm:c}=this.options,p=q(n)&&n>0&&S(t);let a;if(p){const u=new vt(n);S(this._docs[0])?this._searchStringList(t,{heap:u,ignoreFieldNorm:c}):this._searchObjectList(t,{heap:u,ignoreFieldNorm:c}),a=u.extractSorted(i)}else a=S(t)?S(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),ft(a,{ignoreFieldNorm:c}),l&&a.sort(i),q(n)&&n>-1&&(a=a.slice(0,n));return xt(a,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(t,{heap:n,ignoreFieldNorm:s}={}){const r=this._getSearcher(t),{records:l}=this._myIndex,i=n?null:[];return l.forEach(({v:c,i:p,n:a})=>{if(!$(c))return;const{isMatch:u,score:f,indices:x}=r.searchIn(c);if(u){const v={item:c,idx:p,matches:[{score:f,value:c,norm:a,indices:x}]};n?(ae(v,{ignoreFieldNorm:s}),n.shouldInsert(v.score)&&n.insert(v)):i.push(v)}}),i}_searchLogical(t){const n=be(t,this.options),s=(c,p,a)=>{if(!c.children){const{keyId:f,searcher:x}=c,v=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(p,f),searcher:x});return v&&v.length?[{idx:a,item:p,matches:v}]:[]}const u=[];for(let f=0,x=c.children.length;f<x;f+=1){const v=c.children[f],d=s(v,p,a);if(d.length)u.push(...d);else if(c.operator===Q.AND)return[]}return u},r=this._myIndex.records,l=new Map,i=[];return r.forEach(({$:c,i:p})=>{if($(c)){let a=s(n,c,p);a.length&&(l.has(p)||(l.set(p,{idx:p,item:c,matches:[]}),i.push(l.get(p))),a.forEach(({matches:u})=>{l.get(p).matches.push(...u)}))}}),i}_searchObjectList(t,{heap:n,ignoreFieldNorm:s}={}){const r=this._getSearcher(t),{keys:l,records:i}=this._myIndex,c=n?null:[];return i.forEach(({$:p,i:a})=>{if(!$(p))return;let u=[];if(l.forEach((f,x)=>{u.push(...this._findMatches({key:f,value:p[x],searcher:r}))}),u.length){const f={idx:a,item:p,matches:u};n?(ae(f,{ignoreFieldNorm:s}),n.shouldInsert(f.score)&&n.insert(f)):c.push(f)}}),c}_findMatches({key:t,value:n,searcher:s}){if(!$(n))return[];let r=[];if(j(n))n.forEach(({v:l,i,n:c})=>{if(!$(l))return;const{isMatch:p,score:a,indices:u}=s.searchIn(l);p&&r.push({score:a,key:t,value:l,idx:i,norm:c,indices:u})});else{const{v:l,n:i}=n,{isMatch:c,score:p,indices:a}=s.searchIn(l);c&&r.push({score:p,key:t,value:l,norm:i,indices:a})}return r}}z.version="7.2.0";z.createIndex=Ce;z.parseIndex=Je;z.config=h;z.parseQuery=be;ye(dt);z.use=function(...o){o.forEach(t=>ye(t))};const L=o=>o==null?"—":`€${o.toFixed(2)}`,Ct=o=>{if(!o)return"—";if(o<60)return`${o} min`;const t=Math.floor(o/60),n=o%60;return n>0?`${t}h ${n}min`:`${t}h`},_t=o=>{switch(o){case"confirmed":return"Confirmed";case"completed":return"Completed";case"pending":return"Pending";case"cancelled":return"Cancelled";default:return o||"Unknown"}},ve=o=>{switch(o){case"confirmed":case"completed":return"#16a34a";case"pending":return"#ca8a04";case"cancelled":return"#dc2626";default:return"#6b7280"}},Nt=(o,t={})=>{const n=`${o.customerInfo?.firstName||""} ${o.customerInfo?.lastName||""}`.trim()||"Unknown Customer",s=o.id?.slice(0,8)||"—",r=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),l=`
2
- <!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Reservation ${s}</title>
8
- <style>
9
- * {
10
- margin: 0;
11
- padding: 0;
12
- box-sizing: border-box;
13
- }
14
-
15
- body {
16
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
17
- line-height: 1.6;
18
- color: #1f2937;
19
- background: #fff;
20
- padding: 40px;
21
- max-width: 800px;
22
- margin: 0 auto;
23
- }
24
-
25
- .header {
26
- display: flex;
27
- justify-content: space-between;
28
- align-items: flex-start;
29
- margin-bottom: 40px;
30
- padding-bottom: 20px;
31
- border-bottom: 2px solid #e5e7eb;
32
- }
33
-
34
- .company-info {
35
- display: flex;
36
- align-items: center;
37
- gap: 16px;
38
- }
39
-
40
- .company-logo {
41
- max-height: 50px;
42
- max-width: 150px;
43
- object-fit: contain;
44
- }
45
-
46
- .company-name {
47
- font-size: 24px;
48
- font-weight: 700;
49
- color: #111827;
50
- }
51
-
52
- .document-info {
53
- text-align: right;
54
- }
55
-
56
- .document-title {
57
- font-size: 28px;
58
- font-weight: 700;
59
- color: #111827;
60
- margin-bottom: 8px;
61
- }
62
-
63
- .booking-id {
64
- font-size: 14px;
65
- color: #6b7280;
66
- }
67
-
68
- .status-badge {
69
- display: inline-block;
70
- padding: 4px 12px;
71
- border-radius: 9999px;
72
- font-size: 12px;
73
- font-weight: 600;
74
- text-transform: uppercase;
75
- margin-top: 8px;
76
- }
77
-
78
- .section {
79
- margin-bottom: 32px;
80
- }
81
-
82
- .section-title {
83
- font-size: 12px;
84
- font-weight: 600;
85
- text-transform: uppercase;
86
- letter-spacing: 0.05em;
87
- color: #6b7280;
88
- margin-bottom: 12px;
89
- }
90
-
91
- .section-content {
92
- background: #f9fafb;
93
- border-radius: 8px;
94
- padding: 20px;
95
- }
96
-
97
- .customer-name {
98
- font-size: 18px;
99
- font-weight: 600;
100
- margin-bottom: 8px;
101
- }
102
-
103
- .contact-info {
104
- font-size: 14px;
105
- color: #4b5563;
106
- }
107
-
108
- .contact-info a {
109
- color: #4b5563;
110
- text-decoration: none;
111
- }
112
-
113
- .grid {
114
- display: grid;
115
- grid-template-columns: 1fr 1fr;
116
- gap: 16px;
117
- }
118
-
119
- .info-card {
120
- background: #f9fafb;
121
- border-radius: 8px;
122
- padding: 16px;
123
- }
124
-
125
- .info-label {
126
- font-size: 12px;
127
- color: #6b7280;
128
- margin-bottom: 4px;
129
- }
130
-
131
- .info-value {
132
- font-size: 16px;
133
- font-weight: 600;
134
- }
135
-
136
- .package-row {
137
- display: flex;
138
- justify-content: space-between;
139
- align-items: flex-start;
140
- }
141
-
142
- .package-name {
143
- font-size: 16px;
144
- font-weight: 600;
145
- }
146
-
147
- .package-duration {
148
- font-size: 14px;
149
- color: #6b7280;
150
- }
151
-
152
- .package-price {
153
- font-size: 16px;
154
- font-weight: 600;
155
- }
156
-
157
- .payment-row {
158
- display: flex;
159
- justify-content: space-between;
160
- padding: 8px 0;
161
- font-size: 14px;
162
- }
163
-
164
- .payment-label {
165
- color: #6b7280;
166
- }
167
-
168
- .payment-value {
169
- font-weight: 500;
170
- }
171
-
172
- .payment-value.green {
173
- color: #16a34a;
174
- }
175
-
176
- .payment-value.orange {
177
- color: #ea580c;
178
- }
179
-
180
- .payment-divider {
181
- border-top: 1px solid #e5e7eb;
182
- margin: 12px 0;
183
- }
184
-
185
- .payment-total {
186
- font-size: 16px;
187
- font-weight: 600;
188
- }
189
-
190
- .footer {
191
- margin-top: 60px;
192
- padding-top: 20px;
193
- border-top: 1px solid #e5e7eb;
194
- text-align: center;
195
- font-size: 12px;
196
- color: #9ca3af;
197
- }
198
-
199
- @media print {
200
- body {
201
- padding: 20px;
202
- }
203
-
204
- .no-print {
205
- display: none;
206
- }
207
- }
208
- </style>
209
- </head>
210
- <body>
211
- <div class="header">
212
- <div class="company-info">
213
- ${t.companyLogo?`<img src="${t.companyLogo}" alt="Logo" class="company-logo" />`:""}
214
- ${t.companyName?`<span class="company-name">${t.companyName}</span>`:""}
215
- </div>
216
- <div class="document-info">
217
- <div class="document-title">Reservation</div>
218
- <div class="booking-id">Booking #${s}</div>
219
- <div
220
- class="status-badge"
221
- style="background-color: ${ve(o.status)}20; color: ${ve(o.status)};"
222
- >
223
- ${_t(o.status)}
224
- </div>
225
- </div>
226
- </div>
227
-
228
- <div class="section">
229
- <div class="section-title">Customer</div>
230
- <div class="section-content">
231
- <div class="customer-name">${n}</div>
232
- <div class="contact-info">
233
- ${o.customerInfo?.email?`<div>Email: <a href="mailto:${o.customerInfo.email}">${o.customerInfo.email}</a></div>`:""}
234
- ${o.customerInfo?.phone?`<div>Phone: <a href="tel:${o.customerInfo.phone}">${o.customerInfo.phone}</a></div>`:""}
235
- </div>
236
- </div>
237
- </div>
238
-
239
- <div class="section">
240
- <div class="section-title">Reservation Details</div>
241
- <div class="grid">
242
- <div class="info-card">
243
- <div class="info-label">Date</div>
244
- <div class="info-value">${t.date||"—"}</div>
245
- </div>
246
- <div class="info-card">
247
- <div class="info-label">Time</div>
248
- <div class="info-value">${o.startTime} - ${o.endTime}</div>
249
- </div>
250
- <div class="info-card">
251
- <div class="info-label">Spots</div>
252
- <div class="info-value">${o.spots||1} ${(o.spots||1)===1?"person":"people"}</div>
253
- </div>
254
- ${t.resourceName?`
255
- <div class="info-card">
256
- <div class="info-label">Resource</div>
257
- <div class="info-value">${t.resourceName}</div>
258
- </div>
259
- `:""}
260
- ${t.agendaName?`
261
- <div class="info-card">
262
- <div class="info-label">Service</div>
263
- <div class="info-value">${t.agendaName}</div>
264
- </div>
265
- `:""}
266
- </div>
267
- </div>
268
-
269
- ${o.pricingOption?`
270
- <div class="section">
271
- <div class="section-title">Package</div>
272
- <div class="section-content">
273
- <div class="package-row">
274
- <div>
275
- <div class="package-name">${o.pricingOption.name}</div>
276
- <div class="package-duration">${Ct(o.pricingOption.duration)}</div>
277
- </div>
278
- <div class="package-price">${L(o.pricingOption.price)}</div>
279
- </div>
280
- </div>
281
- </div>
282
- `:""}
283
-
284
- <div class="section">
285
- <div class="section-title">Payment Summary</div>
286
- <div class="section-content">
287
- <div class="payment-row">
288
- <span class="payment-label">Base price</span>
289
- <span class="payment-value">${L(o.reservationBasePrice)}</span>
290
- </div>
291
- ${o.reservationAddOnsPrice?`
292
- <div class="payment-row">
293
- <span class="payment-label">Add-ons</span>
294
- <span class="payment-value">${L(o.reservationAddOnsPrice)}</span>
295
- </div>
296
- `:""}
297
- ${o.discount?`
298
- <div class="payment-row">
299
- <span class="payment-label">Discount</span>
300
- <span class="payment-value green">-${L(o.discount)}</span>
301
- </div>
302
- `:""}
303
-
304
- <div class="payment-divider"></div>
305
-
306
- <div class="payment-row payment-total">
307
- <span>Reservation Total</span>
308
- <span>${L(o.reservationPrice)}</span>
309
- </div>
310
-
311
- ${o.amountPaid!==void 0||o.amountDue!==void 0?`
312
- <div class="payment-divider"></div>
313
-
314
- ${o.amountPaid!==void 0?`
315
- <div class="payment-row">
316
- <span class="payment-label">Amount paid</span>
317
- <span class="payment-value green">${L(o.amountPaid)}</span>
318
- </div>
319
- `:""}
320
-
321
- ${o.amountDue!==void 0&&o.amountDue>0?`
322
- <div class="payment-row">
323
- <span class="payment-label">Amount due</span>
324
- <span class="payment-value orange">${L(o.amountDue)}</span>
325
- </div>
326
- `:""}
327
- `:""}
328
- </div>
329
- </div>
330
-
331
- <div class="footer">
332
- <p>Generated on ${r}</p>
333
- ${t.companyName?`<p>${t.companyName}</p>`:""}
334
- </div>
335
- </body>
336
- </html>
337
- `,i=window.open("","_blank");i&&(i.document.write(l),i.document.close(),i.onload=()=>{i.print()})},Dt={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},yt={class:"grid gap-2"},Vt={class:"grid gap-2"},bt={class:"grid gap-2"},wt=e.defineComponent({__name:"CancelReservationDialog",emits:["confirm"],setup(o,{expose:t,emit:n}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=n,i=e.ref(!1),c=e.ref(!1),p=e.ref(""),a=e.ref(""),u=e.ref(""),f=v=>{c.value=!s.mailAccount,i.value=!0,v&&(p.value=v.customerInfo?.email,a.value="Cancellation of your reservation - "+new Date(v.date)?.toDateString(),u.value=`Dear ${v.customerInfo?.firstName??""} ${v.customerInfo?.lastName??""},
338
-
339
- We are writing to inform you that your reservation scheduled for ${new Date(v.date)?.toDateString()} at ${v.startTime} has been cancelled.
340
-
341
- Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`)},x=()=>{if(!c.value){if(!p.value||!a.value||!u.value)return alert("Please fill in all the fields.");r({to:p.value,subject:a.value,body:u.value})}i.value=!1;const{$confetti:v}=useNuxtApp();v(),l("confirm")};return t({openDialog:f}),(v,d)=>{const g=e.resolveComponent("DialogTitle"),V=e.resolveComponent("DialogDescription"),k=e.resolveComponent("DialogHeader"),w=e.resolveComponent("Checkbox"),N=e.resolveComponent("Label"),b=e.resolveComponent("Input"),M=e.resolveComponent("Textarea"),R=e.resolveComponent("Button"),F=e.resolveComponent("DialogFooter"),y=e.resolveComponent("DialogScrollContent"),E=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(E,{open:i.value,"onUpdate:open":d[5]||(d[5]=C=>i.value=C)},{default:e.withCtx(()=>[e.createVNode(y,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(k,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...d[6]||(d[6]=[e.createTextVNode(" Cancel Reservation ",-1)])]),_:1}),e.createVNode(V)]),_:1}),e.createElementVNode("div",Dt,[e.createVNode(w,{modelValue:c.value,"onUpdate:modelValue":d[0]||(d[0]=C=>c.value=C),id:"cancel-dialog-skip-mail",class:"border-black/80 dark:border-gray-200",disabled:!e.unref(s).mailAccount},null,8,["modelValue","disabled"]),e.createVNode(N,{for:"cancel-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...d[7]||(d[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":c.value}])},[e.createElementVNode("div",yt,[e.createVNode(N,{for:"cancel-dialog-email"},{default:e.withCtx(()=>[...d[8]||(d[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(b,{modelValue:p.value,"onUpdate:modelValue":d[1]||(d[1]=C=>p.value=C),disabled:c.value,id:"cancel-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Vt,[e.createVNode(N,{for:"cancel-dialog-subject"},{default:e.withCtx(()=>[...d[9]||(d[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(b,{modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=C=>a.value=C),disabled:c.value,id:"cancel-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",bt,[e.createVNode(N,{for:"cancel-dialog-body"},{default:e.withCtx(()=>[...d[10]||(d[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(M,{modelValue:u.value,"onUpdate:modelValue":d[3]||(d[3]=C=>u.value=C),disabled:c.value,id:"cancel-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode(R,{variant:"outline",onClick:d[4]||(d[4]=C=>i.value=!1)},{default:e.withCtx(()=>[...d[11]||(d[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(R,{variant:"destructive",onClick:x},{default:e.withCtx(()=>[...d[12]||(d[12]=[e.createTextVNode("Cancel reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Et=e.defineComponent({__name:"TransferReservationDialog",setup(o,{expose:t}){const{config:n}=T.useModule(),s=e.ref(!1);return t({openDialog:()=>{s.value=!0}}),(l,i)=>{const c=e.resolveComponent("DialogTitle"),p=e.resolveComponent("DialogDescription"),a=e.resolveComponent("DialogHeader"),u=e.resolveComponent("Button"),f=e.resolveComponent("DialogFooter"),x=e.resolveComponent("DialogScrollContent"),v=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(v,{open:s.value,"onUpdate:open":i[2]||(i[2]=d=>s.value=d)},{default:e.withCtx(()=>[e.createVNode(x,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[...i[3]||(i[3]=[e.createTextVNode(" Transfer Reservation ",-1)])]),_:1}),e.createVNode(p)]),_:1}),i[6]||(i[6]=e.createElementVNode("div",{class:"py-4"},null,-1)),e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(u,{variant:"outline",onClick:i[0]||(i[0]=d=>s.value=!1)},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(u,{onClick:i[1]||(i[1]=d=>s.value=!1)},{default:e.withCtx(()=>[...i[5]||(i[5]=[e.createTextVNode("Transfer reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),At={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},kt={class:"grid gap-2"},Bt={class:"grid gap-2"},Mt={class:"grid gap-2"},$t=e.defineComponent({__name:"ApproveReservationDialog",emits:["confirm"],setup(o,{expose:t,emit:n}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=n,i=e.ref(!1),c=e.ref("approve"),p=e.ref(!1),a=e.ref(""),u=e.ref(""),f=e.ref(""),x=(d,g)=>{p.value=!s.mailAccount,i.value=!0,d&&(g||(g="approve"),c.value=g,a.value=d.customerInfo?.email,u.value="Confirmation: Your reservation for "+new Date(d.date)?.toDateString(),f.value=`Dear ${d.customerInfo?.firstName??""} ${d.customerInfo?.lastName??""},
342
-
343
- This email confirms your reservation for ${new Date(d.date)?.toDateString()} at ${d.startTime}.
344
-
345
- We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`)},v=()=>{if(!p.value){if(!a.value||!u.value||!f.value)return alert("Please fill in all the fields.");r({to:a.value,subject:u.value,body:f.value})}i.value=!1;const{$confetti:d}=useNuxtApp();d(),l("confirm")};return t({openDialog:x}),(d,g)=>{const V=e.resolveComponent("DialogTitle"),k=e.resolveComponent("DialogDescription"),w=e.resolveComponent("DialogHeader"),N=e.resolveComponent("Checkbox"),b=e.resolveComponent("Label"),M=e.resolveComponent("Input"),R=e.resolveComponent("Textarea"),F=e.resolveComponent("Button"),y=e.resolveComponent("DialogFooter"),E=e.resolveComponent("DialogScrollContent"),C=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(C,{open:i.value,"onUpdate:open":g[5]||(g[5]=A=>i.value=A)},{default:e.withCtx(()=>[e.createVNode(E,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(V,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value==="approve"?"Approve Reservation":"Resend Confirmation Email"),1)]),_:1}),e.createVNode(k)]),_:1}),e.createElementVNode("div",At,[e.createVNode(N,{modelValue:p.value,"onUpdate:modelValue":g[0]||(g[0]=A=>p.value=A),id:"reject-dialog-skip-mail",class:"border-black/80 dark:border-gray-200",disabled:!e.unref(s).mailAccount},null,8,["modelValue","disabled"]),e.createVNode(b,{for:"reject-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...g[6]||(g[6]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":p.value}])},[e.createElementVNode("div",kt,[e.createVNode(b,{for:"approve-dialog-email"},{default:e.withCtx(()=>[...g[7]||(g[7]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(M,{modelValue:a.value,"onUpdate:modelValue":g[1]||(g[1]=A=>a.value=A),disabled:p.value,id:"approve-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Bt,[e.createVNode(b,{for:"approve-dialog-subject"},{default:e.withCtx(()=>[...g[8]||(g[8]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(M,{modelValue:u.value,"onUpdate:modelValue":g[2]||(g[2]=A=>u.value=A),disabled:p.value,id:"approve-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Mt,[e.createVNode(b,{for:"approve-dialog-body"},{default:e.withCtx(()=>[...g[9]||(g[9]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(R,{modelValue:f.value,"onUpdate:modelValue":g[3]||(g[3]=A=>f.value=A),disabled:p.value,id:"approve-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(F,{variant:"outline",onClick:g[4]||(g[4]=A=>i.value=!1)},{default:e.withCtx(()=>[...g[10]||(g[10]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(F,{onClick:v},{default:e.withCtx(()=>[...g[11]||(g[11]=[e.createTextVNode("Approve reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),St={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},Ft={class:"grid gap-2"},Rt={class:"grid gap-2"},Tt={class:"grid gap-2"},It=e.defineComponent({__name:"RejectReservationDialog",emits:["confirm"],setup(o,{expose:t,emit:n}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=n,i=e.ref(!1),c=e.ref(!1),p=e.ref(""),a=e.ref(""),u=e.ref(""),f=v=>{c.value=!s.mailAccount,i.value=!0,v&&(p.value=v.customerInfo?.email,a.value="Regarding your reservation request for "+new Date(v.date)?.toDateString(),u.value=`Dear ${v.customerInfo?.firstName??""} ${v.customerInfo?.lastName??""},
346
-
347
- Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(v.date)?.toDateString()} at ${v.startTime}.
348
-
349
- We would love to see you another time!`)},x=()=>{if(!c.value){if(!p.value||!a.value||!u.value)return alert("Please fill in all the fields.");r({to:p.value,subject:a.value,body:u.value})}i.value=!1;const{$confetti:v}=useNuxtApp();v(),l("confirm")};return t({openDialog:f}),(v,d)=>{const g=e.resolveComponent("DialogTitle"),V=e.resolveComponent("DialogDescription"),k=e.resolveComponent("DialogHeader"),w=e.resolveComponent("Checkbox"),N=e.resolveComponent("Label"),b=e.resolveComponent("Input"),M=e.resolveComponent("Textarea"),R=e.resolveComponent("Button"),F=e.resolveComponent("DialogFooter"),y=e.resolveComponent("DialogScrollContent"),E=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(E,{open:i.value,"onUpdate:open":d[5]||(d[5]=C=>i.value=C)},{default:e.withCtx(()=>[e.createVNode(y,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(k,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...d[6]||(d[6]=[e.createTextVNode(" Reject Reservation Request ",-1)])]),_:1}),e.createVNode(V)]),_:1}),e.createElementVNode("div",St,[e.createVNode(w,{modelValue:c.value,"onUpdate:modelValue":d[0]||(d[0]=C=>c.value=C),id:"reject-dialog-skip-mail",class:"border-black/80 dark:border-gray-200",disabled:!e.unref(s).mailAccount},null,8,["modelValue","disabled"]),e.createVNode(N,{for:"reject-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...d[7]||(d[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":c.value}])},[e.createElementVNode("div",Ft,[e.createVNode(N,{for:"reject-dialog-email"},{default:e.withCtx(()=>[...d[8]||(d[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(b,{modelValue:p.value,"onUpdate:modelValue":d[1]||(d[1]=C=>p.value=C),disabled:c.value,id:"reject-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Rt,[e.createVNode(N,{for:"reject-dialog-subject"},{default:e.withCtx(()=>[...d[9]||(d[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(b,{modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=C=>a.value=C),disabled:c.value,id:"reject-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Tt,[e.createVNode(N,{for:"reject-dialog-body"},{default:e.withCtx(()=>[...d[10]||(d[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(M,{modelValue:u.value,"onUpdate:modelValue":d[3]||(d[3]=C=>u.value=C),disabled:c.value,id:"reject-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode(R,{variant:"outline",onClick:d[4]||(d[4]=C=>i.value=!1)},{default:e.withCtx(()=>[...d[11]||(d[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(R,{variant:"destructive",onClick:x},{default:e.withCtx(()=>[...d[12]||(d[12]=[e.createTextVNode("Reject reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),jt={key:0,class:"space-y-6 py-4"},Ot={class:"space-y-3"},Lt={class:"bg-muted/30 rounded-lg p-4 space-y-3"},Pt={class:"flex items-center gap-3"},zt={class:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center"},Ut={class:"font-medium"},Ht={class:"grid gap-2 text-sm"},Wt={key:0,class:"flex items-center gap-2 text-muted-foreground"},Kt=["href"],Gt={key:1,class:"flex items-center gap-2 text-muted-foreground"},Yt=["href"],Qt={class:"space-y-3"},Jt={class:"grid grid-cols-2 gap-3"},Xt={class:"bg-muted/30 rounded-lg p-3"},Zt={class:"flex items-center gap-2 text-muted-foreground mb-1"},qt={class:"font-medium"},eo={class:"bg-muted/30 rounded-lg p-3"},to={class:"flex items-center gap-2 text-muted-foreground mb-1"},oo={class:"font-medium"},no={key:0,class:"space-y-3"},so={class:"bg-muted/30 rounded-lg p-4"},ao={class:"flex items-start justify-between"},ro={class:"flex items-start gap-3"},io={class:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5"},lo={class:"font-medium"},co={class:"text-sm text-muted-foreground"},uo={class:"font-semibold"},po={class:"space-y-3"},mo={class:"bg-muted/30 rounded-lg p-4 space-y-3"},fo={class:"space-y-2 text-sm"},vo={class:"flex justify-between"},go={key:0,class:"flex justify-between"},ho={key:1,class:"flex justify-between text-green-600 dark:text-green-400"},xo={class:"flex justify-between font-semibold"},Co={key:1,class:"space-y-2 text-sm"},_o={key:0,class:"flex justify-between"},No={class:"text-muted-foreground flex items-center gap-1.5"},Do={class:"text-green-600 dark:text-green-400"},yo={key:1,class:"flex justify-between"},Vo={class:"text-muted-foreground flex items-center gap-1.5"},bo={class:"text-orange-600 dark:text-orange-400 font-medium"},wo=e.defineComponent({__name:"ReservationDetailDialog",emits:["cancelled","confirmed","rejected"],setup(o,{expose:t,emit:n}){const{hasPermission:s}=T.useModulePermissions(),{config:r}=T.useModule(),l=T.useFirebaseIntegration(r.project),i=e.inject("event",e.ref(null)),c=n,p=e.ref(!1),a=e.ref(null),u=e.ref(!1),f=e.useTemplateRef("cancelReservationDialog"),x=e.useTemplateRef("approveReservationDialog"),v=e.useTemplateRef("rejectReservationDialog"),d=e.useTemplateRef("transferReservationDialog"),g=_=>{a.value=_,p.value=!0},V=e.computed(()=>a.value?.customerInfo&&`${a.value.customerInfo.firstName} ${a.value.customerInfo.lastName}`.trim()||"Unknown Customer"),k=e.computed(()=>{let _=a.value?.status;const m=a.value?.reservationStatus;switch(["needs_approval","rejected","approved","cancelled"].includes(m)&&(_=m),_){case"needs_approval":return{label:"Needs Approval",class:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"};case"rejected":return{label:"Rejected",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};case"approved":return{label:"Approved",class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"};case"pending":return{label:"Pending",class:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"};case"cancelled":return{label:"Cancelled",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};default:return{label:_||"Unknown",class:"bg-muted text-muted-foreground"}}}),w=e.computed(()=>a.value?.status==="cancelled"),N=_=>_==null||typeof _!="number"?"—":`€${_?.toFixed(2)}`,b=_=>{if(!_)return"—";if(_<60)return`${_} min`;const m=Math.floor(_/60),D=_%60;return D>0?`${m}h ${D}min`:`${m}h`},M=()=>{if(!a.value)return;let _="";const m=i?.value?.date;if(m)try{_=new Date(m).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}catch{_=m}const D={date:_,resourceName:i?.value?.resource?.name};Nt(a.value,D)},R=()=>{x.value?.openDialog(a.value)},F=()=>{v.value?.openDialog(a.value)},y=()=>{x.value?.openDialog(a.value)},E=()=>{f.value?.openDialog(a.value)},C=async()=>{try{if(u.value||!a.value?.id)throw new Error("Invalid state");u.value=!0;let m=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!m.find(D=>D.id===a.value.res_id))throw new Error("Reservation not found");m.find(D=>D.id===a.value.res_id).status="cancelled",await l.update(r.reservationsCollection,a.value.id,{reservations:m}),a.value.status="cancelled",H.toast.success("Reservation cancelled successfully"),c("cancelled"),p.value=!1}catch(_){console.error("Error cancelling reservation:",_),H.toast.error("Failed to cancel reservation")}finally{u.value=!1}},A=async()=>{try{if(u.value||!a.value?.id)throw new Error("Invalid state");u.value=!0;let m=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!m.find(D=>D.id===a.value.res_id))throw new Error("Reservation not found");m.find(D=>D.id===a.value.res_id).status="approved",await l.update(r.reservationsCollection,a.value.id,{reservations:m}),a.value.status="approved",H.toast.success("Reservation approved successfully"),c("confirmed"),p.value=!1}catch(_){console.error("Error approving reservation:",_),H.toast.error("Failed to approve reservation")}finally{u.value=!1}},W=async()=>{try{if(u.value||!a.value?.id)throw new Error("Invalid state");u.value=!0;let m=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!m.find(D=>D.id===a.value.res_id))throw new Error("Reservation not found");m.find(D=>D.id===a.value.res_id).status="rejected",await l.update(r.reservationsCollection,a.value.id,{reservations:m}),a.value.status="rejected",H.toast.success("Reservation rejected successfully"),c("rejected"),p.value=!1}catch(_){console.error("Error rejecting reservation:",_),H.toast.error("Failed to reject reservation")}finally{u.value=!1}},I=()=>{};return t({openDialog:g}),(_,m)=>{const D=e.resolveComponent("DialogTitle"),U=e.resolveComponent("DialogDescription"),we=e.resolveComponent("DialogHeader"),ie=e.resolveComponent("Separator"),J=e.resolveComponent("Button"),Ee=e.resolveComponent("DropdownMenuTrigger"),X=e.resolveComponent("DropdownMenuLabel"),K=e.resolveComponent("DropdownMenuItem"),Z=e.resolveComponent("DropdownMenuGroup"),le=e.resolveComponent("DropdownMenuSeparator"),Ae=e.resolveComponent("DropdownMenuContent"),ke=e.resolveComponent("DropdownMenu"),Be=e.resolveComponent("DialogFooter"),Me=e.resolveComponent("DialogScrollContent"),$e=e.resolveComponent("Dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode($e,{open:p.value,"onUpdate:open":m[0]||(m[0]=Se=>p.value=Se)},{default:e.withCtx(()=>[e.createVNode(Me,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(we,null,{default:e.withCtx(()=>[e.createVNode(D,{class:"flex items-center gap-3"},{default:e.withCtx(()=>[m[1]||(m[1]=e.createElementVNode("span",null,"Reservation Details",-1)),e.createElementVNode("span",{class:e.normalizeClass(["px-2.5 py-1 text-xs font-medium rounded-full",k.value.class])},e.toDisplayString(k.value.label),3)]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createTextVNode(" Booking #"+e.toDisplayString(a.value?.id?.slice(0,8)||"—"),1)]),_:1})]),_:1}),a.value?(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("div",Ot,[m[2]||(m[2]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Customer",-1)),e.createElementVNode("div",Lt,[e.createElementVNode("div",Pt,[e.createElementVNode("div",zt,[e.createVNode(e.unref(B.User),{size:20,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",Ut,e.toDisplayString(V.value),1)])]),e.createElementVNode("div",Ht,[a.value.customerInfo?.email?(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(e.unref(B.Mail),{size:14}),e.createElementVNode("a",{href:`mailto:${a.value.customerInfo.email}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(a.value.customerInfo.email),9,Kt)])):e.createCommentVNode("",!0),a.value.customerInfo?.phone?(e.openBlock(),e.createElementBlock("div",Gt,[e.createVNode(e.unref(B.Phone),{size:14}),e.createElementVNode("a",{href:`tel:${a.value.customerInfo.phone}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(a.value.customerInfo.phone),9,Yt)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Qt,[m[5]||(m[5]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Reservation",-1)),e.createElementVNode("div",Jt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Zt,[e.createVNode(e.unref(B.Clock),{size:14}),m[3]||(m[3]=e.createElementVNode("span",{class:"text-xs"},"Time",-1))]),e.createElementVNode("p",qt,e.toDisplayString(a.value.startTime)+" - "+e.toDisplayString(a.value.endTime),1)]),e.createElementVNode("div",eo,[e.createElementVNode("div",to,[e.createVNode(e.unref(B.Users),{size:14}),m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs"},"Spots",-1))]),e.createElementVNode("p",oo,e.toDisplayString(a.value.spots||1)+" "+e.toDisplayString(a.value.spots===1?"person":"people"),1)])])]),a.value.pricingOption?(e.openBlock(),e.createElementBlock("div",no,[m[6]||(m[6]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Package",-1)),e.createElementVNode("div",so,[e.createElementVNode("div",ao,[e.createElementVNode("div",ro,[e.createElementVNode("div",io,[e.createVNode(e.unref(B.Tag),{size:18,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",lo,e.toDisplayString(a.value.pricingOption.name),1),e.createElementVNode("p",co,e.toDisplayString(b(a.value.pricingOption.duration)),1)])]),e.createElementVNode("p",uo,e.toDisplayString(N(a.value.pricingOption.price)),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",po,[m[13]||(m[13]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Payment",-1)),e.createElementVNode("div",mo,[e.createElementVNode("div",fo,[e.createElementVNode("div",vo,[m[7]||(m[7]=e.createElementVNode("span",{class:"text-muted-foreground"},"Base price",-1)),e.createElementVNode("span",null,e.toDisplayString(N(a.value.reservationBasePrice)),1)]),a.value.reservationAddOnsPrice?(e.openBlock(),e.createElementBlock("div",go,[m[8]||(m[8]=e.createElementVNode("span",{class:"text-muted-foreground"},"Add-ons",-1)),e.createElementVNode("span",null,e.toDisplayString(N(a.value.reservationAddOnsPrice)),1)])):e.createCommentVNode("",!0),a.value.discount?(e.openBlock(),e.createElementBlock("div",ho,[m[9]||(m[9]=e.createElementVNode("span",null,"Discount",-1)),e.createElementVNode("span",null,"-"+e.toDisplayString(N(a.value.discount)),1)])):e.createCommentVNode("",!0)]),e.createVNode(ie),e.createElementVNode("div",xo,[m[10]||(m[10]=e.createElementVNode("span",null,"Reservation Total",-1)),e.createElementVNode("span",null,e.toDisplayString(N(a.value.reservationPrice)),1)]),a.value.amountPaid!==void 0||a.value.amountDue!==void 0?(e.openBlock(),e.createBlock(ie,{key:0})):e.createCommentVNode("",!0),a.value.amountPaid!==void 0||a.value.amountDue!==void 0?(e.openBlock(),e.createElementBlock("div",Co,[a.value.amountPaid!==void 0?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("span",No,[e.createVNode(e.unref(B.CreditCard),{size:14}),m[11]||(m[11]=e.createTextVNode(" Amount paid ",-1))]),e.createElementVNode("span",Do,e.toDisplayString(N(a.value.amountPaid)),1)])):e.createCommentVNode("",!0),a.value.amountDue!==void 0&&a.value.amountDue>0?(e.openBlock(),e.createElementBlock("div",yo,[e.createElementVNode("span",Vo,[e.createVNode(e.unref(B.Receipt),{size:14}),m[12]||(m[12]=e.createTextVNode(" Amount due ",-1))]),e.createElementVNode("span",bo,e.toDisplayString(N(a.value.amountDue)),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createVNode(Be,{class:"gap-2 sm:justify-between"},{default:e.withCtx(()=>[a.value.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(J,{variant:"destructive",onClick:F},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Ban),{size:16}),m[14]||(m[14]=e.createTextVNode(" Reject Reservation ",-1))]),_:1}),e.createVNode(J,{onClick:R},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ClockCheck),{size:16}),m[15]||(m[15]=e.createTextVNode(" Approve Reservation ",-1))]),_:1})],64)):a.value.reservationStatus==="approved"?(e.openBlock(),e.createBlock(ke,{key:1},{default:e.withCtx(()=>[e.createVNode(Ee,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(J,{variant:"outline",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.MoreHorizontal),{size:16}),m[16]||(m[16]=e.createTextVNode(" Actions ",-1))]),_:1})]),_:1}),e.createVNode(Ae,{class:"w-60",align:"start"},{default:e.withCtx(()=>[e.createVNode(X,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[17]||(m[17]=[e.createTextVNode(" Reservation Actions ",-1)])]),_:1}),e.createVNode(Z,null,{default:e.withCtx(()=>[e.createVNode(K,{onClick:M,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Download),{size:16,class:"text-muted-foreground"}),m[18]||(m[18]=e.createElementVNode("span",null,"Download PDF",-1))]),_:1})]),_:1}),e.createVNode(le),e.createVNode(Z,null,{default:e.withCtx(()=>[e.createVNode(X,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[19]||(m[19]=[e.createTextVNode(" Communication ",-1)])]),_:1}),e.createVNode(K,{onClick:y,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.MailCheck),{size:16,class:"text-muted-foreground"}),m[20]||(m[20]=e.createElementVNode("span",null,"(Re)send Confirmation Mail",-1))]),_:1})]),_:1}),e.unref(s)("manage-reservations")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(le),e.createVNode(Z,null,{default:e.withCtx(()=>[e.createVNode(X,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[21]||(m[21]=[e.createTextVNode(" Cancellation ",-1)])]),_:1}),e.createVNode(K,{onClick:E,class:"gap-2 cursor-pointer",variant:"destructive",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(B.XCircle),{size:16}),m[22]||(m[22]=e.createElementVNode("span",null,"Cancel Reservation",-1))]),_:1},8,["disabled"]),a.value?.reservationPrice&&a.value.reservationPrice>0?(e.openBlock(),e.createBlock(K,{key:0,onClick:I,class:"gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Gift),{class:"text-inherit",size:16}),m[23]||(m[23]=e.createElementVNode("span",null,"Cancel & Send Coupon",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})],64)):e.createCommentVNode("",!0)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["open"]),e.createVNode(wt,{ref_key:"cancelReservationDialog",ref:f,onConfirm:C},null,512),e.createVNode($t,{ref_key:"approveReservationDialog",ref:x,onConfirm:A},null,512),e.createVNode(It,{ref_key:"rejectReservationDialog",ref:v,onConfirm:W},null,512),e.createVNode(Et,{ref_key:"transferReservationDialog",ref:d},null,512)],64)}}});exports.Fuse=z;exports._sfc_main=wo;