(()=>{var e={};e.id=3,e.ids=[3],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},4080:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>i.a,__next_app__:()=>h,originalPathname:()=>u,pages:()=>c,routeModule:()=>m,tree:()=>d}),r(8748),r(5481),r(5866);var a=r(3191),s=r(8716),n=r(7922),i=r.n(n),l=r(5231),o={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>l[e]);r.d(t,o);let d=["",{children:["admin",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,8748)),"/home/syoul/Ccompagnon Marama/app/admin/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,5481)),"/home/syoul/Ccompagnon Marama/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,5866,23)),"next/dist/client/components/not-found-error"]}],c=["/home/syoul/Ccompagnon Marama/app/admin/page.tsx"],u="/admin/page",h={require:r,loadChunk:()=>Promise.resolve()},m=new a.AppPageRouteModule({definition:{kind:s.x.APP_PAGE,page:"/admin/page",pathname:"/admin",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},9705:(e,t,r)=>{Promise.resolve().then(r.bind(r,7042))},7274:(e,t,r)=>{Promise.resolve().then(r.bind(r,7904)),Promise.resolve().then(r.bind(r,7459))},9401:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,2994,23)),Promise.resolve().then(r.t.bind(r,6114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,9671,23)),Promise.resolve().then(r.t.bind(r,1868,23)),Promise.resolve().then(r.t.bind(r,4759,23))},7042:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>F});var a,s=r(326),n=r(7577),i=r(5047),l=r(2881);let o=(0,l.Z)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);var d=r(772),c=r(4633);function u({children:e}){let t=(0,i.useRouter)();return(0,s.jsxs)("div",{className:"min-h-screen bg-background dark:bg-background-dark",children:[s.jsx("header",{className:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 shadow-sm",children:(0,s.jsxs)("div",{className:"max-w-4xl mx-auto px-4 py-4 flex items-center justify-between",children:[s.jsx("h1",{className:"text-xl font-bold text-primary dark:text-primary",children:"Administration"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[s.jsx(c.T,{}),(0,s.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>{localStorage.removeItem("adminPassword"),t.push("/admin/login")},className:"dark:border-gray-700 dark:text-gray-300",children:[s.jsx(o,{className:"h-4 w-4 mr-2"}),"D\xe9connexion"]})]})]})}),s.jsx("main",{className:"max-w-4xl mx-auto px-4 py-6",children:e})]})}var h=r(2643),m=Object.defineProperty,g=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,x=(e,t,r)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))p.call(t,r)&&x(e,r,t[r]);if(g)for(var r of g(t))f.call(t,r)&&x(e,r,t[r]);return e},v=(e,t)=>{var r={};for(var a in e)p.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&g)for(var a of g(e))0>t.indexOf(a)&&f.call(e,a)&&(r[a]=e[a]);return r};(e=>{let t=class t{constructor(e,r,a,n){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw RangeError("Version value out of range");if(n<-1||n>7)throw RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let e=0;e7)throw RangeError("Invalid value");for(c=n;;c++){let r=8*t.getNumDataCodewords(c,a),s=i.getTotalBits(e,c);if(s<=r){u=s;break}if(c>=l)throw RangeError("Data too long")}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&u<=8*t.getNumDataCodewords(c,e)&&(a=e);let h=[];for(let t of e)for(let e of(r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(c),h),t.getData()))h.push(e);s(h.length==u);let m=8*t.getNumDataCodewords(c,a);s(h.length<=m),r(0,Math.min(4,m-h.length),h),r(0,(8-h.length%8)%8,h),s(h.length%8==0);for(let e=236;h.lengthg[t>>>3]|=e<<7-(7&t)),new t(c,a,g,o)}getModule(e,t){return 0<=e&&e>>9)*1335;let n=(t<<10|r)^21522;s(n>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,a(n,e));this.setFunctionModule(8,7,a(n,6)),this.setFunctionModule(8,8,a(n,7)),this.setFunctionModule(7,8,a(n,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,a(n,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,a(n,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,a(n,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;s(t>>>18==0);for(let e=0;e<18;e++){let r=a(t,e),s=this.size-11+e%3,n=Math.floor(e/3);this.setFunctionModule(s,n,r),this.setFunctionModule(n,s,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let a=-4;a<=4;a++){let s=Math.max(Math.abs(a),Math.abs(r)),n=e+a,i=t+r;0<=n&&n{(e!=d-i||r>=o)&&h.push(t[e])});return s(h.length==l),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let s=0;s>>3],7-(7&r)),r++)}}s(r==8*e.length)}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t5&&e++:(this.finderPenaltyAddHistory(s,n),a||(e+=this.finderPenaltyCountPatterns(n)*t.PENALTY_N3),a=this.modules[r][i],s=1);e+=this.finderPenaltyTerminateAndCount(a,s,n)*t.PENALTY_N3}for(let r=0;r5&&e++:(this.finderPenaltyAddHistory(s,n),a||(e+=this.finderPenaltyCountPatterns(n)*t.PENALTY_N3),a=this.modules[i][r],s=1);e+=this.finderPenaltyTerminateAndCount(a,s,n)*t.PENALTY_N3}for(let r=0;re+(t?1:0),r);let a=this.size*this.size,n=Math.ceil(Math.abs(20*r-10*a)/a)-1;return s(0<=n&&n<=9),s(0<=(e+=n*t.PENALTY_N4)&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{let e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),r=[6];for(let a=this.size-7;r.lengtht.MAX_VERSION)throw RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return s(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError("Degree out of range");let r=[];for(let t=0;t0);for(let s of e){let e=s^a.shift();a.push(0),r.forEach((r,s)=>a[s]^=t.reedSolomonMultiply(r,e))}return a}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let r=0;for(let a=7;a>=0;a--)r=r<<1^(r>>>7)*285^(t>>>a&1)*e;return s(r>>>8==0),r}finderPenaltyCountPatterns(e){let t=e[1];s(t<=3*this.size);let r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let a=t-1;a>=0;a--)r.push(e>>>a&1)}function a(e,t){return(e>>>t&1)!=0}function s(e){if(!e)throw Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;let n=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let a=[];for(let e of t)r(e,8,a);return new e(e.Mode.BYTE,t.length,a)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError("String contains non-numeric characters");let a=[];for(let e=0;e=1<{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||(e.QrCode={}))})(a||(a={})),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||(e.QrSegment={}))})(a||(a={}));var b=a,w={L:b.QrCode.Ecc.LOW,M:b.QrCode.Ecc.MEDIUM,Q:b.QrCode.Ecc.QUARTILE,H:b.QrCode.Ecc.HIGH},N="#FFFFFF",C="#000000";function j(e,t=0){let r=[];return e.forEach(function(e,a){let s=null;e.forEach(function(n,i){if(!n&&null!==s){r.push(`M${s+t} ${a+t}h${i-s}v1H${s+t}z`),s=null;return}if(i===e.length-1){if(!n)return;null===s?r.push(`M${i+t},${a+t} h1v1H${i+t}z`):r.push(`M${s+t},${a+t} h${i+1-s}v1H${s+t}z`);return}n&&null===s&&(s=i)})}),r.join("")}function M(e,t){return e.slice().map((e,r)=>r=t.y+t.h?e:e.map((e,r)=>(r=t.x+t.w)&&e))}function k({value:e,level:t,minVersion:r,includeMargin:a,marginSize:s,imageSettings:i,size:l,boostLevel:o}){let d=n.useMemo(()=>{let a=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...b.QrSegment.makeSegments(t)),e),[]);return b.QrCode.encodeSegments(a,w[t],r,void 0,void 0,o)},[e,t,r,o]),{cells:c,margin:u,numCells:h,calculatedImageSettings:m}=n.useMemo(()=>{let e=d.getModules(),t=null!=s?Math.max(Math.floor(s),0):a?4:0,r=e.length+2*t,n=function(e,t,r,a){if(null==a)return null;let s=e.length+2*r,n=Math.floor(.1*t),i=s/t,l=(a.width||n)*i,o=(a.height||n)*i,d=null==a.x?e.length/2-l/2:a.x*i,c=null==a.y?e.length/2-o/2:a.y*i,u=null==a.opacity?1:a.opacity,h=null;if(a.excavate){let e=Math.floor(d),t=Math.floor(c);h={x:e,y:t,w:Math.ceil(l+d-e),h:Math.ceil(o+c-t)}}return{x:d,y:c,h:o,w:l,excavation:h,opacity:u,crossOrigin:a.crossOrigin}}(e,l,t,i);return{cells:e,margin:t,numCells:r,calculatedImageSettings:n}},[d,l,i,a,s]);return{qrcode:d,margin:u,cells:c,numCells:h,calculatedImageSettings:m}}var E=function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0}();n.forwardRef(function(e,t){let{value:r,size:a=128,level:s="L",bgColor:i=N,fgColor:l=C,includeMargin:o=!1,minVersion:d=1,boostLevel:c,marginSize:u,imageSettings:h}=e,m=v(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:g}=m,p=v(m,["style"]),f=null==h?void 0:h.src,x=n.useRef(null),b=n.useRef(null),w=n.useCallback(e=>{x.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[P,R]=n.useState(!1),{margin:A,cells:z,numCells:S,calculatedImageSettings:I}=k({value:r,level:s,minVersion:d,boostLevel:c,includeMargin:o,marginSize:u,imageSettings:h,size:a});n.useEffect(()=>{if(null!=x.current){let e=x.current,t=e.getContext("2d");if(!t)return;let r=z,s=b.current,n=null!=I&&null!==s&&s.complete&&0!==s.naturalHeight&&0!==s.naturalWidth;n&&null!=I.excavation&&(r=M(z,I.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let d=a/S*o;t.scale(d,d),t.fillStyle=i,t.fillRect(0,0,S,S),t.fillStyle=l,E?t.fill(new Path2D(j(r,A))):z.forEach(function(e,r){e.forEach(function(e,a){e&&t.fillRect(a+A,r+A,1,1)})}),I&&(t.globalAlpha=I.opacity),n&&t.drawImage(s,I.x+A,I.y+A,I.w,I.h)}}),n.useEffect(()=>{R(!1)},[f]);let _=y({height:a,width:a},g),O=null;return null!=f&&(O=n.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{R(!0)},ref:b,crossOrigin:null==I?void 0:I.crossOrigin})),n.createElement(n.Fragment,null,n.createElement("canvas",y({style:_,height:a,width:a,ref:w,role:"img"},p)),O)}).displayName="QRCodeCanvas";var P=n.forwardRef(function(e,t){let{value:r,size:a=128,level:s="L",bgColor:i=N,fgColor:l=C,includeMargin:o=!1,minVersion:d=1,boostLevel:c,title:u,marginSize:h,imageSettings:m}=e,g=v(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:p,cells:f,numCells:x,calculatedImageSettings:b}=k({value:r,level:s,minVersion:d,boostLevel:c,includeMargin:o,marginSize:h,imageSettings:m,size:a}),w=f,E=null;null!=m&&null!=b&&(null!=b.excavation&&(w=M(f,b.excavation)),E=n.createElement("image",{href:m.src,height:b.h,width:b.w,x:b.x+p,y:b.y+p,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));let P=j(w,p);return n.createElement("svg",y({height:a,width:a,viewBox:`0 0 ${x} ${x}`,ref:t,role:"img"},g),!!u&&n.createElement("title",null,u),n.createElement("path",{fill:i,d:`M0,0 h${x}v${x}H0z`,shapeRendering:"crispEdges"}),n.createElement("path",{fill:l,d:P,shapeRendering:"crispEdges"}),E)});P.displayName="QRCodeSVG";var R=r(2933),A=r(3810);function z({url:e,size:t=200}){let[r,a]=(0,n.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),a(!0),alert(`✅ Lien copi\xe9 ! ${e} Vous pouvez maintenant le coller (Ctrl+V) pour le partager avec votre client.`),setTimeout(()=>a(!1),3e3)}catch(r){console.error("Erreur lors de la copie:",r);let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",document.body.appendChild(t),t.select();try{document.execCommand("copy")?(a(!0),alert(`✅ Lien copi\xe9 ! ${e} Vous pouvez maintenant le coller (Ctrl+V) pour le partager avec votre client.`),setTimeout(()=>a(!1),3e3)):alert(`Copiez ce lien manuellement: ${e}`)}catch(t){alert(`Copiez ce lien manuellement: ${e}`)}document.body.removeChild(t)}};return(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4 p-6 bg-white rounded-2xl border border-gray-200",children:[s.jsx(P,{value:e,size:t,level:"H"}),(0,s.jsxs)("div",{className:"w-full space-y-3",children:[s.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Lien unique :"}),s.jsx("textarea",{readOnly:!0,value:e,onClick:e=>e.currentTarget.select(),onFocus:e=>e.currentTarget.select(),className:"w-full p-3 text-sm font-mono text-primary bg-secondary border-2 border-primary rounded-lg resize-none",rows:3,style:{cursor:"text"}}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx(d.z,{size:"sm",onClick:i,className:`flex-1 ${r?"bg-green-600 hover:bg-green-700":""}`,children:r?(0,s.jsxs)(s.Fragment,{children:[s.jsx(R.Z,{className:"h-4 w-4 mr-2"}),"Copi\xe9 !"]}):(0,s.jsxs)(s.Fragment,{children:[s.jsx(A.Z,{className:"h-4 w-4 mr-2"}),"Copier"]})}),s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>{let e=document.querySelector("textarea[readonly]");e&&e.select()},className:"flex-1",children:"S\xe9lectionner"})]}),s.jsx("p",{className:"text-xs text-gray-500 text-center",children:"\uD83D\uDCA1 Cliquez sur le lien pour le s\xe9lectionner, puis Ctrl+C pour copier"})]})]})}function S({client:e,onSuccess:t,onCancel:r}){let[a,i]=(0,n.useState)({email:e?.email||"",bungalowNumber:e?.bungalowNumber||"",wifiName:e?.wifiName||"Lagon-WiFi",wifiPassword:e?.wifiPassword||"",gerantMessage:e?.gerantMessage||"Bienvenue dans notre pension de famille !"}),[l,o]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[m,g]=(0,n.useState)(e||null),[p,f]=(0,n.useState)(!1),x=async r=>{r.preventDefault(),o(!0),u(null);try{let r=localStorage.getItem("adminPassword")||"",s=e?`/api/admin/clients/${e.id}`:"/api/admin/clients",n=await fetch(s,{method:e?"PUT":"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(a)});if(!n.ok){let e=await n.json();throw Error(e.error||"Erreur lors de la sauvegarde")}let i=await n.json();g(i),t()}catch(e){u(e.message)}finally{o(!1)}},y=()=>m?`/accueil?token=${m.token}`:"",v=async()=>{let e=y();try{await navigator.clipboard.writeText(e),f(!0),alert(`✅ Lien copi\xe9 ! ${e} Vous pouvez maintenant le coller (Ctrl+V) pour le partager avec votre client.`),setTimeout(()=>f(!1),3e3)}catch(r){console.error("Erreur lors de la copie:",r);let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",document.body.appendChild(t),t.select();try{document.execCommand("copy")?(f(!0),alert(`✅ Lien copi\xe9 ! ${e} Vous pouvez maintenant le coller (Ctrl+V) pour le partager avec votre client.`),setTimeout(()=>f(!1),3e3)):alert(`❌ Copie automatique non support\xe9e. Veuillez copier manuellement le lien: ${e}`)}catch(t){alert(`❌ Copie automatique non support\xe9e. Veuillez copier manuellement le lien: ${e}`)}document.body.removeChild(t)}};return(0,s.jsxs)(h.Zb,{children:[s.jsx(h.Ol,{children:s.jsx(h.ll,{children:e?"Modifier le client":"Nouveau client"})}),(0,s.jsxs)(h.aY,{children:[(0,s.jsxs)("form",{onSubmit:x,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email *"}),s.jsx("input",{type:"email",required:!0,value:a.email,onChange:e=>i({...a,email:e.target.value}),disabled:!!e,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary focus:border-transparent disabled:bg-gray-100"})]}),(0,s.jsxs)("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Num\xe9ro de bungalow *"}),s.jsx("input",{type:"text",required:!0,value:a.bungalowNumber,onChange:e=>i({...a,bungalowNumber:e.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary focus:border-transparent"})]}),(0,s.jsxs)("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Nom du WiFi"}),s.jsx("input",{type:"text",value:a.wifiName,onChange:e=>i({...a,wifiName:e.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary focus:border-transparent"})]}),(0,s.jsxs)("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Mot de passe WiFi"}),s.jsx("input",{type:"text",value:a.wifiPassword,onChange:e=>i({...a,wifiPassword:e.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary focus:border-transparent"})]}),(0,s.jsxs)("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message du g\xe9rant"}),s.jsx("textarea",{value:a.gerantMessage,onChange:e=>i({...a,gerantMessage:e.target.value}),rows:3,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-primary focus:border-transparent"})]}),c&&s.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-xl text-sm",children:c}),(0,s.jsxs)("div",{className:"flex gap-3",children:[s.jsx(d.z,{type:"button",variant:"outline",onClick:r,className:"flex-1",children:"Annuler"}),s.jsx(d.z,{type:"submit",disabled:l,className:"flex-1",children:l?"Enregistrement...":e?"Modifier":"Cr\xe9er"})]})]}),m&&!e&&(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:[s.jsx("h3",{className:"font-semibold text-primary mb-3",children:"Client cr\xe9\xe9 avec succ\xe8s !"}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-700 mb-2",children:"Lien unique :"}),(0,s.jsxs)("div",{className:"bg-secondary rounded-xl p-4 space-y-3",children:[s.jsx("textarea",{readOnly:!0,value:y(),onClick:e=>e.currentTarget.select(),onFocus:e=>e.currentTarget.select(),className:"w-full p-3 text-sm font-mono text-primary bg-white border-2 border-primary rounded-lg resize-none",rows:3,style:{cursor:"text"}}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx(d.z,{size:"sm",onClick:v,className:`flex-1 ${p?"bg-green-600 hover:bg-green-700":""}`,children:p?(0,s.jsxs)(s.Fragment,{children:[s.jsx(R.Z,{className:"h-4 w-4 mr-2"}),"Copi\xe9 !"]}):(0,s.jsxs)(s.Fragment,{children:[s.jsx(A.Z,{className:"h-4 w-4 mr-2"}),"Copier"]})}),s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>{let e=document.querySelector("textarea[readonly]");e&&e.select()},className:"flex-1",children:"S\xe9lectionner"})]})]}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"\uD83D\uDCA1 Cliquez sur le lien pour le s\xe9lectionner, puis Ctrl+C pour copier"})]}),(0,s.jsxs)("div",{children:[s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"QR Code :"}),s.jsx(z,{url:y()})]})]})]})]})]})}let I=(0,l.Z)("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]),_=(0,l.Z)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),O=(0,l.Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function L({onEdit:e,onRefresh:t}){let[r,a]=(0,n.useState)([]),[i,l]=(0,n.useState)(!0),[o,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(null),g=async()=>{try{let e=localStorage.getItem("adminPassword")||"",t=await fetch("/api/admin/clients",{headers:{Authorization:`Bearer ${e}`}});if(t.ok){let e=await t.json();a(e)}else 404===t.status?console.warn("API non disponible en mode statique"):console.error("Erreur lors du chargement des clients:",t.status),a([])}catch(e){console.warn("API non disponible (mode statique/APK). Les fonctionnalit\xe9s admin n\xe9cessitent un serveur."),a([])}finally{l(!1)}},p=async e=>{if(confirm("\xcates-vous s\xfbr de vouloir supprimer ce client ?"))try{let r=localStorage.getItem("adminPassword")||"";(await fetch(`/api/admin/clients/${e}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`}})).ok&&(g(),t())}catch(e){console.error("Erreur lors de la suppression:",e)}},f=e=>`/accueil?token=${e}`;return i?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Chargement..."})}):0===r.length?s.jsx(h.Zb,{children:(0,s.jsxs)(h.aY,{className:"py-8 text-center space-y-4",children:[s.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Aucun client pour le moment."}),(0,s.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-xl p-4 text-sm text-yellow-800 dark:text-yellow-300",children:[s.jsx("p",{className:"font-semibold mb-1",children:"⚠️ Mode hors ligne"}),s.jsx("p",{children:"L'application admin n\xe9cessite une connexion au serveur pour fonctionner. Les API routes ne sont pas disponibles en mode statique."})]})]})}):s.jsx("div",{className:"space-y-4",children:r.map(t=>(0,s.jsxs)(h.Zb,{children:[s.jsx(h.Ol,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex-1",children:[s.jsx(h.ll,{className:"text-lg",children:t.email}),(0,s.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:["Bungalow ",t.bungalowNumber]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>{let e=f(t.token);navigator.clipboard.writeText(e)},children:s.jsx(A.Z,{className:"h-4 w-4"})}),s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>m(u===t.id?null:t.id),children:s.jsx(I,{className:"h-4 w-4"})}),s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>e(t),children:s.jsx(_,{className:"h-4 w-4"})}),s.jsx(d.z,{size:"sm",variant:"outline",onClick:()=>p(t.id),children:s.jsx(O,{className:"h-4 w-4"})})]})]})}),(0,s.jsxs)(h.aY,{children:[(0,s.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,s.jsxs)("div",{children:[s.jsx("span",{className:"font-medium",children:"WiFi:"})," ",t.wifiName]}),(0,s.jsxs)("div",{children:[s.jsx("span",{className:"font-medium",children:"Message:"})," ",t.gerantMessage.substring(0,50),t.gerantMessage.length>50?"...":""]}),(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:["Cr\xe9\xe9 le ",new Date(t.createdAt).toLocaleDateString("fr-FR")]})]}),u===t.id&&s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200",children:s.jsx(z,{url:f(t.token),size:150})})]})]},t.id))})}let T=(0,l.Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);function F(){let[e,t]=(0,n.useState)(!1),[r,a]=(0,n.useState)(),[l,o]=(0,n.useState)(0);return(0,i.useRouter)(),s.jsx(u,{children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-2xl font-bold text-primary",children:"Gestion des clients"}),!e&&(0,s.jsxs)(d.z,{onClick:()=>{a(void 0),t(!0)},children:[s.jsx(T,{className:"h-4 w-4 mr-2"}),"Nouveau client"]})]}),e?s.jsx(S,{client:r,onSuccess:()=>{t(!1),a(void 0),o(e=>e+1)},onCancel:()=>{t(!1),a(void 0)}}):s.jsx(L,{onEdit:e=>{a(e),t(!0)},onRefresh:()=>o(e=>e+1)})]})})}},7904:(e,t,r)=>{"use strict";function a(){return null}r.d(t,{default:()=>a}),r(7577)},7459:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var a=r(326),s=r(4831);function n({children:e,...t}){return a.jsx(s.f,{...t,children:e})}},4633:(e,t,r)=>{"use strict";r.d(t,{T:()=>d});var a=r(326),s=r(4831),n=r(850),i=r(2607),l=r(772),o=r(7577);function d(){let{theme:e,setTheme:t}=(0,s.F)(),[r,d]=(0,o.useState)(!1);return r?a.jsx(l.z,{variant:"ghost",size:"sm",onClick:()=>t("dark"===e?"light":"dark"),className:"h-10 w-10 rounded-full hover:bg-secondary dark:hover:bg-gray-800 p-0","aria-label":"Changer de th\xe8me",children:"dark"===e?a.jsx(n.Z,{className:"h-5 w-5 text-primary dark:text-yellow-400"}):a.jsx(i.Z,{className:"h-5 w-5 text-primary dark:text-blue-300"})}):a.jsx(l.z,{variant:"ghost",size:"sm",className:"h-9 w-9 rounded-full p-0","aria-label":"Changer de th\xe8me",children:a.jsx(n.Z,{className:"h-5 w-5"})})}},772:(e,t,r)=>{"use strict";r.d(t,{z:()=>o});var a=r(326),s=r(7577),n=r(9360),i=r(7863);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-xl text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 dark:bg-primary dark:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 dark:bg-primary/20 dark:text-primary dark:hover:bg-primary/30",outline:"border-2 border-primary text-primary hover:bg-primary hover:text-white dark:border-primary dark:text-primary dark:hover:bg-primary dark:hover:text-white",ghost:"hover:bg-secondary hover:text-secondary-foreground dark:hover:bg-gray-800 dark:hover:text-gray-200"},size:{default:"h-12 px-6 py-3",sm:"h-10 px-4",lg:"h-14 px-8 text-lg"}},defaultVariants:{variant:"default",size:"default"}}),o=s.forwardRef(({className:e,variant:t,size:r,...s},n)=>a.jsx("button",{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:n,...s}));o.displayName="Button"},2643:(e,t,r)=>{"use strict";r.d(t,{Ol:()=>l,Zb:()=>i,aY:()=>d,ll:()=>o});var a=r(326),s=r(7577),n=r(7863);let i=s.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:(0,n.cn)("rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm",e),...t}));i.displayName="Card";let l=s.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",e),...t}));l.displayName="CardHeader";let o=s.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:(0,n.cn)("text-xl font-semibold leading-none tracking-tight text-primary",e),...t}));o.displayName="CardTitle",s.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:(0,n.cn)("text-sm text-gray-600 dark:text-gray-400",e),...t})).displayName="CardDescription";let d=s.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:(0,n.cn)("p-6 pt-0",e),...t}));d.displayName="CardContent",s.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:(0,n.cn)("flex items-center p-6 pt-0",e),...t})).displayName="CardFooter"},7863:(e,t,r)=>{"use strict";r.d(t,{cn:()=>n});var a=r(1135),s=r(1009);function n(...e){return(0,s.m6)((0,a.W)(e))}},2881:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var a=r(7577);let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:l="",children:o,iconNode:d,...c},u)=>(0,a.createElement)("svg",{ref:u,...i,width:t,height:t,stroke:e,strokeWidth:s?24*Number(r)/Number(t):r,className:n("lucide",l),...c},[...d.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(o)?o:[o]])),o=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...i},o)=>(0,a.createElement)(l,{ref:o,iconNode:t,className:n(`lucide-${s(e)}`,r),...i}));return r.displayName=`${e}`,r}},2933:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});let a=(0,r(2881).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},3810:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});let a=(0,r(2881).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},2607:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});let a=(0,r(2881).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},850:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});let a=(0,r(2881).Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},8748:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});let a=(0,r(8570).createProxy)(String.raw`/home/syoul/Ccompagnon Marama/app/admin/page.tsx#default`)},5481:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,metadata:()=>d});var a=r(9510),s=r(5384),n=r.n(s);r(7272);var i=r(8570);let l=(0,i.createProxy)(String.raw`/home/syoul/Ccompagnon Marama/components/PWARegister.tsx#default`),o=(0,i.createProxy)(String.raw`/home/syoul/Ccompagnon Marama/components/ThemeProvider.tsx#ThemeProvider`),d={title:"Compagnon du lagon - Pension Marama",description:"Votre guide num\xe9rique pour votre s\xe9jour \xe0 Fakarava",manifest:"/manifest.json",themeColor:"#0E7490",appleWebApp:{capable:!0,statusBarStyle:"default",title:"Compagnon du lagon - Pension Marama"},viewport:{width:"device-width",initialScale:1,maximumScale:1,userScalable:!1}};function c({children:e}){return(0,a.jsxs)("html",{lang:"fr",suppressHydrationWarning:!0,children:[(0,a.jsxs)("head",{children:[a.jsx("link",{rel:"icon",href:"/logo-relais-marama.svg",type:"image/svg+xml"}),a.jsx("link",{rel:"apple-touch-icon",href:"/logo-relais-marama.svg"})]}),a.jsx("body",{className:n().className,children:(0,a.jsxs)(o,{attribute:"class",defaultTheme:"light",enableSystem:!0,disableTransitionOnChange:!1,children:[e,a.jsx(l,{})]})})]})}},7272:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[276,740,87],()=>r(4080));module.exports=a})();