@oneclick.dev/cms-core-modules 0.0.101 → 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.
- package/dist/Acquisition-Br1Pfny3.js +1 -0
- package/dist/{Acquisition-BJXNY4ko.mjs → Acquisition-CPlZzUBo.mjs} +40 -40
- package/dist/Audience-BfkrmBuQ.js +1 -0
- package/dist/{Audience-CIzVtUvV.mjs → Audience-DTblSAiL.mjs} +89 -89
- package/dist/Content-BHr_rPVY.js +1 -0
- package/dist/{Content-CWhjurn_.mjs → Content-CYOZKvWK.mjs} +56 -56
- package/dist/Overview-BrCwozey.js +1 -0
- package/dist/{Overview-CGo4jaaA.mjs → Overview-kaMhsIUq.mjs} +21 -21
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +2782 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +349 -0
- package/dist/SeoHealth-09sEOu3G.js +1 -0
- package/dist/{SeoHealth-DVFDz3em.mjs → SeoHealth-BzcWd_w7.mjs} +29 -29
- package/dist/{agenda-DMT75Qfo.mjs → agenda-CCOjPiwP.mjs} +1 -1
- package/dist/{agenda-DxD4RMsy.js → agenda-CNPQfaIQ.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{index-BbqRTXuU.js → index-BOnqrBfY.js} +1 -1
- package/dist/{index-D4GsbUId.mjs → index-Bj0qaL1N.mjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +8 -8
- package/dist/{orders-BRfXlWgV.mjs → orders-BJV5vRQr.mjs} +1 -1
- package/dist/{orders-CrCz1WTR.js → orders-C1C5IEIP.js} +1 -1
- package/package.json +2 -2
- package/dist/Acquisition-DPScJD4t.js +0 -1
- package/dist/Audience-Csw1QLmw.js +0 -1
- package/dist/Content-dYr7kYT0.js +0 -1
- package/dist/Overview-DBu86Ikb.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +0 -349
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs +0 -2383
- package/dist/SeoHealth-DzftZW1m.js +0 -1
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),M=require("lucide-vue-next"),T=require("@oneclick.dev/cms-kit"),W=require("./index-ijdf0d9-.js");function j(n){return Array.isArray?Array.isArray(n):Ne(n)==="[object Array]"}function je(n){if(typeof n=="string")return n;if(typeof n=="bigint")return n.toString();const t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function te(n){return n==null?"":je(n)}function B(n){return typeof n=="string"}function Q(n){return typeof n=="number"}function Oe(n){return n===!0||n===!1||Le(n)&&Ne(n)=="[object Boolean]"}function De(n){return typeof n=="object"}function Le(n){return De(n)&&n!==null}function S(n){return n!=null}function Y(n){return!n.trim().length}function Ne(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const ze="Incorrect 'index' type",Pe=n=>`Invalid value for key ${n}`,Ue=n=>`Pattern length exceeds max of ${n}.`,We=n=>`Missing ${n} property in key`,He=n=>`Property 'weight' in key '${n}' must be a positive integer`,he=Object.prototype.hasOwnProperty;class Ke{constructor(t){this._keys=[],this._keyMap={};let o=0;t.forEach(s=>{const r=be(s);this._keys.push(r),this._keyMap[r.id]=r,o+=r.weight}),this._keys.forEach(s=>{s.weight/=o})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function be(n){let t=null,o=null,s=null,r=1,l=null;if(B(n)||j(n))s=n,t=ge(n),o=oe(n);else{if(!he.call(n,"name"))throw new Error(We("name"));const i=n.name;if(s=i,he.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(He(i));t=ge(i),o=oe(i),l=n.getFn}return{path:t,id:o,weight:r,src:s,getFn:l}}function ge(n){return j(n)?n:n.split(".")}function oe(n){return j(n)?n.join("."):n}function Ge(n,t){const o=[];let s=!1;const r=(l,i,d,u)=>{if(S(l))if(!i[d])o.push(u!==void 0?{v:l,i:u}:l);else{const a=i[d],c=l[a];if(!S(c))return;if(d===i.length-1&&(B(c)||Q(c)||Oe(c)||typeof c=="bigint"))o.push(u!==void 0?{v:te(c),i:u}:te(c));else if(j(c)){s=!0;for(let h=0,v=c.length;h<v;h+=1)r(c[h],i,d+1,h)}else i.length&&r(c,i,d+1,u)}};return r(n,B(t)?t.split("."):t,0),s?o:o[0]}const Ye={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Qe={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,t)=>n.score===t.score?n.idx<t.idx?-1:1:n.score<t.score?-1:1},Je={location:0,threshold:.6,distance:100},Xe={useExtendedSearch:!1,useTokenSearch:!1,getFn:Ge,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},x=Object.freeze({...Qe,...Ye,...Je,...Xe}),Ze=/[^ ]+/g;function qe(n=1,t=3){const o=new Map,s=Math.pow(10,t);return{get(r){const l=r.match(Ze).length;if(o.has(l))return o.get(l);const i=1/Math.pow(l,.5*n),d=parseFloat(Math.round(i*s)/s);return o.set(l,d),d},clear(){o.clear()}}}class ce{constructor({getFn:t=x.getFn,fieldNormWeight:o=x.fieldNormWeight}={}){this.norm=qe(o,3),this.getFn=t,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((o,s)=>{this._keysMap[o.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,B(this.docs[0])?this.docs.forEach((t,o)=>{this._addString(t,o)}):this.docs.forEach((t,o)=>{this._addObject(t,o)}),this.norm.clear())}add(t){const o=this.size();B(t)?this._addString(t,o):this._addObject(t,o)}removeAt(t){this.records.splice(t,1);for(let o=t,s=this.size();o<s;o+=1)this.records[o].i-=1}removeAll(t){for(let o=t.length-1;o>=0;o-=1)this.records.splice(t[o],1);for(let o=0,s=this.records.length;o<s;o+=1)this.records[o].i=o}getValueForItemAtKeyId(t,o){return t[this._keysMap[o]]}size(){return this.records.length}_addString(t,o){if(!S(t)||Y(t))return;const s={v:t,i:o,n:this.norm.get(t)};this.records.push(s)}_addObject(t,o){const s={i:o,$:{}};this.keys.forEach((r,l)=>{const i=r.getFn?r.getFn(t):this.getFn(t,r.path);if(S(i)){if(j(i)){const d=[];for(let u=0,a=i.length;u<a;u+=1){const c=i[u];if(S(c)){if(B(c)){if(!Y(c)){const h={v:c,i:u,n:this.norm.get(c)};d.push(h)}}else if(S(c.v)){const h=B(c.v)?c.v:te(c.v);if(!Y(h)){const v={v:h,i:c.i,n:this.norm.get(h)};d.push(v)}}}}s.$[l]=d}else if(B(i)&&!Y(i)){const d={v:i,n:this.norm.get(i)};s.$[l]=d}}}),this.records.push(s)}toJSON(){return{keys:this.keys.map(({getFn:t,...o})=>o),records:this.records}}}function Ve(n,t,{getFn:o=x.getFn,fieldNormWeight:s=x.fieldNormWeight}={}){const r=new ce({getFn:o,fieldNormWeight:s});return r.setKeys(n.map(be)),r.setSources(t),r.create(),r}function et(n,{getFn:t=x.getFn,fieldNormWeight:o=x.fieldNormWeight}={}){const{keys:s,records:r}=n,l=new ce({getFn:t,fieldNormWeight:o});return l.setKeys(s),l.setIndexRecords(r),l}function tt(n=[],t=x.minMatchCharLength){const o=[];let s=-1,r=-1,l=0;for(let i=n.length;l<i;l+=1){const d=n[l];d&&s===-1?s=l:!d&&s!==-1&&(r=l-1,r-s+1>=t&&o.push([s,r]),s=-1)}return n[l-1]&&l-s>=t&&o.push([s,l-1]),o}const P=32;function ot(n,t,o,{location:s=x.location,distance:r=x.distance,threshold:l=x.threshold,findAllMatches:i=x.findAllMatches,minMatchCharLength:d=x.minMatchCharLength,includeMatches:u=x.includeMatches,ignoreLocation:a=x.ignoreLocation}={}){if(t.length>P)throw new Error(Ue(P));const c=t.length,h=n.length,v=Math.max(0,Math.min(s,h));let f=l,m=v;const g=(b,k)=>{const C=b/c;if(a)return C;const A=Math.abs(v-k);return r?C+A/r:A?1:C},_=d>1||u,w=_?Array(h):[];let E;for(;(E=n.indexOf(t,m))>-1;){const b=g(0,E);if(f=Math.min(b,f),m=E+c,_){let k=0;for(;k<c;)w[E+k]=1,k+=1}}m=-1;let D=[],V=1,I=c+h;const F=1<<c-1;for(let b=0;b<c;b+=1){let k=0,C=I;for(;k<C;)g(b,v+C)<=f?k=C:I=C,C=Math.floor((I-k)/2+k);I=C;let A=Math.max(1,v-C+1);const H=i?h:Math.min(v+C,h)+c,R=Array(H+2);R[H+1]=(1<<b)-1;for(let p=H;p>=A;p-=1){const N=p-1,U=o[n[N]];if(_&&(w[N]=+!!U),R[p]=(R[p+1]<<1|1)&U,b&&(R[p]|=(D[p+1]|D[p])<<1|1|D[p+1]),R[p]&F&&(V=g(b,N),V<=f)){if(f=V,m=N,m<=v)break;A=Math.max(1,2*v-m)}}if(g(b+1,v)>f)break;D=R}const $={isMatch:m>=0,score:Math.max(.001,V)};if(_){const b=tt(w,d);b.length?u&&($.indices=b):$.isMatch=!1}return $}function nt(n){const t={};for(let o=0,s=n.length;o<s;o+=1){const r=n.charAt(o);t[r]=(t[r]||0)|1<<s-o-1}return t}function ue(n){if(n.length<=1)return n;n.sort((o,s)=>o[0]-s[0]||o[1]-s[1]);const t=[n[0]];for(let o=1,s=n.length;o<s;o+=1){const r=t[t.length-1],l=n[o];l[0]<=r[1]+1?r[1]=Math.max(r[1],l[1]):t.push(l)}return t}const we={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},st=new RegExp("["+Object.keys(we).join("")+"]","g"),K=String.prototype.normalize?n=>n.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,"").replace(st,t=>we[t]):n=>n;class de{constructor(t,{location:o=x.location,threshold:s=x.threshold,distance:r=x.distance,includeMatches:l=x.includeMatches,findAllMatches:i=x.findAllMatches,minMatchCharLength:d=x.minMatchCharLength,isCaseSensitive:u=x.isCaseSensitive,ignoreDiacritics:a=x.ignoreDiacritics,ignoreLocation:c=x.ignoreLocation}={}){if(this.options={location:o,threshold:s,distance:r,includeMatches:l,findAllMatches:i,minMatchCharLength:d,isCaseSensitive:u,ignoreDiacritics:a,ignoreLocation:c},t=u?t:t.toLowerCase(),t=a?K(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const h=(f,m)=>{this.chunks.push({pattern:f,alphabet:nt(f),startIndex:m})},v=this.pattern.length;if(v>P){let f=0;const m=v%P,g=v-m;for(;f<g;)h(this.pattern.substr(f,P),f),f+=P;if(m){const _=v-P;h(this.pattern.substr(_),_)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:o,ignoreDiacritics:s,includeMatches:r}=this.options;if(t=o?t:t.toLowerCase(),t=s?K(t):t,this.pattern===t){const g={isMatch:!0,score:0};return r&&(g.indices=[[0,t.length-1]]),g}const{location:l,distance:i,threshold:d,findAllMatches:u,minMatchCharLength:a,ignoreLocation:c}=this.options,h=[];let v=0,f=!1;this.chunks.forEach(({pattern:g,alphabet:_,startIndex:w})=>{const{isMatch:E,score:D,indices:V}=ot(t,g,_,{location:l+w,distance:i,threshold:d,findAllMatches:u,minMatchCharLength:a,includeMatches:r,ignoreLocation:c});E&&(f=!0),v+=D,E&&V&&h.push(...V)});const m={isMatch:f,score:f?v/this.chunks.length:1};return f&&r&&(m.indices=ue(h)),m}}class O{constructor(t){this.pattern=t}static isMultiMatch(t){return ve(t,this.multiRegex)}static isSingleMatch(t){return ve(t,this.singleRegex)}search(t){return{isMatch:!1,score:1}}}function ve(n,t){const o=n.match(t);return o?o[1]:null}class rt extends O{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const o=t===this.pattern;return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class at 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 it extends O{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const o=t.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class lt extends O{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const o=!t.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,t.length-1]}}}class ct extends O{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const o=t.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class ut extends O{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const o=!t.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,t.length-1]}}}class Ee extends O{constructor(t,{location:o=x.location,threshold:s=x.threshold,distance:r=x.distance,includeMatches:l=x.includeMatches,findAllMatches:i=x.findAllMatches,minMatchCharLength:d=x.minMatchCharLength,isCaseSensitive:u=x.isCaseSensitive,ignoreDiacritics:a=x.ignoreDiacritics,ignoreLocation:c=x.ignoreLocation}={}){super(t),this._bitapSearch=new de(t,{location:o,threshold:s,distance:r,includeMatches:l,findAllMatches:i,minMatchCharLength:d,isCaseSensitive:u,ignoreDiacritics:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ke extends O{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let o=0,s;const r=[],l=this.pattern.length;for(;(s=t.indexOf(this.pattern,o))>-1;)o=s+l,r.push([s,o-1]);const i=!!r.length;return{isMatch:i,score:i?0:1,indices:r}}}const ne=[rt,ke,it,lt,ut,ct,at,Ee],xe=ne.length,dt="\0",ft="|";function mt(n){const t=[],o=n.length;let s=0;for(;s<o;){for(;s<o&&n[s]===" ";)s++;if(s>=o)break;let r=s;for(;r<o&&n[r]!==" "&&n[r]!=='"';)r++;if(r<o&&n[r]==='"'){for(r++;r<o;){if(n[r]==='"'){const l=r+1;if(l>=o||n[l]===" "){r++;break}if(n[l]==="$"&&(l+1>=o||n[l+1]===" ")){r+=2;break}}r++}t.push(n.substring(s,r)),s=r}else{for(;r<o&&n[r]!==" ";)r++;t.push(n.substring(s,r)),s=r}}return t}function pt(n,t={}){return n.replace(/\\\|/g,dt).split(ft).map(s=>{const r=s.replace(/\u0000/g,"|"),l=mt(r.trim()).filter(d=>d&&!!d.trim()),i=[];for(let d=0,u=l.length;d<u;d+=1){const a=l[d];let c=!1,h=-1;for(;!c&&++h<xe;){const v=ne[h],f=v.isMultiMatch(a);f&&(i.push(new v(f,t)),c=!0)}if(!c)for(h=-1;++h<xe;){const v=ne[h],f=v.isSingleMatch(a);if(f){i.push(new v(f,t));break}}}return i})}const ht=new Set([Ee.type,ke.type]);class gt{constructor(t,{isCaseSensitive:o=x.isCaseSensitive,ignoreDiacritics:s=x.ignoreDiacritics,includeMatches:r=x.includeMatches,minMatchCharLength:l=x.minMatchCharLength,ignoreLocation:i=x.ignoreLocation,findAllMatches:d=x.findAllMatches,location:u=x.location,threshold:a=x.threshold,distance:c=x.distance}={}){this.query=null,this.options={isCaseSensitive:o,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:l,findAllMatches:d,ignoreLocation:i,location:u,threshold:a,distance:c},t=o?t:t.toLowerCase(),t=s?K(t):t,this.pattern=t,this.query=pt(this.pattern,this.options)}static condition(t,o){return o.useExtendedSearch}searchIn(t){const o=this.query;if(!o)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:l}=this.options;t=r?t:t.toLowerCase(),t=l?K(t):t;let i=0;const d=[];let u=0,a=!1;for(let c=0,h=o.length;c<h;c+=1){const v=o[c];d.length=0,i=0,a=!1;for(let f=0,m=v.length;f<m;f+=1){const g=v[f],{isMatch:_,indices:w,score:E}=g.search(t);if(_){i+=1,u+=E;const D=g.constructor.type;D.startsWith("inverse")&&(a=!0),s&&(ht.has(D)?d.push(...w):d.push(w))}else{u=0,i=0,d.length=0,a=!1;break}}if(i){const f={isMatch:!0,score:u/i};return a&&(f.hasInverse=!0),s&&(f.indices=ue(d)),f}}return{isMatch:!1,score:1}}}const se=[];function fe(...n){se.push(...n)}function J(n,t){for(let o=0,s=se.length;o<s;o+=1){const r=se[o];if(r.condition(n,t))return new r(n,t)}return new de(n,t)}const X={AND:"$and",OR:"$or"},re={PATH:"$path",PATTERN:"$val"},ae=n=>!!(n[X.AND]||n[X.OR]),vt=n=>!!n[re.PATH],xt=n=>!j(n)&&De(n)&&!ae(n),Ce=n=>({[X.AND]:Object.keys(n).map(t=>({[t]:n[t]}))});function Ae(n,t,{auto:o=!0}={}){const s=r=>{if(B(r)){const u={keyId:null,pattern:r};return o&&(u.searcher=J(r,t)),u}const l=Object.keys(r),i=vt(r);if(!i&&l.length>1&&!ae(r))return s(Ce(r));if(xt(r)){const u=i?r[re.PATH]:l[0],a=i?r[re.PATTERN]:r[u];if(!B(a))throw new Error(Pe(u));const c={keyId:oe(u),pattern:a};return o&&(c.searcher=J(a,t)),c}const d={children:[],operator:l[0]};return l.forEach(u=>{const a=r[u];j(a)&&a.forEach(c=>{d.children.push(s(c))})}),d};return ae(n)||(n=Ce(n)),s(n)}function ie(n,{ignoreFieldNorm:t=x.ignoreFieldNorm}){let o=1;return n.forEach(({key:s,norm:r,score:l})=>{const i=s?s.weight:null;o*=Math.pow(l===0&&i?Number.EPSILON:l,(i||1)*(t?1:r))}),o}function Ct(n,{ignoreFieldNorm:t=x.ignoreFieldNorm}){n.forEach(o=>{o.score=ie(o.matches,{ignoreFieldNorm:t})})}class _t{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 o=this.heap;for(;t>0;){const s=t-1>>1;if(o[t].score<=o[s].score)break;const r=o[t];o[t]=o[s],o[s]=r,t=s}}_sinkDown(t){const o=this.heap,s=o.length;let r=t;do{t=r;const l=2*t+1,i=2*t+2;if(l<s&&o[l].score>o[r].score&&(r=l),i<s&&o[i].score>o[r].score&&(r=i),r!==t){const d=o[t];o[t]=o[r],o[r]=d}}while(r!==t)}}function yt(n,t){const o=n.matches;t.matches=[],S(o)&&o.forEach(s=>{if(!S(s.indices)||!s.indices.length)return;const{indices:r,value:l}=s,i={indices:r,value:l};s.key&&(i.key=s.key.src),s.idx>-1&&(i.refIndex=s.idx),t.matches.push(i)})}function Dt(n,t){t.score=n.score}function Nt(n,t,{includeMatches:o=x.includeMatches,includeScore:s=x.includeScore}={}){const r=[];return o&&r.push(yt),s&&r.push(Dt),n.map(l=>{const{idx:i}=l,d={item:t[i],refIndex:i};return r.length&&r.forEach(u=>{u(l,d)}),d})}const bt=/\b\w+\b/g;function le({isCaseSensitive:n=!1,ignoreDiacritics:t=!1}={}){return{tokenize(o){return n||(o=o.toLowerCase()),t&&(o=K(o)),o.match(bt)||[]}}}function Vt(n,t,o){const s=new Map,r=new Map;let l=0;function i(d,u,a,c){const h=o.tokenize(d);if(!h.length)return;l++;const v=new Map;for(const f of h)v.set(f,(v.get(f)||0)+1);for(const[f,m]of v){const g={docIdx:u,keyIdx:a,subIdx:c,tf:m};let _=s.get(f);_||(_=[],s.set(f,_)),_.push(g),r.set(f,(r.get(f)||0)+1)}}for(const d of n){const{i:u,v:a,$:c}=d;if(a!==void 0){i(a,u,-1,-1);continue}if(c)for(let h=0;h<t;h++){const v=c[h];if(v)if(Array.isArray(v))for(const f of v)i(f.v,u,h,f.i??-1);else i(v.v,u,h,-1)}}return{terms:s,fieldCount:l,df:r}}function wt(n,t,o,s){const{i:r,v:l,$:i}=t;function d(u,a,c){const h=s.tokenize(u);if(!h.length)return;n.fieldCount++;const v=new Map;for(const f of h)v.set(f,(v.get(f)||0)+1);for(const[f,m]of v){const g={docIdx:r,keyIdx:a,subIdx:c,tf:m};let _=n.terms.get(f);_||(_=[],n.terms.set(f,_)),_.push(g),n.df.set(f,(n.df.get(f)||0)+1)}}if(l!==void 0){d(l,-1,-1);return}if(i)for(let u=0;u<o;u++){const a=i[u];if(a)if(Array.isArray(a))for(const c of a)d(c.v,u,c.i??-1);else d(a.v,u,-1)}}function _e(n,t){for(const[o,s]of n.terms){const r=s.filter(i=>i.docIdx!==t),l=s.length-r.length;l>0&&(n.fieldCount-=l,n.df.set(o,(n.df.get(o)||0)-l),r.length===0?(n.terms.delete(o),n.df.delete(o)):n.terms.set(o,r))}}class L{constructor(t,o,s){this.options={...x,...o},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Ke(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const o=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,s=J(t,o);return this._lastQuery=t,this._lastSearcher=s,s}setCollection(t,o){if(this._docs=t,o&&!(o instanceof ce))throw new Error(ze);if(this._myIndex=o||Ve(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const s=le({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=Vt(this._myIndex.records,this._myIndex.keys.length,s)}}add(t){if(S(t)&&(this._docs.push(t),this._myIndex.add(t),this._invertedIndex)){const o=this._myIndex.records[this._myIndex.records.length-1],s=le({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});wt(this._invertedIndex,o,this._myIndex.keys.length,s)}}remove(t=()=>!1){const o=[],s=[];for(let r=0,l=this._docs.length;r<l;r+=1)t(this._docs[r],r)&&(o.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(const r of s)_e(this._invertedIndex,r);for(let r=s.length-1;r>=0;r-=1)this._docs.splice(s[r],1);this._myIndex.removeAll(s)}return o}removeAt(t){this._invertedIndex&&_e(this._invertedIndex,t);const o=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),o}getIndex(){return this._myIndex}search(t,o){const{limit:s=-1}=o||{},{includeMatches:r,includeScore:l,shouldSort:i,sortFn:d,ignoreFieldNorm:u}=this.options;if(B(t)&&!t.trim()){let h=this._docs.map((v,f)=>({item:v,refIndex:f}));return Q(s)&&s>-1&&(h=h.slice(0,s)),h}const a=Q(s)&&s>0&&B(t);let c;if(a){const h=new _t(s);B(this._docs[0])?this._searchStringList(t,{heap:h,ignoreFieldNorm:u}):this._searchObjectList(t,{heap:h,ignoreFieldNorm:u}),c=h.extractSorted(d)}else c=B(t)?B(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),Ct(c,{ignoreFieldNorm:u}),i&&c.sort(d),Q(s)&&s>-1&&(c=c.slice(0,s));return Nt(c,this._docs,{includeMatches:r,includeScore:l})}_searchStringList(t,{heap:o,ignoreFieldNorm:s}={}){const r=this._getSearcher(t),{records:l}=this._myIndex,i=o?null:[];return l.forEach(({v:d,i:u,n:a})=>{if(!S(d))return;const{isMatch:c,score:h,indices:v}=r.searchIn(d);if(c){const f={item:d,idx:u,matches:[{score:h,value:d,norm:a,indices:v}]};o?(f.score=ie(f.matches,{ignoreFieldNorm:s}),o.shouldInsert(f.score)&&o.insert(f)):i.push(f)}}),i}_searchLogical(t){const o=Ae(t,this.options),s=(d,u,a)=>{if(!("children"in d)){const{keyId:f,searcher:m}=d;let g;return f===null?(g=[],this._myIndex.keys.forEach((_,w)=>{g.push(...this._findMatches({key:_,value:u[w],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(u,f),searcher:m}),g&&g.length?[{idx:a,item:u,matches:g}]:[]}const{children:c,operator:h}=d,v=[];for(let f=0,m=c.length;f<m;f+=1){const g=c[f],_=s(g,u,a);if(_.length)v.push(..._);else if(h===X.AND)return[]}return v},r=this._myIndex.records,l=new Map,i=[];return r.forEach(({$:d,i:u})=>{if(S(d)){const a=s(o,d,u);a.length&&(l.has(u)||(l.set(u,{idx:u,item:d,matches:[]}),i.push(l.get(u))),a.forEach(({matches:c})=>{l.get(u).matches.push(...c)}))}}),i}_searchObjectList(t,{heap:o,ignoreFieldNorm:s}={}){const r=this._getSearcher(t),{keys:l,records:i}=this._myIndex,d=o?null:[];return i.forEach(({$:u,i:a})=>{if(!S(u))return;const c=[];let h=!1,v=!1;if(l.forEach((f,m)=>{const g=this._findMatches({key:f,value:u[m],searcher:r});g.length?(c.push(...g),g[0].hasInverse&&(v=!0)):h=!0}),!(v&&h)&&c.length){const f={idx:a,item:u,matches:c};o?(f.score=ie(f.matches,{ignoreFieldNorm:s}),o.shouldInsert(f.score)&&o.insert(f)):d.push(f)}}),d}_findMatches({key:t,value:o,searcher:s}){if(!S(o))return[];const r=[];if(j(o))o.forEach(({v:l,i,n:d})=>{if(!S(l))return;const{isMatch:u,score:a,indices:c,hasInverse:h}=s.searchIn(l);u&&r.push({score:a,key:t,value:l,idx:i,norm:d,indices:c,hasInverse:h})});else{const{v:l,n:i}=o,{isMatch:d,score:u,indices:a,hasInverse:c}=s.searchIn(l);d&&r.push({score:u,key:t,value:l,norm:i,indices:a,hasInverse:c})}return r}}class Et{static condition(t,o){return o.useTokenSearch}constructor(t,o){this.options=o,this.analyzer=le({isCaseSensitive:o.isCaseSensitive,ignoreDiacritics:o.ignoreDiacritics});const s=this.analyzer.tokenize(t),r=o._invertedIndex,{df:l,fieldCount:i}=r;this.termSearchers=[],this.idfWeights=[];for(const d of s){this.termSearchers.push(new de(d,{location:o.location,threshold:o.threshold,distance:o.distance,includeMatches:o.includeMatches,findAllMatches:o.findAllMatches,minMatchCharLength:o.minMatchCharLength,isCaseSensitive:o.isCaseSensitive,ignoreDiacritics:o.ignoreDiacritics,ignoreLocation:!0}));const u=l.get(d)||0,a=Math.log(1+(i-u+.5)/(u+.5));this.idfWeights.push(a)}}searchIn(t){if(!this.termSearchers.length)return{isMatch:!1,score:1};const o=[];let s=0,r=0,l=0;for(let u=0;u<this.termSearchers.length;u++){const a=this.termSearchers[u].searchIn(t),c=this.idfWeights[u];r+=c,a.isMatch&&(l++,s+=c*(1-a.score),a.indices&&o.push(...a.indices))}if(l===0)return{isMatch:!1,score:1};const i=r>0?1-s/r:0,d={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&o.length&&(d.indices=ue(o)),d}}L.version="7.3.0";L.createIndex=Ve;L.parseIndex=et;L.config=x;L.match=function(n,t,o){return J(n,{...x,...o}).searchIn(t)};L.parseQuery=Ae;fe(gt);fe(Et);L.use=function(...n){n.forEach(t=>fe(t))};const z=n=>n==null?"—":`€${n.toFixed(2)}`,kt=n=>{if(!n)return"—";if(n<60)return`${n} min`;const t=Math.floor(n/60),o=n%60;return o>0?`${t}h ${o}min`:`${t}h`},At=n=>{switch(n){case"confirmed":return"Confirmed";case"completed":return"Completed";case"pending":return"Pending";case"cancelled":return"Cancelled";default:return n||"Unknown"}},ye=n=>{switch(n){case"confirmed":case"completed":return"#16a34a";case"pending":return"#ca8a04";case"cancelled":return"#dc2626";default:return"#6b7280"}},Mt=(n,t={})=>{const o=`${n.customerInfo?.firstName||""} ${n.customerInfo?.lastName||""}`.trim()||"Unknown Customer",s=n.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: ${ye(n.status)}20; color: ${ye(n.status)};"
|
|
222
|
+
>
|
|
223
|
+
${At(n.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">${o}</div>
|
|
232
|
+
<div class="contact-info">
|
|
233
|
+
${n.customerInfo?.email?`<div>Email: <a href="mailto:${n.customerInfo.email}">${n.customerInfo.email}</a></div>`:""}
|
|
234
|
+
${n.customerInfo?.phone?`<div>Phone: <a href="tel:${n.customerInfo.phone}">${n.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">${n.startTime} - ${n.endTime}</div>
|
|
249
|
+
</div>
|
|
250
|
+
<div class="info-card">
|
|
251
|
+
<div class="info-label">Spots</div>
|
|
252
|
+
<div class="info-value">${n.spots||1} ${(n.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
|
+
${n.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">${n.pricingOption.name}</div>
|
|
276
|
+
<div class="package-duration">${kt(n.pricingOption.duration)}</div>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="package-price">${z(n.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">${z(n.reservationBasePrice)}</span>
|
|
290
|
+
</div>
|
|
291
|
+
${n.reservationAddOnsPrice?`
|
|
292
|
+
<div class="payment-row">
|
|
293
|
+
<span class="payment-label">Add-ons</span>
|
|
294
|
+
<span class="payment-value">${z(n.reservationAddOnsPrice)}</span>
|
|
295
|
+
</div>
|
|
296
|
+
`:""}
|
|
297
|
+
${n.discount?`
|
|
298
|
+
<div class="payment-row">
|
|
299
|
+
<span class="payment-label">Discount</span>
|
|
300
|
+
<span class="payment-value green">-${z(n.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>${z(n.reservationPrice)}</span>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
${n.amountPaid!==void 0||n.amountDue!==void 0?`
|
|
312
|
+
<div class="payment-divider"></div>
|
|
313
|
+
|
|
314
|
+
${n.amountPaid!==void 0?`
|
|
315
|
+
<div class="payment-row">
|
|
316
|
+
<span class="payment-label">Amount paid</span>
|
|
317
|
+
<span class="payment-value green">${z(n.amountPaid)}</span>
|
|
318
|
+
</div>
|
|
319
|
+
`:""}
|
|
320
|
+
|
|
321
|
+
${n.amountDue!==void 0&&n.amountDue>0?`
|
|
322
|
+
<div class="payment-row">
|
|
323
|
+
<span class="payment-label">Amount due</span>
|
|
324
|
+
<span class="payment-value orange">${z(n.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()})},Bt={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},St={class:"grid gap-2"},It={class:"grid gap-2"},$t={class:"grid gap-2"},Ft=e.defineComponent({__name:"CancelReservationDialog",emits:["confirm"],setup(n,{expose:t,emit:o}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=o,i=e.ref(!1),d=e.ref(!1),u=e.ref(""),a=e.ref(""),c=e.ref(""),h=f=>{d.value=!s.mailAccount,i.value=!0,f&&(u.value=f.customerInfo?.email,a.value="Cancellation of your reservation - "+new Date(f.date)?.toDateString(),c.value=`Dear ${f.customerInfo?.firstName??""} ${f.customerInfo?.lastName??""},
|
|
338
|
+
|
|
339
|
+
We are writing to inform you that your reservation scheduled for ${new Date(f.date)?.toDateString()} at ${f.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.`)},v=()=>{if(!d.value){if(!u.value||!a.value||!c.value)return alert("Please fill in all the fields.");r({to:u.value,subject:a.value,body:c.value})}i.value=!1;const{$confetti:f}=useNuxtApp();f(),l("confirm")};return t({openDialog:h}),(f,m)=>{const g=e.resolveComponent("DialogTitle"),_=e.resolveComponent("DialogDescription"),w=e.resolveComponent("DialogHeader"),E=e.resolveComponent("Checkbox"),D=e.resolveComponent("Label"),V=e.resolveComponent("Input"),I=e.resolveComponent("Textarea"),F=e.resolveComponent("Button"),$=e.resolveComponent("DialogFooter"),b=e.resolveComponent("DialogScrollContent"),k=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(k,{open:i.value,"onUpdate:open":m[5]||(m[5]=C=>i.value=C)},{default:e.withCtx(()=>[e.createVNode(b,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...m[6]||(m[6]=[e.createTextVNode(" Cancel Reservation ",-1)])]),_:1}),e.createVNode(_)]),_:1}),e.createElementVNode("div",Bt,[e.createVNode(E,{modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=C=>d.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(D,{for:"cancel-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...m[7]||(m[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":d.value}])},[e.createElementVNode("div",St,[e.createVNode(D,{for:"cancel-dialog-email"},{default:e.withCtx(()=>[...m[8]||(m[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(V,{modelValue:u.value,"onUpdate:modelValue":m[1]||(m[1]=C=>u.value=C),disabled:d.value,id:"cancel-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",It,[e.createVNode(D,{for:"cancel-dialog-subject"},{default:e.withCtx(()=>[...m[9]||(m[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(V,{modelValue:a.value,"onUpdate:modelValue":m[2]||(m[2]=C=>a.value=C),disabled:d.value,id:"cancel-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",$t,[e.createVNode(D,{for:"cancel-dialog-body"},{default:e.withCtx(()=>[...m[10]||(m[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(I,{modelValue:c.value,"onUpdate:modelValue":m[3]||(m[3]=C=>c.value=C),disabled:d.value,id:"cancel-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(F,{variant:"outline",onClick:m[4]||(m[4]=C=>i.value=!1)},{default:e.withCtx(()=>[...m[11]||(m[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(F,{variant:"destructive",onClick:v},{default:e.withCtx(()=>[...m[12]||(m[12]=[e.createTextVNode("Cancel reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Tt=e.defineComponent({__name:"TransferReservationDialog",setup(n,{expose:t}){const{config:o}=T.useModule(),s=e.ref(!1);return t({openDialog:()=>{s.value=!0}}),(l,i)=>{const d=e.resolveComponent("DialogTitle"),u=e.resolveComponent("DialogDescription"),a=e.resolveComponent("DialogHeader"),c=e.resolveComponent("Button"),h=e.resolveComponent("DialogFooter"),v=e.resolveComponent("DialogScrollContent"),f=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(f,{open:s.value,"onUpdate:open":i[2]||(i[2]=m=>s.value=m)},{default:e.withCtx(()=>[e.createVNode(v,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[...i[3]||(i[3]=[e.createTextVNode(" Transfer Reservation ",-1)])]),_:1}),e.createVNode(u)]),_:1}),i[6]||(i[6]=e.createElementVNode("div",{class:"py-4"},null,-1)),e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(c,{variant:"outline",onClick:i[0]||(i[0]=m=>s.value=!1)},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(c,{onClick:i[1]||(i[1]=m=>s.value=!1)},{default:e.withCtx(()=>[...i[5]||(i[5]=[e.createTextVNode("Transfer reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Rt={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},jt={class:"grid gap-2"},Ot={class:"grid gap-2"},Lt={class:"grid gap-2"},zt=e.defineComponent({__name:"ApproveReservationDialog",emits:["confirm"],setup(n,{expose:t,emit:o}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=o,i=e.ref(!1),d=e.ref("approve"),u=e.ref(!1),a=e.ref(""),c=e.ref(""),h=e.ref(""),v=(m,g)=>{u.value=!s.mailAccount,i.value=!0,m&&(g||(g="approve"),d.value=g,a.value=m.customerInfo?.email,c.value="Confirmation: Your reservation for "+new Date(m.date)?.toDateString(),h.value=`Dear ${m.customerInfo?.firstName??""} ${m.customerInfo?.lastName??""},
|
|
342
|
+
|
|
343
|
+
This email confirms your reservation for ${new Date(m.date)?.toDateString()} at ${m.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.`)},f=()=>{if(!u.value){if(!a.value||!c.value||!h.value)return alert("Please fill in all the fields.");r({to:a.value,subject:c.value,body:h.value})}i.value=!1;const{$confetti:m}=useNuxtApp();m(),l("confirm")};return t({openDialog:v}),(m,g)=>{const _=e.resolveComponent("DialogTitle"),w=e.resolveComponent("DialogDescription"),E=e.resolveComponent("DialogHeader"),D=e.resolveComponent("Checkbox"),V=e.resolveComponent("Label"),I=e.resolveComponent("Input"),F=e.resolveComponent("Textarea"),$=e.resolveComponent("Button"),b=e.resolveComponent("DialogFooter"),k=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(k,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value==="approve"?"Approve Reservation":"Resend Confirmation Email"),1)]),_:1}),e.createVNode(w)]),_:1}),e.createElementVNode("div",Rt,[e.createVNode(D,{modelValue:u.value,"onUpdate:modelValue":g[0]||(g[0]=A=>u.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(V,{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":u.value}])},[e.createElementVNode("div",jt,[e.createVNode(V,{for:"approve-dialog-email"},{default:e.withCtx(()=>[...g[7]||(g[7]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(I,{modelValue:a.value,"onUpdate:modelValue":g[1]||(g[1]=A=>a.value=A),disabled:u.value,id:"approve-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Ot,[e.createVNode(V,{for:"approve-dialog-subject"},{default:e.withCtx(()=>[...g[8]||(g[8]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(I,{modelValue:c.value,"onUpdate:modelValue":g[2]||(g[2]=A=>c.value=A),disabled:u.value,id:"approve-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Lt,[e.createVNode(V,{for:"approve-dialog-body"},{default:e.withCtx(()=>[...g[9]||(g[9]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(F,{modelValue:h.value,"onUpdate:modelValue":g[3]||(g[3]=A=>h.value=A),disabled:u.value,id:"approve-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(b,null,{default:e.withCtx(()=>[e.createVNode($,{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($,{onClick:f},{default:e.withCtx(()=>[...g[11]||(g[11]=[e.createTextVNode("Approve reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Pt={class:"flex items-center bg-muted/70 dark:bg-muted/20 px-4 rounded-md"},Ut={class:"grid gap-2"},Wt={class:"grid gap-2"},Ht={class:"grid gap-2"},Kt=e.defineComponent({__name:"RejectReservationDialog",emits:["confirm"],setup(n,{expose:t,emit:o}){const{config:s}=T.useModule(),{sendMail:r}=T.useMailer(s.mailAccount),l=o,i=e.ref(!1),d=e.ref(!1),u=e.ref(""),a=e.ref(""),c=e.ref(""),h=f=>{d.value=!s.mailAccount,i.value=!0,f&&(u.value=f.customerInfo?.email,a.value="Regarding your reservation request for "+new Date(f.date)?.toDateString(),c.value=`Dear ${f.customerInfo?.firstName??""} ${f.customerInfo?.lastName??""},
|
|
346
|
+
|
|
347
|
+
Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(f.date)?.toDateString()} at ${f.startTime}.
|
|
348
|
+
|
|
349
|
+
We would love to see you another time!`)},v=()=>{if(!d.value){if(!u.value||!a.value||!c.value)return alert("Please fill in all the fields.");r({to:u.value,subject:a.value,body:c.value})}i.value=!1;const{$confetti:f}=useNuxtApp();f(),l("confirm")};return t({openDialog:h}),(f,m)=>{const g=e.resolveComponent("DialogTitle"),_=e.resolveComponent("DialogDescription"),w=e.resolveComponent("DialogHeader"),E=e.resolveComponent("Checkbox"),D=e.resolveComponent("Label"),V=e.resolveComponent("Input"),I=e.resolveComponent("Textarea"),F=e.resolveComponent("Button"),$=e.resolveComponent("DialogFooter"),b=e.resolveComponent("DialogScrollContent"),k=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(k,{open:i.value,"onUpdate:open":m[5]||(m[5]=C=>i.value=C)},{default:e.withCtx(()=>[e.createVNode(b,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...m[6]||(m[6]=[e.createTextVNode(" Reject Reservation Request ",-1)])]),_:1}),e.createVNode(_)]),_:1}),e.createElementVNode("div",Pt,[e.createVNode(E,{modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=C=>d.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(D,{for:"reject-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...m[7]||(m[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":d.value}])},[e.createElementVNode("div",Ut,[e.createVNode(D,{for:"reject-dialog-email"},{default:e.withCtx(()=>[...m[8]||(m[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(V,{modelValue:u.value,"onUpdate:modelValue":m[1]||(m[1]=C=>u.value=C),disabled:d.value,id:"reject-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Wt,[e.createVNode(D,{for:"reject-dialog-subject"},{default:e.withCtx(()=>[...m[9]||(m[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(V,{modelValue:a.value,"onUpdate:modelValue":m[2]||(m[2]=C=>a.value=C),disabled:d.value,id:"reject-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Ht,[e.createVNode(D,{for:"reject-dialog-body"},{default:e.withCtx(()=>[...m[10]||(m[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(I,{modelValue:c.value,"onUpdate:modelValue":m[3]||(m[3]=C=>c.value=C),disabled:d.value,id:"reject-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(F,{variant:"outline",onClick:m[4]||(m[4]=C=>i.value=!1)},{default:e.withCtx(()=>[...m[11]||(m[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(F,{variant:"destructive",onClick:v},{default:e.withCtx(()=>[...m[12]||(m[12]=[e.createTextVNode("Reject reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Gt={key:0,class:"space-y-6 py-4"},Yt={class:"space-y-3"},Qt={class:"bg-muted/30 rounded-lg p-4 space-y-3"},Jt={class:"flex items-center gap-3"},Xt={class:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center"},Zt={class:"font-medium"},qt={class:"grid gap-2 text-sm"},eo={key:0,class:"flex items-center gap-2 text-muted-foreground"},to=["href"],oo={key:1,class:"flex items-center gap-2 text-muted-foreground"},no=["href"],so={class:"space-y-3"},ro={class:"grid grid-cols-2 gap-3"},ao={class:"bg-muted/30 rounded-lg p-3"},io={class:"flex items-center gap-2 text-muted-foreground mb-1"},lo={class:"font-medium"},co={class:"bg-muted/30 rounded-lg p-3"},uo={class:"flex items-center gap-2 text-muted-foreground mb-1"},fo={class:"font-medium"},mo={key:0,class:"space-y-3"},po={class:"bg-muted/30 rounded-lg p-4"},ho={class:"flex items-start justify-between"},go={class:"flex items-start gap-3"},vo={class:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5"},xo={class:"font-medium"},Co={class:"text-sm text-muted-foreground"},_o={class:"font-semibold"},yo={class:"space-y-3"},Do={class:"bg-muted/30 rounded-lg p-4 space-y-3"},No={class:"space-y-2 text-sm"},bo={class:"flex justify-between"},Vo={key:0,class:"flex justify-between"},wo={key:1,class:"flex justify-between text-green-600 dark:text-green-400"},Eo={class:"flex justify-between font-semibold"},ko={key:1,class:"space-y-2 text-sm"},Ao={key:0,class:"flex justify-between"},Mo={class:"text-muted-foreground flex items-center gap-1.5"},Bo={class:"text-green-600 dark:text-green-400"},So={key:1,class:"flex justify-between"},Io={class:"text-muted-foreground flex items-center gap-1.5"},$o={class:"text-orange-600 dark:text-orange-400 font-medium"},Fo=e.defineComponent({__name:"ReservationDetailDialog",emits:["cancelled","confirmed","rejected"],setup(n,{expose:t,emit:o}){const{hasPermission:s}=T.useModulePermissions(),{config:r}=T.useModule(),l=T.useFirebaseIntegration(r.project),i=e.inject("event",e.ref(null)),d=o,u=e.ref(!1),a=e.ref(null),c=e.ref(!1),h=e.useTemplateRef("cancelReservationDialog"),v=e.useTemplateRef("approveReservationDialog"),f=e.useTemplateRef("rejectReservationDialog"),m=e.useTemplateRef("transferReservationDialog"),g=y=>{a.value=y,u.value=!0},_=e.computed(()=>a.value?.customerInfo&&`${a.value.customerInfo.firstName} ${a.value.customerInfo.lastName}`.trim()||"Unknown Customer"),w=e.computed(()=>{let y=a.value?.status;const p=a.value?.reservationStatus;switch(["needs_approval","rejected","approved","cancelled"].includes(p)&&(y=p),y){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:y||"Unknown",class:"bg-muted text-muted-foreground"}}}),E=e.computed(()=>a.value?.status==="cancelled"),D=y=>y==null||typeof y!="number"?"—":`€${y?.toFixed(2)}`,V=y=>{if(!y)return"—";if(y<60)return`${y} min`;const p=Math.floor(y/60),N=y%60;return N>0?`${p}h ${N}min`:`${p}h`},I=()=>{if(!a.value)return;let y="";const p=i?.value?.date;if(p)try{y=new Date(p).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}catch{y=p}const N={date:y,resourceName:i?.value?.resource?.name};Mt(a.value,N)},F=()=>{v.value?.openDialog(a.value)},$=()=>{f.value?.openDialog(a.value)},b=()=>{v.value?.openDialog(a.value)},k=()=>{h.value?.openDialog(a.value)},C=async()=>{try{if(c.value||!a.value?.id)throw new Error("Invalid state");c.value=!0;let p=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!p.find(N=>N.id===a.value.res_id))throw new Error("Reservation not found");p.find(N=>N.id===a.value.res_id).status="cancelled",await l.update(r.reservationsCollection,a.value.id,{reservations:p}),a.value.status="cancelled",W.toast.success("Reservation cancelled successfully"),d("cancelled"),u.value=!1}catch(y){console.error("Error cancelling reservation:",y),W.toast.error("Failed to cancel reservation")}finally{c.value=!1}},A=async()=>{try{if(c.value||!a.value?.id)throw new Error("Invalid state");c.value=!0;let p=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!p.find(N=>N.id===a.value.res_id))throw new Error("Reservation not found");p.find(N=>N.id===a.value.res_id).status="approved",await l.update(r.reservationsCollection,a.value.id,{reservations:p}),a.value.status="approved",W.toast.success("Reservation approved successfully"),d("confirmed"),u.value=!1}catch(y){console.error("Error approving reservation:",y),W.toast.error("Failed to approve reservation")}finally{c.value=!1}},H=async()=>{try{if(c.value||!a.value?.id)throw new Error("Invalid state");c.value=!0;let p=(await l.get(r.reservationsCollection,a.value.id))?.reservations||[];if(!p.find(N=>N.id===a.value.res_id))throw new Error("Reservation not found");p.find(N=>N.id===a.value.res_id).status="rejected",await l.update(r.reservationsCollection,a.value.id,{reservations:p}),a.value.status="rejected",W.toast.success("Reservation rejected successfully"),d("rejected"),u.value=!1}catch(y){console.error("Error rejecting reservation:",y),W.toast.error("Failed to reject reservation")}finally{c.value=!1}},R=()=>{};return t({openDialog:g}),(y,p)=>{const N=e.resolveComponent("DialogTitle"),U=e.resolveComponent("DialogDescription"),Me=e.resolveComponent("DialogHeader"),me=e.resolveComponent("Separator"),Z=e.resolveComponent("Button"),Be=e.resolveComponent("DropdownMenuTrigger"),q=e.resolveComponent("DropdownMenuLabel"),G=e.resolveComponent("DropdownMenuItem"),ee=e.resolveComponent("DropdownMenuGroup"),pe=e.resolveComponent("DropdownMenuSeparator"),Se=e.resolveComponent("DropdownMenuContent"),Ie=e.resolveComponent("DropdownMenu"),$e=e.resolveComponent("DialogFooter"),Fe=e.resolveComponent("DialogScrollContent"),Te=e.resolveComponent("Dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Te,{open:u.value,"onUpdate:open":p[0]||(p[0]=Re=>u.value=Re)},{default:e.withCtx(()=>[e.createVNode(Fe,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(Me,null,{default:e.withCtx(()=>[e.createVNode(N,{class:"flex items-center gap-3"},{default:e.withCtx(()=>[p[1]||(p[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",w.value.class])},e.toDisplayString(w.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",Gt,[e.createElementVNode("div",Yt,[p[2]||(p[2]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Customer",-1)),e.createElementVNode("div",Qt,[e.createElementVNode("div",Jt,[e.createElementVNode("div",Xt,[e.createVNode(e.unref(M.User),{size:20,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",Zt,e.toDisplayString(_.value),1)])]),e.createElementVNode("div",qt,[a.value.customerInfo?.email?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(e.unref(M.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,to)])):e.createCommentVNode("",!0),a.value.customerInfo?.phone?(e.openBlock(),e.createElementBlock("div",oo,[e.createVNode(e.unref(M.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,no)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",so,[p[5]||(p[5]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Reservation",-1)),e.createElementVNode("div",ro,[e.createElementVNode("div",ao,[e.createElementVNode("div",io,[e.createVNode(e.unref(M.Clock),{size:14}),p[3]||(p[3]=e.createElementVNode("span",{class:"text-xs"},"Time",-1))]),e.createElementVNode("p",lo,e.toDisplayString(a.value.startTime)+" - "+e.toDisplayString(a.value.endTime),1)]),e.createElementVNode("div",co,[e.createElementVNode("div",uo,[e.createVNode(e.unref(M.Users),{size:14}),p[4]||(p[4]=e.createElementVNode("span",{class:"text-xs"},"Spots",-1))]),e.createElementVNode("p",fo,e.toDisplayString(a.value.spots||1)+" "+e.toDisplayString(a.value.spots===1?"person":"people"),1)])])]),a.value.pricingOption?(e.openBlock(),e.createElementBlock("div",mo,[p[6]||(p[6]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Package",-1)),e.createElementVNode("div",po,[e.createElementVNode("div",ho,[e.createElementVNode("div",go,[e.createElementVNode("div",vo,[e.createVNode(e.unref(M.Tag),{size:18,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",xo,e.toDisplayString(a.value.pricingOption.name),1),e.createElementVNode("p",Co,e.toDisplayString(V(a.value.pricingOption.duration)),1)])]),e.createElementVNode("p",_o,e.toDisplayString(D(a.value.pricingOption.price)),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",yo,[p[13]||(p[13]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Payment",-1)),e.createElementVNode("div",Do,[e.createElementVNode("div",No,[e.createElementVNode("div",bo,[p[7]||(p[7]=e.createElementVNode("span",{class:"text-muted-foreground"},"Base price",-1)),e.createElementVNode("span",null,e.toDisplayString(D(a.value.reservationBasePrice)),1)]),a.value.reservationAddOnsPrice?(e.openBlock(),e.createElementBlock("div",Vo,[p[8]||(p[8]=e.createElementVNode("span",{class:"text-muted-foreground"},"Add-ons",-1)),e.createElementVNode("span",null,e.toDisplayString(D(a.value.reservationAddOnsPrice)),1)])):e.createCommentVNode("",!0),a.value.discount?(e.openBlock(),e.createElementBlock("div",wo,[p[9]||(p[9]=e.createElementVNode("span",null,"Discount",-1)),e.createElementVNode("span",null,"-"+e.toDisplayString(D(a.value.discount)),1)])):e.createCommentVNode("",!0)]),e.createVNode(me),e.createElementVNode("div",Eo,[p[10]||(p[10]=e.createElementVNode("span",null,"Reservation Total",-1)),e.createElementVNode("span",null,e.toDisplayString(D(a.value.reservationPrice)),1)]),a.value.amountPaid!==void 0||a.value.amountDue!==void 0?(e.openBlock(),e.createBlock(me,{key:0})):e.createCommentVNode("",!0),a.value.amountPaid!==void 0||a.value.amountDue!==void 0?(e.openBlock(),e.createElementBlock("div",ko,[a.value.amountPaid!==void 0?(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("span",Mo,[e.createVNode(e.unref(M.CreditCard),{size:14}),p[11]||(p[11]=e.createTextVNode(" Amount paid ",-1))]),e.createElementVNode("span",Bo,e.toDisplayString(D(a.value.amountPaid)),1)])):e.createCommentVNode("",!0),a.value.amountDue!==void 0&&a.value.amountDue>0?(e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("span",Io,[e.createVNode(e.unref(M.Receipt),{size:14}),p[12]||(p[12]=e.createTextVNode(" Amount due ",-1))]),e.createElementVNode("span",$o,e.toDisplayString(D(a.value.amountDue)),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createVNode($e,{class:"gap-2 sm:justify-between"},{default:e.withCtx(()=>[a.value.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Z,{variant:"destructive",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Ban),{size:16}),p[14]||(p[14]=e.createTextVNode(" Reject Reservation ",-1))]),_:1}),e.createVNode(Z,{onClick:F},{default:e.withCtx(()=>[e.createVNode(e.unref(M.ClockCheck),{size:16}),p[15]||(p[15]=e.createTextVNode(" Approve Reservation ",-1))]),_:1})],64)):a.value.reservationStatus==="approved"?(e.openBlock(),e.createBlock(Ie,{key:1},{default:e.withCtx(()=>[e.createVNode(Be,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(Z,{variant:"outline",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MoreHorizontal),{size:16}),p[16]||(p[16]=e.createTextVNode(" Actions ",-1))]),_:1})]),_:1}),e.createVNode(Se,{class:"w-60",align:"start"},{default:e.withCtx(()=>[e.createVNode(q,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...p[17]||(p[17]=[e.createTextVNode(" Reservation Actions ",-1)])]),_:1}),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createVNode(G,{onClick:I,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Download),{size:16,class:"text-muted-foreground"}),p[18]||(p[18]=e.createElementVNode("span",null,"Download PDF",-1))]),_:1})]),_:1}),e.createVNode(pe),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createVNode(q,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...p[19]||(p[19]=[e.createTextVNode(" Communication ",-1)])]),_:1}),e.createVNode(G,{onClick:b,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MailCheck),{size:16,class:"text-muted-foreground"}),p[20]||(p[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(pe),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createVNode(q,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...p[21]||(p[21]=[e.createTextVNode(" Cancellation ",-1)])]),_:1}),e.createVNode(G,{onClick:k,class:"gap-2 cursor-pointer",variant:"destructive",disabled:E.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.XCircle),{size:16}),p[22]||(p[22]=e.createElementVNode("span",null,"Cancel Reservation",-1))]),_:1},8,["disabled"]),a.value?.reservationPrice&&a.value.reservationPrice>0?(e.openBlock(),e.createBlock(G,{key:0,onClick:R,class:"gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",disabled:E.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Gift),{class:"text-inherit",size:16}),p[23]||(p[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(Ft,{ref_key:"cancelReservationDialog",ref:h,onConfirm:C},null,512),e.createVNode(zt,{ref_key:"approveReservationDialog",ref:v,onConfirm:A},null,512),e.createVNode(Kt,{ref_key:"rejectReservationDialog",ref:f,onConfirm:H},null,512),e.createVNode(Tt,{ref_key:"transferReservationDialog",ref:m},null,512)],64)}}});exports.Fuse=L;exports._sfc_main=Fo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("@oneclick.dev/cms-kit"),m=require("lucide-vue-next");require("./index-BuzLn4Km.js");const _=require("@oneclick.dev/cms-kit/charts"),u=require("./index-DQYBP8Js.js"),E=require("./index-C4YUVWzJ.js");function g(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:Math.round(t).toString()}function C(t){return`${(t*100).toFixed(1)}%`}function b(t){return t.toFixed(1)}function z(t){return t<=3?"text-emerald-600 dark:text-emerald-400":t<=10?"text-blue-600 dark:text-blue-400":t<=20?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function $(t){return t<=3?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":t<=10?"bg-blue-500/10 text-blue-600 dark:text-blue-400":t<=20?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-red-500/10 text-red-600 dark:text-red-400"}function S(t){try{return new URL(t).pathname}catch{return t}}const P={class:"grid grid-cols-2 @3xl:grid-cols-4 gap-4"},M={class:"flex items-center flex-wrap gap-2 text-xs text-muted-foreground"},F={class:"text-2xl font-bold tabular-nums"},L={class:"flex items-center flex-wrap gap-2 text-xs text-muted-foreground"},R={class:"text-2xl font-bold tabular-nums"},q={class:"flex items-center flex-wrap gap-2 text-xs text-muted-foreground"},A={class:"text-2xl font-bold tabular-nums"},U={class:"flex items-center flex-wrap gap-2 text-xs text-muted-foreground"},K=e.defineComponent({__name:"SeoKpiCards",props:{totals:{}},setup(t){return(c,a)=>{const n=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",P,[e.createVNode(n,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[e.createVNode(e.unref(m.MousePointerClick),{class:"size-3.5 shrink-0"}),a[0]||(a[0]=e.createTextVNode(" Total Clicks ",-1))]),e.createElementVNode("p",F,e.toDisplayString(e.unref(g)(t.totals.clicks)),1)]),_:1}),e.createVNode(n,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",L,[e.createVNode(e.unref(m.Eye),{class:"size-3.5 shrink-0"}),a[1]||(a[1]=e.createTextVNode(" Total Impressions ",-1))]),e.createElementVNode("p",R,e.toDisplayString(e.unref(g)(t.totals.impressions)),1)]),_:1}),e.createVNode(n,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(e.unref(m.TrendingUp),{class:"size-3.5 shrink-0"}),a[2]||(a[2]=e.createTextVNode(" Average CTR ",-1))]),e.createElementVNode("p",A,e.toDisplayString(e.unref(C)(t.totals.ctr)),1)]),_:1}),e.createVNode(n,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",U,[e.createVNode(e.unref(m.Hash),{class:"size-3.5 shrink-0"}),a[3]||(a[3]=e.createTextVNode(" Avg Position ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["text-2xl font-bold tabular-nums",e.unref(z)(t.totals.avgPosition)])},e.toDisplayString(e.unref(b)(t.totals.avgPosition)),3)]),_:1})])}}}),O={class:"flex items-center gap-4"},I={class:"flex items-center gap-2"},H={class:"text-xs"},X={class:"flex items-center gap-2"},j={class:"text-xs"},G={class:"flex items-center gap-2"},J={class:"text-xs"},Q={class:"flex items-center gap-2"},W={class:"text-xs"},Y={key:0,class:"flex h-3 rounded-full overflow-hidden mt-3"},Z=e.defineComponent({__name:"SeoRankingDistribution",props:{keywords:{}},setup(t){const c=t,a=e.computed(()=>c.keywords.filter(s=>s.position<=3).length),n=e.computed(()=>c.keywords.filter(s=>s.position<=10).length),d=e.computed(()=>c.keywords.filter(s=>s.position<=20).length);return(s,o)=>{const l=e.resolveComponent("Card");return e.openBlock(),e.createBlock(l,{class:"p-4"},{default:e.withCtx(()=>[o[8]||(o[8]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Keyword Ranking Distribution",-1)),e.createElementVNode("div",O,[e.createElementVNode("div",I,[o[1]||(o[1]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-emerald-500"},null,-1)),e.createElementVNode("span",H,[o[0]||(o[0]=e.createTextVNode("Top 3: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(a.value),1)])]),e.createElementVNode("div",X,[o[3]||(o[3]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",j,[o[2]||(o[2]=e.createTextVNode("Top 10: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value),1)])]),e.createElementVNode("div",G,[o[5]||(o[5]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"},null,-1)),e.createElementVNode("span",J,[o[4]||(o[4]=e.createTextVNode("Top 20: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(d.value),1)])]),e.createElementVNode("div",Q,[o[7]||(o[7]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"},null,-1)),e.createElementVNode("span",W,[o[6]||(o[6]=e.createTextVNode("20+: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(t.keywords.length-d.value),1)])])]),t.keywords.length>0?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",{class:"bg-emerald-500 transition-all",style:e.normalizeStyle({width:`${a.value/t.keywords.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-blue-500 transition-all",style:e.normalizeStyle({width:`${(n.value-a.value)/t.keywords.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-amber-500 transition-all",style:e.normalizeStyle({width:`${(d.value-n.value)/t.keywords.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-red-500 transition-all",style:e.normalizeStyle({width:`${(t.keywords.length-d.value)/t.keywords.length*100}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1})}}}),ee={key:0,class:"h-48"},te={key:1,class:"text-xs text-muted-foreground text-center py-10"},oe=e.defineComponent({__name:"SeoClicksChart",props:{trends:{}},setup(t){const c=t,a=(o,l)=>l,n=o=>o.clicks||0,d=o=>{const l=c.trends[Math.round(o)];if(!l)return"";const i=new Date(l.date);return`${i.getDate()}/${i.getMonth()+1}`},s=o=>{const l=c.trends[Math.round(Number(o))];return l?new Date(l.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};return(o,l)=>{const i=e.resolveComponent("Card");return e.openBlock(),e.createBlock(i,{class:"p-4"},{default:e.withCtx(()=>[l[0]||(l[0]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Clicks Over Time",-1)),t.trends.length>1?(e.openBlock(),e.createElementBlock("div",ee,[e.createVNode(e.unref(u.S),{data:t.trends,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(E.C),{x:a,y:n,color:"#3b82f6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(E.C$1),{x:a,y:n,color:"#3b82f6",curveType:"monotoneX"}),e.createVNode(e.unref(u.C),{type:"x",tickFormat:d,numTicks:5,gridLine:!1}),e.createVNode(e.unref(u.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(u.A),{template:y=>e.unref(_.componentToString)(e.unref(_.ChartTooltipContent),{namePayload:[{name:"Clicks",value:y.clicks,color:"#3b82f6"}],labelFormatter:s})},null,8,["template"]),e.createVNode(e.unref(u.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",te,"Not enough data for chart"))]),_:1})}}}),ne={key:0,class:"h-48"},se={key:1,class:"text-xs text-muted-foreground text-center py-10"},re=e.defineComponent({__name:"SeoImpressionsChart",props:{trends:{}},setup(t){const c=t,a=(o,l)=>l,n=o=>o.impressions||0,d=o=>{const l=c.trends[Math.round(o)];if(!l)return"";const i=new Date(l.date);return`${i.getDate()}/${i.getMonth()+1}`},s=o=>{const l=c.trends[Math.round(Number(o))];return l?new Date(l.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};return(o,l)=>{const i=e.resolveComponent("Card");return e.openBlock(),e.createBlock(i,{class:"p-4"},{default:e.withCtx(()=>[l[0]||(l[0]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Impressions Over Time",-1)),t.trends.length>1?(e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(e.unref(u.S),{data:t.trends,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(E.C),{x:a,y:n,color:"#8b5cf6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(E.C$1),{x:a,y:n,color:"#8b5cf6",curveType:"monotoneX"}),e.createVNode(e.unref(u.C),{type:"x",tickFormat:d,numTicks:5,gridLine:!1}),e.createVNode(e.unref(u.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(u.A),{template:y=>e.unref(_.componentToString)(e.unref(_.ChartTooltipContent),{namePayload:[{name:"Impressions",value:y.impressions,color:"#8b5cf6"}],labelFormatter:s})},null,8,["template"]),e.createVNode(e.unref(u.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",se,"Not enough data for chart"))]),_:1})}}}),le={class:"divide-y"},ae={key:0,class:"p-8 text-center text-sm text-muted-foreground"},ce={class:"flex items-start @sm:items-center gap-3"},de={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5 @sm:mt-0"},ie={class:"flex-1 min-w-0"},me={class:"flex flex-col @sm:flex-row @sm:items-center gap-2 @sm:gap-3"},ue={class:"flex-1 min-w-0"},pe={class:"text-sm font-medium truncate"},fe={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},xe={class:"flex items-center gap-3 @sm:gap-4 text-xs text-muted-foreground @sm:shrink-0 flex-wrap"},ge={class:"flex items-center gap-1"},ye={class:"flex items-center gap-1"},ke=e.defineComponent({__name:"SeoKeywordsTab",props:{keywords:{}},setup(t){const c=t,a=e.computed(()=>Math.max(...c.keywords.map(n=>n.clicks),1));return(n,d)=>(e.openBlock(),e.createElementBlock("div",le,[t.keywords.length===0?(e.openBlock(),e.createElementBlock("div",ae," No keyword data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.keywords,(s,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",ce,[e.createElementVNode("span",de,e.toDisplayString(o+1)+".",1),e.createElementVNode("div",ie,[e.createElementVNode("div",me,[e.createElementVNode("div",ue,[e.createElementVNode("p",pe,e.toDisplayString(s.query),1),e.createElementVNode("div",fe,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70",style:e.normalizeStyle({width:`${s.clicks/a.value*100}%`})},null,4)])]),e.createElementVNode("div",xe,[e.createElementVNode("span",ge,[e.createVNode(e.unref(m.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)(s.clicks)),1)]),e.createElementVNode("span",ye,[e.createVNode(e.unref(m.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)(s.impressions)),1)]),e.createElementVNode("span",null,e.toDisplayString(e.unref(C)(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",e.unref($)(s.position)])}," #"+e.toDisplayString(e.unref(b)(s.position)),3)])])])])]))),128))]))}}),ve={class:"divide-y"},Ne={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Ve={class:"flex items-start @sm:items-center gap-3"},he={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5 @sm:mt-0"},_e={class:"flex-1 min-w-0"},Ee={class:"flex flex-col @sm:flex-row @sm:items-center gap-2 @sm:gap-3"},be={class:"flex-1 min-w-0"},we=["title"],Ce={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},$e={class:"flex items-center gap-3 @sm:gap-4 text-xs text-muted-foreground @sm:shrink-0 flex-wrap"},Be={class:"flex items-center gap-1"},Se={class:"flex items-center gap-1"},Te=e.defineComponent({__name:"SeoPagesTab",props:{pages:{}},setup(t){const c=t,a=e.computed(()=>Math.max(...c.pages.map(n=>n.clicks),1));return(n,d)=>(e.openBlock(),e.createElementBlock("div",ve,[t.pages.length===0?(e.openBlock(),e.createElementBlock("div",Ne," No page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pages,(s,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Ve,[e.createElementVNode("span",he,e.toDisplayString(o+1)+".",1),e.createElementVNode("div",_e,[e.createElementVNode("div",Ee,[e.createElementVNode("div",be,[e.createElementVNode("p",{class:"text-sm font-medium truncate",title:s.page},e.toDisplayString(e.unref(S)(s.page)),9,we),e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:"h-full rounded-full bg-violet-500/70",style:e.normalizeStyle({width:`${s.clicks/a.value*100}%`})},null,4)])]),e.createElementVNode("div",$e,[e.createElementVNode("span",Be,[e.createVNode(e.unref(m.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)(s.clicks)),1)]),e.createElementVNode("span",Se,[e.createVNode(e.unref(m.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)(s.impressions)),1)]),e.createElementVNode("span",null,e.toDisplayString(e.unref(C)(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",e.unref($)(s.position)])}," #"+e.toDisplayString(e.unref(b)(s.position)),3)])])])])]))),128))]))}}),De={class:"divide-y"},ze={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Pe={class:"flex items-start gap-3"},Me={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5"},Fe={class:"flex-1 min-w-0"},Le={class:"flex flex-col @sm:flex-row @sm:items-center gap-2 @sm:gap-3"},Re={class:"flex-1 min-w-0 space-y-0.5"},qe={class:"text-sm font-medium"},Ae=["title"],Ue={class:"flex items-center gap-3 @sm:gap-4 text-xs text-muted-foreground @sm:shrink-0 flex-wrap"},Ke={class:"flex items-center gap-1"},Oe=e.defineComponent({__name:"SeoMappingTab",props:{queryPages:{}},setup(t){return(c,a)=>(e.openBlock(),e.createElementBlock("div",De,[t.queryPages.length===0?(e.openBlock(),e.createElementBlock("div",ze," No query-page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.queryPages,(n,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Pe,[e.createElementVNode("span",Me,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Fe,[e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[e.createElementVNode("p",qe,e.toDisplayString(n.query),1),e.createElementVNode("p",{class:"text-xs text-muted-foreground truncate",title:n.page},"→ "+e.toDisplayString(e.unref(S)(n.page)),9,Ae)]),e.createElementVNode("div",Ue,[e.createElementVNode("span",Ke,[e.createVNode(e.unref(m.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)(n.clicks)),1)]),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",e.unref($)(n.position)])}," #"+e.toDisplayString(e.unref(b)(n.position)),3)])])])])]))),128))]))}}),Ie={class:"flex flex-col gap-6 w-full max-w-7xl mx-auto py-8"},He={class:"flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center"},Xe={key:0,class:"flex items-center gap-2"},je={class:"flex items-center border rounded-lg overflow-hidden"},Ge=["onClick"],Je={class:"text-sm text-destructive font-medium"},Qe={key:3,class:"flex items-center justify-center py-20"},We={class:"grid grid-cols-1 @3xl:grid-cols-2 gap-4"},Ye={class:"border-b"},Ze={class:"flex"},et=e.defineComponent({__name:"SeoHealth",setup(t){const{config:c}=w.useModule(),{moduleId:a}=w.useModuleRoute();w.useModuleBreadcrumbs(()=>[{label:"SEO Health"}]);const n=e.ref(!0),d=e.ref(null),s=e.ref("30"),o=e.ref([]),l=e.ref({clicks:0,impressions:0,ctr:0,avgPosition:0}),i=e.ref([]),y=e.ref([]),B=e.ref([]),v=e.computed(()=>!!(c.serviceAccount&&c.propertyId&&c.siteUrl)),T=e.computed(()=>!!c.siteUrl);function N(x){return`/api/v1/modules/${a}${x}`}const D=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}];async function V(){if(!v.value)return;n.value=!0,d.value=null;const x=`${s.value}daysAgo`;try{const[r,h,k,f]=await Promise.all([$fetch(N(`/seo/trends?startDate=${x}&endDate=today`)),$fetch(N(`/seo/keywords?startDate=${x}&endDate=today&limit=50`)),$fetch(N(`/seo/pages?startDate=${x}&endDate=today&limit=30`)),$fetch(N(`/seo/query-pages?startDate=${x}&endDate=today`))]);o.value=r.rows||[],l.value=r.totals||{clicks:0,impressions:0,ctr:0,avgPosition:0},i.value=h.rows||[],y.value=k.rows||[],B.value=f.rows||[]}catch(r){d.value=r?.data?.statusMessage||r?.message||"Failed to load SEO data"}finally{n.value=!1}}e.watch(s,()=>V()),e.onMounted(()=>{v.value?V():n.value=!1});const p=e.ref("keywords");return(x,r)=>{const h=e.resolveComponent("Button"),k=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",He,[r[3]||(r[3]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"SEO Health"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Search Console performance & keyword rankings")],-1)),v.value?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",je,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(D,f=>e.createElementVNode("button",{key:f.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",s.value===f.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:tt=>s.value=f.value},e.toDisplayString(f.label),11,Ge)),64))]),e.createVNode(h,{variant:"outline",size:"icon",onClick:V,disabled:n.value},{default:e.withCtx(()=>[e.createVNode(e.unref(m.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":n.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),T.value?v.value?d.value?(e.openBlock(),e.createBlock(k,{key:2,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",Je,e.toDisplayString(d.value),1),e.createVNode(h,{variant:"outline",size:"sm",class:"mt-3",onClick:V},{default:e.withCtx(()=>[...r[7]||(r[7]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):n.value?(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(e.unref(m.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createVNode(K,{totals:l.value},null,8,["totals"]),e.createVNode(Z,{keywords:i.value},null,8,["keywords"]),e.createElementVNode("div",We,[e.createVNode(oe,{trends:o.value},null,8,["trends"]),e.createVNode(re,{trends:o.value},null,8,["trends"])]),e.createVNode(k,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",p.value==="keywords"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:r[0]||(r[0]=f=>p.value="keywords")},[e.createVNode(e.unref(m.Search),{class:"size-3.5 inline mr-1.5"}),r[8]||(r[8]=e.createTextVNode(" Keywords ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",p.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:r[1]||(r[1]=f=>p.value="pages")},[e.createVNode(e.unref(m.FileText),{class:"size-3.5 inline mr-1.5"}),r[9]||(r[9]=e.createTextVNode(" Pages ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",p.value==="mapping"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:r[2]||(r[2]=f=>p.value="mapping")},[e.createVNode(e.unref(m.ArrowUpRight),{class:"size-3.5 inline mr-1.5"}),r[10]||(r[10]=e.createTextVNode(" Keyword → Page ",-1))],2)])]),p.value==="keywords"?(e.openBlock(),e.createBlock(ke,{key:0,keywords:i.value},null,8,["keywords"])):e.createCommentVNode("",!0),p.value==="pages"?(e.openBlock(),e.createBlock(Te,{key:1,pages:y.value},null,8,["pages"])):e.createCommentVNode("",!0),p.value==="mapping"?(e.openBlock(),e.createBlock(Oe,{key:2,queryPages:B.value},null,8,["queryPages"])):e.createCommentVNode("",!0)]),_:1})],64)):(e.openBlock(),e.createBlock(k,{key:1,class:"p-8 text-center"},{default:e.withCtx(()=>[...r[6]||(r[6]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Configure your service account, property ID, and site URL in module settings.",-1)])]),_:1})):(e.openBlock(),e.createBlock(k,{key:0,class:"p-8 text-center space-y-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.AlertTriangle),{class:"size-10 text-amber-500 mx-auto"}),r[4]||(r[4]=e.createElementVNode("p",{class:"text-lg font-medium"},"Search Console not configured",-1)),r[5]||(r[5]=e.createElementVNode("p",{class:"text-sm text-muted-foreground max-w-md mx-auto"},[e.createTextVNode(" Add your "),e.createElementVNode("strong",null,"Search Console Site URL"),e.createTextVNode(" in the module settings to enable SEO data. Use the exact format from Google Search Console (e.g. "),e.createElementVNode("code",null,"https://example.com"),e.createTextVNode(" or "),e.createElementVNode("code",null,"sc-domain:example.com"),e.createTextVNode("). ")],-1))]),_:1}))])}}});exports.default=et;
|