PageSourceSearch

https://bluedreamsresort.com/_next/static/chunks/45036-c43be146318a5a45.js

js bluedreamsresort.com collected 2026-10-05 19:53:09 UTC 13,482 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45036],{45036:(e,t,l)=>{l.d(t,{ExportService:()=>o});var a=l(18720);class o{static triggerDownload(e,t){let l=URL.createObjectURL(e),a=document.createElement("a");a.href=l,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(l)}static async loadImageAsPngBase64(e){return new Promise(t=>{let l=new Image,a=!1,o=e=>{a||(a=!0,clearTimeout(r),t(e))},r=setTimeout(()=>o(null),4e3);l.crossOrigin="anonymous",l.onload=()=>{try{let e=document.createElement("canvas");e.width=l.naturalWidth||l.width,e.height=l.naturalHeight||l.height;let t=e.getContext("2d");t?(t.drawImage(l,0,0),o(e.toDataURL("image/png"))):o(null)}catch(e){console.warn("Failed to convert image to PNG:",e),o(null)}},l.onerror=()=>o(null),l.src=e})}static formatValue(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"€";return"string"==typeof e?e:"percent"===t?`%${e.toFixed(1)}`:"currency"===t?`${l}${Math.round(e).toLocaleString("tr-TR")}`:e.toLocaleString("tr-TR")}static normalize(e){return e?e.replace(/ğ/g,"g").replace(/Ğ/g,"G").replace(/ü/g,"u").replace(/Ü/g,"U").replace(/ş/g,"s").replace(/Ş/g,"S").replace(/ı/g,"i").replace(/İ/g,"I").replace(/ö/g,"o").replace(/Ö/g,"O").replace(/ç/g,"c").replace(/Ç/g,"C"):""}static async generatePMSReportPDF(e){let t=a.toast.loading("Dosya hazırlanıyor...");try{let r=await Promise.all([l.e(53930),l.e(85033),l.e(56241)]).then(l.bind(l,55172)),i=await l.e(36941).then(l.bind(l,36941)),n=r.jsPDF||r.default;if("function"!=typeof n)throw Error("jsPDF module is not available");let s=new n({orientation:"landscape",unit:"mm",format:"a4"}),d=s.internal.pageSize.getWidth(),c=s.internal.pageSize.getHeight(),g=d-30,m="TRY"===e.metadata.currency?"₺":"€",h=e.metadata.hotelName.toLowerCase(),u="/images/logo.png";h.includes("belconti")?u=
1"/belconti/logo.svg":(h.includes("blue-dreams")||h.includes("bluedreams")||h.includes("blue dreams"))&&(u="/bdr-logo-dark.png");let p=await this.loadImageAsPngBase64(u),b=(t,l)=>{let a=e.metadata;p?(s.addImage(p,"PNG",15,9,25,10),s.setFont("helvetica","bold"),s.setFontSize(14),s.setTextColor(30,41,59),s.text(o.normalize(a.hotelName.toUpperCase()),43,15)):(s.setFont("helvetica","bold"),s.setFontSize(14),s.setTextColor(30,41,59),s.text(o.normalize(a.hotelName.toUpperCase()),15,15)),s.setFontSize(11),s.setFont("helvetica","normal"),s.setTextColor(71,85,105),s.text(o.normalize(a.title),15,21),s.setFont("helvetica","bold"),s.setFontSize(14),s.setTextColor(30,58,138),s.text("PMA GRAVITY",d-15,15,{align:"right"}),s.setFontSize(8),s.setFont("helvetica","normal"),s.setTextColor(148,163,184);let r=a.exportDate||new Date().toLocaleString("tr-TR");s.text(`Tarih: ${o.normalize(r)}`,d-15,20,{align:"right"}),s.setDrawColor(226,232,240),s.setLineWidth(.5),s.line(15,25,d-15,25),s.setFontSize(8),s.setFont("helvetica","bold"),s.setTextColor(71,85,105);let i=`DONEM: ${o.normalize(a.dateRange)}  |  PARA BIRIMI: ${o.normalize(a.currency)}  |  CIRO: ${o.normalize(a.priceType.toUpperCase())}  |  BAZ TARIH: ${o.normalize(a.dateBasis.toUpperCase())}`;s.text(i,15,29),s.line(15,31,d-15,31)},C=(e,t)=>{s.setDrawColor(226,232,240),s.setLineWidth(.5),s.line(15,c-12,d-15,c-12),s.setFontSize(8),s.setFont("helvetica","normal"),s.setTextColor(148,163,184),s.text("PMA Partner / PPG Master Raporlama Ekosistemi",15,c-8),s.text(`Sayfa ${e} / ${t}`,d-15,c-8,{align:"right"})},f=36;e.blocks.forEach(e=>{if("kpi_grid"===e.type){f+25>c-15&&(s.addPage(),f=36);let t=e.kpis||[],l=t.length,a=(g-6*(l-1))/l,r=f;t.forEach((e,t)=>{let l=15+t*(a+6);s.setFillColor(248,250,252),s.setDrawColor(226,232,240),s.setLineWidth(.3),s.rect(l,r,a,22,"FD"),s.setFillColor(30,58,138),s.rect(l,r,2,22,"F"),s.setFont("helvetica","bold"),s.setFontSize(7.5),s.setTextColor(100,116,139),s.text(o.normalize(e.label.toUpperCase()),l+6,r+6),s.setFontSize(13),s.setTextColor(15,23,42);let i=this.formatValue(e.value,e.type,m);s.text(o.normalize(i),l+6,r+13),e.subValue&&(s.setFont("helvetica","italic"),s.setFontSize(7),s.setTextColor(148,163,184),s.text(o.normalize(e.subValue),l+6,r+18))}),f+=30}else if("chart"===e.type){f+100>c-15&&(s.addPage(),f=36);let t=f;if(e.chartImageBase64)s.addImage(e.chartImageBase64,"PNG",15,t,g,100);else if(e.chartData&&e.chartData.labels.length>0){let l=e.chartData;s.setDrawColor(241,245,249),s.setFillColor(255,255,255),s.rect(15,t,g,100,"FD"),s.setFont("helvetica","bold"),s.setFontSize(9),s.setTextColor(51,65,85),s.text("PERFORMANS VE TAHMIN TRENDI",20,t+7);let a=t+12,r=g-26,i=Math.max(...l.datasets.flatMap(e=>e.data),1);s.setFontSize(6.5),s.setFont("helvetica","normal"),s.setTextColor(148,163,184);for(let e=0;e<=4;e++){let t=a+78-19.5*e,l=i/4*e;s.setDrawColor(241,245,249),s.setLineWidth(.3),s.line(33,t,33+r,t);let o=l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(0)}k`:l.toFixed(0);s.text(o,30,t+1.5,{align:"right"})}let n=l.labels.length,d=r/n,c=l.datasets.length,m=.6*d/c;l.labels.forEach((e,t)=>{let r=33+t*d+d/2;s.setFontSize(7),s.setTextColor(100,116,139),s.text(o.normalize(e),r,a+78+5,{align:"center"}),l.datasets.forEach((e,l)=>{let o=(e.data[t]||0)/i*78;0===l?s.setFillColor(30,58,138):s.setFillColor(14,165,233),s.rect(r-c*m/2+l*m+1.2*(l>0),a+78-o,m,o,"F")})});let h=38,u=a+78+9;l.datasets.forEach((e,t)=>{s.setFillColor(0===t?30:14,0===t?58:165,0===t?138:233),s.rect(h,u,3,3,"F"),s.setFontSize(7),s.setFont("helvetica","bold"),s.setTextColor(71,85,105),s.text(o.normalize(e.label),h+5,u+2.5),h+=s.getTextWidth(o.normalize(e.label))+15})}f+=108}else if("data_table"===e.type){let t;f>80&&(s.addPage(),f=36),e.title&&(f+10>c-15&&(s.addPage(),f=36),s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(30,41,59),s.text(o.normalize(e.title.toUpperCase()),15,f),f+=5);let l=e.table,a=l.headers.map(e=>o.normalize(e)),r=l.rows.map(e=>e.map(e=>"string"==typeof e?o.normalize(e):e)),n=i.default||i.autoTable,d={startY:f,margin:{left:15,right:15},head:[a],body:r,theme:"striped",styles:{fontSize:8,font:"helvetica",cellPadding:3},headStyles:{fillColor:[30,58,138],textColor:[255,255,255],fontStyle:"bold"},alternateRowStyles:{fillColor:[248,250,252]},columnStyles:{...a.reduce((e,t,l)=>((t.toLowerCase().includes("gelir")||t.toLowerCase().includes("adr")||t.toLowerCase().includes("doluluk")||t.toLowerCase().includes("%")||t.toLowerCase().includes("oda")||t.toLowerCase().includes("gece")||t.toLowerCase().includes("tutar"))&&(e[l]={halign:"right"}),e),{})}};if("function"==typeof n)n(s,d);else if("function"==typeof s.autoTable)s.autoTable(d);else throw Error("jspdf-autotable is not loaded or registered");let m=t?.finalY??s.lastAutoTable?.finalY;
1if("number"!=typeof m)throw Error("jspdf-autotable did not return a table position");if(f=m+10,e.explanation){let t=s.splitTextToSize(o.normalize(e.explanation),g-10),l=5*t.length+6;f+l>c-15&&(s.addPage(),f=36),s.setFillColor(240,249,255),s.setDrawColor(186,230,253),s.setLineWidth(.3),s.rect(15,f,g,l,"FD"),s.setFillColor(14,165,233),s.rect(15,f,2,l,"F"),s.setFont("helvetica","italic"),s.setFontSize(8.5),s.setTextColor(3,105,161),t.forEach((e,t)=>{s.text(e,21,f+5+5*t)}),f+=l+8}}});let F=s.getNumberOfPages();for(let e=1;e<=F;e++)s.setPage(e),b(e,F),C(e,F);let x=e.metadata.title.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-"),w=s.output("blob"),z=`pms-report-${x}.pdf`;return this.triggerDownload(w,z),a.toast.dismiss(t),a.toast.success("PDF indirildi",{description:z,action:{label:"Tekrar indir",onClick:()=>{this.triggerDownload(w,z)}},duration:8e3}),!0}catch(e){return a.toast.dismiss(t),a.toast.error("Dosya hazırlanırken bir hata oluştu."),console.error("[ExportService] PDF generate error:",e),!1}}static async generateAnalyticalExcel(e){let t=a.toast.loading("Dosya hazırlanıyor...");try{let o=new((await l.e(10343).then(l.t.bind(l,39280,23))).default||await l.e(10343).then(l.t.bind(l,39280,23))).Workbook;o.creator="PMA Partner / PPG Master",o.created=new Date;let r=e.metadata,i=o.addWorksheet("\xd6zet & Dashboard",{properties:{tabColor:{argb:"1E3A8B"}},views:[{showGridLines:!0}]}),n=r.hotelName.toLowerCase(),s="/images/logo.png";n.includes("belconti")?s=
1"/belconti/logo.svg":(n.includes("blue-dreams")||n.includes("bluedreams")||n.includes("blue dreams"))
1&&(s="/bdr-logo-dark.png");let d=await this.loadImageAsPngBase64(s);if(d)try{let e=o.addImage({base64:d,extension:"png"});i.addImage(e,{tl:{col:0,row:0},ext:{width:100,height:40}})}catch(e){console.warn("[ExportService] Excel logo embed failed:",e)}i.getCell("D1").value=r.hotelName.toUpperCase(),i.getCell("D1").font={name:"Calibri",size:14,bold:!0,color:{argb:"1E3A8B"}},i.getCell("D2").value=`${r.title} — Y\xf6netici \xd6zeti`,i.getCell("D2").font={name:"Calibri",size:12,bold:!0,color:{argb:"475569"}};let c=`D\xf6nem: ${r.dateRange}  |  Para Birimi: ${r.currency}  |  Ciro T\xfcr\xfc: ${r.priceType}  |  Baz Tarih: ${r.dateBasis}`;i.getCell("D3").value=c,i.getCell("D3").font={name:"Calibri",size:9,italic:!0,color:{argb:"64748B"}};let g=6,m=0;for(let t of e.blocks)if("kpi_grid"===t.type)i.getCell(`A${g}`).value="METRİK A\xc7IKLAMASI",i.getCell(`B${g}`).value="DEĞER",i.getCell(`C${g}`).value="A\xc7IKLAMA / HEDEF",["A","B","C"].forEach(e=>{let t=i.getCell(`${e}${g}`);t.font={name:"Calibri",size:10,bold:!0,color:{argb:"FFFFFF"}},t.fill={type:"pattern",pattern:"solid",fgColor:{argb:"1E3A8B"}},t.alignment={vertical:"middle",horizontal:"B"===e?"right":"left"}}),t.kpis.forEach((e,t)=>{let l=g+1+t;i.getCell(`A${l}`).value=e.label,i.getCell(`B${l}`).value=Number(e.value),i.getCell(`C${l}`).value=e.subValue||"";let a=i.getCell(`B${l}`);"currency"===e.type?a.numFmt="TRY"===r.currency?'"₺"#,##0':'"€"#,##0':"percent"===e.type?(a.value=Number(e.value)/100,a.numFmt="0.0%"):"text"!==e.type&&(a.numFmt="#,##0"),i.getCell(`A${l}`).font={name:"Calibri",size:10,bold:!0},a.font={name:"Calibri",size:11,bold:!0,color:{argb:"0F172A"}},i.getCell(`C${l}`).font={name:"Calibri",size:9,italic:!0,color:{argb:"64748B"}};let o=t%2==0?"F8FAFC":"FFFFFF";["A","B","C"].forEach(e=>{let t=i.getCell(`${e}${l}`);t.fill={type:"pattern",pattern:"solid",fgColor:{argb:o}},t.border={bottom:{style:"thin",color:{argb:"E2E8F0"}}},t.alignment={vertical:"middle",horizontal:"B"===e?"right":"left"}})}),g+=t.kpis.length+3;else if("chart"===t.type&&t.chartImageBase64)try{let e=o.addImage({base64:t.chartImageBase64,extension:"png"});i.addImage(e,{tl:{col:4,row:5},ext:{width:520,height:260}})}catch(e){console.warn("[ExportService] Could not embed Excel chart image:",e)}else if("data_table"===t.type){m++;let e=t.title||`Detay Tablo ${m}`,l=o.addWorksheet(e.slice(0,31),{properties:{tabColor:{argb:"0EA5E9"}},views:[{showGridLines:!0,state:"frozen",ySplit:4}]});l.getCell("A1").value=e.toUpperCase(),l.getCell("A1").font={name:"Calibri",size:12,bold:!0,color:{argb:"0EA5E9"}},l.getCell("A2").value=`Aşağıda raporun kırılım bazlı veri tablosu yer almaktadır.`,l.getCell("A2").font={name:"Calibri",size:9,color:{argb:"64748B"}},l.addRow([]);let a=t.table,i=l.addRow(a.headers);i.height=24,i.eachCell(e=>{e.font={name:"Calibri",size:10,bold:!0,color:{argb:"FFFFFF"}},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"0F172A"}},e.alignment={vertical:"middle",horizontal:"left"}}),a.rows.forEach((e,t)=>{let o=e.map((e,t)=>{let l=a.headers[t]?.toLowerCase()||"";if("string"==typeof e){let t=e.replace(/[^\d.-]/g,"");if(t&&!isNaN(Number(t)))return l.includes("%")||l.includes("doluluk")?Number(t)/100:Number(t)}return e}),i=l.addRow(o);i.height=20,i.eachCell((e,l)=>{e.font={name:"Calibri",size:10},e.alignment={vertical:"middle"};let o=a.headers[l-1]?.toLowerCase()||"",i=o.includes("gelir")||o.includes("adr")||o.includes("fiyat")||o.includes("tutar"),n=o.includes("doluluk")||o.includes("%"),s=o.includes("oda")||o.includes("gece")||o.includes("adet")||o.includes("rezervasyon")||o.includes("nights");"number"==typeof e.value&&(i?(e.numFmt="TRY"===r.currency?'"₺"#,##0':'"€"#,##0',e.alignment={horizontal:"right",vertical:"middle"}):n?(e.numFmt="0.0%",e.alignment={horizontal:"right",vertical:"middle"}):s&&(e.numFmt="#,##0",e.alignment={horizontal:"right",vertical:"middle"})),t%2==0&&(e.fill={type:"pattern",pattern:"solid",fgColor:{argb:"F8FAFC"}}),e.border={bottom:{style:"thin",color:{argb:"F1F5F9"}}}})});let n=String.fromCharCode(64+a.headers.length);if(l.autoFilter=`A4:${n}${4+a.rows.length}`,t.explanation){l.addRow([]);let e=l.addRow([t.explanation]);l.mergeCells(`A${e.number}:${n}${e.number}`),e.height=30;let a=l.getCell(`A${e.number}`);a.font={name:"Calibri",size:10,italic:!0,color:{argb:"0369A1"}},a.fill={type:"pattern",pattern:"solid",fgColor:{argb:"F0F9FF"}},a.alignment={wrapText:!0,vertical:"middle"}}}
1o.worksheets.forEach(e=>{e.columns.forEach(e=>{let t=0;e.eachCell({includeEmpty:!0},e=>{let l=e.value,a=0;null!=l&&(a="object"==typeof l&&l.text?l.text.toString().length:l.toString().length),a>t&&(t=a)}),e.width=Math.max(t+4,12)})});let h=await o.xlsx.writeBuffer(),u=r.title.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-"),p=new Blob([h],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),b=`pms-report-${u}.xlsx`;return this.triggerDownload(p,b),a.toast.dismiss(t),a.toast.success("Excel indirildi",{description:b,action:{label:"Tekrar indir",onClick:()=>{this.triggerDownload(p,b)}},duration:8e3}),!0}catch(e){return a.toast.dismiss(t),a.toast.error("Dosya hazırlanırken bir hata oluştu."),console.error("[ExportService] Excel generate error:",e),!1}}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.