sme-pos-package 1.0.3 → 1.0.5

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/index.js CHANGED
@@ -1,2 +1,73 @@
1
- var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(o,t)=>{for(var e in t)n(o,e,{get:t[e],enumerable:!0})},m=(o,t,e,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of i(t))!d.call(o,l)&&l!==e&&n(o,l,{get:()=>t[l],enumerable:!(c=u(t,l))||c.enumerable});return o};var f=o=>m(n({},"__esModule",{value:!0}),o);var C={};p(C,{ExampleButton:()=>a});module.exports=f(C);var r=require("react"),s=require("react/jsx-runtime"),k=({label:o,onClick:t})=>{let[e,c]=(0,r.useState)(!1);return(0,s.jsx)("button",{className:"custom",onClick:()=>{c(!0),t()},children:e?"Clicked!":o})},a=k;0&&(module.exports={ExampleButton});
1
+ var vm=Object.create;var xr=Object.defineProperty,wm=Object.defineProperties,bm=Object.getOwnPropertyDescriptor,Pm=Object.getOwnPropertyDescriptors,Rm=Object.getOwnPropertyNames,Ao=Object.getOwnPropertySymbols,Am=Object.getPrototypeOf,Rn=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable;var An=Math.pow,Fl=(e,t,a)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,h=(e,t)=>{for(var a in t||(t={}))Rn.call(t,a)&&Fl(e,a,t[a]);if(Ao)for(var a of Ao(t))Vl.call(t,a)&&Fl(e,a,t[a]);return e},P=(e,t)=>wm(e,Pm(t));var $=(e,t)=>{var a={};for(var r in e)Rn.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&Ao)for(var r of Ao(e))t.indexOf(r)<0&&Vl.call(e,r)&&(a[r]=e[r]);return a};var Tm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Dm=(e,t)=>{for(var a in t)xr(e,a,{get:t[a],enumerable:!0})},Bl=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rm(t))!Rn.call(e,o)&&o!==a&&xr(e,o,{get:()=>t[o],enumerable:!(r=bm(t,o))||r.enumerable});return e};var gt=(e,t,a)=>(a=e!=null?vm(Am(e)):{},Bl(t||!e||!e.__esModule?xr(a,"default",{value:e,enumerable:!0}):a,e)),Mm=e=>Bl(xr({},"__esModule",{value:!0}),e);var de=(e,t,a)=>new Promise((r,o)=>{var s=d=>{try{i(a.next(d))}catch(l){o(l)}},n=d=>{try{i(a.throw(d))}catch(l){o(l)}},i=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,n);i((a=a.apply(e,t)).next())});var eu=Tm((My,Jl)=>{Jl.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}});var vy={};Dm(vy,{EMenuLink:()=>$c,KitchenTemplate:()=>xp,OpenSessionModal:()=>yn,PosOrderTemplate:()=>vp,PosTemplate:()=>hm});module.exports=Mm(vy);var ea=require("react/jsx-runtime");var Ol=({className:e=""})=>(0,ea.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:(0,ea.jsx)("path",{d:"M12.0001 10.7275L16.4551 6.27246L17.7277 7.54506L13.2727 12.0001L17.7277 16.4551L16.4551 17.7277L12.0001 13.2727L7.54506 17.7277L6.27246 16.4551L10.7275 12.0001L6.27246 7.54506L7.54506 6.27246L12.0001 10.7275Z",fill:"currentColor"})});var Nl=()=>(0,ea.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ea.jsx)("path",{d:"M7.39992 15.1663H4.59992C1.99325 15.1663 0.833252 14.0063 0.833252 11.3997V8.59967C0.833252 5.99301 1.99325 4.83301 4.59992 4.83301H7.39992C10.0066 4.83301 11.1666 5.99301 11.1666 8.59967V11.3997C11.1666 14.0063 10.0066 15.1663 7.39992 15.1663ZM4.59992 5.83301C2.53325 5.83301 1.83325 6.53301 1.83325 8.59967V11.3997C1.83325 13.4663 2.53325 14.1663 4.59992 14.1663H7.39992C9.46659 14.1663 10.1666 13.4663 10.1666 11.3997V8.59967C10.1666 6.53301 9.46659 5.83301 7.39992 5.83301H4.59992Z",fill:"#1F1F1F"}),(0,ea.jsx)("path",{d:"M11.3999 11.1663H10.6666C10.3933 11.1663 10.1666 10.9397 10.1666 10.6663V8.59967C10.1666 6.53301 9.46659 5.83301 7.39992 5.83301H5.33325C5.05992 5.83301 4.83325 5.60634 4.83325 5.33301V4.59967C4.83325 1.99301 5.99325 0.833008 8.59992 0.833008H11.3999C14.0066 0.833008 15.1666 1.99301 15.1666 4.59967V7.39967C15.1666 10.0063 14.0066 11.1663 11.3999 11.1663ZM11.1666 10.1663H11.3999C13.4666 10.1663 14.1666 9.46634 14.1666 7.39967V4.59967C14.1666 2.53301 13.4666 1.83301 11.3999 1.83301H8.59992C6.53325 1.83301 5.83325 2.53301 5.83325 4.59967V4.83301H7.39992C10.0066 4.83301 11.1666 5.99301 11.1666 8.59967V10.1663Z",fill:"#1F1F1F"})]});var Lr=require("react/jsx-runtime"),Ul=()=>(0,Lr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,Lr.jsx)("path",{d:"M13 13.75V13H10.75V10.75H13V12.25H14.5V13.75H13.75V15.25H12.25V16.75H10.75V14.5H12.25V13.75H13ZM16.75 16.75H13.75V15.25H15.25V13.75H16.75V16.75ZM3.25 3.25H9.25V9.25H3.25V3.25ZM4.75 4.75V7.75H7.75V4.75H4.75ZM10.75 3.25H16.75V9.25H10.75V3.25ZM12.25 4.75V7.75H15.25V4.75H12.25ZM3.25 10.75H9.25V16.75H3.25V10.75ZM4.75 12.25V15.25H7.75V12.25H4.75ZM14.5 10.75H16.75V12.25H14.5V10.75ZM5.5 5.5H7V7H5.5V5.5ZM5.5 13H7V14.5H5.5V13ZM13 5.5H14.5V7H13V5.5Z",fill:"#060606"})}),Hl=({className:e})=>(0,Lr.jsx)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:`${e}`,children:(0,Lr.jsx)("path",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128 192 384l-96-96"})});var zc=require("@fctc/widget-logic/widget");var xe=gt(require("react"),1),Em=Object.defineProperty,To=Object.getOwnPropertySymbols,ql=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable,_l=(e,t,a)=>t in e?Em(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Tn=(e,t)=>{for(var a in t||(t={}))ql.call(t,a)&&_l(e,a,t[a]);if(To)for(var a of To(t))jl.call(t,a)&&_l(e,a,t[a]);return e},Dn=(e,t)=>{var a={};for(var r in e)ql.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&To)for(var r of To(e))t.indexOf(r)<0&&jl.call(e,r)&&(a[r]=e[r]);return a};var ta;(e=>{let t=class K{constructor(l,u,f,c){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],l<K.MIN_VERSION||l>K.MAX_VERSION)throw new RangeError("Version value out of range");if(c<-1||c>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let p=[];for(let g=0;g<this.size;g++)p.push(!1);for(let g=0;g<this.size;g++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();let m=this.addEccAndInterleave(f);if(this.drawCodewords(m),c==-1){let g=1e9;for(let L=0;L<8;L++){this.applyMask(L),this.drawFormatBits(L);let S=this.getPenaltyScore();S<g&&(c=L,g=S),this.applyMask(L)}}s(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}static encodeText(l,u){let f=e.QrSegment.makeSegments(l);return K.encodeSegments(f,u)}static encodeBinary(l,u){let f=e.QrSegment.makeBytes(l);return K.encodeSegments([f],u)}static encodeSegments(l,u,f=1,c=40,p=-1,m=!0){if(!(K.MIN_VERSION<=f&&f<=c&&c<=K.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let g,L;for(g=f;;g++){let v=K.getNumDataCodewords(g,u)*8,b=i.getTotalBits(l,g);if(b<=v){L=b;break}if(g>=c)throw new RangeError("Data too long")}for(let v of[K.Ecc.MEDIUM,K.Ecc.QUARTILE,K.Ecc.HIGH])m&&L<=K.getNumDataCodewords(g,v)*8&&(u=v);let S=[];for(let v of l){r(v.mode.modeBits,4,S),r(v.numChars,v.mode.numCharCountBits(g),S);for(let b of v.getData())S.push(b)}s(S.length==L);let y=K.getNumDataCodewords(g,u)*8;s(S.length<=y),r(0,Math.min(4,y-S.length),S),r(0,(8-S.length%8)%8,S),s(S.length%8==0);for(let v=236;S.length<y;v^=253)r(v,8,S);let I=[];for(;I.length*8<S.length;)I.push(0);return S.forEach((v,b)=>I[b>>>3]|=v<<7-(b&7)),new K(g,u,I,p)}getModule(l,u){return 0<=l&&l<this.size&&0<=u&&u<this.size&&this.modules[u][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let f=0;f<this.size;f++)this.setFunctionModule(6,f,f%2==0),this.setFunctionModule(f,6,f%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),u=l.length;for(let f=0;f<u;f++)for(let c=0;c<u;c++)f==0&&c==0||f==0&&c==u-1||f==u-1&&c==0||this.drawAlignmentPattern(l[f],l[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(l){let u=this.errorCorrectionLevel.formatBits<<3|l,f=u;for(let p=0;p<10;p++)f=f<<1^(f>>>9)*1335;let c=(u<<10|f)^21522;s(c>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,o(c,p));this.setFunctionModule(8,7,o(c,6)),this.setFunctionModule(8,8,o(c,7)),this.setFunctionModule(7,8,o(c,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,o(c,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,o(c,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,o(c,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let f=0;f<12;f++)l=l<<1^(l>>>11)*7973;let u=this.version<<12|l;s(u>>>18==0);for(let f=0;f<18;f++){let c=o(u,f),p=this.size-11+f%3,m=Math.floor(f/3);this.setFunctionModule(p,m,c),this.setFunctionModule(m,p,c)}}drawFinderPattern(l,u){for(let f=-4;f<=4;f++)for(let c=-4;c<=4;c++){let p=Math.max(Math.abs(c),Math.abs(f)),m=l+c,g=u+f;0<=m&&m<this.size&&0<=g&&g<this.size&&this.setFunctionModule(m,g,p!=2&&p!=4)}}drawAlignmentPattern(l,u){for(let f=-2;f<=2;f++)for(let c=-2;c<=2;c++)this.setFunctionModule(l+c,u+f,Math.max(Math.abs(c),Math.abs(f))!=1)}setFunctionModule(l,u,f){this.modules[u][l]=f,this.isFunction[u][l]=!0}addEccAndInterleave(l){let u=this.version,f=this.errorCorrectionLevel;if(l.length!=K.getNumDataCodewords(u,f))throw new RangeError("Invalid argument");let c=K.NUM_ERROR_CORRECTION_BLOCKS[f.ordinal][u],p=K.ECC_CODEWORDS_PER_BLOCK[f.ordinal][u],m=Math.floor(K.getNumRawDataModules(u)/8),g=c-m%c,L=Math.floor(m/c),S=[],y=K.reedSolomonComputeDivisor(p);for(let v=0,b=0;v<c;v++){let D=l.slice(b,b+L-p+(v<g?0:1));b+=D.length;let M=K.reedSolomonComputeRemainder(D,y);v<g&&D.push(0),S.push(D.concat(M))}let I=[];for(let v=0;v<S[0].length;v++)S.forEach((b,D)=>{(v!=L-p||D>=g)&&I.push(b[v])});return s(I.length==m),I}drawCodewords(l){if(l.length!=Math.floor(K.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let f=this.size-1;f>=1;f-=2){f==6&&(f=5);for(let c=0;c<this.size;c++)for(let p=0;p<2;p++){let m=f-p,L=(f+1&2)==0?this.size-1-c:c;!this.isFunction[L][m]&&u<l.length*8&&(this.modules[L][m]=o(l[u>>>3],7-(u&7)),u++)}}s(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u<this.size;u++)for(let f=0;f<this.size;f++){let c;switch(l){case 0:c=(f+u)%2==0;break;case 1:c=u%2==0;break;case 2:c=f%3==0;break;case 3:c=(f+u)%3==0;break;case 4:c=(Math.floor(f/3)+Math.floor(u/2))%2==0;break;case 5:c=f*u%2+f*u%3==0;break;case 6:c=(f*u%2+f*u%3)%2==0;break;case 7:c=((f+u)%2+f*u%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[u][f]&&c&&(this.modules[u][f]=!this.modules[u][f])}}getPenaltyScore(){let l=0;for(let p=0;p<this.size;p++){let m=!1,g=0,L=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[p][S]==m?(g++,g==5?l+=K.PENALTY_N1:g>5&&l++):(this.finderPenaltyAddHistory(g,L),m||(l+=this.finderPenaltyCountPatterns(L)*K.PENALTY_N3),m=this.modules[p][S],g=1);l+=this.finderPenaltyTerminateAndCount(m,g,L)*K.PENALTY_N3}for(let p=0;p<this.size;p++){let m=!1,g=0,L=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][p]==m?(g++,g==5?l+=K.PENALTY_N1:g>5&&l++):(this.finderPenaltyAddHistory(g,L),m||(l+=this.finderPenaltyCountPatterns(L)*K.PENALTY_N3),m=this.modules[S][p],g=1);l+=this.finderPenaltyTerminateAndCount(m,g,L)*K.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let m=0;m<this.size-1;m++){let g=this.modules[p][m];g==this.modules[p][m+1]&&g==this.modules[p+1][m]&&g==this.modules[p+1][m+1]&&(l+=K.PENALTY_N2)}let u=0;for(let p of this.modules)u=p.reduce((m,g)=>m+(g?1:0),u);let f=this.size*this.size,c=Math.ceil(Math.abs(u*20-f*10)/f)-1;return s(0<=c&&c<=9),l+=c*K.PENALTY_N4,s(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{let l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,f=[6];for(let c=this.size-7;f.length<l;c-=u)f.splice(1,0,c);return f}}static getNumRawDataModules(l){if(l<K.MIN_VERSION||l>K.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){let f=Math.floor(l/7)+2;u-=(25*f-10)*f-55,l>=7&&(u-=36)}return s(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(K.getNumRawDataModules(l)/8)-K.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*K.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let c=0;c<l-1;c++)u.push(0);u.push(1);let f=1;for(let c=0;c<l;c++){for(let p=0;p<u.length;p++)u[p]=K.reedSolomonMultiply(u[p],f),p+1<u.length&&(u[p]^=u[p+1]);f=K.reedSolomonMultiply(f,2)}return u}static reedSolomonComputeRemainder(l,u){let f=u.map(c=>0);for(let c of l){let p=c^f.shift();f.push(0),u.forEach((m,g)=>f[g]^=K.reedSolomonMultiply(m,p))}return f}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let f=0;for(let c=7;c>=0;c--)f=f<<1^(f>>>7)*285,f^=(u>>>c&1)*l;return s(f>>>8==0),f}finderPenaltyCountPatterns(l){let u=l[1];s(u<=this.size*3);let f=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(f&&l[0]>=u*4&&l[6]>=u?1:0)+(f&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,f){return l&&(this.finderPenaltyAddHistory(u,f),u=0),u+=this.size,this.finderPenaltyAddHistory(u,f),this.finderPenaltyCountPatterns(f)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};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]];let a=t;e.QrCode=t;function r(d,l,u){if(l<0||l>31||d>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(d>>>f&1)}function o(d,l){return(d>>>l&1)!=0}function s(d){if(!d)throw new Error("Assertion error")}let n=class fe{constructor(l,u,f){if(this.mode=l,this.numChars=u,this.bitData=f,u<0)throw new RangeError("Invalid argument");this.bitData=f.slice()}static makeBytes(l){let u=[];for(let f of l)r(f,8,u);return new fe(fe.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!fe.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let f=0;f<l.length;){let c=Math.min(l.length-f,3);r(parseInt(l.substring(f,f+c),10),c*3+1,u),f+=c}return new fe(fe.Mode.NUMERIC,l.length,u)}static makeAlphanumeric(l){if(!fe.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let u=[],f;for(f=0;f+2<=l.length;f+=2){let c=fe.ALPHANUMERIC_CHARSET.indexOf(l.charAt(f))*45;c+=fe.ALPHANUMERIC_CHARSET.indexOf(l.charAt(f+1)),r(c,11,u)}return f<l.length&&r(fe.ALPHANUMERIC_CHARSET.indexOf(l.charAt(f)),6,u),new fe(fe.Mode.ALPHANUMERIC,l.length,u)}static makeSegments(l){return l==""?[]:fe.isNumeric(l)?[fe.makeNumeric(l)]:fe.isAlphanumeric(l)?[fe.makeAlphanumeric(l)]:[fe.makeBytes(fe.toUtf8ByteArray(l))]}static makeEci(l){let u=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)r(l,8,u);else if(l<16384)r(2,2,u),r(l,14,u);else if(l<1e6)r(6,3,u),r(l,21,u);else throw new RangeError("ECI assignment value out of range");return new fe(fe.Mode.ECI,0,u)}static isNumeric(l){return fe.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return fe.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,u){let f=0;for(let c of l){let p=c.mode.numCharCountBits(u);if(c.numChars>=1<<p)return 1/0;f+=4+p+c.bitData.length}return f}static toUtf8ByteArray(l){l=encodeURI(l);let u=[];for(let f=0;f<l.length;f++)l.charAt(f)!="%"?u.push(l.charCodeAt(f)):(u.push(parseInt(l.substring(f+1,f+3),16)),f+=2);return u}};n.NUMERIC_REGEX=/^[0-9]*$/,n.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,n.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=n;e.QrSegment=n})(ta||(ta={}));(e=>{let t;(a=>{let r=class{constructor(n,i){this.ordinal=n,this.formatBits=i}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2);let o=r;a.Ecc=r})(t=e.QrCode||(e.QrCode={}))})(ta||(ta={}));(e=>{let t;(a=>{let r=class{constructor(n,i){this.modeBits=n,this.numBitsCharCount=i}numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]);let o=r;a.Mode=r})(t=e.QrSegment||(e.QrSegment={}))})(ta||(ta={}));var Pa=ta;var km={L:Pa.QrCode.Ecc.LOW,M:Pa.QrCode.Ecc.MEDIUM,Q:Pa.QrCode.Ecc.QUARTILE,H:Pa.QrCode.Ecc.HIGH},Wl=128,zl="L",Gl="#FFFFFF",$l="#000000",Kl=!1,Xl=1,Fm=4,Vm=0,Bm=.1;function Zl(e,t=0){let a=[];return e.forEach(function(r,o){let s=null;r.forEach(function(n,i){if(!n&&s!==null){a.push(`M${s+t} ${o+t}h${i-s}v1H${s+t}z`),s=null;return}if(i===r.length-1){if(!n)return;s===null?a.push(`M${i+t},${o+t} h1v1H${i+t}z`):a.push(`M${s+t},${o+t} h${i+1-s}v1H${s+t}z`);return}n&&s===null&&(s=i)})}),a.join("")}function Yl(e,t){return e.slice().map((a,r)=>r<t.y||r>=t.y+t.h?a:a.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function Om(e,t,a,r){if(r==null)return null;let o=e.length+a*2,s=Math.floor(t*Bm),n=o/t,i=(r.width||s)*n,d=(r.height||s)*n,l=r.x==null?e.length/2-i/2:r.x*n,u=r.y==null?e.length/2-d/2:r.y*n,f=r.opacity==null?1:r.opacity,c=null;if(r.excavate){let m=Math.floor(l),g=Math.floor(u),L=Math.ceil(i+l-m),S=Math.ceil(d+u-g);c={x:m,y:g,w:L,h:S}}let p=r.crossOrigin;return{x:l,y:u,h:d,w:i,excavation:c,opacity:f,crossOrigin:p}}function Nm(e,t){return t!=null?Math.max(Math.floor(t),0):e?Fm:Vm}function Ql({value:e,level:t,minVersion:a,includeMargin:r,marginSize:o,imageSettings:s,size:n,boostLevel:i}){let d=xe.default.useMemo(()=>{let m=(Array.isArray(e)?e:[e]).reduce((g,L)=>(g.push(...Pa.QrSegment.makeSegments(L)),g),[]);return Pa.QrCode.encodeSegments(m,km[t],a,void 0,void 0,i)},[e,t,a,i]),{cells:l,margin:u,numCells:f,calculatedImageSettings:c}=xe.default.useMemo(()=>{let p=d.getModules(),m=Nm(r,o),g=p.length+m*2,L=Om(p,n,m,s);return{cells:p,margin:m,numCells:g,calculatedImageSettings:L}},[d,n,s,r,o]);return{qrcode:d,margin:u,cells:l,numCells:f,calculatedImageSettings:c}}var Um=(function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0})(),Hm=xe.default.forwardRef(function(t,a){let r=t,{value:o,size:s=Wl,level:n=zl,bgColor:i=Gl,fgColor:d=$l,includeMargin:l=Kl,minVersion:u=Xl,boostLevel:f,marginSize:c,imageSettings:p}=r,g=Dn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:L}=g,S=Dn(g,["style"]),y=p==null?void 0:p.src,I=xe.default.useRef(null),v=xe.default.useRef(null),b=xe.default.useCallback(j=>{I.current=j,typeof a=="function"?a(j):a&&(a.current=j)},[a]),[D,M]=xe.default.useState(!1),{margin:R,cells:k,numCells:V,calculatedImageSettings:U}=Ql({value:o,level:n,minVersion:u,boostLevel:f,includeMargin:l,marginSize:c,imageSettings:p,size:s});xe.default.useEffect(()=>{if(I.current!=null){let j=I.current,Q=j.getContext("2d");if(!Q)return;let ee=k,W=v.current,ae=U!=null&&W!==null&&W.complete&&W.naturalHeight!==0&&W.naturalWidth!==0;ae&&U.excavation!=null&&(ee=Yl(k,U.excavation));let ue=window.devicePixelRatio||1;j.height=j.width=s*ue;let Re=s/V*ue;Q.scale(Re,Re),Q.fillStyle=i,Q.fillRect(0,0,V,V),Q.fillStyle=d,Um?Q.fill(new Path2D(Zl(ee,R))):k.forEach(function(ge,Ye){ge.forEach(function(it,ba){it&&Q.fillRect(ba+R,Ye+R,1,1)})}),U&&(Q.globalAlpha=U.opacity),ae&&Q.drawImage(W,U.x+R,U.y+R,U.w,U.h)}}),xe.default.useEffect(()=>{M(!1)},[y]);let z=Tn({height:s,width:s},L),q=null;return y!=null&&(q=xe.default.createElement("img",{src:y,key:y,style:{display:"none"},onLoad:()=>{M(!0)},ref:v,crossOrigin:U==null?void 0:U.crossOrigin})),xe.default.createElement(xe.default.Fragment,null,xe.default.createElement("canvas",Tn({style:z,height:s,width:s,ref:b,role:"img"},S)),q)});Hm.displayName="QRCodeCanvas";var Mn=xe.default.forwardRef(function(t,a){let r=t,{value:o,size:s=Wl,level:n=zl,bgColor:i=Gl,fgColor:d=$l,includeMargin:l=Kl,minVersion:u=Xl,boostLevel:f,title:c,marginSize:p,imageSettings:m}=r,g=Dn(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:L,cells:S,numCells:y,calculatedImageSettings:I}=Ql({value:o,level:n,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:m,size:s}),v=S,b=null;m!=null&&I!=null&&(I.excavation!=null&&(v=Yl(S,I.excavation)),b=xe.default.createElement("image",{href:m.src,height:I.h,width:I.w,x:I.x+L,y:I.y+L,preserveAspectRatio:"none",opacity:I.opacity,crossOrigin:I.crossOrigin}));let D=Zl(v,L);return xe.default.createElement("svg",Tn({height:s,width:s,viewBox:`0 0 ${y} ${y}`,ref:a,role:"img"},g),!!c&&xe.default.createElement("title",null,c),xe.default.createElement("path",{fill:i,d:`M0,0 h${y}v${y}H0z`,shapeRendering:"crispEdges"}),xe.default.createElement("path",{fill:d,d:D,shapeRendering:"crispEdges"}),b)});Mn.displayName="QRCodeSVG";var Gc=require("react");var Xm=require("react");var Ir=require("react");var _m=gt(eu());var au=(e,t,a,r)=>{var s,n,i,d;let o=[a,h({code:t},r||{})];if((n=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&n.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);xt(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(d=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&d.warn?e.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},tu={},yr=(e,t,a,r)=>{xt(a)&&tu[a]||(xt(a)&&(tu[a]=new Date),au(e,t,a,r))},ru=(e,t)=>()=>{if(e.isInitialized)t();else{let a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},Do=(e,t,a)=>{e.loadNamespaces(t,ru(e,a))},En=(e,t,a,r)=>{if(xt(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Do(e,a,r);a.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,ru(e,r))},ou=(e,t,a={})=>!t.languages||!t.languages.length?(yr(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,o)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e))return!1}});var xt=e=>typeof e=="string",kn=e=>typeof e=="object"&&e!==null;var qm=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,jm={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Wm=e=>jm[e],su=e=>e.replace(qm,Wm);var zm={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:su};var Cr=()=>zm;var Gm;var aa=()=>Gm;var lu=require("react");var Ra=(0,lu.createContext)(),Mo=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}};var _e=require("react");var Zm=(e,t)=>{let a=(0,_e.useRef)();return(0,_e.useEffect)(()=>{a.current=t?a.current:e},[e,t]),a.current},uu=(e,t,a,r)=>e.getFixedT(t,a,r),Ym=(e,t,a,r)=>(0,_e.useCallback)(uu(e,t,a,r),[e,t,a,r]),Je=(e,t={})=>{var v,b,D,M;let{i18n:a}=t,{i18n:r,defaultNS:o}=(0,_e.useContext)(Ra)||{},s=a||r||aa();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Mo),!s){yr(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");let R=(V,U)=>xt(U)?U:kn(U)&&xt(U.defaultValue)?U.defaultValue:Array.isArray(V)?V[V.length-1]:V,k=[R,{},!1];return k.t=R,k.i18n={},k.ready=!1,k}(v=s.options.react)!=null&&v.wait&&yr(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");let n=h(h(h({},Cr()),s.options.react),t),{useSuspense:i,keyPrefix:d}=n,l=e||o||((b=s.options)==null?void 0:b.defaultNS);l=xt(l)?[l]:l||["translation"],(M=(D=s.reportNamespaces).addUsedNamespaces)==null||M.call(D,l);let u=(s.isInitialized||s.initializedStoreOnce)&&l.every(R=>ou(R,s,n)),f=Ym(s,t.lng||null,n.nsMode==="fallback"?l:l[0],d),c=()=>f,p=()=>uu(s,t.lng||null,n.nsMode==="fallback"?l:l[0],d),[m,g]=(0,_e.useState)(c),L=l.join();t.lng&&(L=`${t.lng}${L}`);let S=Zm(L),y=(0,_e.useRef)(!0);(0,_e.useEffect)(()=>{let{bindI18n:R,bindI18nStore:k}=n;y.current=!0,!u&&!i&&(t.lng?En(s,t.lng,l,()=>{y.current&&g(p)}):Do(s,l,()=>{y.current&&g(p)})),u&&S&&S!==L&&y.current&&g(p);let V=()=>{y.current&&g(p)};return R&&(s==null||s.on(R,V)),k&&(s==null||s.store.on(k,V)),()=>{y.current=!1,s&&R&&(R==null||R.split(" ").forEach(U=>s.off(U,V))),k&&s&&k.split(" ").forEach(U=>s.store.off(U,V))}},[s,L]),(0,_e.useEffect)(()=>{y.current&&u&&g(c)},[s,d,u]);let I=[m,s,u];if(I.t=m,I.i18n=s,I.ready=u,u||!u&&!i)return I;throw new Promise(R=>{t.lng?En(s,t.lng,l,()=>R()):Do(s,l,()=>R())})};var du=require("react");var fu=require("react");var ah=require("react");var Jm=require("react");function cu(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=cu(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function pu(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=cu(e))&&(r&&(r+=" "),r+=t);return r}var mu=require("tailwind-merge");function Et(...e){return(0,mu.twMerge)(pu(e))}var hu=e=>e?new Intl.NumberFormat("en-US").format(Number(e)):"";var Eo=e=>{let t=new Date(e),a=t==null?void 0:t.getHours().toString().padStart(2,"0"),r=t==null?void 0:t.getMinutes().toString().padStart(2,"0");return`${a}:${r}`},ko=e=>{let t=new Date(e),a=t==null?void 0:t.getDate().toString().padStart(2,"0"),r=((t==null?void 0:t.getMonth())+1).toString().padStart(2,"0"),o=t==null?void 0:t.getFullYear();return`${a}/${r}/${o}`};var gu=e=>e.toLocaleString("vi-VN",{maximumFractionDigits:0});var eo=require("react/jsx-runtime"),ft=require("react");var xu=require("react"),Aa=(0,xu.createContext)({});var Lu=require("react");function Ta(e){let t=(0,Lu.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Fo=require("react");var Da=typeof window!="undefined";var Vo=Da?Fo.useLayoutEffect:Fo.useEffect;var hi=require("react/jsx-runtime"),Ad=gt(require("react"),1),Qr=require("react");var yu=require("react"),kt=(0,yu.createContext)(null);var Pd=require("react/jsx-runtime");function ra(e,t){e.indexOf(t)===-1&&e.push(t)}function oa(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var we=(e,t,a)=>a>t?t:a<e?e:a;function Sr(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var $e=()=>{},Ae=()=>{};process.env.NODE_ENV!=="production"&&($e=(e,t,a)=>{!e&&typeof console!="undefined"&&console.warn(Sr(t,a))},Ae=(e,t,a)=>{if(!e)throw new Error(Sr(t,a))});var Te={};var vr=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function wr(e){return typeof e=="object"&&e!==null}var br=e=>/^0[^.\s]+$/u.test(e);function sa(e){let t;return()=>(t===void 0&&(t=e()),t)}var ie=e=>e;var rh=(e,t)=>a=>t(e(a)),et=(...e)=>e.reduce(rh);var lt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Lt=class{constructor(){this.subscriptions=[]}add(t){return ra(this.subscriptions,t),()=>oa(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let s=0;s<o;s++){let n=this.subscriptions[s];n&&n(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var Ce=e=>e*1e3,Ie=e=>e/1e3;function Pr(e,t){return t?e*(1e3/t):0}var Cu=new Set;function na(e,t,a){e||Cu.has(t)||(console.warn(Sr(t,a)),Cu.add(t))}var Iu=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,oh=1e-7,sh=12;function nh(e,t,a,r,o){let s,n,i=0;do n=t+(a-t)/2,s=Iu(n,r,o)-e,s>0?a=n:t=n;while(Math.abs(s)>oh&&++i<sh);return n}function Ft(e,t,a,r){if(e===t&&a===r)return ie;let o=s=>nh(s,0,1,e,a);return s=>s===0||s===1?s:Iu(o(s),t,r)}var Bo=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Oo=e=>t=>1-e(1-t);var No=Ft(.33,1.53,.69,.99),Ma=Oo(No),Rr=Bo(Ma);var Ar=e=>(e*=2)<1?.5*Ma(e):.5*(2-Math.pow(2,-10*(e-1)));var Tr=e=>1-Math.sin(Math.acos(e)),Dr=Oo(Tr),Mr=Bo(Tr);var Fn=Ft(.42,0,1,1),Vn=Ft(0,0,.58,1),Er=Ft(.42,0,.58,1);var Bn=e=>Array.isArray(e)&&typeof e[0]!="number";var kr=e=>Array.isArray(e)&&typeof e[0]=="number";var Su={linear:ie,easeIn:Fn,easeInOut:Er,easeOut:Vn,circIn:Tr,circInOut:Mr,circOut:Dr,backIn:Ma,backInOut:Rr,backOut:No,anticipate:Ar},ih=e=>typeof e=="string",Uo=e=>{if(kr(e)){Ae(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,a,r,o]=e;return Ft(t,a,r,o)}else if(ih(e))return Ae(Su[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Su[e];return e};var Fr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];var Ve={value:null,addProjectionMetrics:null};function vu(e,t){let a=new Set,r=new Set,o=!1,s=!1,n=new WeakSet,i={delta:0,timestamp:0,isProcessing:!1},d=0;function l(f){n.has(f)&&(u.schedule(f),e()),d++,f(i)}let u={schedule:(f,c=!1,p=!1)=>{let g=p&&o?a:r;return c&&n.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),n.delete(f)},process:f=>{if(i=f,o){s=!0;return}o=!0,[a,r]=[r,a],a.forEach(l),t&&Ve.value&&Ve.value.frameloop[t].push(d),d=0,a.clear(),o=!1,s&&(s=!1,u.process(f))}};return u}var lh=40;function Ho(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},s=()=>a=!0,n=Fr.reduce((I,v)=>(I[v]=vu(s,t?v:void 0),I),{}),{setup:i,read:d,resolveKeyframes:l,preUpdate:u,update:f,preRender:c,render:p,postRender:m}=n,g=()=>{let I=Te.useManualTiming?o.timestamp:performance.now();a=!1,Te.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(I-o.timestamp,lh),1)),o.timestamp=I,o.isProcessing=!0,i.process(o),d.process(o),l.process(o),u.process(o),f.process(o),c.process(o),p.process(o),m.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(g))},L=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:Fr.reduce((I,v)=>{let b=n[v];return I[v]=(D,M=!1,R=!1)=>(a||L(),b.schedule(D,M,R)),I},{}),cancel:I=>{for(let v=0;v<Fr.length;v++)n[Fr[v]].cancel(I)},state:o,steps:n}}var{schedule:G,cancel:Be,state:ce,steps:Vr}=Ho(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:ie,!0);var _o;function uh(){_o=void 0}var pe={now:()=>(_o===void 0&&pe.set(ce.isProcessing||Te.useManualTiming?ce.timestamp:performance.now()),_o),set:e=>{_o=e,queueMicrotask(uh)}};var tt={layout:0,mainThread:0,waapi:0};var wu=e=>t=>typeof t=="string"&&t.startsWith(e),Br=wu("--"),dh=wu("var(--"),ia=e=>dh(e)?fh.test(e.split("/*")[0].trim()):!1,fh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var ut={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},yt=P(h({},ut),{transform:e=>we(0,1,e)}),Or=P(h({},ut),{default:1});var Vt=e=>Math.round(e*1e5)/1e5;var Ea=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bu(e){return e==null}var Pu=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var ka=(e,t)=>a=>!!(typeof a=="string"&&Pu.test(a)&&a.startsWith(e)||t&&!bu(a)&&Object.prototype.hasOwnProperty.call(a,t)),qo=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,s,n,i]=r.match(Ea);return{[e]:parseFloat(o),[t]:parseFloat(s),[a]:parseFloat(n),alpha:i!==void 0?parseFloat(i):1}};var ch=e=>we(0,255,e),On=P(h({},ut),{transform:e=>Math.round(ch(e))}),dt={test:ka("rgb","red"),parse:qo("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+On.transform(e)+", "+On.transform(t)+", "+On.transform(a)+", "+Vt(yt.transform(r))+")"};function ph(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var Nr={test:ka("#"),parse:ph,transform:dt.transform};var Ur=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),at=Ur("deg"),De=Ur("%"),B=Ur("px"),Nn=Ur("vh"),Un=Ur("vw"),jo=P(h({},De),{parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)});var Bt={test:ka("hsl","hue"),parse:qo("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(Vt(t))+", "+De.transform(Vt(a))+", "+Vt(yt.transform(r))+")"};var se={test:e=>dt.test(e)||Nr.test(e)||Bt.test(e),parse:e=>dt.test(e)?dt.parse(e):Bt.test(e)?Bt.parse(e):Nr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?dt.transform(e):Bt.transform(e),getAnimatableNone:e=>{let t=se.parse(e);return t.alpha=0,se.transform(t)}};var Ru=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mh(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ea))==null?void 0:t.length)||0)+(((a=e.match(Ru))==null?void 0:a.length)||0)>0}var Tu="number",Du="color",hh="var",gh="var(",Au="${}",xh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ot(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],s=0,i=t.replace(xh,d=>(se.test(d)?(r.color.push(s),o.push(Du),a.push(se.parse(d))):d.startsWith(gh)?(r.var.push(s),o.push(hh),a.push(d)):(r.number.push(s),o.push(Tu),a.push(parseFloat(d))),++s,Au)).split(Au);return{values:a,split:i,indexes:r,types:o}}function Mu(e){return Ot(e).values}function Eu(e){let{split:t,types:a}=Ot(e),r=t.length;return o=>{let s="";for(let n=0;n<r;n++)if(s+=t[n],o[n]!==void 0){let i=a[n];i===Tu?s+=Vt(o[n]):i===Du?s+=se.transform(o[n]):s+=o[n]}return s}}var Lh=e=>typeof e=="number"?0:se.test(e)?se.getAnimatableNone(e):e;function yh(e){let t=Mu(e);return Eu(e)(t.map(Lh))}var Me={test:mh,parse:Mu,createTransformer:Eu,getAnimatableNone:yh};function Hn(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function ku({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,s=0,n=0;if(!t)o=s=n=a;else{let i=a<.5?a*(1+t):a+t-a*t,d=2*a-i;o=Hn(d,i,e+1/3),s=Hn(d,i,e),n=Hn(d,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(n*255),alpha:r}}function Fa(e,t){return a=>a>0?t:e}var Z=(e,t,a)=>e+(t-e)*a;var _n=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Ch=[Nr,dt,Bt],Ih=e=>Ch.find(t=>t.test(e));function Fu(e){let t=Ih(e);if($e(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let a=t.parse(e);return t===Bt&&(a=ku(a)),a}var qn=(e,t)=>{let a=Fu(e),r=Fu(t);if(!a||!r)return Fa(e,t);let o=h({},a);return s=>(o.red=_n(a.red,r.red,s),o.green=_n(a.green,r.green,s),o.blue=_n(a.blue,r.blue,s),o.alpha=Z(a.alpha,r.alpha,s),dt.transform(o))};var Wo=new Set(["none","hidden"]);function Vu(e,t){return Wo.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function Sh(e,t){return a=>Z(e,t,a)}function zo(e){return typeof e=="number"?Sh:typeof e=="string"?ia(e)?Fa:se.test(e)?qn:bh:Array.isArray(e)?Bu:typeof e=="object"?se.test(e)?qn:vh:Fa}function Bu(e,t){let a=[...e],r=a.length,o=e.map((s,n)=>zo(s)(s,t[n]));return s=>{for(let n=0;n<r;n++)a[n]=o[n](s);return a}}function vh(e,t){let a=h(h({},e),t),r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=zo(e[o])(e[o],t[o]));return o=>{for(let s in r)a[s]=r[s](o);return a}}function wh(e,t){var o;let a=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let n=t.types[s],i=e.indexes[n][r[n]],d=(o=e.values[i])!=null?o:0;a[s]=d,r[n]++}return a}var bh=(e,t)=>{let a=Me.createTransformer(t),r=Ot(e),o=Ot(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Wo.has(e)&&!o.values.length||Wo.has(t)&&!r.values.length?Vu(e,t):et(Bu(wh(r,o),o.values),a):($e(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Fa(e,t))};function Go(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?Z(e,t,a):zo(e)(e,t)}var Ou=e=>{let t=({timestamp:a})=>e(a);return{start:(a=!0)=>G.update(t,a),stop:()=>Be(t),now:()=>ce.isProcessing?ce.timestamp:pe.now()}};var $o=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`};function Va(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function Nu(e,t=100,a){let r=a(P(h({},e),{keyframes:[0,t]})),o=Math.min(Va(r),2e4);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:Ie(o)}}var Ph=5;function Ko(e,t,a){let r=Math.max(t-Ph,0);return Pr(a-e(r),t-r)}var oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Wn=.001;function Uu({duration:e=oe.duration,bounce:t=oe.bounce,velocity:a=oe.velocity,mass:r=oe.mass}){let o,s;$e(e<=Ce(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let n=1-t;n=we(oe.minDamping,oe.maxDamping,n),e=we(oe.minDuration,oe.maxDuration,Ie(e)),n<1?(o=l=>{let u=l*n,f=u*e,c=u-a,p=Xo(l,n),m=Math.exp(-f);return Wn-c/p*m},s=l=>{let f=l*n*e,c=f*a+a,p=Math.pow(n,2)*Math.pow(l,2)*e,m=Math.exp(-f),g=Xo(Math.pow(l,2),n);return(-o(l)+Wn>0?-1:1)*((c-p)*m)/g}):(o=l=>{let u=Math.exp(-l*e),f=(l-a)*e+1;return-Wn+u*f},s=l=>{let u=Math.exp(-l*e),f=(a-l)*(e*e);return u*f});let i=5/e,d=Ah(o,s,i);if(e=Ce(e),isNaN(d))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{let l=Math.pow(d,2)*r;return{stiffness:l,damping:n*2*Math.sqrt(r*l),duration:e}}}var Rh=12;function Ah(e,t,a){let r=a;for(let o=1;o<Rh;o++)r=r-e(r)/t(r);return r}function Xo(e,t){return e*Math.sqrt(1-t*t)}var Th=["duration","bounce"],Dh=["stiffness","damping","mass"];function Hu(e,t){return t.some(a=>e[a]!==void 0)}function Mh(e){let t=h({velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1},e);if(!Hu(e,Dh)&&Hu(e,Th))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,s=2*we(.05,1,1-(e.bounce||0))*Math.sqrt(o);t=P(h({},t),{mass:oe.mass,stiffness:o,damping:s})}else{let a=Uu(e);t=P(h(h({},t),a),{mass:oe.mass}),t.isResolvedFromDuration=!0}return t}function Ba(e=oe.visualDuration,t=oe.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,s=a.keyframes[0],n=a.keyframes[a.keyframes.length-1],i={done:!1,value:s},{stiffness:d,damping:l,mass:u,duration:f,velocity:c,isResolvedFromDuration:p}=Mh(P(h({},a),{velocity:-Ie(a.velocity||0)})),m=c||0,g=l/(2*Math.sqrt(d*u)),L=n-s,S=Ie(Math.sqrt(d/u)),y=Math.abs(L)<5;r||(r=y?oe.restSpeed.granular:oe.restSpeed.default),o||(o=y?oe.restDelta.granular:oe.restDelta.default);let I;if(g<1){let b=Xo(S,g);I=D=>{let M=Math.exp(-g*S*D);return n-M*((m+g*S*L)/b*Math.sin(b*D)+L*Math.cos(b*D))}}else if(g===1)I=b=>n-Math.exp(-S*b)*(L+(m+S*L)*b);else{let b=S*Math.sqrt(g*g-1);I=D=>{let M=Math.exp(-g*S*D),R=Math.min(b*D,300);return n-M*((m+g*S*L)*Math.sinh(R)+b*L*Math.cosh(R))/b}}let v={calculatedDuration:p&&f||null,next:b=>{let D=I(b);if(p)i.done=b>=f;else{let M=b===0?m:0;g<1&&(M=b===0?Ce(m):Ko(I,b,D));let R=Math.abs(M)<=r,k=Math.abs(n-D)<=o;i.done=R&&k}return i.value=i.done?n:D,i},toString:()=>{let b=Math.min(Va(v),2e4),D=$o(M=>v.next(b*M).value,b,30);return b+"ms "+D},toTransition:()=>{}};return v}Ba.applyToOptions=e=>{let t=Nu(e,100,Ba);return e.ease=t.ease,e.duration=Ce(t.duration),e.type="keyframes",e};function Hr({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:n,min:i,max:d,restDelta:l=.5,restSpeed:u}){let f=e[0],c={done:!1,value:f},p=R=>i!==void 0&&R<i||d!==void 0&&R>d,m=R=>i===void 0?d:d===void 0||Math.abs(i-R)<Math.abs(d-R)?i:d,g=a*t,L=f+g,S=n===void 0?L:n(L);S!==L&&(g=S-f);let y=R=>-g*Math.exp(-R/r),I=R=>S+y(R),v=R=>{let k=y(R),V=I(R);c.done=Math.abs(k)<=l,c.value=c.done?S:V},b,D,M=R=>{p(c.value)&&(b=R,D=Ba({keyframes:[c.value,m(c.value)],velocity:Ko(I,R,c.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return M(0),{calculatedDuration:null,next:R=>{let k=!1;return!D&&b===void 0&&(k=!0,v(R),M(R)),b!==void 0&&R>=b?D.next(R-b):(!k&&v(R),c)}}}function Eh(e,t,a){let r=[],o=a||Te.mix||Go,s=e.length-1;for(let n=0;n<s;n++){let i=o(e[n],e[n+1]);if(t){let d=Array.isArray(t)?t[n]||ie:t;i=et(d,i)}r.push(i)}return r}function _u(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let s=e.length;if(Ae(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let n=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=Eh(t,r,o),d=i.length,l=u=>{if(n&&u<e[0])return t[0];let f=0;if(d>1)for(;f<e.length-2&&!(u<e[f+1]);f++);let c=lt(e[f],e[f+1],u);return i[f](c)};return a?u=>l(we(e[0],e[s-1],u)):l}function qu(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=lt(0,t,r);e.push(Z(a,1,o))}}function ju(e){let t=[0];return qu(t,e.length-1),t}function Wu(e,t){return e.map(a=>a*t)}function kh(e,t){return e.map(()=>t||Er).splice(0,e.length-1)}function Nt({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=Bn(r)?r.map(Uo):Uo(r),s={done:!1,value:t[0]},n=Wu(a&&a.length===t.length?a:ju(t),e),i=_u(n,t,{ease:Array.isArray(o)?o:kh(t,o)});return{calculatedDuration:e,next:d=>(s.value=i(d),s.done=d>=e,s)}}var Fh=e=>e!==null;function Oa(e,{repeat:t,repeatType:a="loop"},r,o=1){let s=e.filter(Fh),i=o<0||t&&a!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}var Vh={decay:Hr,inertia:Hr,tween:Nt,keyframes:Nt,spring:Ba};function Zo(e){typeof e.type=="string"&&(e.type=Vh[e.type])}var Ut=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,a){return this.finished.then(t,a)}};var Bh=e=>e/100,Ct=class extends Ut{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,o;let{motionValue:a}=this.options;a&&a.updatedAt!==pe.now()&&this.tick(pe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},tt.mainThread++,this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;Zo(t);let{type:a=Nt,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:n=0}=t,{keyframes:i}=t,d=a||Nt;process.env.NODE_ENV!=="production"&&d!==Nt&&Ae(i.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${i}`,"spring-two-frames"),d!==Nt&&typeof i[0]!="number"&&(this.mixKeyframes=et(Bh,Go(i[0],i[1])),i=[0,100]);let l=d(P(h({},t),{keyframes:i}));s==="mirror"&&(this.mirroredGenerator=d(P(h({},t),{keyframes:[...i].reverse(),velocity:-n}))),l.calculatedDuration===null&&(l.calculatedDuration=Va(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}updateTime(t){let a=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(t,a=!1){let{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:n,resolvedDuration:i,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);let{delay:l=0,keyframes:u,repeat:f,repeatType:c,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:L}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),a?this.currentTime=t:this.updateTime(t);let S=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?S<0:S>o;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let I=this.currentTime,v=r;if(f){let R=Math.min(this.currentTime,o)/i,k=Math.floor(R),V=R%1;!V&&R>=1&&(V=1),V===1&&k--,k=Math.min(k,f+1),k%2&&(c==="reverse"?(V=1-V,p&&(V-=p/i)):c==="mirror"&&(v=n)),I=we(0,1,V)*i}let b=y?{done:!1,value:u[0]}:v.next(I);s&&(b.value=s(b.value));let{done:D}=b;!y&&d!==null&&(D=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return M&&m!==Hr&&(b.value=Oa(u,this.options,L,this.speed)),g&&g(b.value),M&&this.finish(),b}then(t,a){return this.finished.then(t,a)}get duration(){return Ie(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ie(t)}get time(){return Ie(this.currentTime)}set time(t){var a;t=Ce(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(a=this.driver)==null||a.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(pe.now());let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=Ie(this.currentTime))}play(){var o,s;if(this.isStopped)return;let{driver:t=Ou,startTime:a}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),(s=(o=this.options).onPlay)==null||s.call(o);let r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=a!=null?a:r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,a;this.notifyFinished(),this.teardown(),this.state="finished",(a=(t=this.options).onComplete)==null||a.call(t)}cancel(){var t,a;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(a=(t=this.options).onCancel)==null||a.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,tt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var a;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(a=this.driver)==null||a.stop(),t.observe(this)}};function zu(e){var t;for(let a=1;a<e.length;a++)(t=e[a])!=null||(e[a]=e[a-1])}var la=e=>e*180/Math.PI,zn=e=>{let t=la(Math.atan2(e[1],e[0]));return Gn(t)},Oh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zn,rotateZ:zn,skewX:e=>la(Math.atan(e[1])),skewY:e=>la(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gn=e=>(e=e%360,e<0&&(e+=360),e),Gu=zn,$u=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ku=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Nh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$u,scaleY:Ku,scale:e=>($u(e)+Ku(e))/2,rotateX:e=>Gn(la(Math.atan2(e[6],e[5]))),rotateY:e=>Gn(la(Math.atan2(-e[2],e[0]))),rotateZ:Gu,rotate:Gu,skewX:e=>la(Math.atan(e[4])),skewY:e=>la(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function _r(e){return e.includes("scale")?1:0}function qr(e,t){if(!e||e==="none")return _r(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,o;if(a)r=Nh,o=a;else{let i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Oh,o=i}if(!o)return _r(t);let s=r[t],n=o[1].split(",").map(Uh);return typeof s=="function"?s(n):n[s]}var $n=(e,t)=>{let{transform:a="none"}=getComputedStyle(e);return qr(a,t)};function Uh(e){return parseFloat(e.trim())}var rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qe=new Set(rt);var Kn=e=>e===ut||e===B,Hh=new Set(["x","y","z"]),_h=rt.filter(e=>!Hh.has(e));function Xu(e){let t=[];return _h.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var Ht={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>qr(t,"x"),y:(e,{transform:t})=>qr(t,"y")};Ht.translateX=Ht.x;Ht.translateY=Ht.y;var ua=new Set,Xn=!1,Zn=!1,Yn=!1;function Zu(){if(Zn){let e=Array.from(ua).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=Xu(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([s,n])=>{var i;(i=r.getValue(s))==null||i.set(n)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zn=!1,Xn=!1,ua.forEach(e=>e.complete(Yn)),ua.clear()}function Yu(){ua.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zn=!0)})}function Qn(){Yn=!0,Yu(),Zu(),Yn=!1}var It=class{constructor(t,a,r,o,s,n=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=s,this.isAsync=n}scheduleResolve(){this.state="scheduled",this.isAsync?(ua.add(this),Xn||(Xn=!0,G.read(Yu),G.resolveKeyframes(Zu))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;if(t[0]===null){let s=o==null?void 0:o.get(),n=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let i=r.readValue(a,n);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=n),o&&s===void 0&&o.set(t[0])}zu(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ua.delete(this)}cancel(){this.state==="scheduled"&&(ua.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Qu=e=>e.startsWith("--");function Ju(e,t,a){Qu(t)?e.style.setProperty(t,a):e.style[t]=a}var ed=sa(()=>window.ScrollTimeline!==void 0);var td={};function ad(e,t){let a=sa(e);return()=>{var r;return(r=td[t])!=null?r:a()}}var Yo=ad(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var da=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`;var Jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:da([0,.65,.55,1]),circOut:da([.55,0,1,.45]),backIn:da([.31,.01,.66,-.59]),backOut:da([.33,1.53,.69,.99])};function ei(e,t){if(e)return typeof e=="function"?Yo()?$o(e,t):"ease-out":kr(e)?da(e):Array.isArray(e)?e.map(a=>ei(a,t)||Jn.easeOut):Jn[e]}function rd(e,t,a,{delay:r=0,duration:o=300,repeat:s=0,repeatType:n="loop",ease:i="easeOut",times:d}={},l=void 0){let u={[t]:a};d&&(u.offset=d);let f=ei(i,o);Array.isArray(f)&&(u.easing=f),Ve.value&&tt.waapi++;let c={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:n==="reverse"?"alternate":"normal"};l&&(c.pseudoElement=l);let p=e.animate(u,c);return Ve.value&&p.finished.finally(()=>{tt.waapi--}),p}function Qo(e){return typeof e=="function"&&"applyToOptions"in e}function od(a){var r=a,{type:e}=r,t=$(r,["type"]);var o,s;return Qo(e)&&Yo()?e.applyToOptions(t):((o=t.duration)!=null||(t.duration=300),(s=t.ease)!=null||(t.ease="easeOut"),t)}var Jo=class extends Ut{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;let{element:a,name:r,keyframes:o,pseudoElement:s,allowFlatten:n=!1,finalKeyframe:i,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=n,this.options=t,Ae(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=od(t);this.animation=rd(a,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let u=Oa(o,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(u):Ju(a,r,u),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,a;(a=(t=this.animation).finish)==null||a.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,a;this.isPseudoElement||(a=(t=this.animation).commitStyles)==null||a.call(t)}get duration(){var a,r;let t=((r=(a=this.animation.effect)==null?void 0:a.getComputedTiming)==null?void 0:r.call(a).duration)||0;return Ie(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Ie(t)}get time(){return Ie(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ce(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:a}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&ed()?(this.animation.timeline=t,ie):a(this)}};var sd={anticipate:Ar,backInOut:Rr,circInOut:Mr};function qh(e){return e in sd}function nd(e){typeof e.ease=="string"&&qh(e.ease)&&(e.ease=sd[e.ease])}var id=10,es=class extends Jo{constructor(t){nd(t),Zo(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){var u;let l=this.options,{motionValue:a,onUpdate:r,onComplete:o,element:s}=l,n=$(l,["motionValue","onUpdate","onComplete","element"]);if(!a)return;if(t!==void 0){a.set(t);return}let i=new Ct(P(h({},n),{autoplay:!1})),d=Ce((u=this.finishedTime)!=null?u:this.time);a.setWithVelocity(i.sample(d-id).value,i.sample(d).value,id),i.stop()}};var ti=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Me.test(e)||e==="0")&&!e.startsWith("url("));function jh(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function ld(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],n=ti(o,t),i=ti(s,t);return $e(n===i,`You are trying to animate ${t} from "${o}" to "${s}". "${n?s:o}" is not an animatable value.`,"value-not-animatable"),!n||!i?!1:jh(e)||(a==="spring"||Qo(a))&&r}function Na(e){e.duration=0,e.type="keyframes"}var Wh=new Set(["opacity","clipPath","filter","transform"]),zh=sa(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ud(e){var u;let{motionValue:t,name:a,repeatDelay:r,repeatType:o,damping:s,type:n}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;let{onUpdate:d,transformTemplate:l}=t.owner.getProps();return zh()&&a&&Wh.has(a)&&(a!=="transform"||!l)&&!d&&!r&&o!=="mirror"&&s!==0&&n!=="inertia"}var Gh=40,jr=class extends Ut{constructor(c){var p=c,{autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:n="loop",keyframes:i,name:d,motionValue:l,element:u}=p,f=$(p,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);var L;super(),this.stop=()=>{var S,y;this._animation&&(this._animation.stop(),(S=this.stopTimeline)==null||S.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=pe.now();let m=h({autoplay:t,delay:a,type:r,repeat:o,repeatDelay:s,repeatType:n,name:d,motionValue:l,element:u},f),g=(u==null?void 0:u.KeyframeResolver)||It;this.keyframeResolver=new g(i,(S,y,I)=>this.onKeyframesResolved(S,y,m,!I),d,l,u),(L=this.keyframeResolver)==null||L.scheduleResolve()}onKeyframesResolved(t,a,r,o){this.keyframeResolver=void 0;let{name:s,type:n,velocity:i,delay:d,isHandoff:l,onUpdate:u}=r;this.resolvedAt=pe.now(),ld(t,s,n,i)||((Te.instantAnimations||!d)&&(u==null||u(Oa(t,r,a))),t[0]=t[t.length-1],Na(r),r.repeat=0);let f=o?this.resolvedAt?this.resolvedAt-this.createdAt>Gh?this.resolvedAt:this.createdAt:this.createdAt:void 0,c=P(h({startTime:f,finalKeyframe:a},r),{keyframes:t}),p=!l&&ud(c)?new es(P(h({},c),{element:c.motionValue.owner.current})):new Ct(c);p.finished.then(()=>this.notifyFinished()).catch(ie),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,a){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Qn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};var $h=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Kh(e){let t=$h.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a!=null?a:r}`,o]}var Xh=4;function ai(e,t,a=1){Ae(a<=Xh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[r,o]=Kh(e);if(!r)return;let s=window.getComputedStyle(t).getPropertyValue(r);if(s){let n=s.trim();return vr(n)?parseFloat(n):n}return ia(o)?ai(o,t,a+1):o}function fa(e,t){var a,r;return(r=(a=e==null?void 0:e[t])!=null?a:e==null?void 0:e.default)!=null?r:e}var Wr=new Set(["width","height","top","left","right","bottom",...rt]);var dd={test:e=>e==="auto",parse:e=>e};var ts=e=>t=>t.test(e);var ri=[ut,B,De,at,Un,Nn,dd],oi=e=>ri.find(ts(e));function fd(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||br(e):!0}var Zh=new Set(["brightness","contrast","saturate","opacity"]);function Yh(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(Ea)||[];if(!r)return e;let o=a.replace(r,""),s=Zh.has(t)?1:0;return r!==a&&(s*=100),t+"("+s+o+")"}var Qh=/\b([a-z-]*)\(.*?\)/gu,zr=P(h({},Me),{getAnimatableNone:e=>{let t=e.match(Qh);return t?t.map(Yh).join(" "):e}});var si=P(h({},ut),{transform:Math.round});var cd={rotate:at,rotateX:at,rotateY:at,rotateZ:at,scale:Or,scaleX:Or,scaleY:Or,scaleZ:Or,skew:at,skewX:at,skewY:at,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:yt,originX:jo,originY:jo,originZ:B};var ca=P(h({borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,backgroundPositionX:B,backgroundPositionY:B},cd),{zIndex:si,fillOpacity:yt,strokeOpacity:yt,numOctaves:si});var pd=P(h({},ca),{color:se,backgroundColor:se,outlineColor:se,fill:se,stroke:se,borderColor:se,borderTopColor:se,borderRightColor:se,borderBottomColor:se,borderLeftColor:se,filter:zr,WebkitFilter:zr}),Gr=e=>pd[e];function $r(e,t){let a=Gr(e);return a!==zr&&(a=Me),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var Jh=new Set(["auto","none","0"]);function md(e,t,a){let r=0,o;for(;r<e.length&&!o;){let s=e[r];typeof s=="string"&&!Jh.has(s)&&Ot(s).values.length&&(o=e[r]),r++}if(o&&a)for(let s of t)e[s]=$r(a,o)}var Kr=class extends It{constructor(t,a,r,o,s){super(t,a,r,o,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let l=t[d];if(typeof l=="string"&&(l=l.trim(),ia(l))){let u=ai(l,a.current);u!==void 0&&(t[d]=u),d===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Wr.has(r)||t.length!==2)return;let[o,s]=t,n=oi(o),i=oi(s);if(n!==i)if(Kn(n)&&Kn(i))for(let d=0;d<t.length;d++){let l=t[d];typeof l=="string"&&(t[d]=parseFloat(l))}else Ht[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||fd(t[o]))&&r.push(o);r.length&&md(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ht[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var i;let{element:t,name:a,unresolvedKeyframes:r}=this;if(!t||!t.current)return;let o=t.getValue(a);o&&o.jump(this.measuredOrigin,!1);let s=r.length-1,n=r[s];r[s]=Ht[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=n),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([d,l])=>{t.getValue(d).set(l)}),this.resolveNoneKeyframes()}};function hd(e,t,a){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let s=(r=a==null?void 0:a[e])!=null?r:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}var Xr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Zr(e){return wr(e)&&"offsetHeight"in e}var gd=30,eg=e=>!isNaN(parseFloat(e)),ni={current:void 0},as=class{constructor(t,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;let o=pe.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=pe.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eg(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&na(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new Lt);let r=this.events[t].add(a);return t==="change"?()=>{r(),G.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ni.current&&ni.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=pe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gd)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,gd);return Pr(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,a;(t=this.dependents)==null||t.clear(),(a=this.events.destroy)==null||a.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ke(e,t){return new as(e,t)}var{schedule:pa,cancel:tg}=Ho(queueMicrotask,!1);var Xe={x:!1,y:!1};function rs(){return Xe.x||Xe.y}function ii(e){return e==="x"||e==="y"?Xe[e]?null:(Xe[e]=!0,()=>{Xe[e]=!1}):Xe.x||Xe.y?null:(Xe.x=Xe.y=!0,()=>{Xe.x=Xe.y=!1})}function os(e,t){let a=hd(e),r=new AbortController,o=P(h({passive:!0},t),{signal:r.signal});return[a,o,()=>r.abort()]}function xd(e){return!(e.pointerType==="touch"||rs())}function li(e,t,a={}){let[r,o,s]=os(e,a),n=i=>{if(!xd(i))return;let{target:d}=i,l=t(d,i);if(typeof l!="function"||!d)return;let u=f=>{xd(f)&&(l(f),d.removeEventListener("pointerleave",u))};d.addEventListener("pointerleave",u,o)};return r.forEach(i=>{i.addEventListener("pointerenter",n,o)}),s}var ui=(e,t)=>t?e===t?!0:ui(e,t.parentElement):!1;var ma=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var ag=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ld(e){return ag.has(e.tagName)||e.tabIndex!==-1}var Ua=new WeakSet;function yd(e){return t=>{t.key==="Enter"&&e(t)}}function di(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var Cd=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=yd(()=>{if(Ua.has(a))return;di(a,"down");let o=yd(()=>{di(a,"up")}),s=()=>di(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",s,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function Id(e){return ma(e)&&!rs()}function fi(e,t,a={}){let[r,o,s]=os(e,a),n=i=>{let d=i.currentTarget;if(!Id(i))return;Ua.add(d);let l=t(d,i),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",c),Ua.has(d)&&Ua.delete(d),Id(p)&&typeof l=="function"&&l(p,{success:m})},f=p=>{u(p,d===window||d===document||a.useGlobalTarget||ui(d,p.target))},c=p=>{u(p,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",c,o)};return r.forEach(i=>{(a.useGlobalTarget?window:i).addEventListener("pointerdown",n,o),Zr(i)&&(i.addEventListener("focus",l=>Cd(l,o)),!Ld(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),s}function Yr(e){return wr(e)&&"ownerSVGElement"in e}function ci(e){return Yr(e)&&e.tagName==="svg"}var re=e=>!!(e&&e.getVelocity);var rg=[...ri,se,Me],pi=e=>rg.find(ts(e));var ss=gt(require("react"),1),St=require("react");var Sd=require("react"),Ha=(0,Sd.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var wd=gt(require("react"),1);function vd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function og(...e){return t=>{let a=!1,r=e.map(o=>{let s=vd(o,t);return!a&&typeof s=="function"&&(a=!0),s});if(a)return()=>{for(let o=0;o<r.length;o++){let s=r[o];typeof s=="function"?s():vd(e[o],null)}}}}function bd(...e){return wd.useCallback(og(...e),e)}var mi=class extends ss.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=a.offsetParent,o=Zr(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=a.offsetHeight||0,s.width=a.offsetWidth||0,s.top=a.offsetTop,s.left=a.offsetLeft,s.right=o-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}};function Rd({children:e,isPresent:t,anchorX:a,root:r}){let o=(0,St.useId)(),s=(0,St.useRef)(null),n=(0,St.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=(0,St.useContext)(Ha),d=bd(s,e==null?void 0:e.ref);return(0,St.useInsertionEffect)(()=>{let{width:l,height:u,top:f,left:c,right:p}=n.current;if(t||!s.current||!l||!u)return;let m=a==="left"?`left: ${c}`:`right: ${p}`;s.current.dataset.motionPopId=o;let g=document.createElement("style");i&&(g.nonce=i);let L=r!=null?r:document.head;return L.appendChild(g),g.sheet&&g.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${l}px !important;
5
+ height: ${u}px !important;
6
+ ${m}px !important;
7
+ top: ${f}px !important;
8
+ }
9
+ `),()=>{L.contains(g)&&L.removeChild(g)}},[t]),(0,Pd.jsx)(mi,{isPresent:t,childRef:s,sizeRef:n,children:ss.cloneElement(e,{ref:d})})}var Td=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:n,anchorX:i,root:d})=>{let l=Ta(sg),u=(0,Qr.useId)(),f=!0,c=(0,Qr.useMemo)(()=>(f=!1,{id:u,initial:t,isPresent:a,custom:o,onExitComplete:p=>{l.set(p,!0);for(let m of l.values())if(!m)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[a,l,r]);return s&&f&&(c=h({},c)),(0,Qr.useMemo)(()=>{l.forEach((p,m)=>l.set(m,!1))},[a]),Ad.useEffect(()=>{!a&&!l.size&&r&&r()},[a]),n==="popLayout"&&(e=(0,hi.jsx)(Rd,{isPresent:a,anchorX:i,root:d,children:e})),(0,hi.jsx)(kt.Provider,{value:c,children:e})};function sg(){return new Map}var _t=require("react");function ns(e=!0){let t=(0,_t.useContext)(kt);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,s=(0,_t.useId)();(0,_t.useEffect)(()=>{if(e)return o(s)},[e]);let n=(0,_t.useCallback)(()=>e&&r&&r(s),[s,r,e]);return!a&&r?[!1,n]:[!0]}var is=require("react"),Jr=e=>e.key||"";function gi(e){let t=[];return is.Children.forEach(e,a=>{(0,is.isValidElement)(a)&&t.push(a)}),t}var xi=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:n=!1,anchorX:i="left",root:d})=>{let[l,u]=ns(n),f=(0,ft.useMemo)(()=>gi(e),[e]),c=n&&!l?[]:f.map(Jr),p=(0,ft.useRef)(!0),m=(0,ft.useRef)(f),g=Ta(()=>new Map),[L,S]=(0,ft.useState)(f),[y,I]=(0,ft.useState)(f);Vo(()=>{p.current=!1,m.current=f;for(let D=0;D<y.length;D++){let M=Jr(y[D]);c.includes(M)?g.delete(M):g.get(M)!==!0&&g.set(M,!1)}},[y,c.length,c.join("-")]);let v=[];if(f!==L){let D=[...f];for(let M=0;M<y.length;M++){let R=y[M],k=Jr(R);c.includes(k)||(D.splice(M,0,R),v.push(R))}return s==="wait"&&v.length&&(D=v),I(gi(D)),S(f),null}process.env.NODE_ENV!=="production"&&s==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:b}=(0,ft.useContext)(Aa);return(0,eo.jsx)(eo.Fragment,{children:y.map(D=>{let M=Jr(D),R=n&&!l?!1:f===y||c.includes(M),k=()=>{if(g.has(M))g.set(M,!0);else return;let V=!0;g.forEach(U=>{U||(V=!1)}),V&&(b==null||b(),I(m.current),n&&(u==null||u()),r&&r())};return(0,eo.jsx)(Td,{isPresent:R,initial:!p.current||a?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:R?void 0:k,anchorX:i,children:D},M)})})};var Dd=require("react"),ls=(0,Dd.createContext)({strict:!1});var Md={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},vt={};for(let e in Md)vt[e]={isEnabled:t=>Md[e].some(a=>!!t[a])};function Ed(e){for(let t in e)vt[t]=h(h({},vt[t]),e[t])}var ng=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function to(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ng.has(e)}var kd=e=>!to(e);function ig(e){typeof e=="function"&&(kd=t=>t.startsWith("on")?!to(t):e(t))}try{ig(require("@emotion/is-prop-valid").default)}catch(e){}function Fd(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(kd(o)||a===!0&&to(o)||!t&&!to(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}var Cs=require("react/jsx-runtime");var Za=require("react");var Vd=require("react"),qt=(0,Vd.createContext)({});var fs=require("react");function jt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wt(e){return typeof e=="string"||Array.isArray(e)}var us=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ao=["initial",...us];function ha(e){return jt(e.animate)||ao.some(t=>wt(e[t]))}function ds(e){return!!(ha(e)||e.variants)}function Bd(e,t){if(ha(e)){let{initial:a,animate:r}=e;return{initial:a===!1||wt(a)?a:void 0,animate:wt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Nd(e){let{initial:t,animate:a}=Bd(e,(0,fs.useContext)(qt));return(0,fs.useMemo)(()=>({initial:t,animate:a}),[Od(t),Od(a)])}function Od(e){return Array.isArray(e)?e.join(" "):e}var za=require("react");var qd=require("react");function Ud(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var _a={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;let a=Ud(e,t.target.x),r=Ud(e,t.target.y);return`${a}% ${r}%`}};var Hd={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Me.parse(e);if(o.length>5)return r;let s=Me.createTransformer(e),n=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,d=a.y.scale*t.y;o[0+n]/=i,o[1+n]/=d;let l=Z(i,d,.5);return typeof o[2+n]=="number"&&(o[2+n]/=l),typeof o[3+n]=="number"&&(o[3+n]/=l),s(o)}};var ro={borderRadius:P(h({},_a),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:Hd};function cs(e,{layout:t,layoutId:a}){return qe.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!ro[e]||e==="opacity")}var lg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ug=rt.length;function _d(e,t,a){let r="",o=!0;for(let s=0;s<ug;s++){let n=rt[s],i=e[n];if(i===void 0)continue;let d=!0;if(typeof i=="number"?d=i===(n.startsWith("scale")?1:0):d=parseFloat(i)===0,!d||a){let l=Xr(i,ca[n]);if(!d){o=!1;let u=lg[n]||n;r+=`${u}(${l}) `}a&&(t[n]=l)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function qa(e,t,a){let{style:r,vars:o,transformOrigin:s}=e,n=!1,i=!1;for(let d in t){let l=t[d];if(qe.has(d)){n=!0;continue}else if(Br(d)){o[d]=l;continue}else{let u=Xr(l,ca[d]);d.startsWith("origin")?(i=!0,s[d]=u):r[d]=u}}if(t.transform||(n||a?r.transform=_d(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:d="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${d} ${l} ${u}`}}var ja=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Li(e,t,a){for(let r in t)!re(t[r])&&!cs(r,a)&&(e[r]=t[r])}function dg({transformTemplate:e},t){return(0,qd.useMemo)(()=>{let a=ja();return qa(a,t,e),Object.assign({},a.vars,a.style)},[t])}function fg(e,t){let a=e.style||{},r={};return Li(r,a,e),Object.assign(r,dg(e,t)),r}function jd(e,t){let a={},r=fg(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a}var zd=require("react");var cg={offset:"stroke-dashoffset",array:"stroke-dasharray"},pg={offset:"strokeDashoffset",array:"strokeDasharray"};function Wd(e,t,a=1,r=0,o=!0){e.pathLength=1;let s=o?cg:pg;e[s.offset]=B.transform(-r);let n=B.transform(t),i=B.transform(a);e[s.array]=`${n} ${i}`}function ps(e,f,d,l,u){var c=f,{attrX:t,attrY:a,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:n=0}=c,i=$(c,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]);var g,L;if(qa(e,i,l),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:m}=e;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=(g=p.transformOrigin)!=null?g:"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(L=u==null?void 0:u.transformBox)!=null?L:"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),a!==void 0&&(p.y=a),r!==void 0&&(p.scale=r),o!==void 0&&Wd(p,o,s,n,!1)}var ms=()=>P(h({},ja()),{attrs:{}});var hs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Gd(e,t,a,r){let o=(0,zd.useMemo)(()=>{let s=ms();return ps(s,t,hs(r),e.transformTemplate,e.style),P(h({},s.attrs),{style:h({},s.style)})},[t]);if(e.style){let s={};Li(s,e.style,e),o.style=h(h({},s),o.style)}return o}var $d=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Wa(e){return typeof e!="string"||e.includes("-")?!1:!!($d.indexOf(e)>-1||/[A-Z]/u.test(e))}function Kd(e,t,a,{latestValues:r},o,s=!1){let i=(Wa(e)?Gd:jd)(t,r,o,e),d=Fd(t,typeof e=="string",s),l=e!==za.Fragment?P(h(h({},d),i),{ref:a}):{},{children:u}=t,f=(0,za.useMemo)(()=>re(u)?u.get():u,[u]);return(0,za.createElement)(e,P(h({},l),{children:f}))}var yi=require("react");function Xd(e){let t=[{},{}];return e==null||e.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Ga(e,t,a,r){if(typeof t=="function"){let[o,s]=Xd(r);t=t(a!==void 0?a:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,s]=Xd(r);t=t(a!==void 0?a:e.custom,o,s)}return t}function $a(e){return re(e)?e.get():e}function mg({scrapeMotionValuesFromProps:e,createRenderState:t},a,r,o){return{latestValues:hg(a,r,o,e),renderState:t()}}function hg(e,t,a,r){let o={},s=r(e,{});for(let p in s)o[p]=$a(s[p]);let{initial:n,animate:i}=e,d=ha(e),l=ds(e);t&&l&&!d&&e.inherit!==!1&&(n===void 0&&(n=t.initial),i===void 0&&(i=t.animate));let u=a?a.initial===!1:!1;u=u||n===!1;let f=u?i:n;if(f&&typeof f!="boolean"&&!jt(f)){let p=Array.isArray(f)?f:[f];for(let m=0;m<p.length;m++){let g=Ga(e,p[m]);if(g){let c=g,{transitionEnd:L,transition:S}=c,y=$(c,["transitionEnd","transition"]);for(let I in y){let v=y[I];if(Array.isArray(v)){let b=u?v.length-1:0;v=v[b]}v!==null&&(o[I]=v)}for(let I in L)o[I]=L[I]}}}return o}var gs=e=>(t,a)=>{let r=(0,yi.useContext)(qt),o=(0,yi.useContext)(kt),s=()=>mg(e,t,r,o);return a?s():Ta(s)};function Ka(e,t,a){var s;let{style:r}=e,o={};for(let n in r)(re(r[n])||t.style&&re(t.style[n])||cs(n,e)||((s=a==null?void 0:a.getValue(n))==null?void 0:s.liveStyle)!==void 0)&&(o[n]=r[n]);return o}var Zd=gs({scrapeMotionValuesFromProps:Ka,createRenderState:ja});function xs(e,t,a){let r=Ka(e,t,a);for(let o in e)if(re(e[o])||re(t[o])){let s=rt.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}var Yd=gs({scrapeMotionValuesFromProps:xs,createRenderState:ms});var Qd=Symbol.for("motionComponentSymbol");var Jd=require("react");function bt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ef(e,t,a){return(0,Jd.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):bt(a)&&(a.current=r))},[t])}var Oe=require("react");var Xa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var gg="framerAppearId",Ls="data-"+Xa(gg);var tf=require("react"),ys=(0,tf.createContext)({});function af(e,t,a,r,o){var g,L;let{visualElement:s}=(0,Oe.useContext)(qt),n=(0,Oe.useContext)(ls),i=(0,Oe.useContext)(kt),d=(0,Oe.useContext)(Ha).reducedMotion,l=(0,Oe.useRef)(null);r=r||n.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:a,presenceContext:i,blockInitialAnimation:i?i.initial===!1:!1,reducedMotionConfig:d}));let u=l.current,f=(0,Oe.useContext)(ys);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&xg(l.current,a,o,f);let c=(0,Oe.useRef)(!1);(0,Oe.useInsertionEffect)(()=>{u&&c.current&&u.update(a,i)});let p=a[Ls],m=(0,Oe.useRef)(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((L=window.MotionHasOptimisedAnimation)==null?void 0:L.call(window,p)));return Vo(()=>{u&&(c.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,Oe.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,p)}),m.current=!1),u.enteringChildren=void 0)}),u}function xg(e,t,a,r){let{layoutId:o,layout:s,drag:n,dragConstraints:i,layoutScroll:d,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:rf(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!n||i&&bt(i),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:d,layoutRoot:l})}function rf(e){if(e)return e.options.allowProjection!==!1?e.projection:rf(e.parent)}function Is(e,{forwardMotionProps:t=!1}={},a,r){var i,d;a&&Ed(a);let o=Wa(e)?Yd:Zd;function s(l,u){let f,c=P(h(h({},(0,Za.useContext)(Ha)),l),{layoutId:Lg(l)}),{isStatic:p}=c,m=Nd(l),g=o(l,p);if(!p&&Da){yg(c,a);let L=Cg(c);f=L.MeasureLayout,m.visualElement=af(e,g,c,r,L.ProjectionNode)}return(0,Cs.jsxs)(qt.Provider,{value:m,children:[f&&m.visualElement?(0,Cs.jsx)(f,h({visualElement:m.visualElement},c)):null,Kd(e,l,ef(g,m.visualElement,u),g,p,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${(d=(i=e.displayName)!=null?i:e.name)!=null?d:""})`}`;let n=(0,Za.forwardRef)(s);return n[Qd]=e,n}function Lg({layoutId:e}){let t=(0,Za.useContext)(Aa).id;return t&&e!==void 0?t+"-"+e:e}function yg(e,t){let a=(0,Za.useContext)(ls).strict;if(process.env.NODE_ENV!=="production"&&t&&a){let r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?$e(!1,r,"lazy-strict-mode"):Ae(!1,r,"lazy-strict-mode")}}function Cg(e){let{drag:t,layout:a}=vt;if(!t&&!a)return{};let r=h(h({},t),a);return{MeasureLayout:t!=null&&t.isEnabled(e)||a!=null&&a.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function of(e,t){if(typeof Proxy=="undefined")return Is;let a=new Map,r=(s,n)=>Is(s,n,e,t),o=(s,n)=>(process.env.NODE_ENV!=="production"&&na(!1,"motion() is deprecated. Use motion.create() instead."),r(s,n));return new Proxy(o,{get:(s,n)=>n==="create"?r:(a.has(n)||a.set(n,Is(n,void 0,e,t)),a.get(n))})}var Sf=require("react");function Ss({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function sf({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nf(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function Ci(e){return e===void 0||e===1}function vs({scale:e,scaleX:t,scaleY:a}){return!Ci(e)||!Ci(t)||!Ci(a)}function Pt(e){return vs(e)||Ii(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ii(e){return lf(e.x)||lf(e.y)}function lf(e){return e&&e!=="0%"}function oo(e,t,a){let r=e-a,o=t*r;return a+o}function uf(e,t,a,r,o){return o!==void 0&&(e=oo(e,o,r)),oo(e,a,r)+t}function Si(e,t=0,a=1,r,o){e.min=uf(e.min,t,a,r,o),e.max=uf(e.max,t,a,r,o)}function vi(e,{x:t,y:a}){Si(e.x,t.translate,t.scale,t.originPoint),Si(e.y,a.translate,a.scale,a.originPoint)}var df=.999999999999,ff=1.0000000000001;function pf(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let s,n;for(let i=0;i<o;i++){s=a[i],n=s.projectionDelta;let{visualElement:d}=s.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ga(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(t.x*=n.x.scale,t.y*=n.y.scale,vi(e,n)),r&&Pt(s.latestValues)&&ga(e,s.latestValues))}t.x<ff&&t.x>df&&(t.x=1),t.y<ff&&t.y>df&&(t.y=1)}function Wt(e,t){e.min=e.min+t,e.max=e.max+t}function cf(e,t,a,r,o=.5){let s=Z(e.min,e.max,o);Si(e,t,a,s,r)}function ga(e,t){cf(e.x,t.x,t.scaleX,t.scale,t.originX),cf(e.y,t.y,t.scaleY,t.scale,t.originY)}function wi(e,t){return Ss(nf(e.getBoundingClientRect(),t))}function mf(e,t,a){let r=wi(e,a),{scroll:o}=t;return o&&(Wt(r.x,o.offset.x),Wt(r.y,o.offset.y)),r}var hf=()=>({translate:0,scale:1,origin:0,originPoint:0}),xa=()=>({x:hf(),y:hf()}),gf=()=>({min:0,max:0}),le=()=>({x:gf(),y:gf()});var so={current:null},ws={current:!1};function xf(){if(ws.current=!0,!!Da)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>so.current=e.matches;e.addEventListener("change",t),t()}else so.current=!1}var Lf=new WeakMap;function yf(e,t,a){for(let r in t){let o=t[r],s=a[r];if(re(o))e.addValue(r,o);else if(re(s))e.addValue(r,Ke(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){let n=e.getValue(r);n.liveStyle===!0?n.jump(o):n.hasAnimated||n.set(o)}else{let n=e.getStaticValue(r);e.addValue(r,Ke(n!==void 0?n:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var Cf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],bs=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:n},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=It,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let p=pe.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,G.render(this.render,!1,!0))};let{latestValues:d,renderState:l}=n;this.latestValues=d,this.baseTarget=h({},d),this.initialValues=a.initial?h({},d):{},this.renderState=l,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!s,this.isControllingVariants=ha(a),this.isVariantNode=ds(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let c=this.scrapeMotionValuesFromProps(a,{},this),{willChange:u}=c,f=$(c,["willChange"]);for(let p in f){let m=f[p];d[p]!==void 0&&re(m)&&m.set(d[p])}}mount(t){var a;this.current=t,Lf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,o)=>this.bindToMotionValue(o,r)),ws.current||xf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:so.current,process.env.NODE_ENV!=="production"&&na(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(a=this.parent)==null||a.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Be(this.notifyUpdate),Be(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let a in this.events)this.events[a].clear();for(let a in this.features){let r=this.features[a];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){var a;this.children.add(t),(a=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=qe.has(t);r&&this.onBindTransform&&this.onBindTransform();let o=a.on("change",n=>{this.latestValues[t]=n,this.props.onUpdate&&G.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vt){let a=vt[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):le()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<Cf.length;r++){let o=Cf[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let s="on"+o,n=t[s];n&&(this.propEventSubscriptions[o]=this.on(o,n))}this.prevMotionValues=yf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=Ke(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var o;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(o=this.getBaseTargetFromProps(this.props,t))!=null?o:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(vr(r)||br(r))?r=parseFloat(r):!pi(r)&&Me.test(a)&&(r=$r(t,a)),this.setBaseTarget(t,re(r)?r.get():r)),re(r)?r.get():r}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var s;let{initial:a}=this.props,r;if(typeof a=="string"||typeof a=="object"){let n=Ga(this.props,a,(s=this.presenceContext)==null?void 0:s.custom);n&&(r=n[t])}if(a&&r!==void 0)return r;let o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!re(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new Lt),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}scheduleRenderMicrotask(){pa.render(this.render)}};var Ya=class extends bs{constructor(){super(...arguments),this.KeyframeResolver=Kr}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;re(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function Ps(e,{style:t,vars:a},r,o){let s=e.style,n;for(n in t)s[n]=t[n];o==null||o.applyProjectionStyles(s,r);for(n in a)s.setProperty(n,a[n])}function Ig(e){return window.getComputedStyle(e)}var Rs=class extends Ya{constructor(){super(...arguments),this.type="html",this.renderInstance=Ps}readValueFromInstance(t,a){var r;if(qe.has(a))return(r=this.projection)!=null&&r.isProjecting?_r(a):$n(t,a);{let o=Ig(t),s=(Br(a)?o.getPropertyValue(a):o[a])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:a}){return wi(t,a)}build(t,a,r){qa(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Ka(t,a,r)}};var As=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function If(e,t,a,r){Ps(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(As.has(o)?o:Xa(o),t.attrs[o])}var Ts=class extends Ya{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=le}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(qe.has(a)){let r=Gr(a);return r&&r.default||0}return a=As.has(a)?a:Xa(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return xs(t,a,r)}build(t,a,r){ps(t,a,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,a,r,o){If(t,a,r,o)}mount(t){this.isSVGTag=hs(t.tagName),super.mount(t)}};var vf=(e,t)=>Wa(e)?new Ts(t):new Rs(t,{allowProjection:e!==Sf.Fragment});function ct(e,t,a){let r=e.getProps();return Ga(r,t,a!==void 0?a:r.custom,e)}var no=e=>Array.isArray(e);function Sg(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Ke(a))}function vg(e){return no(e)?e[e.length-1]||0:e}function wf(e,t){let n=ct(e,t)||{},{transitionEnd:r={},transition:o={}}=n,s=$(n,["transitionEnd","transition"]);s=h(h({},s),r);for(let i in s){let d=vg(s[i]);Sg(e,i,d)}}function bf(e){return!!(re(e)&&e.add)}function io(e,t){let a=e.getValue("willChange");if(bf(a))return a.add(t);if(!a&&Te.WillChange){let r=new Te.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ds(e){return e.props[Ls]}var wg=e=>e!==null;function Pf(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(wg),s=t&&a!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}var bg={type:"spring",stiffness:500,damping:25,restSpeed:10},Pg=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rg={type:"keyframes",duration:.8},Ag={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rf=(e,{keyframes:t})=>t.length>2?Rg:qe.has(e)?e.startsWith("scale")?Pg(t[1]):bg:Ag;function Af(f){var c=f,{when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:n,repeatDelay:i,from:d,elapsed:l}=c,u=$(c,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(u).length}var Qa=(e,t,a,r={},o,s)=>n=>{let i=fa(r,e)||{},d=i.delay||r.delay||0,{elapsed:l=0}=r;l=l-Ce(d);let u=P(h({keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity()},i),{delay:-l,onUpdate:c=>{t.set(c),i.onUpdate&&i.onUpdate(c)},onComplete:()=>{n(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:s?void 0:o});Af(i)||Object.assign(u,Rf(e,u)),u.duration&&(u.duration=Ce(u.duration)),u.repeatDelay&&(u.repeatDelay=Ce(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Na(u),u.delay===0&&(f=!0)),(Te.instantAnimations||Te.skipAnimations)&&(f=!0,Na(u),u.delay=0),u.allowFlatten=!i.type&&!i.ease,f&&!s&&t.get()!==void 0){let c=Pf(u.keyframes,i);if(c!==void 0){G.update(()=>{u.onUpdate(c),u.onComplete()});return}}return i.isSync?new Ct(u):new jr(u)};function Tg({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Ms(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var f;let u=t,{transition:s=e.getDefaultTransition(),transitionEnd:n}=u,i=$(u,["transition","transitionEnd"]);r&&(s=r);let d=[],l=o&&e.animationState&&e.animationState.getState()[o];for(let c in i){let p=e.getValue(c,(f=e.latestValues[c])!=null?f:null),m=i[c];if(m===void 0||l&&Tg(l,c))continue;let g=h({delay:a},fa(s||{},c)),L=p.get();if(L!==void 0&&!p.isAnimating&&!Array.isArray(m)&&m===L&&!g.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){let I=Ds(e);if(I){let v=window.MotionHandoffAnimation(I,c,G);v!==null&&(g.startTime=v,S=!0)}}io(e,c),p.start(Qa(c,p,m,e.shouldReduceMotion&&Wr.has(c)?{type:!1}:g,e,S));let y=p.animation;y&&d.push(y)}return n&&Promise.all(d).then(()=>{G.update(()=>{n&&wf(e,n)})}),d}function Es(e,t,a,r=0,o=1){let s=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),n=e.size,i=(n-1)*r;return typeof a=="function"?a(s,n):o===1?s*r:i-s*r}function ks(e,t,a={}){var d;let r=ct(e,t,a.type==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0),{transition:o=e.getDefaultTransition()||{}}=r||{};a.transitionOverride&&(o=a.transitionOverride);let s=r?()=>Promise.all(Ms(e,r,a)):()=>Promise.resolve(),n=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:u=0,staggerChildren:f,staggerDirection:c}=o;return Dg(e,t,l,u,f,c,a)}:()=>Promise.resolve(),{when:i}=o;if(i){let[l,u]=i==="beforeChildren"?[s,n]:[n,s];return l().then(()=>u())}else return Promise.all([s(),n(a.delay)])}function Dg(e,t,a=0,r=0,o=0,s=1,n){let i=[];for(let d of e.variantChildren)d.notify("AnimationStart",t),i.push(ks(d,t,P(h({},n),{delay:a+(typeof r=="function"?0:r)+Es(e.variantChildren,d,r,o,s)})).then(()=>d.notify("AnimationComplete",t)));return Promise.all(i)}function Tf(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(s=>ks(e,s,a));r=Promise.all(o)}else if(typeof t=="string")r=ks(e,t,a);else{let o=typeof t=="function"?ct(e,t,a.custom):t;r=Promise.all(Ms(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}function bi(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}var Mg=ao.length;function Pi(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?Pi(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<Mg;a++){let r=ao[a],o=e.props[r];(wt(o)||o===!1)&&(t[r]=o)}return t}var Eg=[...us].reverse(),kg=us.length;function Fg(e){return t=>Promise.all(t.map(({animation:a,options:r})=>Tf(e,a,r)))}function Mf(e){let t=Fg(e),a=Df(),r=!0,o=d=>(l,u)=>{var c;let f=ct(e,u,d==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);if(f){let p=f,{transition:m,transitionEnd:g}=p,L=$(p,["transition","transitionEnd"]);l=h(h(h({},l),L),g)}return l};function s(d){t=d(e)}function n(d){let{props:l}=e,u=Pi(e.parent)||{},f=[],c=new Set,p={},m=1/0;for(let L=0;L<kg;L++){let S=Eg[L],y=a[S],I=l[S]!==void 0?l[S]:u[S],v=wt(I),b=S===d?y.isActive:null;b===!1&&(m=L);let D=I===u[S]&&I!==l[S]&&v;if(D&&r&&e.manuallyAnimateOnMount&&(D=!1),y.protectedKeys=h({},p),!y.isActive&&b===null||!I&&!y.prevProp||jt(I)||typeof I=="boolean")continue;let M=Vg(y.prevProp,I),R=M||S===d&&y.isActive&&!D&&v||L>m&&v,k=!1,V=Array.isArray(I)?I:[I],U=V.reduce(o(S),{});b===!1&&(U={});let{prevResolvedValues:z={}}=y,q=h(h({},z),U),j=W=>{R=!0,c.has(W)&&(k=!0,c.delete(W)),y.needsAnimating[W]=!0;let ae=e.getValue(W);ae&&(ae.liveStyle=!1)};for(let W in q){let ae=U[W],ue=z[W];if(p.hasOwnProperty(W))continue;let Re=!1;no(ae)&&no(ue)?Re=!bi(ae,ue):Re=ae!==ue,Re?ae!=null?j(W):c.add(W):ae!==void 0&&c.has(W)?j(W):y.protectedKeys[W]=!0}y.prevProp=I,y.prevResolvedValues=U,y.isActive&&(p=h(h({},p),U)),r&&e.blockInitialAnimation&&(R=!1);let Q=D&&M;R&&(!Q||k)&&f.push(...V.map(W=>{let ae={type:S};if(typeof W=="string"&&r&&!Q&&e.manuallyAnimateOnMount&&e.parent){let{parent:ue}=e,Re=ct(ue,W);if(ue.enteringChildren&&Re){let{delayChildren:ge}=Re.transition||{};ae.delay=Es(ue.enteringChildren,e,ge)}}return{animation:W,options:ae}}))}if(c.size){let L={};if(typeof l.initial!="boolean"){let S=ct(e,Array.isArray(l.initial)?l.initial[0]:l.initial);S&&S.transition&&(L.transition=S.transition)}c.forEach(S=>{let y=e.getBaseTarget(S),I=e.getValue(S);I&&(I.liveStyle=!0),L[S]=y!=null?y:null}),f.push({animation:L})}let g=!!f.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function i(d,l){var f;if(a[d].isActive===l)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(c=>{var p;return(p=c.animationState)==null?void 0:p.setActive(d,l)}),a[d].isActive=l;let u=n(d);for(let c in a)a[c].protectedKeys={};return u}return{animateChanges:n,setActive:i,setAnimateFunction:s,getState:()=>a,reset:()=>{a=Df()}}}function Vg(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bi(t,e):!1}function La(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Df(){return{animate:La(!0),whileInView:La(),whileHover:La(),whileTap:La(),whileDrag:La(),whileFocus:La(),exit:La()}}var be=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Fs=class extends be{constructor(t){super(t),t.animationState||(t.animationState=Mf(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();jt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var Bg=0,Vs=class extends be{constructor(){super(...arguments),this.id=Bg++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>{a(this.id)})}mount(){let{register:t,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var Ef={animation:{Feature:Fs},exit:{Feature:Vs}};function Rt(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}var kf=e=>t=>ma(t)&&e(t,At(t));function zt(e,t,a,r){return Rt(e,t,kf(a),r)}var Of=1e-4,Og=1-Of,Ng=1+Of,Nf=.01,Ug=0-Nf,Hg=0+Nf;function Se(e){return e.max-e.min}function Uf(e,t,a){return Math.abs(e-t)<=a}function Ff(e,t,a,r=.5){e.origin=r,e.originPoint=Z(t.min,t.max,e.origin),e.scale=Se(a)/Se(t),e.translate=Z(a.min,a.max,e.origin)-e.originPoint,(e.scale>=Og&&e.scale<=Ng||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ug&&e.translate<=Hg||isNaN(e.translate))&&(e.translate=0)}function Ja(e,t,a,r){Ff(e.x,t.x,a.x,r?r.originX:void 0),Ff(e.y,t.y,a.y,r?r.originY:void 0)}function Vf(e,t,a){e.min=a.min+t.min,e.max=e.min+Se(t)}function Hf(e,t,a){Vf(e.x,t.x,a.x),Vf(e.y,t.y,a.y)}function Bf(e,t,a){e.min=t.min-a.min,e.max=e.min+Se(t)}function lo(e,t,a){Bf(e.x,t.x,a.x),Bf(e.y,t.y,a.y)}function Ne(e){return[e("x"),e("y")]}var Bs=({current:e})=>e?e.ownerDocument.defaultView:null;var _f=(e,t)=>Math.abs(e-t);function qf(e,t){let a=_f(e.x,t.x),r=_f(e.y,t.y);return Math.sqrt(An(a,2)+An(r,2))}var er=class{constructor(t,a,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:n=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=Ai(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=qf(c.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;let{point:g}=c,{timestamp:L}=ce;this.history.push(P(h({},g),{timestamp:L}));let{onStart:S,onMove:y}=this.handlers;p||(S&&S(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,p)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Ri(p,this.transformPagePoint),G.update(this.updatePoint,!0)},this.handlePointerUp=(c,p)=>{this.end();let{onEnd:m,onSessionEnd:g,resumeAnimation:L}=this.handlers;if(this.dragSnapToOrigin&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let S=Ai(c.type==="pointercancel"?this.lastMoveEventInfo:Ri(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,S),g&&g(c,S)},!ma(t))return;this.dragSnapToOrigin=s,this.handlers=a,this.transformPagePoint=r,this.distanceThreshold=n,this.contextWindow=o||window;let i=At(t),d=Ri(i,this.transformPagePoint),{point:l}=d,{timestamp:u}=ce;this.history=[P(h({},l),{timestamp:u})];let{onSessionStart:f}=a;f&&f(t,Ai(d,this.history)),this.removeListeners=et(zt(this.contextWindow,"pointermove",this.handlePointerMove),zt(this.contextWindow,"pointerup",this.handlePointerUp),zt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Be(this.updatePoint)}};function Ri(e,t){return t?{point:t(e.point)}:e}function jf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ai({point:e},t){return{point:e,delta:jf(e,Wf(t)),offset:jf(e,_g(t)),velocity:qg(t,.1)}}function _g(e){return e[0]}function Wf(e){return e[e.length-1]}function qg(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=Wf(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Ce(t)));)a--;if(!r)return{x:0,y:0};let s=Ie(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};let n={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Xf(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?Z(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?Z(a,e,r.max):Math.min(e,a)),e}function zf(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function Zf(e,{top:t,left:a,bottom:r,right:o}){return{x:zf(e.x,a,o),y:zf(e.y,t,r)}}function Gf(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function Yf(e,t){return{x:Gf(e.x,t.x),y:Gf(e.y,t.y)}}function Qf(e,t){let a=.5,r=Se(e),o=Se(t);return o>r?a=lt(t.min,t.max-r,e.min):r>o&&(a=lt(e.min,e.max-o,t.min)),we(0,1,a)}function Jf(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var Os=.35;function ec(e=Os){return e===!1?e=0:e===!0&&(e=Os),{x:$f(e,"left","right"),y:$f(e,"top","bottom")}}function $f(e,t,a){return{min:Kf(e,t),max:Kf(e,a)}}function Kf(e,t){return typeof e=="number"?e:e[t]||0}var jg=new WeakMap,Us=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=le(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:a=!1,distanceThreshold:r}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;let s=f=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(At(f).point)},n=(f,c)=>{let{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ii(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=c,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ne(S=>{let y=this.getAxisMotionValue(S).get()||0;if(De.test(y)){let{projection:I}=this.visualElement;if(I&&I.layout){let v=I.layout.layoutBox[S];v&&(y=Se(v)*(parseFloat(y)/100))}}this.originPoint[S]=y}),g&&G.postRender(()=>g(f,c)),io(this.visualElement,"transform");let{animationState:L}=this.visualElement;L&&L.setActive("whileDrag",!0)},i=(f,c)=>{this.latestPointerEvent=f,this.latestPanInfo=c;let{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:L}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:S}=c;if(m&&this.currentDirection===null){this.currentDirection=Wg(S),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",c.point,S),this.updateAxis("y",c.point,S),this.visualElement.render(),L&&L(f,c)},d=(f,c)=>{this.latestPointerEvent=f,this.latestPanInfo=c,this.stop(f,c),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>Ne(f=>{var c;return this.getAnimationState(f)==="paused"&&((c=this.getAxisMotionValue(f).animation)==null?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new er(t,{onSessionStart:s,onStart:n,onMove:i,onSessionEnd:d,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Bs(this.visualElement)})}stop(t,a){let r=t||this.latestPointerEvent,o=a||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;let{velocity:n}=o;this.startAnimation(n);let{onDragEnd:i}=this.getProps();i&&G.postRender(()=>i(r,o))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!Ns(t,o,this.currentDirection))return;let s=this.getAxisMotionValue(t),n=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(n=Xf(n,this.constraints[t],this.elastic[t])),s.set(n)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:a}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&bt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Zf(r.layoutBox,t):this.constraints=!1,this.elastic=ec(a),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ne(n=>{this.constraints!==!1&&this.getAxisMotionValue(n)&&(this.constraints[n]=Jf(r.layoutBox[n],this.constraints[n]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!bt(t))return!1;let r=t.current;Ae(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let s=mf(r,o.root,this.visualElement.getTransformPagePoint()),n=Yf(o.layout.layoutBox,s);if(a){let i=a(sf(n));this.hasMutatedConstraints=!!i,i&&(n=Ss(i))}return n}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:i}=this.getProps(),d=this.constraints||{},l=Ne(u=>{if(!Ns(u,a,this.currentDirection))return;let f=d&&d[u]||{};n&&(f={min:0,max:0});let c=o?200:1e6,p=o?40:1e7,m=h(h({type:"inertia",velocity:r?t[u]:0,bounceStiffness:c,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10},s),f);return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return io(this.visualElement,t),r.start(Qa(t,r,0,a,this.visualElement,!1))}stopAnimation(){Ne(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ne(t=>{var a;return(a=this.getAxisMotionValue(t).animation)==null?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)==null?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ne(a=>{let{drag:r}=this.getProps();if(!Ns(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,s=this.getAxisMotionValue(a);if(o&&o.layout){let{min:n,max:i}=o.layout.layoutBox[a];s.set(t[a]-Z(n,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!bt(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};Ne(n=>{let i=this.getAxisMotionValue(n);if(i&&this.constraints!==!1){let d=i.get();o[n]=Qf({min:d,max:d},this.constraints[n])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ne(n=>{if(!Ns(n,t,null))return;let i=this.getAxisMotionValue(n),{min:d,max:l}=this.constraints[n];i.set(Z(d,l,o[n]))})}addListeners(){if(!this.visualElement.current)return;jg.set(this.visualElement,this);let t=this.visualElement.current,a=zt(t,"pointerdown",d=>{let{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(d)}),r=()=>{let{dragConstraints:d}=this.getProps();bt(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),G.read(r);let n=Rt(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ne(u=>{let f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=d[u].translate,f.set(f.get()+d[u].translate))}),this.visualElement.render())}));return()=>{n(),a(),s(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:n=Os,dragMomentum:i=!0}=t;return P(h({},t),{drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:n,dragMomentum:i})}};function Ns(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function Wg(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Hs=class extends be{constructor(t){super(t),this.removeGroupControls=ie,this.removeListeners=ie,this.controls=new Us(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ie}unmount(){this.removeGroupControls(),this.removeListeners()}};var tc=e=>(t,a)=>{e&&G.postRender(()=>e(t,a))},_s=class extends be{constructor(){super(...arguments),this.removePointerDownListener=ie}onPointerDown(t){this.session=new er(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bs(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:tc(t),onStart:tc(a),onMove:r,onEnd:(s,n)=>{delete this.session,o&&G.postRender(()=>o(s,n))}}}mount(){this.removePointerDownListener=zt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var ac=require("react/jsx-runtime");var uo=require("react");var tr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var Ti=!1,Di=class extends uo.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(a.group&&a.group.add(s),r&&r.register&&o&&r.register(s),Ti&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions(P(h({},s.options),{onExitComplete:()=>this.safeToRemove()}))),tr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:s}=this.props,{projection:n}=r;return n&&(n.isPresent=s,Ti=!0,o||t.layoutDependency!==a||a===void 0||t.isPresent!==s?n.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?n.promote():n.relegate()||G.postRender(()=>{let i=n.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pa.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;Ti=!0,o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function qs(e){let[t,a]=ns(),r=(0,uo.useContext)(Aa);return(0,ac.jsx)(Di,P(h({},e),{layoutGroup:r,switchLayoutGroup:(0,uo.useContext)(ys),isPresent:t,safeToRemove:a}))}function rc(e,t,a){let r=re(e)?e:Ke(e);return r.start(Qa("",r,t,a)),r.animation}var oc=(e,t)=>e.depth-t.depth;var js=class{constructor(){this.children=[],this.isDirty=!1}add(t){ra(this.children,t),this.isDirty=!0}remove(t){oa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oc),this.isDirty=!1,this.children.forEach(t)}};function sc(e,t){let a=pe.now(),r=({timestamp:o})=>{let s=o-a;s>=t&&(Be(r),e(s-t))};return G.setup(r,!0),()=>Be(r)}var uc=["TopLeft","TopRight","BottomLeft","BottomRight"],zg=uc.length,nc=e=>typeof e=="string"?parseFloat(e):e,ic=e=>typeof e=="number"||B.test(e);function dc(e,t,a,r,o,s){var n,i,d,l;o?(e.opacity=Z(0,(n=a.opacity)!=null?n:1,Gg(r)),e.opacityExit=Z((i=t.opacity)!=null?i:1,0,$g(r))):s&&(e.opacity=Z((d=t.opacity)!=null?d:1,(l=a.opacity)!=null?l:1,r));for(let u=0;u<zg;u++){let f=`border${uc[u]}Radius`,c=lc(t,f),p=lc(a,f);if(c===void 0&&p===void 0)continue;c||(c=0),p||(p=0),c===0||p===0||ic(c)===ic(p)?(e[f]=Math.max(Z(nc(c),nc(p),r),0),(De.test(p)||De.test(c))&&(e[f]+="%")):e[f]=p}(t.rotate||a.rotate)&&(e.rotate=Z(t.rotate||0,a.rotate||0,r))}function lc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Gg=fc(0,.5,Dr),$g=fc(.5,.95,ie);function fc(e,t,a){return r=>r<e?0:r>t?1:a(lt(e,t,r))}function cc(e,t){e.min=t.min,e.max=t.max}function Ze(e,t){cc(e.x,t.x),cc(e.y,t.y)}function Mi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function pc(e,t,a,r,o){return e-=t,e=oo(e,1/a,r),o!==void 0&&(e=oo(e,1/o,r)),e}function Kg(e,t=0,a=1,r=.5,o,s=e,n=e){if(De.test(t)&&(t=parseFloat(t),t=Z(n.min,n.max,t/100)-n.min),typeof t!="number")return;let i=Z(s.min,s.max,r);e===s&&(i-=t),e.min=pc(e.min,t,a,i,o),e.max=pc(e.max,t,a,i,o)}function mc(e,t,[a,r,o],s,n){Kg(e,t[a],t[r],t[o],t.scale,s,n)}var Xg=["x","scaleX","originX"],Zg=["y","scaleY","originY"];function Ei(e,t,a,r){mc(e.x,t,Xg,a?a.x:void 0,r?r.x:void 0),mc(e.y,t,Zg,a?a.y:void 0,r?r.y:void 0)}function hc(e){return e.translate===0&&e.scale===1}function ki(e){return hc(e.x)&&hc(e.y)}function gc(e,t){return e.min===t.min&&e.max===t.max}function Lc(e,t){return gc(e.x,t.x)&&gc(e.y,t.y)}function xc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fi(e,t){return xc(e.x,t.x)&&xc(e.y,t.y)}function Vi(e){return Se(e.x)/Se(e.y)}function Bi(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Ws=class{constructor(){this.members=[]}add(t){ra(this.members,t),t.scheduleRender()}remove(t){if(oa(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function yc(e,t,a){let r="",o=e.x.translate/t.x,s=e.y.translate/t.y,n=(a==null?void 0:a.z)||0;if((o||s||n)&&(r=`translate3d(${o}px, ${s}px, ${n}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:l,rotate:u,rotateX:f,rotateY:c,skewX:p,skewY:m}=a;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),c&&(r+=`rotateY(${c}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}let i=e.x.scale*t.x,d=e.y.scale*t.y;return(i!==1||d!==1)&&(r+=`scale(${i}, ${d})`),r||"none"}var ya={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Oi=["","X","Y","Z"],Yg=1e3,Qg=0;function Ni(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ac(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=Ds(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",G,!(o||s))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ac(r)}function zs({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(n={},i=t==null?void 0:t()){this.id=Qg++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ve.value&&(ya.nodes=ya.calculatedTargetDeltas=ya.calculatedProjections=0),this.nodes.forEach(tx),this.nodes.forEach(sx),this.nodes.forEach(nx),this.nodes.forEach(ax),Ve.addProjectionMetrics&&Ve.addProjectionMetrics(ya)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new js)}addEventListener(n,i){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Lt),this.eventHandlers.get(n).add(i)}notifyListeners(n,...i){let d=this.eventHandlers.get(n);d&&d.notify(...i)}hasListeners(n){return this.eventHandlers.has(n)}mount(n){if(this.instance)return;this.isSVG=Yr(n)&&!ci(n),this.instance=n;let{layoutId:i,layout:d,visualElement:l}=this.options;if(l&&!l.current&&l.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||i)&&(this.isLayoutDirty=!0),e){let u,f=0,c=()=>this.root.updateBlockedByResize=!1;G.read(()=>{f=window.innerWidth}),e(n,()=>{let p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=sc(c,250),tr.hasAnimatedSinceResize&&(tr.hasAnimatedSinceResize=!1,this.nodes.forEach(Sc)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&l&&(i||d)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:c,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let m=this.options.transition||l.getDefaultTransition()||fx,{onLayoutAnimationStart:g,onLayoutAnimationComplete:L}=l.getProps(),S=!this.targetLayout||!Fi(this.targetLayout,p),y=!f&&c;if(this.options.layoutRoot||this.resumeFrom||y||f&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let I=P(h({},fa(m,"layout")),{onPlay:g,onComplete:L});(l.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,y)}else f||Sc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Be(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ix),this.animationId++)}getTransformTemplate(){let{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ac(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){let f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:i,layout:d}=this.options;if(i===void 0&&!d)return;let l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Cc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ic);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ox),this.nodes.forEach(Jg),this.nodes.forEach(ex)):this.nodes.forEach(Ic),this.clearAllSnapshots();let i=pe.now();ce.delta=we(0,1e3/60,i-ce.timestamp),ce.timestamp=i,ce.isProcessing=!0,Vr.update.process(ce),Vr.preRender.process(ce),Vr.render.process(ce),ce.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pa.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rx),this.sharedNodes.forEach(lx)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,G.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){G.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Se(this.snapshot.measuredBox.x)&&!Se(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();let n=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=le(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0)}updateScroll(n="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(i=!1),i&&this.instance){let d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:d,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!o)return;let n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!ki(this.projectionDelta),d=this.getTransformTemplate(),l=d?d(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;n&&this.instance&&(i||Pt(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(n=!0){let i=this.measurePageBox(),d=this.removeElementScroll(i);return n&&(d=this.removeTransform(d)),cx(d),{animationId:this.root.animationId,measuredBox:i,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;let{visualElement:n}=this.options;if(!n)return le();let i=n.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(px))){let{scroll:u}=this.root;u&&(Wt(i.x,u.offset.x),Wt(i.y,u.offset.y))}return i}removeElementScroll(n){var d;let i=le();if(Ze(i,n),(d=this.scroll)!=null&&d.wasRoot)return i;for(let l=0;l<this.path.length;l++){let u=this.path[l],{scroll:f,options:c}=u;u!==this.root&&f&&c.layoutScroll&&(f.wasRoot&&Ze(i,n),Wt(i.x,f.offset.x),Wt(i.y,f.offset.y))}return i}applyTransform(n,i=!1){let d=le();Ze(d,n);for(let l=0;l<this.path.length;l++){let u=this.path[l];!i&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ga(d,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Pt(u.latestValues)&&ga(d,u.latestValues)}return Pt(this.latestValues)&&ga(d,this.latestValues),d}removeTransform(n){let i=le();Ze(i,n);for(let d=0;d<this.path.length;d++){let l=this.path[d];if(!l.instance||!Pt(l.latestValues))continue;vs(l.latestValues)&&l.updateSnapshot();let u=le(),f=l.measurePageBox();Ze(u,f),Ei(i,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Pt(this.latestValues)&&Ei(i,this.latestValues),i}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(n){this.options=P(h(h({},this.options),n),{crossfade:n.crossfade!==void 0?n.crossfade:!0})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ce.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(n=!1){var p;let i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);let d=!!this.resumingFrom||this!==i;if(!(n||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ce.timestamp;let c=this.getClosestProjectingParent();c&&this.linkedParentVersion!==c.layoutVersion&&!c.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(c&&c.layout?this.createRelativeTarget(c,this.layout.layoutBox,c.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=le(),this.targetWithTransforms=le()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ze(this.target,this.layout.layoutBox),vi(this.target,this.targetDelta)):Ze(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,c&&!!c.resumingFrom==!!this.resumingFrom&&!c.options.layoutScroll&&c.target&&this.animationProgress!==1?this.createRelativeTarget(c,this.target,c.target):this.relativeParent=this.relativeTarget=void 0),Ve.value&&ya.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||vs(this.parent.latestValues)||Ii(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(n,i,d){this.relativeParent=n,this.linkedParentVersion=n.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=le(),this.relativeTargetOrigin=le(),lo(this.relativeTargetOrigin,i,d),Ze(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;let n=this.getLead(),i=!!this.resumingFrom||this!==n,d=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(d=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===ce.timestamp&&(d=!1),d)return;let{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ze(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,c=this.treeScale.y;pf(this.layoutCorrected,this.treeScale,this.path,i),n.layout&&!n.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(n.target=n.layout.layoutBox,n.targetWithTransforms=le());let{target:p}=n;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Mi(this.prevProjectionDelta.x,this.projectionDelta.x),Mi(this.prevProjectionDelta.y,this.projectionDelta.y)),Ja(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==c||!Bi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Ve.value&&ya.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(n=!0){var i;if((i=this.options.visualElement)==null||i.scheduleRender(),n){let d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xa(),this.projectionDelta=xa(),this.projectionDeltaWithTransform=xa()}setAnimationOrigin(n,i=!1){let d=this.snapshot,l=d?d.latestValues:{},u=h({},this.latestValues),f=xa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let c=le(),p=d?d.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,L=this.getStack(),S=!L||L.members.length<=1,y=!!(g&&!S&&this.options.crossfade===!0&&!this.path.some(dx));this.animationProgress=0;let I;this.mixTargetDelta=v=>{let b=v/1e3;vc(f.x,n.x,b),vc(f.y,n.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(lo(c,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ux(this.relativeTarget,this.relativeTargetOrigin,c,b),I&&Lc(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=le()),Ze(I,this.relativeTarget)),g&&(this.animationValues=u,dc(u,l,this.latestValues,b,y,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(n){var i,d,l;this.notifyListeners("animationStart"),(i=this.currentAnimation)==null||i.stop(),(l=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||l.stop(),this.pendingAnimation&&(Be(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=G.update(()=>{tr.hasAnimatedSinceResize=!0,tt.layout++,this.motionValue||(this.motionValue=Ke(0)),this.currentAnimation=rc(this.motionValue,[0,1e3],P(h({},n),{velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),n.onUpdate&&n.onUpdate(u)},onStop:()=>{tt.layout--},onComplete:()=>{tt.layout--,n.onComplete&&n.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Yg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let n=this.getLead(),{targetWithTransforms:i,target:d,layout:l,latestValues:u}=n;if(!(!i||!d||!l)){if(this!==n&&this.layout&&l&&Tc(this.options.animationType,this.layout.layoutBox,l.layoutBox)){d=this.target||le();let f=Se(this.layout.layoutBox.x);d.x.min=n.target.x.min,d.x.max=d.x.min+f;let c=Se(this.layout.layoutBox.y);d.y.min=n.target.y.min,d.y.max=d.y.min+c}Ze(i,d),ga(i,u),Ja(this.projectionDeltaWithTransform,this.layoutCorrected,i,u)}}registerSharedNode(n,i){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Ws),this.sharedNodes.get(n).add(i);let l=i.options.initialPromotionConfig;i.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(i):void 0})}isLead(){let n=this.getStack();return n?n.lead===this:!0}getLead(){var i;let{layoutId:n}=this.options;return n?((i=this.getStack())==null?void 0:i.lead)||this:this}getPrevLead(){var i;let{layoutId:n}=this.options;return n?(i=this.getStack())==null?void 0:i.prevLead:void 0}getStack(){let{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:i,preserveFollowOpacity:d}={}){let l=this.getStack();l&&l.promote(this,d),n&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let n=this.getStack();return n?n.relegate(this):!1}resetSkewAndRotation(){let{visualElement:n}=this.options;if(!n)return;let i=!1,{latestValues:d}=n;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(i=!0),!i)return;let l={};d.z&&Ni("z",n,l,this.animationValues);for(let u=0;u<Oi.length;u++)Ni(`rotate${Oi[u]}`,n,l,this.animationValues),Ni(`skew${Oi[u]}`,n,l,this.animationValues);n.render();for(let u in l)n.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);n.scheduleRender()}applyProjectionStyles(n,i){var m,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){n.visibility="hidden";return}let d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,n.visibility="",n.opacity="",n.pointerEvents=$a(i==null?void 0:i.pointerEvents)||"",n.transform=d?d(this.latestValues,""):"none";return}let l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(n.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,n.pointerEvents=$a(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Pt(this.latestValues)&&(n.transform=d?d({},""):"none",this.hasProjected=!1);return}n.visibility="";let u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=yc(this.projectionDeltaWithTransform,this.treeScale,u);d&&(f=d(u,f)),n.transform=f;let{x:c,y:p}=this.projectionDelta;n.transformOrigin=`${c.origin*100}% ${p.origin*100}% 0`,l.animationValues?n.opacity=l===this?(g=(m=u.opacity)!=null?m:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:n.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(let L in ro){if(u[L]===void 0)continue;let{correct:S,applyTo:y,isCSSVariable:I}=ro[L],v=f==="none"?u[L]:S(u[L],l);if(y){let b=y.length;for(let D=0;D<b;D++)n[y[D]]=v}else I?this.options.visualElement.renderState.vars[L]=v:n[L]=v}this.options.layoutId&&(n.pointerEvents=l===this?$a(i==null?void 0:i.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(n=>{var i;return(i=n.currentAnimation)==null?void 0:i.stop()}),this.root.nodes.forEach(Cc),this.root.sharedNodes.clear()}}}function Jg(e){e.updateLayout()}function ex(e){var a;let t=((a=e.resumeFrom)==null?void 0:a.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,n=t.source!==e.layout.source;s==="size"?Ne(f=>{let c=n?t.measuredBox[f]:t.layoutBox[f],p=Se(c);c.min=r[f].min,c.max=c.min+p}):Tc(s,t.layoutBox,r)&&Ne(f=>{let c=n?t.measuredBox[f]:t.layoutBox[f],p=Se(r[f]);c.max=c.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});let i=xa();Ja(i,r,t.layoutBox);let d=xa();n?Ja(d,e.applyTransform(o,!0),t.measuredBox):Ja(d,r,t.layoutBox);let l=!ki(i),u=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:c,layout:p}=f;if(c&&p){let m=le();lo(m,t.layoutBox,c.layoutBox);let g=le();lo(g,r,p.layoutBox),Fi(m,g)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:d,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function tx(e){Ve.value&&ya.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ax(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rx(e){e.clearSnapshot()}function Cc(e){e.clearMeasurements()}function Ic(e){e.isLayoutDirty=!1}function ox(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function sx(e){e.resolveTargetDelta()}function nx(e){e.calcProjection()}function ix(e){e.resetSkewAndRotation()}function lx(e){e.removeLeadSnapshot()}function vc(e,t,a){e.translate=Z(t.translate,0,a),e.scale=Z(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function wc(e,t,a,r){e.min=Z(t.min,a.min,r),e.max=Z(t.max,a.max,r)}function ux(e,t,a,r){wc(e.x,t.x,a.x,r),wc(e.y,t.y,a.y,r)}function dx(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var fx={duration:.45,ease:[.4,0,.1,1]},bc=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Pc=bc("applewebkit/")&&!bc("chrome/")?Math.round:ie;function Rc(e){e.min=Pc(e.min),e.max=Pc(e.max)}function cx(e){Rc(e.x),Rc(e.y)}function Tc(e,t,a){return e==="position"||e==="preserve-aspect"&&!Uf(Vi(t),Vi(a),.2)}function px(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var Dc=zs({attachResizeListener:(e,t)=>Rt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var Ui={current:void 0},Gs=zs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ui.current){let e=new Dc({});e.mount(window),e.setOptions({layoutScroll:!0}),Ui.current=e}return Ui.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var Mc={pan:{Feature:_s},drag:{Feature:Hs,ProjectionNode:Gs,MeasureLayout:qs}};function Ec(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,s=r[o];s&&G.postRender(()=>s(t,At(t)))}var $s=class extends be{mount(){let{current:t}=this.node;t&&(this.unmount=li(t,(a,r)=>(Ec(this.node,r,"Start"),o=>Ec(this.node,o,"End"))))}unmount(){}};var Ks=class extends be{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(a){t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=et(Rt(this.node.current,"focus",()=>this.onFocus()),Rt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function kc(e,t,a){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),s=r[o];s&&G.postRender(()=>s(t,At(t)))}var Xs=class extends be{mount(){let{current:t}=this.node;t&&(this.unmount=fi(t,(a,r)=>(kc(this.node,r,"Start"),(o,{success:s})=>kc(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var _i=new WeakMap,Hi=new WeakMap,mx=e=>{let t=_i.get(e.target);t&&t(e)},hx=e=>{e.forEach(mx)};function gx(a){var r=a,{root:e}=r,t=$(r,["root"]);let o=e||document;Hi.has(o)||Hi.set(o,{});let s=Hi.get(o),n=JSON.stringify(t);return s[n]||(s[n]=new IntersectionObserver(hx,h({root:e},t))),s[n]}function Fc(e,t,a){let r=gx(t);return _i.set(e,a),r.observe(e),()=>{_i.delete(e),r.unobserve(e)}}var xx={some:0,all:1},Zs=class extends be{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:s}=t,n={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:xx[o]},i=d=>{let{isIntersecting:l}=d;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),c=l?u:f;c&&c(d)};return Fc(this.node.current,n,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(Lx(t,a))&&this.startObserver()}unmount(){}};function Lx({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Vc={inView:{Feature:Zs},tap:{Feature:Xs},focus:{Feature:Ks},hover:{Feature:$s}};var Bc={layout:{ProjectionNode:Gs,MeasureLayout:qs}};var Oc=h(h(h(h({},Ef),Vc),Mc),Bc);var ar=of(Oc,vf);var Ca=require("react/jsx-runtime"),yx=({onClose:e,title:t,headerClassName:a,headerAction:r})=>(0,Ca.jsxs)("div",{className:Et("p-6 py-4 flex items-center justify-between border-b border-stroke-disabled",a),children:[(0,Ca.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ca.jsx)("p",{className:"font-semibold leading-6 text-text-primary tracking-[-0.24px]",children:t}),r]}),(0,Ca.jsx)("button",{onClick:e,children:(0,Ca.jsx)(Ol,{})})]}),Nc=yx;var Uc=require("react"),Hc=require("react-dom");var Ys=require("react/jsx-runtime"),Cx=({isOpen:e,children:t,className:a,id:r})=>{let o=(0,Uc.useMemo)(()=>document.getElementById(r!=null?r:"root"),[r]);return(0,Hc.createPortal)((0,Ys.jsx)(xi,{mode:"wait",children:e&&(0,Ys.jsx)(ar.div,{className:`fixed inset-0 z-50 flex items-center justify-center ${a!=null?a:""}`,onTouchStart:s=>s.stopPropagation(),onScroll:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation(),children:(0,Ys.jsx)("div",{className:"size-full overflow-hidden sm:w-limitWidth",children:t})})}),o!=null?o:document.body)},_c=Cx;var Gt=require("react/jsx-runtime"),qc={transition:{duration:.3}},Ix=e=>{let{isOpen:t,onClose:a,children:r,className:o,title:s,footer:n,modalClassName:i,headerClassName:d,headerAction:l}=e;return(0,Gt.jsx)(_c,{isOpen:t,children:(0,Gt.jsx)(ar.div,P(h({initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},qc),{className:"flex size-full items-center justify-center bg-overlay pt-safe-area-inset-top",onClick:u=>{a(),u.stopPropagation()},children:(0,Gt.jsxs)(ar.div,P(h({},qc),{onClick:u=>u.stopPropagation(),className:Et("relative h-fit max-h-[80%] max-w-[80%] bg-white rounded-2xl flex flex-col overflow-hidden",i),children:[s&&(0,Gt.jsx)(Nc,{onClose:a,title:s,headerClassName:d,headerAction:l}),(0,Gt.jsx)("div",{className:Et("overflow-y-auto p-6 flex-1",o),children:r}),n&&(0,Gt.jsx)("div",{className:"sticky bottom-0",children:n})]}))}))})},Qs=Ix;var jc=require("@fctc/widget-logic/hooks"),Sx=require("@fctc/widget-logic/provider"),fo=require("react"),wx=require("react/jsx-runtime"),Wc={user:{},company:{},userProfile:{}},vx=(0,fo.createContext)(Wc);var Js=()=>{let e=(0,fo.useContext)(vx);return e||Wc};var je=require("react/jsx-runtime"),bx=e=>{var c;let{formValues:t,pos_slug_key:a,value:r}=e,{t:o}=Je(),{user:s}=Js(),[n,i]=(0,Gc.useState)(!1),d=(c=s==null?void 0:s.userProfile)==null?void 0:c.data,l=`${r}/${d==null?void 0:d.short_name}/${t==null?void 0:t[a]}`,{handleCopyToClipboard:u,isCopied:f}=(0,zc.copyLinkButtonController)({value:l,defaultValue:l});return(0,je.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,je.jsxs)("div",{className:"border border-stroke-disabled rounded-lg flex max-w-[400px]",children:[(0,je.jsx)("span",{className:"p-[10px] border-r border-stroke-disabled text-sm font-medium text-tertiary truncate line-clamp-1 ",children:l}),(0,je.jsx)("button",{className:"cursor-pointer p-[12px]",type:"button",onClick:()=>u(l),children:f?(0,je.jsx)(Hl,{}):(0,je.jsx)(Nl,{})})]}),(0,je.jsx)("button",{type:"button",onClick:()=>i(!n),className:"p-[10px] border border-stroke-disabled rounded-xl",children:(0,je.jsx)(Ul,{})}),(0,je.jsx)(Qs,{isOpen:n,onClose:()=>i(!n),title:o("qr_e_menu"),className:"",children:l&&(0,je.jsx)("div",{className:"flex flex-col items-center gap-6",children:(0,je.jsx)(Mn,{value:l,size:220,bgColor:"#ffffff",fgColor:"#000000",level:"L"})})})]})},$c=bx;var qi=require("react/jsx-runtime"),rr=()=>(0,qi.jsx)("svg",{viewBox:"0 0 305 1",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-px",preserveAspectRatio:"none",children:(0,qi.jsx)("line",{y1:"0.5",x2:"305",y2:"0.5",stroke:"#424242",strokeOpacity:"0.16",strokeDasharray:"4 4"})});var en=require("react/jsx-runtime"),Px=({id:e,onClick:t,iconSrc:a,children:r,className:o,text:s,disabled:n,type:i="button",textClassName:d,style:l})=>(0,en.jsxs)("button",{id:e,type:i,onClick:t,disabled:n,className:Et("button",o),style:l,children:[a,s&&(0,en.jsx)("p",{className:Et("line-clamp-1 font-semibold",d),children:s}),r]}),$t=Px;var Ia=require("react/jsx-runtime"),Rx=e=>{var a,r;if(!((a=e==null?void 0:e.stages)!=null&&a.length)||((r=e==null?void 0:e.stages)==null?void 0:r.length)===0)return null;let t=o=>`https://sme-api-dev.atomsolution.vn/wesap/${o}`;return(0,Ia.jsx)("div",{className:"grid grid-cols-2 gap-2",children:e.stages.map((o,s)=>(0,Ia.jsxs)("div",{style:{backgroundColor:o.color+"33"},className:"flex flex-col gap-1 p-2 rounded-lg",children:[(0,Ia.jsx)("div",{className:"flex items-center justify-between",children:(0,Ia.jsx)("img",{src:t(o.icon_url),className:"w-6 aspect-square "})}),(0,Ia.jsx)("p",{style:{color:o.color},className:"text-sm font-medium leading-5 tracking-[-0.2px]",children:o.display_name})]},s))})},Kc=Rx;var gp=require("react");var _=gt(require("react")),Yx=gt(require("react-dom"));var H=gt(require("react"));function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Wi.apply(this,arguments)}var or;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(or||(or={}));function J(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function ot(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(a){}}}function sr(e){let{pathname:t="/",search:a="",hash:r=""}=e;return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function nr(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Xc;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Xc||(Xc={}));function Yc(e,t){let{route:a,pathname:r,params:o}=e;return{id:a.id,pathname:r,params:o,data:t[a.id],handle:a.handle}}function tn(e,t){t===void 0&&(t={});let a=e;a.endsWith("*")&&a!=="*"&&!a.endsWith("/*")&&(ot(!1,'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".')),a=a.replace(/\*$/,"/*"));let r=a.startsWith("/")?"/":"",o=n=>n==null?"":typeof n=="string"?n:String(n),s=a.split(/\/+/).map((n,i,d)=>{if(i===d.length-1&&n==="*")return o(t["*"]);let u=n.match(/^:([\w-]+)(\??)$/);if(u){let[,f,c]=u,p=t[f];return J(c==="?"||p!=null,'Missing ":'+f+'" param'),o(p)}return n.replace(/\?$/g,"")}).filter(n=>!!n);return r+s.join("/")}function ir(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=Ax(e.path,e.caseSensitive,e.end),o=t.match(a);if(!o)return null;let s=o[0],n=s.replace(/(.)\/+$/,"$1"),i=o.slice(1);return{params:r.reduce((l,u,f)=>{let{paramName:c,isOptional:p}=u;if(c==="*"){let g=i[f]||"";n=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}let m=i[f];return p&&!m?l[c]=void 0:l[c]=(m||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:n,pattern:e}}function Ax(e,t,a){t===void 0&&(t=!1),a===void 0&&(a=!0),ot(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(n,i,d)=>(r.push({paramName:i,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function pt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}var Tx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dx=e=>Tx.test(e);function zi(e,t){t===void 0&&(t="/");let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?nr(e):e,s;if(a)if(Dx(a))s=a;else{if(a.includes("//")){let n=a;a=a.replace(/\/\/+/g,"/"),ot(!1,"Pathnames cannot have embedded double slashes - normalizing "+(n+" -> "+a))}a.startsWith("/")?s=Zc(a.substring(1),"/"):s=Zc(a,t)}else s=t;return{pathname:s,search:Ex(r),hash:kx(o)}}function Zc(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function ji(e,t,a,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Mx(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Gi(e,t){let a=Mx(e);return t?a.map((r,o)=>o===a.length-1?r.pathname:r.pathnameBase):a.map(r=>r.pathnameBase)}function $i(e,t,a,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=nr(e):(o=Wi({},e),J(!o.pathname||!o.pathname.includes("?"),ji("?","pathname","search",o)),J(!o.pathname||!o.pathname.includes("#"),ji("#","pathname","hash",o)),J(!o.search||!o.search.includes("#"),ji("#","search","hash",o)));let s=e===""||o.pathname==="",n=s?"/":o.pathname,i;if(n==null)i=a;else{let f=t.length-1;if(!r&&n.startsWith("..")){let c=n.split("/");for(;c[0]==="..";)c.shift(),f-=1;o.pathname=c.join("/")}i=f>=0?t[f]:"/"}let d=zi(o,i),l=n&&n!=="/"&&n.endsWith("/"),u=(s||n===".")&&a.endsWith("/");return!d.pathname.endsWith("/")&&(l||u)&&(d.pathname+="/"),d}var co=e=>e.join("/").replace(/\/\/+/g,"/");var Ex=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Qc=["post","put","patch","delete"],hk=new Set(Qc),Fx=["get",...Qc],gk=new Set(Fx);function an(){return an=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},an.apply(this,arguments)}var ur=H.createContext(null);process.env.NODE_ENV!=="production"&&(ur.displayName="DataRouter");var dr=H.createContext(null);process.env.NODE_ENV!=="production"&&(dr.displayName="DataRouterState");var _x=H.createContext(null);process.env.NODE_ENV!=="production"&&(_x.displayName="Await");var We=H.createContext(null);process.env.NODE_ENV!=="production"&&(We.displayName="Navigation");var po=H.createContext(null);process.env.NODE_ENV!=="production"&&(po.displayName="Location");var Kt=H.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(Kt.displayName="Route");var qx=H.createContext(null);process.env.NODE_ENV!=="production"&&(qx.displayName="RouteError");function Ki(e,t){let{relative:a}=t===void 0?{}:t;mo()||(process.env.NODE_ENV!=="production"?J(!1,"useHref() may be used only in the context of a <Router> component."):J(!1));let{basename:r,navigator:o}=H.useContext(We),{hash:s,pathname:n,search:i}=Sa(e,{relative:a}),d=n;return r!=="/"&&(d=n==="/"?r:co([r,n])),o.createHref({pathname:d,search:i,hash:s})}function mo(){return H.useContext(po)!=null}function Xt(){return mo()||(process.env.NODE_ENV!=="production"?J(!1,"useLocation() may be used only in the context of a <Router> component."):J(!1)),H.useContext(po).location}var rp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function op(e){H.useContext(We).static||H.useLayoutEffect(e)}function Tt(){let{isDataRoute:e}=H.useContext(Kt);return e?Gx():jx()}function jx(){mo()||(process.env.NODE_ENV!=="production"?J(!1,"useNavigate() may be used only in the context of a <Router> component."):J(!1));let e=H.useContext(ur),{basename:t,future:a,navigator:r}=H.useContext(We),{matches:o}=H.useContext(Kt),{pathname:s}=Xt(),n=JSON.stringify(Gi(o,a.v7_relativeSplatPath)),i=H.useRef(!1);return op(()=>{i.current=!0}),H.useCallback(function(l,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&ot(i.current,rp),!i.current)return;if(typeof l=="number"){r.go(l);return}let f=$i(l,JSON.parse(n),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:co([t,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[t,r,n,s,e])}function Sa(e,t){let{relative:a}=t===void 0?{}:t,{future:r}=H.useContext(We),{matches:o}=H.useContext(Kt),{pathname:s}=Xt(),n=JSON.stringify(Gi(o,r.v7_relativeSplatPath));return H.useMemo(()=>$i(e,JSON.parse(n),s,a==="path"),[e,n,s,a])}var sp=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(sp||{}),ho=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(ho||{});function Xi(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function Wx(e){let t=H.useContext(ur);return t||(process.env.NODE_ENV!=="production"?J(!1,Xi(e)):J(!1)),t}function np(e){let t=H.useContext(dr);return t||(process.env.NODE_ENV!=="production"?J(!1,Xi(e)):J(!1)),t}function zx(e){let t=H.useContext(Kt);return t||(process.env.NODE_ENV!=="production"?J(!1,Xi(e)):J(!1)),t}function ip(e){let t=zx(e),a=t.matches[t.matches.length-1];return a.route.id||(process.env.NODE_ENV!=="production"?J(!1,e+' can only be used on routes that contain a unique "id"'):J(!1)),a.route.id}function Zi(){return ip(ho.UseRouteId)}function Yi(){return np(ho.UseNavigation).navigation}function Qi(){let{matches:e,loaderData:t}=np(ho.UseMatches);return H.useMemo(()=>e.map(a=>Yc(a,t)),[e,t])}function Gx(){let{router:e}=Wx(sp.UseNavigateStable),t=ip(ho.UseNavigateStable),a=H.useRef(!1);return op(()=>{a.current=!0}),H.useCallback(function(o,s){s===void 0&&(s={}),process.env.NODE_ENV!=="production"&&ot(a.current,rp),a.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,an({fromRouteId:t},s)))},[e,t])}var Jc={};function $x(e,t){process.env.NODE_ENV!=="production"&&!Jc[t]&&(Jc[t]=!0,console.warn(t))}var lr=(e,t,a)=>$x(e,"\u26A0\uFE0F React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+a+"."));function lp(e,t){(e==null?void 0:e.v7_startTransition)===void 0&&lr("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&lr("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist===void 0&&lr("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod===void 0&&lr("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration===void 0&&lr("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation===void 0&&lr("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}var Kx="startTransition",vk=H[Kx];function Ji(e){let{basename:t="/",children:a=null,location:r,navigationType:o=or.Pop,navigator:s,static:n=!1,future:i}=e;mo()&&(process.env.NODE_ENV!=="production"?J(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."):J(!1));let d=t.replace(/^\/*/,"/"),l=H.useMemo(()=>({basename:d,navigator:s,static:n,future:an({v7_relativeSplatPath:!1},i)}),[d,i,s,n]);typeof r=="string"&&(r=nr(r));let{pathname:u="/",search:f="",hash:c="",state:p=null,key:m="default"}=r,g=H.useMemo(()=>{let L=pt(u,d);return L==null?null:{location:{pathname:L,search:f,hash:c,state:p,key:m},navigationType:o}},[d,u,f,c,p,m,o]);return process.env.NODE_ENV!=="production"&&ot(g!=null,'<Router basename="'+d+'"> is not able to match the URL '+('"'+u+f+c+'" because it does not start with the ')+"basename, so the <Router> won't render anything."),g==null?null:H.createElement(We.Provider,{value:l},H.createElement(po.Provider,{children:a,value:g}))}var wk=new Promise(()=>{});function va(){return va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},va.apply(this,arguments)}function al(e,t){if(e==null)return{};var a={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(a[o]=e[o]);return a}var sn="get",nn="application/x-www-form-urlencoded";function ln(e){return e!=null&&typeof e.tagName=="string"}function Qx(e){return ln(e)&&e.tagName.toLowerCase()==="button"}function Jx(e){return ln(e)&&e.tagName.toLowerCase()==="form"}function eL(e){return ln(e)&&e.tagName.toLowerCase()==="input"}function tL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aL(e,t){return e.button===0&&(!t||t==="_self")&&!tL(e)}function fp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let r=e[a];return t.concat(Array.isArray(r)?r.map(o=>[a,o]):[[a,r]])},[]))}var rn=null;function rL(){if(rn===null)try{new FormData(document.createElement("form"),0),rn=!1}catch(e){rn=!0}return rn}var oL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function el(e){return e!=null&&!oL.has(e)?(process.env.NODE_ENV!=="production"&&ot(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+nn+'"')),null):e}function sL(e,t){let a,r,o,s,n;if(Jx(e)){let i=e.getAttribute("action");r=i?pt(i,t):null,a=e.getAttribute("method")||sn,o=el(e.getAttribute("enctype"))||nn,s=new FormData(e)}else if(Qx(e)||eL(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||i.getAttribute("action");if(r=d?pt(d,t):null,a=e.getAttribute("formmethod")||i.getAttribute("method")||sn,o=el(e.getAttribute("formenctype"))||el(i.getAttribute("enctype"))||nn,s=new FormData(i,e),!rL()){let{name:l,type:u,value:f}=e;if(u==="image"){let c=l?l+".":"";s.append(c+"x","0"),s.append(c+"y","0")}else l&&s.append(l,f)}}else{if(ln(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=sn,r=null,o=nn,n=e}return s&&o==="text/plain"&&(n=s,s=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:s,body:n}}var nL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],iL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],lL=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],uL="6";try{window.__reactRouterVersion=uL}catch(e){}var cp=_.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(cp.displayName="ViewTransition");var dL=_.createContext(new Map);process.env.NODE_ENV!=="production"&&(dL.displayName="Fetchers");var fL="startTransition",up=_[fL],cL="flushSync",aF=Yx[cL],pL="useId",rF=_[pL];function mL(e){let{basename:t,children:a,future:r,history:o}=e,[s,n]=_.useState({action:o.action,location:o.location}),{v7_startTransition:i}=r||{},d=_.useCallback(l=>{i&&up?up(()=>n(l)):n(l)},[n,i]);return _.useLayoutEffect(()=>o.listen(d),[o,d]),_.useEffect(()=>lp(r),[r]),_.createElement(Ji,{basename:t,children:a,location:s.location,navigationType:s.action,navigator:o,future:r})}process.env.NODE_ENV!=="production"&&(mL.displayName="unstable_HistoryRouter");var hL=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",gL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pp=_.forwardRef(function(t,a){let{onClick:r,relative:o,reloadDocument:s,replace:n,state:i,target:d,to:l,preventScrollReset:u,viewTransition:f}=t,c=al(t,nL),{basename:p}=_.useContext(We),m,g=!1;if(typeof l=="string"&&gL.test(l)&&(m=l,hL))try{let I=new URL(window.location.href),v=l.startsWith("//")?new URL(I.protocol+l):new URL(l),b=pt(v.pathname,p);v.origin===I.origin&&b!=null?l=b+v.search+v.hash:g=!0}catch(I){process.env.NODE_ENV!=="production"&&ot(!1,'<Link to="'+l+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let L=Ki(l,{relative:o}),S=IL(l,{replace:n,state:i,target:d,preventScrollReset:u,relative:o,viewTransition:f});function y(I){r&&r(I),I.defaultPrevented||S(I)}return _.createElement("a",va({},c,{href:m||L,onClick:g||s?r:y,ref:a,target:d}))});process.env.NODE_ENV!=="production"&&(pp.displayName="Link");var xL=_.forwardRef(function(t,a){let{"aria-current":r="page",caseSensitive:o=!1,className:s="",end:n=!1,style:i,to:d,viewTransition:l,children:u}=t,f=al(t,iL),c=Sa(d,{relative:f.relative}),p=Xt(),m=_.useContext(dr),{navigator:g,basename:L}=_.useContext(We),S=m!=null&&TL(c)&&l===!0,y=g.encodeLocation?g.encodeLocation(c).pathname:c.pathname,I=p.pathname,v=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(I=I.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&L&&(v=pt(v,L)||v);let b=y!=="/"&&y.endsWith("/")?y.length-1:y.length,D=I===y||!n&&I.startsWith(y)&&I.charAt(b)==="/",M=v!=null&&(v===y||!n&&v.startsWith(y)&&v.charAt(y.length)==="/"),R={isActive:D,isPending:M,isTransitioning:S},k=D?r:void 0,V;typeof s=="function"?V=s(R):V=[s,D?"active":null,M?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof i=="function"?i(R):i;return _.createElement(pp,va({},f,{"aria-current":k,className:V,ref:a,style:U,to:d,viewTransition:l}),typeof u=="function"?u(R):u)});process.env.NODE_ENV!=="production"&&(xL.displayName="NavLink");var LL=_.forwardRef((e,t)=>{let{fetcherKey:a,navigate:r,reloadDocument:o,replace:s,state:n,method:i=sn,action:d,onSubmit:l,relative:u,preventScrollReset:f,viewTransition:c}=e,p=al(e,lL),m=bL(),g=PL(d,{relative:u}),L=i.toLowerCase()==="get"?"get":"post";return _.createElement("form",va({ref:t,method:L,action:g,onSubmit:o?l:y=>{if(l&&l(y),y.defaultPrevented)return;y.preventDefault();let I=y.nativeEvent.submitter,v=(I==null?void 0:I.getAttribute("formmethod"))||i;m(I||y.currentTarget,{fetcherKey:a,method:v,navigate:r,replace:s,state:n,relative:u,preventScrollReset:f,viewTransition:c})}},p))});process.env.NODE_ENV!=="production"&&(LL.displayName="Form");function yL(e){let{getKey:t,storageKey:a}=e;return RL({getKey:t,storageKey:a}),null}process.env.NODE_ENV!=="production"&&(yL.displayName="ScrollRestoration");var go;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(go||(go={}));var tl;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(tl||(tl={}));function mp(e){return e+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function rl(e){let t=_.useContext(ur);return t||(process.env.NODE_ENV!=="production"?J(!1,mp(e)):J(!1)),t}function CL(e){let t=_.useContext(dr);return t||(process.env.NODE_ENV!=="production"?J(!1,mp(e)):J(!1)),t}function IL(e,t){let{target:a,replace:r,state:o,preventScrollReset:s,relative:n,viewTransition:i}=t===void 0?{}:t,d=Tt(),l=Xt(),u=Sa(e,{relative:n});return _.useCallback(f=>{if(aL(f,a)){f.preventDefault();let c=r!==void 0?r:sr(l)===sr(u);d(e,{replace:c,state:o,preventScrollReset:s,relative:n,viewTransition:i})}},[l,d,u,r,o,a,e,s,n,i])}function SL(){if(typeof document=="undefined")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}var vL=0,wL=()=>"__"+String(++vL)+"__";function bL(){let{router:e}=rl(go.UseSubmit),{basename:t}=_.useContext(We),a=Zi();return _.useCallback(function(r,o){o===void 0&&(o={}),SL();let{action:s,method:n,encType:i,formData:d,body:l}=sL(r,t);if(o.navigate===!1){let u=o.fetcherKey||wL();e.fetch(u,a,o.action||s,{preventScrollReset:o.preventScrollReset,formData:d,body:l,formMethod:o.method||n,formEncType:o.encType||i,flushSync:o.flushSync})}else e.navigate(o.action||s,{preventScrollReset:o.preventScrollReset,formData:d,body:l,formMethod:o.method||n,formEncType:o.encType||i,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,a])}function PL(e,t){let{relative:a}=t===void 0?{}:t,{basename:r}=_.useContext(We),o=_.useContext(Kt);o||(process.env.NODE_ENV!=="production"?J(!1,"useFormAction must be used inside a RouteContext"):J(!1));let[s]=o.matches.slice(-1),n=va({},Sa(e||".",{relative:a})),i=Xt();if(e==null){n.search=i.search;let d=new URLSearchParams(n.search),l=d.getAll("index");if(l.some(f=>f==="")){d.delete("index"),l.filter(c=>c).forEach(c=>d.append("index",c));let f=d.toString();n.search=f?"?"+f:""}}return(!e||e===".")&&s.route.index&&(n.search=n.search?n.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(n.pathname=n.pathname==="/"?r:co([r,n.pathname])),sr(n)}var dp="react-router-scroll-positions",on={};function RL(e){let{getKey:t,storageKey:a}=e===void 0?{}:e,{router:r}=rl(go.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:s}=CL(tl.UseScrollRestoration),{basename:n}=_.useContext(We),i=Xt(),d=Qi(),l=Yi();_.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),AL(_.useCallback(()=>{if(l.state==="idle"){let u=(t?t(i,d):null)||i.key;on[u]=window.scrollY}try{sessionStorage.setItem(a||dp,JSON.stringify(on))}catch(u){process.env.NODE_ENV!=="production"&&ot(!1,"Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly ("+u+").")}window.history.scrollRestoration="auto"},[a,t,l.state,i,d])),typeof document!="undefined"&&(_.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(a||dp);u&&(on=JSON.parse(u))}catch(u){}},[a]),_.useLayoutEffect(()=>{let u=t&&n!=="/"?(c,p)=>t(va({},c,{pathname:pt(c.pathname,n)||c.pathname}),p):t,f=r==null?void 0:r.enableScrollRestoration(on,()=>window.scrollY,u);return()=>f&&f()},[r,n,t]),_.useLayoutEffect(()=>{if(o!==!1){if(typeof o=="number"){window.scrollTo(0,o);return}if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}s!==!0&&window.scrollTo(0,0)}},[i,o,s]))}function AL(e,t){let{capture:a}=t||{};_.useEffect(()=>{let r=a!=null?{capture:a}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,a])}function TL(e,t){t===void 0&&(t={});let a=_.useContext(cp);a==null&&(process.env.NODE_ENV!=="production"?J(!1,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):J(!1));let{basename:r}=rl(go.useViewTransitionState),o=Sa(e,{relative:t.relative});if(!a.isTransitioning)return!1;let s=pt(a.currentLocation.pathname,r)||a.currentLocation.pathname,n=pt(a.nextLocation.pathname,r)||a.nextLocation.pathname;return ir(o.pathname,n)!=null||ir(o.pathname,s)!=null}var Zt=require("react/jsx-runtime"),DL=({columns:e,row:t,onClickRow:a})=>{let r=Tt(),o=(0,gp.useMemo)(()=>t.id,[t]),{t:s}=Je(),n=()=>{sessionStorage.setItem("enter_pincode",window.location.href.split("console")[1]),localStorage.setItem("backUrl",window.location.href.split("console")[1]),r(`${tn("/pos/kitchens/:kitchenId/orders",{kitchenId:o})}?`)};return(0,Zt.jsxs)("div",{style:{boxShadow:"0 2px 4px 0 rgba(27, 28, 29, 0.04)"},className:"p-4 rounded-2xl bg-white flex flex-col gap-4 h-fit border border-stroke-disabled",onClick:()=>a(e,t),children:[(0,Zt.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Zt.jsx)("p",{className:"font-semibold leading-6 tracking-[-0.24px] text-strong-950",children:t.name}),(0,Zt.jsx)(Kc,{stages:t.stage_ids})]}),(0,Zt.jsx)(rr,{}),(0,Zt.jsx)($t,{onClick:i=>{i.stopPropagation(),n()},className:"rounded-[6px] bg-primary h-11",text:s("detail_button")})]})},xp=DL;var ol=require("react/jsx-runtime"),Lp=()=>(0,ol.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:(0,ol.jsx)("path",{d:"M18.7531 21H6.15312C5.43704 21 4.75028 20.7155 4.24394 20.2092C3.73759 19.7028 3.45313 19.0161 3.45312 18.3V3.9C3.45312 3.66131 3.54795 3.43239 3.71673 3.2636C3.88551 3.09482 4.11443 3 4.35312 3H16.9531C17.1918 3 17.4207 3.09482 17.5895 3.2636C17.7583 3.43239 17.8531 3.66131 17.8531 3.9V14.7H21.4531V18.3C21.4531 19.0161 21.1687 19.7028 20.6623 20.2092C20.156 20.7155 19.4692 21 18.7531 21ZM17.8531 16.5V18.3C17.8531 18.5387 17.9479 18.7676 18.1167 18.9364C18.2855 19.1052 18.5144 19.2 18.7531 19.2C18.9918 19.2 19.2207 19.1052 19.3895 18.9364C19.5583 18.7676 19.6531 18.5387 19.6531 18.3V16.5H17.8531ZM16.0531 19.2V4.8H5.25312V18.3C5.25312 18.5387 5.34795 18.7676 5.51673 18.9364C5.68551 19.1052 5.91443 19.2 6.15312 19.2H16.0531ZM7.05312 7.5H14.2531V9.3H7.05312V7.5ZM7.05312 11.1H14.2531V12.9H7.05312V11.1ZM7.05312 14.7H11.5531V16.5H7.05312V14.7Z",fill:"#666666"})});var sl=require("react/jsx-runtime");var yp=()=>(0,sl.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",children:(0,sl.jsx)("path",{d:"M8.59985 4.2998V7.89941H12.2004V8.09961H8.59985V11.7002H8.39966V8.09961H4.80005V7.89941H8.39966V4.2998H8.59985Z",fill:"currentColor",stroke:"currentColor"})});var fr=require("react/jsx-runtime"),ML=({orderStatus:e,onAddItem:t,onPayment:a,onIssueInvoice:r,onPrintInvoice:o})=>{let{t:s}=Je();return(0,fr.jsxs)("div",{className:"flex items-center gap-3 justify-center",children:[(0,fr.jsx)($t,{className:"button-secondary",onClick:()=>{e==="draft"?t&&t():r&&r()},iconSrc:(0,fr.jsx)(yp,{}),text:s(e==="draft"?"add_dish":"create_invoice")}),(0,fr.jsx)($t,{className:"button-primary",onClick:()=>{e==="draft"?a&&a():o&&o()},text:s(e==="draft"?"payment":"print_invoice")})]})},Cp=ML;var nl=require("react/jsx-runtime"),EL=[{id:1,value:"new",color:"#F6B51E",background:"#FFFAEB"},{id:2,value:"paid",color:"#1FC163",background:"#E0FAEB"},{id:3,value:"invoiced",color:"#35ADE9",background:"#EBF1FF"},{id:4,value:"cancel",color:"#FB2B3D",background:"#FFEBEC"},{id:5,value:"in_paid",color:"#1FC163",background:"#E0FAEB"}],kL=({status:e})=>{let{t}=Je(),a=EL.find(r=>r.value===e);return(0,nl.jsx)("div",{style:{borderColor:a==null?void 0:a.color,backgroundColor:a==null?void 0:a.background,color:a==null?void 0:a.color},className:"px-2 py-1 rounded border w-fit",children:(0,nl.jsx)("p",{className:"text-xs font-medium leading-4",children:t((a==null?void 0:a.value)||"")})})},Ip=kL;var Sp=require("react"),ve=require("react/jsx-runtime"),FL=({readOnly:e,row:t,handleClick:a,onAddItem:r,onPayment:o,onIssueInvoice:s,onPrintInvoice:n})=>{var d;let i=(0,Sp.useMemo)(()=>new Date(t.date_order),[t]);return(0,ve.jsxs)("div",{onClick:()=>a(),className:"p-4 h-fit flex-1 rounded-2xl bg-white flex flex-col gap-3",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,ve.jsx)("div",{className:"w-14 aspect-square rounded-lg bg-neutral-100-96 flex items-center justify-center",children:(0,ve.jsx)(Lp,{})}),(0,ve.jsxs)("div",{className:"flex flex-col flex-1 gap-2 justify-center",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ve.jsxs)("p",{className:"font-bold leading-6 text-text-primary tracking-[-0.16px]",children:["#",t.id]}),(0,ve.jsx)(Ip,{status:t.state})]}),(0,ve.jsxs)("p",{className:"text-sm leading-5 text-text-secondary tracking-[-0.12px]",children:[ko(i)," ",(0,ve.jsxs)("span",{className:"text-text-secondary",children:["\u2022 ",Eo(i)]})]})]})]}),(0,ve.jsxs)("div",{className:"relative",children:[(0,ve.jsx)("div",{className:"h-4 aspect-square bg-weak-50 rounded-full absolute -left-6 -top-2"}),(0,ve.jsx)(rr,{}),(0,ve.jsx)("div",{className:"h-4 aspect-square bg-weak-50 rounded-full absolute -right-6 -top-2"})]}),(0,ve.jsxs)("div",{className:"flex justify-between items-center",children:[(0,ve.jsxs)("p",{className:"text-text-primary text-end font-semibold leading-6 tracking-[-0.24px]",children:[gu(t.amount_total)," ",(d=t.currency_id)==null?void 0:d.display_name]}),!e&&(0,ve.jsx)(Cp,{orderStatus:t.state,onAddItem:r,onPayment:o,onIssueInvoice:s,onPrintInvoice:n})]})]})},vp=FL;var il=require("react/jsx-runtime"),wp=()=>(0,il.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,il.jsx)("path",{d:"M0.5 7.99998C0.5 7.35123 0.5825 6.72273 0.737 6.12198C1.15135 6.14377 1.56365 6.05055 1.92833 5.85264C2.29301 5.65472 2.59586 5.35983 2.8034 5.00054C3.01095 4.64126 3.1151 4.23158 3.10436 3.8168C3.09361 3.40202 2.96837 2.99829 2.7425 2.65023C3.64921 1.75816 4.7681 1.11161 5.99375 0.771484C6.18199 1.14159 6.46898 1.45238 6.82294 1.66947C7.1769 1.88655 7.58402 2.00145 7.99925 2.00145C8.41448 2.00145 8.8216 1.88655 9.17556 1.66947C9.52952 1.45238 9.81651 1.14159 10.0048 0.771484C11.2304 1.11161 12.3493 1.75816 13.256 2.65023C13.0299 2.99835 12.9045 3.40224 12.8936 3.81721C12.8828 4.23218 12.987 4.64206 13.1946 5.00149C13.4023 5.36093 13.7054 5.65591 14.0703 5.8538C14.4352 6.05168 14.8477 6.14476 15.2623 6.12273C15.4167 6.72273 15.4993 7.35123 15.4993 7.99998C15.4993 8.64873 15.4167 9.27723 15.2623 9.87799C14.8478 9.85606 14.4354 9.94917 14.0706 10.147C13.7059 10.3449 13.4029 10.6398 13.1953 10.9991C12.9876 11.3584 12.8834 11.7681 12.8941 12.183C12.9048 12.5978 13.0301 13.0016 13.256 13.3497C12.3493 14.2418 11.2304 14.8884 10.0048 15.2285C9.81651 14.8584 9.52952 14.5476 9.17556 14.3305C8.8216 14.1134 8.41448 13.9985 7.99925 13.9985C7.58402 13.9985 7.1769 14.1134 6.82294 14.3305C6.46898 14.5476 6.18199 14.8584 5.99375 15.2285C4.7681 14.8884 3.64921 14.2418 2.7425 13.3497C2.96863 13.0016 3.09405 12.5977 3.10488 12.1828C3.11571 11.7678 3.01152 11.3579 2.80386 10.9985C2.59619 10.639 2.29314 10.3441 1.92823 10.1462C1.56332 9.94829 1.15078 9.85521 0.73625 9.87724C0.5825 9.27798 0.5 8.64948 0.5 7.99998ZM4.103 10.25C4.5755 11.0682 4.7105 12.0095 4.526 12.893C4.832 13.1105 5.1575 13.2987 5.49875 13.4555C6.18625 12.8396 7.07699 12.4993 8 12.5C8.945 12.5 9.8285 12.8532 10.5013 13.4555C10.8425 13.2987 11.168 13.1105 11.474 12.893C11.2846 11.99 11.4352 11.0488 11.897 10.25C12.358 9.45076 13.0978 8.84985 13.9745 8.56248C14.0092 8.18829 14.0092 7.81168 13.9745 7.43748C13.0975 7.15028 12.3574 6.54935 11.8962 5.74998C11.4345 4.95118 11.2838 4.01001 11.4733 3.10698C11.1673 2.88943 10.8417 2.7011 10.5005 2.54448C9.81319 3.16018 8.92276 3.50044 8 3.49998C7.07699 3.50063 6.18625 3.16036 5.49875 2.54448C5.1576 2.7011 4.83192 2.88943 4.526 3.10698C4.71542 4.01001 4.56479 4.95118 4.103 5.74998C3.64203 6.5492 2.90224 7.15012 2.0255 7.43748C1.99081 7.81168 1.99081 8.18829 2.0255 8.56248C2.90252 8.84969 3.6426 9.45062 4.10375 10.25H4.103ZM8 10.25C7.40326 10.25 6.83097 10.0129 6.40901 9.59097C5.98705 9.16902 5.75 8.59672 5.75 7.99998C5.75 7.40325 5.98705 6.83095 6.40901 6.40899C6.83097 5.98704 7.40326 5.74998 8 5.74998C8.59674 5.74998 9.16903 5.98704 9.59099 6.40899C10.0129 6.83095 10.25 7.40325 10.25 7.99998C10.25 8.59672 10.0129 9.16902 9.59099 9.59097C9.16903 10.0129 8.59674 10.25 8 10.25ZM8 8.74998C8.19891 8.74998 8.38968 8.67097 8.53033 8.53031C8.67098 8.38966 8.75 8.1989 8.75 7.99998C8.75 7.80107 8.67098 7.61031 8.53033 7.46965C8.38968 7.329 8.19891 7.24998 8 7.24998C7.80109 7.24998 7.61032 7.329 7.46967 7.46965C7.32902 7.61031 7.25 7.80107 7.25 7.99998C7.25 8.1989 7.32902 8.38966 7.46967 8.53031C7.61032 8.67097 7.80109 8.74998 8 8.74998Z",fill:"curentColor"})});var Yt={POS_ID:"pos_id",FLOOR:"floor",SESSION_ID:"session-id",ORDER_ID:"order-id",CATEGORY_ID:"category-id",OPEN:"open",CUSTOMER_INFO:"customer-info",CUSTOMER_ID:"customer-id",TABLE_ID:"table-id",KITCHEN_ORDER_STATUS:"kitchen-order-status",CLOSE_SESSION:"close-session",SHOW_SCREEN:"show-screen"};var bp=require("@fctc/widget-logic/provider"),Pp=require("@fctc/widget-logic/utils"),un=require("@tanstack/react-query");var VL=()=>{var p;let{useCreateSession:e,useHandleClosingSession:t,useCreatePosConfig:a}=(0,bp.useService)(),r=e().mutateAsync,o=t().mutateAsync,s=a().mutateAsync,{user:n}=Js(),i=(p=n==null?void 0:n.userProfile)==null?void 0:p.data,d=Pp.sessionStorageUtils.getMenuFocus().service||"wesap",l=(i==null?void 0:i.x_node)||"",u=(0,un.useMutation)({mutationFn:m=>de(null,null,function*(){return yield r({configId:m,model:"pos.session",service:d,xNode:l})})}),f=(0,un.useMutation)({mutationFn:({cashBoxValue:m,sessionId:g})=>o({model:"pos.session",ids:[Number(g)],service:d,xNode:l,method:"set_opening_control",kwargs:{cashbox_value:m,notes:"Opening cashbox"}})}),c=(0,un.useMutation)({mutationFn:L=>de(null,[L],function*({name:m,modulePosRestaurant:g}){return yield s({model:"pos.config",name:m,service:d,xNode:l,modulePosRestaurant:g})})});return{openSession:u,setOpeningCashBox:f,createPosConfig:c}},Rp=VL;var N=e=>typeof e=="string",xo=()=>{let e,t,a=new Promise((r,o)=>{e=r,t=o});return a.resolve=e,a.reject=t,a},Ap=e=>e==null?"":""+e,BL=(e,t,a)=>{e.forEach(r=>{t[r]&&(a[r]=t[r])})},OL=/###/g,Tp=e=>e&&e.indexOf("###")>-1?e.replace(OL,"."):e,Dp=e=>!e||N(e),Lo=(e,t,a)=>{let r=N(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(Dp(e))return{};let s=Tp(r[o]);!e[s]&&a&&(e[s]=new a),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++o}return Dp(e)?{}:{obj:e,k:Tp(r[o])}},Mp=(e,t,a)=>{let{obj:r,k:o}=Lo(e,t,Object);if(r!==void 0||t.length===1){r[o]=a;return}let s=t[t.length-1],n=t.slice(0,t.length-1),i=Lo(e,n,Object);for(;i.obj===void 0&&n.length;)s=`${n[n.length-1]}.${s}`,n=n.slice(0,n.length-1),i=Lo(e,n,Object),i!=null&&i.obj&&typeof i.obj[`${i.k}.${s}`]!="undefined"&&(i.obj=void 0);i.obj[`${i.k}.${s}`]=a},NL=(e,t,a,r)=>{let{obj:o,k:s}=Lo(e,t,Object);o[s]=o[s]||[],o[s].push(a)},fn=(e,t)=>{let{obj:a,k:r}=Lo(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},UL=(e,t,a)=>{let r=fn(e,a);return r!==void 0?r:fn(t,a)},Up=(e,t,a)=>{for(let r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?N(e[r])||e[r]instanceof String||N(t[r])||t[r]instanceof String?a&&(e[r]=t[r]):Up(e[r],t[r],a):e[r]=t[r]);return e},cr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),HL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_L=e=>N(e)?e.replace(/[&<>"'\/]/g,t=>HL[t]):e,dl=class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let a=this.regExpMap.get(t);if(a!==void 0)return a;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}},qL=[" ",",","?","!",";"],jL=new dl(20),WL=(e,t,a)=>{t=t||"",a=a||"";let r=qL.filter(n=>t.indexOf(n)<0&&a.indexOf(n)<0);if(r.length===0)return!0;let o=jL.getRegExp(`(${r.map(n=>n==="?"?"\\?":n).join("|")})`),s=!o.test(e);if(!s){let n=e.indexOf(a);n>0&&!o.test(e.substring(0,n))&&(s=!0)}return s},fl=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(a),o=e;for(let s=0;s<r.length;){if(!o||typeof o!="object")return;let n,i="";for(let d=s;d<r.length;++d)if(d!==s&&(i+=a),i+=r[d],n=o[i],n!==void 0){if(["string","number","boolean"].indexOf(typeof n)>-1&&d<r.length-1)continue;s+=d-s+1;break}o=n}return o},yo=e=>e==null?void 0:e.replace("_","-"),zL={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var a,r;(r=(a=console==null?void 0:console[e])==null?void 0:a.apply)==null||r.call(a,console,t)}},cl=class e{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||zL,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,r,o){return o&&!this.debug?null:(N(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new e(this.logger,h({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},mt=new cl,pr=class{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);let o=this.observers[r].get(a)||0;this.observers[r].set(a,o+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,s])=>{for(let n=0;n<s;n++)o(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,s])=>{for(let n=0;n<s;n++)o.apply(o,[t,...a])})}},cn=class extends pr{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){let a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,r,o={}){var l,u;let s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,n=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,i;t.indexOf(".")>-1?i=t.split("."):(i=[t,a],r&&(Array.isArray(r)?i.push(...r):N(r)&&s?i.push(...r.split(s)):i.push(r)));let d=fn(this.data,i);return!d&&!a&&!r&&t.indexOf(".")>-1&&(t=i[0],a=i[1],r=i.slice(2).join(".")),d||!n||!N(r)?d:fl((u=(l=this.data)==null?void 0:l[t])==null?void 0:u[a],r,s)}addResource(t,a,r,o,s={silent:!1}){let n=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=[t,a];r&&(i=i.concat(n?r.split(n):r)),t.indexOf(".")>-1&&(i=t.split("."),o=a,a=i[1]),this.addNamespaces(a),Mp(this.data,i,o),s.silent||this.emit("added",t,a,r,o)}addResources(t,a,r,o={silent:!1}){for(let s in r)(N(r[s])||Array.isArray(r[s]))&&this.addResource(t,a,s,r[s],{silent:!0});o.silent||this.emit("added",t,a,r)}addResourceBundle(t,a,r,o,s,n={silent:!1,skipCopy:!1}){let i=[t,a];t.indexOf(".")>-1&&(i=t.split("."),o=r,r=a,a=i[1]),this.addNamespaces(a);let d=fn(this.data,i)||{};n.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?Up(d,r,s):d=h(h({},d),r),Mp(this.data,i,d),n.silent||this.emit("added",t,a,r)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){let a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}},Hp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,r,o){return e.forEach(s=>{var n,i;t=(i=(n=this.processors[s])==null?void 0:n.process(t,a,r,o))!=null?i:t}),t}},_p=Symbol("i18next/PATH_KEY");function GL(){let e=[],t=Object.create(null),a;return t.get=(r,o)=>{var s;return(s=a==null?void 0:a.revoke)==null||s.call(a),o===_p?e:(e.push(o),a=Proxy.revocable(r,t),a.proxy)},Proxy.revocable(Object.create(null),t).proxy}function pl(e,t){var r;let{[_p]:a}=e(GL());return a.join((r=t==null?void 0:t.keySeparator)!=null?r:".")}var Ep={},ll=e=>!N(e)&&typeof e!="boolean"&&typeof e!="number",pn=class e extends pr{constructor(t,a={}){super(),BL(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){let r=h({},a);if(t==null)return!1;let o=this.resolve(t,r);if((o==null?void 0:o.res)===void 0)return!1;let s=ll(o.res);return!(r.returnObjects===!1&&s)}extractFromKey(t,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");let o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,s=a.ns||this.options.defaultNS||[],n=r&&t.indexOf(r)>-1,i=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!WL(t,r,o);if(n&&!i){let d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:N(s)?[s]:s};let l=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(l[0])>-1)&&(s=l.shift()),t=l.join(o)}return{key:t,namespaces:N(s)?[s]:s}}translate(t,a,r){let o=typeof a=="object"?h({},a):a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o=h({},o)),o||(o={}),t==null)return"";typeof t=="function"&&(t=pl(t,h(h({},this.options),o))),Array.isArray(t)||(t=[String(t)]);let s=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,n=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:i,namespaces:d}=this.extractFromKey(t[t.length-1],o),l=d[d.length-1],u=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");let f=o.lng||this.language,c=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return c?s?{res:`${l}${u}${i}`,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:`${l}${u}${i}`:s?{res:i,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:i;let p=this.resolve(t,o),m=p==null?void 0:p.res,g=(p==null?void 0:p.usedKey)||i,L=(p==null?void 0:p.exactUsedKey)||i,S=["[object Number]","[object Function]","[object RegExp]"],y=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,v=o.count!==void 0&&!N(o.count),b=e.hasDefaultValue(o),D=v?this.pluralResolver.getSuffix(f,o.count,o):"",M=o.ordinal&&v?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",R=v&&!o.ordinal&&o.count===0,k=R&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${D}`]||o[`defaultValue${M}`]||o.defaultValue,V=m;I&&!m&&b&&(V=k);let U=ll(V),z=Object.prototype.toString.apply(V);if(I&&V&&U&&S.indexOf(z)<0&&!(N(y)&&Array.isArray(V))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,V,P(h({},o),{ns:d})):`key '${i} (${this.language})' returned an object instead of string.`;return s?(p.res=q,p.usedParams=this.getUsedParamsDetails(o),p):q}if(n){let q=Array.isArray(V),j=q?[]:{},Q=q?L:g;for(let ee in V)if(Object.prototype.hasOwnProperty.call(V,ee)){let W=`${Q}${n}${ee}`;b&&!m?j[ee]=this.translate(W,P(h({},o),{defaultValue:ll(k)?k[ee]:void 0,joinArrays:!1,ns:d})):j[ee]=this.translate(W,P(h({},o),{joinArrays:!1,ns:d})),j[ee]===W&&(j[ee]=V[ee])}m=j}}else if(I&&N(y)&&Array.isArray(m))m=m.join(y),m&&(m=this.extendTranslation(m,t,o,r));else{let q=!1,j=!1;!this.isValidLookup(m)&&b&&(q=!0,m=k),this.isValidLookup(m)||(j=!0,m=i);let ee=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:m,W=b&&k!==m&&this.options.updateMissing;if(j||q||W){if(this.logger.log(W?"updateKey":"missingKey",f,l,i,W?k:m),n){let ge=this.resolve(i,P(h({},o),{keySeparator:!1}));ge&&ge.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ae=[],ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(let ge=0;ge<ue.length;ge++)ae.push(ue[ge]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(o.lng||this.language):ae.push(o.lng||this.language);let Re=(ge,Ye,it)=>{var gr;let ba=b&&it!==m?it:ee;this.options.missingKeyHandler?this.options.missingKeyHandler(ge,l,Ye,ba,W,o):(gr=this.backendConnector)!=null&&gr.saveMissing&&this.backendConnector.saveMissing(ge,l,Ye,ba,W,o),this.emit("missingKey",ge,l,Ye,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?ae.forEach(ge=>{let Ye=this.pluralResolver.getSuffixes(ge,o);R&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Ye.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ye.push(`${this.options.pluralSeparator}zero`),Ye.forEach(it=>{Re([ge],i+it,o[`defaultValue${it}`]||k)})}):Re(ae,i,k))}m=this.extendTranslation(m,t,o,p,r),j&&m===i&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${i}`),(j||q)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${i}`:i,q?m:void 0,o))}return s?(p.res=m,p.usedParams=this.getUsedParamsDetails(o),p):m}extendTranslation(t,a,r,o,s){var d,l;if((d=this.i18nFormat)!=null&&d.parse)t=this.i18nFormat.parse(t,h(h({},this.options.interpolation.defaultVariables),r),r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(P(h({},r),{interpolation:h(h({},this.options.interpolation),r.interpolation)}));let u=N(t)&&(((l=r==null?void 0:r.interpolation)==null?void 0:l.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(u){let p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let c=r.replace&&!N(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c=h(h({},this.options.interpolation.defaultVariables),c)),t=this.interpolator.interpolate(t,c,r.lng||this.language||o.usedLng,r),u){let p=t.match(this.interpolator.nestingRegexp),m=p&&p.length;f<m&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...p)=>(s==null?void 0:s[0])===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${a[0]}`),null):this.translate(...p,a),r)),r.interpolation&&this.interpolator.reset()}let n=r.postProcess||this.options.postProcess,i=N(n)?[n]:n;return t!=null&&(i!=null&&i.length)&&r.applyPostProcessor!==!1&&(t=Hp.handle(i,t,a,this.options&&this.options.postProcessPassResolved?h({i18nResolved:P(h({},o),{usedParams:this.getUsedParamsDetails(r)})},r):r,this)),t}resolve(t,a={}){let r,o,s,n,i;return N(t)&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(r))return;let l=this.extractFromKey(d,a),u=l.key;o=u;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));let c=a.count!==void 0&&!N(a.count),p=c&&!a.ordinal&&a.count===0,m=a.context!==void 0&&(N(a.context)||typeof a.context=="number")&&a.context!=="",g=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);f.forEach(L=>{var S,y;this.isValidLookup(r)||(i=L,!Ep[`${g[0]}-${L}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((y=this.utils)!=null&&y.hasLoadedNamespace(i))&&(Ep[`${g[0]}-${L}`]=!0,this.logger.warn(`key "${o}" for languages "${g.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(I=>{var D;if(this.isValidLookup(r))return;n=I;let v=[u];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(v,u,I,L,a);else{let M;c&&(M=this.pluralResolver.getSuffix(I,a.count,a));let R=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(a.ordinal&&M.indexOf(k)===0&&v.push(u+M.replace(k,this.options.pluralSeparator)),v.push(u+M),p&&v.push(u+R)),m){let V=`${u}${this.options.contextSeparator||"_"}${a.context}`;v.push(V),c&&(a.ordinal&&M.indexOf(k)===0&&v.push(V+M.replace(k,this.options.pluralSeparator)),v.push(V+M),p&&v.push(V+R))}}let b;for(;b=v.pop();)this.isValidLookup(r)||(s=b,r=this.getResource(I,L,b,a))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:n,usedNS:i}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,r,o={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,a,r,o):this.resourceStore.getResource(t,a,r,o)}getUsedParamsDetails(t={}){let a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!N(t.replace),o=r?t.replace:t;if(r&&typeof t.count!="undefined"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o=h(h({},this.options.interpolation.defaultVariables),o)),!r){o=h({},o);for(let s of a)delete o[s]}return o}static hasDefaultValue(t){let a="defaultValue";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a===r.substring(0,a.length)&&t[r]!==void 0)return!0;return!1}},mn=class{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mt.create("languageUtils")}getScriptPartFromCode(t){if(t=yo(t),!t||t.indexOf("-")<0)return null;let a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=yo(t),!t||t.indexOf("-")<0)return t;let a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(N(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch(r){}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let a;return t.forEach(r=>{if(a)return;let o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&t.forEach(r=>{if(a)return;let o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return a=o;let s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return a=s;a=this.options.supportedLngs.find(n=>{if(n===s)return n;if(!(n.indexOf("-")<0&&s.indexOf("-")<0)&&(n.indexOf("-")>0&&s.indexOf("-")<0&&n.substring(0,n.indexOf("-"))===s||n.indexOf(s)===0&&s.length>1))return n})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),N(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let r=t[a];return r||(r=t[this.getScriptPartFromCode(a)]),r||(r=t[this.formatLanguageCode(a)]),r||(r=t[this.getLanguagePartFromCode(a)]),r||(r=t.default),r||[]}toResolveHierarchy(t,a){let r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),o=[],s=n=>{n&&(this.isSupportedCode(n)?o.push(n):this.logger.warn(`rejecting language code not found in supportedLngs: ${n}`))};return N(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):N(t)&&s(this.formatLanguageCode(t)),r.forEach(n=>{o.indexOf(n)<0&&s(this.formatLanguageCode(n))}),o}},kp={zero:0,one:1,two:2,few:3,many:4,other:5},Fp={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})},ml=class{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=mt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){let r=yo(t==="dev"?"en":t),o=a.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let n;try{n=new Intl.PluralRules(r,{type:o})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Fp;if(!t.match(/-|_/))return Fp;let d=this.languageUtils.getLanguagePartFromCode(t);n=this.getRule(d,a)}return this.pluralRulesCache[s]=n,n}needsPlural(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,a,r={}){return this.getSuffixes(t,r).map(o=>`${a}${o}`)}getSuffixes(t,a={}){let r=this.getRule(t,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((o,s)=>kp[o]-kp[s]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,a,r={}){let o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,r))}},Vp=(e,t,a,r=".",o=!0)=>{let s=UL(e,t,a);return!s&&o&&N(a)&&(s=fl(e,a,r),s===void 0&&(s=fl(t,a,r))),s},ul=e=>e.replace(/\$/g,"$$$$"),hn=class{constructor(t={}){var a;this.logger=mt.create("interpolator"),this.options=t,this.format=((a=t==null?void 0:t.interpolation)==null?void 0:a.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});let{escape:a,escapeValue:r,useRawValueToEscape:o,prefix:s,prefixEscaped:n,suffix:i,suffixEscaped:d,formatSeparator:l,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:c,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:L,maxReplaces:S,alwaysFormat:y}=t.interpolation;this.escape=a!==void 0?a:_L,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?cr(s):n||"{{",this.suffix=i?cr(i):d||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=c?cr(c):p||cr("$t("),this.nestingSuffix=m?cr(m):g||cr(")"),this.nestingOptionsSeparator=L||",",this.maxReplaces=S||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let t=(a,r)=>(a==null?void 0:a.source)===r?(a.lastIndex=0,a):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,a,r,o){var p;let s,n,i,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){let y=Vp(a,d,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,P(h(h({},o),a),{interpolationkey:m})):y}let g=m.split(this.formatSeparator),L=g.shift().trim(),S=g.join(this.formatSeparator).trim();return this.format(Vp(a,d,L,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,P(h(h({},o),a),{interpolationkey:L}))};this.resetRegExp();let u=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=o==null?void 0:o.interpolation)==null?void 0:p.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ul(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ul(this.escape(m)):ul(m)}].forEach(m=>{for(i=0;s=m.regex.exec(t);){let g=s[1].trim();if(n=l(g),n===void 0)if(typeof u=="function"){let S=u(t,s,o);n=N(S)?S:""}else if(o&&Object.prototype.hasOwnProperty.call(o,g))n="";else if(f){n=s[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),n="";else!N(n)&&!this.useRawValueToEscape&&(n=Ap(n));let L=m.safeValue(n);if(t=t.replace(s[0],L),f?(m.regex.lastIndex+=n.length,m.regex.lastIndex-=s[0].length):m.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),t}nest(t,a,r={}){let o,s,n,i=(d,l)=>{var g;let u=this.nestingOptionsSeparator;if(d.indexOf(u)<0)return d;let f=d.split(new RegExp(`${u}[ ]*{`)),c=`{${f[1]}`;d=f[0],c=this.interpolate(c,n);let p=c.match(/'/g),m=c.match(/"/g);(((g=p==null?void 0:p.length)!=null?g:0)%2===0&&!m||m.length%2!==0)&&(c=c.replace(/'/g,'"'));try{n=JSON.parse(c),l&&(n=h(h({},l),n))}catch(L){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,L),`${d}${u}${c}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,d};for(;o=this.nestingRegexp.exec(t);){let d=[];n=h({},r),n=n.replace&&!N(n.replace)?n.replace:n,n.applyPostProcessor=!1,delete n.defaultValue;let l=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(l!==-1&&(d=o[1].slice(l).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),o[1]=o[1].slice(0,l)),s=a(i.call(this,o[1].trim(),n),n),s&&o[0]===t&&!N(s))return s;N(s)||(s=Ap(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),d.length&&(s=d.reduce((u,f)=>this.format(u,f,r.lng,P(h({},r),{interpolationkey:o[1].trim()})),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}},$L=e=>{let t=e.toLowerCase().trim(),a={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?a.currency||(a.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(n=>{if(n){let[i,...d]=n.split(":"),l=d.join(":").trim().replace(/^'+|'+$/g,""),u=i.trim();a[u]||(a[u]=l),l==="false"&&(a[u]=!1),l==="true"&&(a[u]=!0),isNaN(l)||(a[u]=parseInt(l,10))}})}return{formatName:t,formatOptions:a}},Bp=e=>{let t={};return(a,r,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s=P(h({},s),{[o.interpolationkey]:void 0}));let n=r+JSON.stringify(s),i=t[n];return i||(i=e(yo(r),o),t[n]=i),i(a)}},KL=e=>(t,a,r)=>e(yo(a),r)(t),hl=class{constructor(t={}){this.logger=mt.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";let r=a.cacheInBuiltFormats?Bp:KL;this.formats={number:r((o,s)=>{let n=new Intl.NumberFormat(o,h({},s));return i=>n.format(i)}),currency:r((o,s)=>{let n=new Intl.NumberFormat(o,P(h({},s),{style:"currency"}));return i=>n.format(i)}),datetime:r((o,s)=>{let n=new Intl.DateTimeFormat(o,h({},s));return i=>n.format(i)}),relativetime:r((o,s)=>{let n=new Intl.RelativeTimeFormat(o,h({},s));return i=>n.format(i,s.range||"day")}),list:r((o,s)=>{let n=new Intl.ListFormat(o,h({},s));return i=>n.format(i)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=Bp(a)}format(t,a,r,o={}){let s=a.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(i=>i.indexOf(")")>-1)){let i=s.findIndex(d=>d.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,i)].join(this.formatSeparator)}return s.reduce((i,d)=>{var f;let{formatName:l,formatOptions:u}=$L(d);if(this.formats[l]){let c=i;try{let p=((f=o==null?void 0:o.formatParams)==null?void 0:f[o.interpolationkey])||{},m=p.locale||p.lng||o.locale||o.lng||r;c=this.formats[l](i,m,h(h(h({},u),o),p))}catch(p){this.logger.warn(p)}return c}else this.logger.warn(`there was no format function for ${l}`);return i},t)}},XL=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},gl=class extends pr{constructor(t,a,r,o={}){var s,n;super(),this.backend=t,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=mt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(n=(s=this.backend)==null?void 0:s.init)==null||n.call(s,r,o.backend,o)}queueLoad(t,a,r,o){let s={},n={},i={},d={};return t.forEach(l=>{let u=!0;a.forEach(f=>{let c=`${l}|${f}`;!r.reload&&this.store.hasResourceBundle(l,f)?this.state[c]=2:this.state[c]<0||(this.state[c]===1?n[c]===void 0&&(n[c]=!0):(this.state[c]=1,u=!1,n[c]===void 0&&(n[c]=!0),s[c]===void 0&&(s[c]=!0),d[f]===void 0&&(d[f]=!0)))}),u||(i[l]=!0)}),(Object.keys(s).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(n),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(d)}}loaded(t,a,r){let o=t.split("|"),s=o[0],n=o[1];a&&this.emit("failedLoading",s,n,a),!a&&r&&this.store.addResourceBundle(s,n,r,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&r&&(this.state[t]=0);let i={};this.queue.forEach(d=>{NL(d.loaded,[s],n),XL(d,t),a&&d.errors.push(a),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(l=>{i[l]||(i[l]={});let u=d.loaded[l];u.length&&u.forEach(f=>{i[l][f]===void 0&&(i[l][f]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(d=>!d.done)}read(t,a,r,o=0,s=this.retryTimeout,n){if(!t.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:r,tried:o,wait:s,callback:n});return}this.readingCalls++;let i=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){let f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,r,o+1,s*2,n)},s);return}n(l,u)},d=this.backend[r].bind(this.backend);if(d.length===2){try{let l=d(t,a);l&&typeof l.then=="function"?l.then(u=>i(null,u)).catch(i):i(null,l)}catch(l){i(l)}return}return d(t,a,i)}prepareLoading(t,a,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();N(t)&&(t=this.languageUtils.toResolveHierarchy(t)),N(a)&&(a=[a]);let s=this.queueLoad(t,a,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(n=>{this.loadOne(n)})}load(t,a,r){this.prepareLoading(t,a,{},r)}reload(t,a,r){this.prepareLoading(t,a,{reload:!0},r)}loadOne(t,a=""){let r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${a}loading namespace ${s} for language ${o} failed`,n),!n&&i&&this.logger.log(`${a}loaded namespace ${s} for language ${o}`,i),this.loaded(t,n,i)})}saveMissing(t,a,r,o,s,n={},i=()=>{}){var d,l,u,f,c;if((l=(d=this.services)==null?void 0:d.utils)!=null&&l.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((c=this.backend)!=null&&c.create){let p=P(h({},n),{isUpdate:s}),m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(t,a,r,o,p):g=m(t,a,r,o),g&&typeof g.then=="function"?g.then(L=>i(null,L)).catch(i):i(null,g)}catch(g){i(g)}else m(t,a,r,o,i,p)}!t||!t[0]||this.store.addResource(t[0],a,r,o)}}},Op=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),N(e[1])&&(t.defaultValue=e[1]),N(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){let a=e[3]||e[2];Object.keys(a).forEach(r=>{t[r]=a[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Np=e=>{var t,a;return N(e.ns)&&(e.ns=[e.ns]),N(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),N(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((a=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:a.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},dn=()=>{},ZL=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})},xl=class e extends pr{constructor(t={},a){if(super(),this.options=Np(t),this.services={},this.logger=mt,this.modules={external:[]},ZL(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(N(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));let r=Op();this.options=h(h(h({},r),this.options),Np(t)),this.options.interpolation=h(h({},r.interpolation),this.options.interpolation),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);let o=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?mt.init(o(this.modules.logger),this.options):mt.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=hl;let u=new mn(this.options);this.store=new cn(this.options.resources,this.options);let f=this.services;f.logger=mt,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new ml(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),l&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(l),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new hn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new gl(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new pn(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,a||(a=dn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});let i=xo(),d=()=>{let l=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(f),a(u,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),i}loadResources(t,a=dn){var s,n;let r=a,o=N(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();let i=[],d=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&i.indexOf(f)<0&&i.push(f)})};o?d(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>d(u)),(n=(s=this.options.preload)==null?void 0:s.forEach)==null||n.call(s,l=>d(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,a,r){let o=xo();return typeof t=="function"&&(r=t,t=void 0),typeof a=="function"&&(r=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),r||(r=dn),this.services.backendConnector.reload(t,a,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Hp.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a<this.languages.length;a++){let r=this.languages[a];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;let r=xo();this.emit("languageChanging",t);let o=i=>{this.language=i,this.languages=this.services.languageUtils.toResolveHierarchy(i),this.resolvedLanguage=void 0,this.setResolvedLanguage(i)},s=(i,d)=>{d?this.isLanguageChangingTo===t&&(o(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,r.resolve((...l)=>this.t(...l)),a&&a(i,(...l)=>this.t(...l))},n=i=>{var u,f;!t&&!i&&this.services.languageDetector&&(i=[]);let d=N(i)?i:i&&i[0],l=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(N(i)?[i]:i);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,l)),this.loadResources(l,c=>{s(c,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?n(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(n):this.services.languageDetector.detect(n):n(t),r}getFixedT(t,a,r){let o=(s,n,...i)=>{let d;typeof n!="object"?d=this.options.overloadTranslationOptionHandler([s,n].concat(i)):d=h({},n),d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs,d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||r||o.keyPrefix);let l=this.options.keySeparator||".",u;return d.keyPrefix&&Array.isArray(s)?u=s.map(f=>(typeof f=="function"&&(f=pl(f,h(h({},this.options),n))),`${d.keyPrefix}${l}${f}`)):(typeof s=="function"&&(s=pl(s,h(h({},this.options),n))),u=d.keyPrefix?`${d.keyPrefix}${l}${s}`:s),this.t(u,d)};return N(t)?o.lng=t:o.lngs=t,o.ns=a,o.keyPrefix=r,o}t(...t){var a;return(a=this.translator)==null?void 0:a.translate(...t)}exists(...t){var a;return(a=this.translator)==null?void 0:a.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;let n=(i,d)=>{let l=this.services.backendConnector.state[`${i}|${d}`];return l===-1||l===0||l===2};if(a.precheck){let i=a.precheck(this,n);if(i!==void 0)return i}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||n(r,t)&&(!o||n(s,t)))}loadNamespaces(t,a){let r=xo();return this.options.ns?(N(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),a&&a(o)}),r):(a&&a(),Promise.resolve())}loadLanguages(t,a){let r=xo();N(t)&&(t=[t]);let o=this.options.preload||[],s=t.filter(n=>o.indexOf(n)<0&&this.services.languageUtils.isSupportedCode(n));return s.length?(this.options.preload=o.concat(s),this.loadResources(n=>{r.resolve(),a&&a(n)}),r):(a&&a(),Promise.resolve())}dir(t){var o,s;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{let n=new Intl.Locale(t);if(n&&n.getTextInfo){let i=n.getTextInfo();if(i&&i.direction)return i.direction}}catch(n){}let a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((s=this.services)==null?void 0:s.languageUtils)||new mn(Op());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){let r=new e(t,a);return r.createInstance=e.createInstance,r}cloneInstance(t={},a=dn){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let o=P(h(h({},this.options),t),{isClone:!0}),s=new e(o);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(i=>{s[i]=this[i]}),s.services=h({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){let i=Object.keys(this.store.data).reduce((d,l)=>(d[l]=h({},this.store.data[l]),d[l]=Object.keys(d[l]).reduce((u,f)=>(u[f]=h({},d[l][f]),u),d[l]),d),{});s.store=new cn(i,o),s.services.resourceStore=s.store}return t.interpolation&&(s.services.interpolator=new hn(o)),s.translator=new pn(s.services,o),s.translator.on("*",(i,...d)=>{s.emit(i,...d)}),s.init(o,a),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},Ue=xl.createInstance(),BF=Ue.createInstance,OF=Ue.dir,NF=Ue.init,UF=Ue.loadResources,HF=Ue.reloadResources,_F=Ue.use,qF=Ue.changeLanguage,jF=Ue.getFixedT,ze=Ue.t,WF=Ue.exists,zF=Ue.setDefaultNamespace,GF=Ue.hasLoadedNamespace,$F=Ue.loadNamespaces,KF=Ue.loadLanguages;var wo=require("react");var ke=gt(require("react"),1);var vo=e=>e.type==="checkbox",wa=e=>e instanceof Date,He=e=>e==null,em=e=>typeof e=="object",ye=e=>!He(e)&&!Array.isArray(e)&&em(e)&&!wa(e),YL=e=>ye(e)&&e.target?vo(e.target)?e.target.checked:e.target.value:e,QL=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,JL=(e,t)=>e.has(QL(t)),ey=e=>{let t=e.constructor&&e.constructor.prototype;return ye(t)&&t.hasOwnProperty("isPrototypeOf")},Il=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function Pe(e){let t,a=Array.isArray(e),r=typeof FileList!="undefined"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Il&&(e instanceof Blob||r))&&(a||ye(e)))if(t=a?[]:Object.create(Object.getPrototypeOf(e)),!a&&!ey(e))t=e;else for(let o in e)e.hasOwnProperty(o)&&(t[o]=Pe(e[o]));else return e;return t}var Ln=e=>/^\w*$/.test(e),he=e=>e===void 0,Sl=e=>Array.isArray(e)?e.filter(Boolean):[],vl=e=>Sl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,t,a)=>{if(!t||!ye(e))return a;let r=(Ln(t)?[t]:vl(t)).reduce((o,s)=>He(o)?o:o[s],e);return he(r)||r===e?he(e[t])?a:e[t]:r},ht=e=>typeof e=="boolean",ne=(e,t,a)=>{let r=-1,o=Ln(t)?[t]:vl(t),s=o.length,n=s-1;for(;++r<s;){let i=o[r],d=a;if(r!==n){let l=e[i];d=ye(l)||Array.isArray(l)?l:isNaN(+o[r+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=d,e=e[i]}},qp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},st={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Dt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},tm=ke.default.createContext(null);tm.displayName="HookFormContext";var am=e=>{let r=e,{children:t}=r,a=$(r,["children"]);return ke.default.createElement(tm.Provider,{value:a},t)},ty=(e,t,a,r=!0)=>{let o={defaultValues:t._defaultValues};for(let s in e)Object.defineProperty(o,s,{get:()=>{let n=s;return t._proxyFormState[n]!==st.all&&(t._proxyFormState[n]=!r||st.all),a&&(a[n]=!0),e[n]}});return o},ay=typeof window!="undefined"?ke.default.useLayoutEffect:ke.default.useEffect;var Ge=e=>typeof e=="string",ry=(e,t,a,r,o)=>Ge(e)?(r&&t.watch.add(e),E(a,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),E(a,s))):(r&&(t.watchAll=!0),a),yl=e=>He(e)||!em(e);function Qt(e,t,a=new WeakSet){if(yl(e)||yl(t))return Object.is(e,t);if(wa(e)&&wa(t))return e.getTime()===t.getTime();let r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(a.has(e)||a.has(t))return!0;a.add(e),a.add(t);for(let s of r){let n=e[s];if(!o.includes(s))return!1;if(s!=="ref"){let i=t[s];if(wa(n)&&wa(i)||ye(n)&&ye(i)||Array.isArray(n)&&Array.isArray(i)?!Qt(n,i,a):!Object.is(n,i))return!1}}return!0}var oy=(e,t,a,r,o)=>t?P(h({},a[e]),{types:P(h({},a[e]&&a[e].types?a[e].types:{}),{[r]:o||!0})}):{},Io=e=>Array.isArray(e)?e:[e],jp=()=>{let e=[];return{get observers(){return e},next:o=>{for(let s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function rm(e,t){let a={};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r],s=t[r];if(o&&ye(o)&&s){let n=rm(o,s);ye(n)&&(a[r]=n)}else e[r]&&(a[r]=s)}return a}var Ee=e=>ye(e)&&!Object.keys(e).length,wl=e=>e.type==="file",nt=e=>typeof e=="function",gn=e=>{if(!Il)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},om=e=>e.type==="select-multiple",bl=e=>e.type==="radio",sy=e=>bl(e)||vo(e),Ll=e=>gn(e)&&e.isConnected;function ny(e,t){let a=t.slice(0,-1).length,r=0;for(;r<a;)e=he(e)?r++:e[t[r++]];return e}function iy(e){for(let t in e)if(e.hasOwnProperty(t)&&!he(e[t]))return!1;return!0}function Le(e,t){let a=Array.isArray(t)?t:Ln(t)?[t]:vl(t),r=a.length===1?e:ny(e,a),o=a.length-1,s=a[o];return r&&delete r[s],o!==0&&(ye(r)&&Ee(r)||Array.isArray(r)&&iy(r))&&Le(e,a.slice(0,-1)),e}var ly=e=>{for(let t in e)if(nt(e[t]))return!0;return!1};function sm(e){return Array.isArray(e)||ye(e)&&!ly(e)}function Cl(e,t={}){for(let a in e){let r=e[a];sm(r)?(t[a]=Array.isArray(r)?[]:{},Cl(r,t[a])):he(r)||(t[a]=!0)}return t}function hr(e,t,a){a||(a=Cl(t));for(let r in e){let o=e[r];if(sm(o))he(t)||yl(a[r])?a[r]=Cl(o,Array.isArray(o)?[]:{}):hr(o,He(t)?{}:t[r],a[r]);else{let s=t[r];a[r]=!Qt(o,s)}}return a}var Wp={value:!1,isValid:!1},zp={value:!0,isValid:!0},nm=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!he(e[0].attributes.value)?he(e[0].value)||e[0].value===""?zp:{value:e[0].value,isValid:!0}:zp:Wp}return Wp},im=(e,{valueAsNumber:t,valueAsDate:a,setValueAs:r})=>he(e)?e:t?e===""?NaN:e&&+e:a&&Ge(e)?new Date(e):r?r(e):e,Gp={isValid:!1,value:null},lm=e=>Array.isArray(e)?e.reduce((t,a)=>a&&a.checked&&!a.disabled?{isValid:!0,value:a.value}:t,Gp):Gp;function $p(e){let t=e.ref;return wl(t)?t.files:bl(t)?lm(e.refs).value:om(t)?[...t.selectedOptions].map(({value:a})=>a):vo(t)?nm(e.refs).value:im(he(t.value)?e.ref.value:t.value,e)}var uy=(e,t,a,r)=>{let o={};for(let s of e){let n=E(t,s);n&&ne(o,s,n._f)}return{criteriaMode:a,names:[...e],fields:o,shouldUseNativeValidation:r}},xn=e=>e instanceof RegExp,Co=e=>he(e)?e:xn(e)?e.source:ye(e)?xn(e.value)?e.value.source:e.value:e,Kp=e=>({isOnSubmit:!e||e===st.onSubmit,isOnBlur:e===st.onBlur,isOnChange:e===st.onChange,isOnAll:e===st.all,isOnTouch:e===st.onTouched}),Xp="AsyncFunction",dy=e=>!!e&&!!e.validate&&!!(nt(e.validate)&&e.validate.constructor.name===Xp||ye(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Xp)),fy=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Zp=(e,t,a)=>!a&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),So=(e,t,a,r)=>{for(let s of a||Object.keys(e)){let n=E(e,s);if(n){let o=n,{_f:i}=o,d=$(o,["_f"]);if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(So(d,t))break}else if(ye(d)&&So(d,t))break}}};function Yp(e,t,a){let r=E(e,a);if(r||Ln(a))return{error:r,name:a};let o=a.split(".");for(;o.length;){let s=o.join("."),n=E(t,s),i=E(e,s);if(n&&!Array.isArray(n)&&a!==s)return{name:a};if(i&&i.type)return{name:s,error:i};if(i&&i.root&&i.root.type)return{name:`${s}.root`,error:i.root};o.pop()}return{name:a}}var cy=(e,t,a,r)=>{a(e);let n=e,{name:o}=n,s=$(n,["name"]);return Ee(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||st.all))},py=(e,t,a)=>!e||!t||e===t||Io(e).some(r=>r&&(a?r===t:r.startsWith(t)||t.startsWith(r))),my=(e,t,a,r,o)=>o.isOnAll?!1:!a&&o.isOnTouch?!(t||e):(a?r.isOnBlur:o.isOnBlur)?!e:(a?r.isOnChange:o.isOnChange)?e:!0,hy=(e,t)=>!Sl(E(e,t)).length&&Le(e,t),gy=(e,t,a)=>{let r=Io(E(e,a));return ne(r,"root",t[a]),ne(e,a,r),e};function Qp(e,t,a="validate"){if(Ge(e)||Array.isArray(e)&&e.every(Ge)||ht(e)&&!e)return{type:a,message:Ge(e)?e:"",ref:t}}var mr=e=>ye(e)&&!xn(e)?e:{value:e,message:""},Jp=(e,t,a,r,o,s)=>de(null,null,function*(){let{ref:n,refs:i,required:d,maxLength:l,minLength:u,min:f,max:c,pattern:p,validate:m,name:g,valueAsNumber:L,mount:S}=e._f,y=E(a,g);if(!S||t.has(g))return{};let I=i?i[0]:n,v=z=>{o&&I.reportValidity&&(I.setCustomValidity(ht(z)?"":z||""),I.reportValidity())},b={},D=bl(n),M=vo(n),R=D||M,k=(L||wl(n))&&he(n.value)&&he(y)||gn(n)&&n.value===""||y===""||Array.isArray(y)&&!y.length,V=oy.bind(null,g,r,b),U=(z,q,j,Q=Dt.maxLength,ee=Dt.minLength)=>{let W=z?q:j;b[g]=h({type:z?Q:ee,message:W,ref:n},V(z?Q:ee,W))};if(s?!Array.isArray(y)||!y.length:d&&(!R&&(k||He(y))||ht(y)&&!y||M&&!nm(i).isValid||D&&!lm(i).isValid)){let{value:z,message:q}=Ge(d)?{value:!!d,message:d}:mr(d);if(z&&(b[g]=h({type:Dt.required,message:q,ref:I},V(Dt.required,q)),!r))return v(q),b}if(!k&&(!He(f)||!He(c))){let z,q,j=mr(c),Q=mr(f);if(!He(y)&&!isNaN(y)){let ee=n.valueAsNumber||y&&+y;He(j.value)||(z=ee>j.value),He(Q.value)||(q=ee<Q.value)}else{let ee=n.valueAsDate||new Date(y),W=Re=>new Date(new Date().toDateString()+" "+Re),ae=n.type=="time",ue=n.type=="week";Ge(j.value)&&y&&(z=ae?W(y)>W(j.value):ue?y>j.value:ee>new Date(j.value)),Ge(Q.value)&&y&&(q=ae?W(y)<W(Q.value):ue?y<Q.value:ee<new Date(Q.value))}if((z||q)&&(U(!!z,j.message,Q.message,Dt.max,Dt.min),!r))return v(b[g].message),b}if((l||u)&&!k&&(Ge(y)||s&&Array.isArray(y))){let z=mr(l),q=mr(u),j=!He(z.value)&&y.length>+z.value,Q=!He(q.value)&&y.length<+q.value;if((j||Q)&&(U(j,z.message,q.message),!r))return v(b[g].message),b}if(p&&!k&&Ge(y)){let{value:z,message:q}=mr(p);if(xn(z)&&!y.match(z)&&(b[g]=h({type:Dt.pattern,message:q,ref:n},V(Dt.pattern,q)),!r))return v(q),b}if(m){if(nt(m)){let z=yield m(y,a),q=Qp(z,I);if(q&&(b[g]=h(h({},q),V(Dt.validate,q.message)),!r))return v(q.message),b}else if(ye(m)){let z={};for(let q in m){if(!Ee(z)&&!r)break;let j=Qp(yield m[q](y,a),I,q);j&&(z=h(h({},j),V(q,j.message)),v(j.message),r&&(b[g]=z))}if(!Ee(z)&&(b[g]=h({ref:I},z),!r))return b}}return v(!0),b}),xy={mode:st.onSubmit,reValidateMode:st.onChange,shouldFocusError:!0};function Ly(e={}){let t=h(h({},xy),e),a={submitCount:0,isDirty:!1,isReady:!1,isLoading:nt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=ye(t.defaultValues)||ye(t.values)?Pe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Pe(o),n={action:!1,mount:!1,watch:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,l=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f=h({},u),c={array:jp(),state:jp()},p=t.criteriaMode===st.all,m=x=>C=>{clearTimeout(l),l=setTimeout(x,C)},g=x=>de(null,null,function*(){if(!t.disabled&&(u.isValid||f.isValid||x)){let C=t.resolver?Ee((yield M()).errors):yield k(r,!0);C!==a.isValid&&c.state.next({isValid:C})}}),L=(x,C)=>{!t.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((x||Array.from(i.mount)).forEach(w=>{w&&(C?ne(a.validatingFields,w,C):Le(a.validatingFields,w))}),c.state.next({validatingFields:a.validatingFields,isValidating:!Ee(a.validatingFields)}))},S=(x,C=[],w,F,T=!0,A=!0)=>{if(F&&w&&!t.disabled){if(n.action=!0,A&&Array.isArray(E(r,x))){let O=w(E(r,x),F.argA,F.argB);T&&ne(r,x,O)}if(A&&Array.isArray(E(a.errors,x))){let O=w(E(a.errors,x),F.argA,F.argB);T&&ne(a.errors,x,O),hy(a.errors,x)}if((u.touchedFields||f.touchedFields)&&A&&Array.isArray(E(a.touchedFields,x))){let O=w(E(a.touchedFields,x),F.argA,F.argB);T&&ne(a.touchedFields,x,O)}(u.dirtyFields||f.dirtyFields)&&(a.dirtyFields=hr(o,s)),c.state.next({name:x,isDirty:U(x,C),dirtyFields:a.dirtyFields,errors:a.errors,isValid:a.isValid})}else ne(s,x,C)},y=(x,C)=>{ne(a.errors,x,C),c.state.next({errors:a.errors})},I=x=>{a.errors=x,c.state.next({errors:a.errors,isValid:!1})},v=(x,C,w,F)=>{let T=E(r,x);if(T){let A=E(s,x,he(w)?E(o,x):w);he(A)||F&&F.defaultChecked||C?ne(s,x,C?A:$p(T._f)):j(x,A),n.mount&&!n.action&&g()}},b=(x,C,w,F,T)=>{let A=!1,O=!1,Y={name:x};if(!t.disabled){if(!w||F){(u.isDirty||f.isDirty)&&(O=a.isDirty,a.isDirty=Y.isDirty=U(),A=O!==Y.isDirty);let X=Qt(E(o,x),C);O=!!E(a.dirtyFields,x),X?Le(a.dirtyFields,x):ne(a.dirtyFields,x,!0),Y.dirtyFields=a.dirtyFields,A=A||(u.dirtyFields||f.dirtyFields)&&O!==!X}if(w){let X=E(a.touchedFields,x);X||(ne(a.touchedFields,x,w),Y.touchedFields=a.touchedFields,A=A||(u.touchedFields||f.touchedFields)&&X!==w)}A&&T&&c.state.next(Y)}return A?Y:{}},D=(x,C,w,F)=>{let T=E(a.errors,x),A=(u.isValid||f.isValid)&&ht(C)&&a.isValid!==C;if(t.delayError&&w?(d=m(()=>y(x,w)),d(t.delayError)):(clearTimeout(l),d=null,w?ne(a.errors,x,w):Le(a.errors,x)),(w?!Qt(T,w):T)||!Ee(F)||A){let O=P(h(h({},F),A&&ht(C)?{isValid:C}:{}),{errors:a.errors,name:x});a=h(h({},a),O),c.state.next(O)}},M=x=>de(null,null,function*(){L(x,!0);let C=yield t.resolver(s,t.context,uy(x||i.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return L(x),C}),R=x=>de(null,null,function*(){let{errors:C}=yield M(x);if(x)for(let w of x){let F=E(C,w);F?ne(a.errors,w,F):Le(a.errors,w)}else a.errors=C;return C}),k=(F,T,...A)=>de(null,[F,T,...A],function*(x,C,w={valid:!0}){for(let Y in x){let X=x[Y];if(X){let O=X,{_f:me}=O,Jt=$(O,["_f"]);if(me){let Qe=i.array.has(me.name),Ro=X._f&&dy(X._f);Ro&&u.validatingFields&&L([me.name],!0);let Mt=yield Jp(X,i.disabled,s,p,t.shouldUseNativeValidation&&!C,Qe);if(Ro&&u.validatingFields&&L([me.name]),Mt[me.name]&&(w.valid=!1,C))break;!C&&(E(Mt,me.name)?Qe?gy(a.errors,Mt,me.name):ne(a.errors,me.name,Mt[me.name]):Le(a.errors,me.name))}!Ee(Jt)&&(yield k(Jt,C,w))}}return w.valid}),V=()=>{for(let x of i.unMount){let C=E(r,x);C&&(C._f.refs?C._f.refs.every(w=>!Ll(w)):!Ll(C._f.ref))&&vn(x)}i.unMount=new Set},U=(x,C)=>!t.disabled&&(x&&C&&ne(s,x,C),!Qt(Re(),o)),z=(x,C,w)=>ry(x,i,h({},n.mount?s:he(C)?o:Ge(x)?{[x]:C}:C),w,C),q=x=>Sl(E(n.mount?s:o,x,t.shouldUnregister?E(o,x,[]):[])),j=(x,C,w={})=>{let F=E(r,x),T=C;if(F){let A=F._f;A&&(!A.disabled&&ne(s,x,im(C,A)),T=gn(A.ref)&&He(C)?"":C,om(A.ref)?[...A.ref.options].forEach(O=>O.selected=T.includes(O.value)):A.refs?vo(A.ref)?A.refs.forEach(O=>{(!O.defaultChecked||!O.disabled)&&(Array.isArray(T)?O.checked=!!T.find(Y=>Y===O.value):O.checked=T===O.value||!!T)}):A.refs.forEach(O=>O.checked=O.value===T):wl(A.ref)?A.ref.value="":(A.ref.value=T,A.ref.type||c.state.next({name:x,values:Pe(s)})))}(w.shouldDirty||w.shouldTouch)&&b(x,T,w.shouldTouch,w.shouldDirty,!0),w.shouldValidate&&ue(x)},Q=(x,C,w)=>{for(let F in C){if(!C.hasOwnProperty(F))return;let T=C[F],A=x+"."+F,O=E(r,A);(i.array.has(x)||ye(T)||O&&!O._f)&&!wa(T)?Q(A,T,w):j(A,T,w)}},ee=(x,C,w={})=>{let F=E(r,x),T=i.array.has(x),A=Pe(C);ne(s,x,A),T?(c.array.next({name:x,values:Pe(s)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&w.shouldDirty&&c.state.next({name:x,dirtyFields:hr(o,s),isDirty:U(x,A)})):F&&!F._f&&!He(A)?Q(x,A,w):j(x,A,w),Zp(x,i)&&c.state.next(P(h({},a),{name:x})),c.state.next({name:n.mount?x:void 0,values:Pe(s)})},W=x=>de(null,null,function*(){n.mount=!0;let C=x.target,w=C.name,F=!0,T=E(r,w),A=X=>{F=Number.isNaN(X)||wa(X)&&isNaN(X.getTime())||Qt(X,E(s,w,X))},O=Kp(t.mode),Y=Kp(t.reValidateMode);if(T){let X,me,Jt=C.type?$p(T._f):YL(x),Qe=x.type===qp.BLUR||x.type===qp.FOCUS_OUT,Ro=!fy(T._f)&&!t.resolver&&!E(a.errors,w)&&!T._f.deps||my(Qe,E(a.touchedFields,w),a.isSubmitted,Y,O),Mt=Zp(w,i,Qe);ne(s,w,Jt),Qe?(!C||!C.readOnly)&&(T._f.onBlur&&T._f.onBlur(x),d&&d(0)):T._f.onChange&&T._f.onChange(x);let Pn=b(w,Jt,Qe),Im=!Ee(Pn)||Mt;if(!Qe&&c.state.next({name:w,type:x.type,values:Pe(s)}),Ro)return(u.isValid||f.isValid)&&(t.mode==="onBlur"?Qe&&g():Qe||g()),Im&&c.state.next(h({name:w},Mt?{}:Pn));if(!Qe&&Mt&&c.state.next(h({},a)),t.resolver){let{errors:El}=yield M([w]);if(A(Jt),F){let Sm=Yp(a.errors,r,w),kl=Yp(El,r,Sm.name||w);X=kl.error,w=kl.name,me=Ee(El)}}else L([w],!0),X=(yield Jp(T,i.disabled,s,p,t.shouldUseNativeValidation))[w],L([w]),A(Jt),F&&(X?me=!1:(u.isValid||f.isValid)&&(me=yield k(r,!0)));F&&(T._f.deps&&(!Array.isArray(T._f.deps)||T._f.deps.length>0)&&ue(T._f.deps),D(w,me,X,Pn))}}),ae=(x,C)=>{if(E(a.errors,C)&&x.focus)return x.focus(),1},ue=(w,...F)=>de(null,[w,...F],function*(x,C={}){let T,A,O=Io(x);if(t.resolver){let Y=yield R(he(x)?x:O);T=Ee(Y),A=x?!O.some(X=>E(Y,X)):T}else x?(A=(yield Promise.all(O.map(Y=>de(null,null,function*(){let X=E(r,Y);return yield k(X&&X._f?{[Y]:X}:X)})))).every(Boolean),!(!A&&!a.isValid)&&g()):A=T=yield k(r);return c.state.next(P(h(h({},!Ge(x)||(u.isValid||f.isValid)&&T!==a.isValid?{}:{name:x}),t.resolver||!x?{isValid:T}:{}),{errors:a.errors})),C.shouldFocus&&!A&&So(r,ae,x?O:i.mount),A}),Re=(x,C)=>{let w=h({},n.mount?s:o);return C&&(w=rm(C.dirtyFields?a.dirtyFields:a.touchedFields,w)),he(x)?w:Ge(x)?E(w,x):x.map(F=>E(w,F))},ge=(x,C)=>({invalid:!!E((C||a).errors,x),isDirty:!!E((C||a).dirtyFields,x),error:E((C||a).errors,x),isValidating:!!E(a.validatingFields,x),isTouched:!!E((C||a).touchedFields,x)}),Ye=x=>{x&&Io(x).forEach(C=>Le(a.errors,C)),c.state.next({errors:x?a.errors:{}})},it=(x,C,w)=>{let F=(E(r,x,{_f:{}})._f||{}).ref,me=E(a.errors,x)||{},{ref:A,message:O,type:Y}=me,X=$(me,["ref","message","type"]);ne(a.errors,x,P(h(h({},X),C),{ref:F})),c.state.next({name:x,errors:a.errors,isValid:!1}),w&&w.shouldFocus&&F&&F.focus&&F.focus()},ba=(x,C)=>nt(x)?c.state.subscribe({next:w=>"values"in w&&x(z(void 0,C),w)}):z(x,C,!0),gr=x=>c.state.subscribe({next:C=>{py(x.name,C.name,x.exact)&&cy(C,x.formState||u,Cm,x.reRenderRoot)&&x.callback(P(h(h({values:h({},s)},a),C),{defaultValues:o}))}}).unsubscribe,gm=x=>(n.mount=!0,f=h(h({},f),x.formState),gr(P(h({},x),{formState:f}))),vn=(x,C={})=>{for(let w of x?Io(x):i.mount)i.mount.delete(w),i.array.delete(w),C.keepValue||(Le(r,w),Le(s,w)),!C.keepError&&Le(a.errors,w),!C.keepDirty&&Le(a.dirtyFields,w),!C.keepTouched&&Le(a.touchedFields,w),!C.keepIsValidating&&Le(a.validatingFields,w),!t.shouldUnregister&&!C.keepDefaultValue&&Le(o,w);c.state.next({values:Pe(s)}),c.state.next(h(h({},a),C.keepDirty?{isDirty:U()}:{})),!C.keepIsValid&&g()},Rl=({disabled:x,name:C})=>{(ht(x)&&n.mount||x||i.disabled.has(C))&&(x?i.disabled.add(C):i.disabled.delete(C))},wn=(x,C={})=>{let w=E(r,x),F=ht(C.disabled)||ht(t.disabled);return ne(r,x,P(h({},w||{}),{_f:h(P(h({},w&&w._f?w._f:{ref:{name:x}}),{name:x,mount:!0}),C)})),i.mount.add(x),w?Rl({disabled:ht(C.disabled)?C.disabled:t.disabled,name:x}):v(x,!0,C.value),P(h(h({},F?{disabled:C.disabled||t.disabled}:{}),t.progressive?{required:!!C.required,min:Co(C.min),max:Co(C.max),minLength:Co(C.minLength),maxLength:Co(C.maxLength),pattern:Co(C.pattern)}:{}),{name:x,onChange:W,onBlur:W,ref:T=>{if(T){wn(x,C),w=E(r,x);let A=he(T.value)&&T.querySelectorAll&&T.querySelectorAll("input,select,textarea")[0]||T,O=sy(A),Y=w._f.refs||[];if(O?Y.find(X=>X===A):A===w._f.ref)return;ne(r,x,{_f:h(h({},w._f),O?{refs:[...Y.filter(Ll),A,...Array.isArray(E(o,x))?[{}]:[]],ref:{type:A.type,name:x}}:{ref:A})}),v(x,!1,void 0,A)}else w=E(r,x,{}),w._f&&(w._f.mount=!1),(t.shouldUnregister||C.shouldUnregister)&&!(JL(i.array,x)&&n.action)&&i.unMount.add(x)}})},bn=()=>t.shouldFocusError&&So(r,ae,i.mount),xm=x=>{ht(x)&&(c.state.next({disabled:x}),So(r,(C,w)=>{let F=E(r,w);F&&(C.disabled=F._f.disabled||x,Array.isArray(F._f.refs)&&F._f.refs.forEach(T=>{T.disabled=F._f.disabled||x}))},0,!1))},Al=(x,C)=>w=>de(null,null,function*(){let F;w&&(w.preventDefault&&w.preventDefault(),w.persist&&w.persist());let T=Pe(s);if(c.state.next({isSubmitting:!0}),t.resolver){let{errors:A,values:O}=yield M();a.errors=A,T=Pe(O)}else yield k(r);if(i.disabled.size)for(let A of i.disabled)Le(T,A);if(Le(a.errors,"root"),Ee(a.errors)){c.state.next({errors:{}});try{yield x(T,w)}catch(A){F=A}}else C&&(yield C(h({},a.errors),w)),bn(),setTimeout(bn);if(c.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ee(a.errors)&&!F,submitCount:a.submitCount+1,errors:a.errors}),F)throw F}),Lm=(x,C={})=>{E(r,x)&&(he(C.defaultValue)?ee(x,Pe(E(o,x))):(ee(x,C.defaultValue),ne(o,x,Pe(C.defaultValue))),C.keepTouched||Le(a.touchedFields,x),C.keepDirty||(Le(a.dirtyFields,x),a.isDirty=C.defaultValue?U(x,Pe(E(o,x))):U()),C.keepError||(Le(a.errors,x),u.isValid&&g()),c.state.next(h({},a)))},Tl=(x,C={})=>{let w=x?Pe(x):o,F=Pe(w),T=Ee(x),A=T?o:F;if(C.keepDefaultValues||(o=w),!C.keepValues){if(C.keepDirtyValues){let O=new Set([...i.mount,...Object.keys(hr(o,s))]);for(let Y of Array.from(O))E(a.dirtyFields,Y)?ne(A,Y,E(s,Y)):ee(Y,E(A,Y))}else{if(Il&&he(x))for(let O of i.mount){let Y=E(r,O);if(Y&&Y._f){let X=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(gn(X)){let me=X.closest("form");if(me){me.reset();break}}}}if(C.keepFieldsRef)for(let O of i.mount)ee(O,E(A,O));else r={}}s=t.shouldUnregister?C.keepDefaultValues?Pe(o):{}:Pe(A),c.array.next({values:h({},A)}),c.state.next({values:h({},A)})}i={mount:C.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},n.mount=!u.isValid||!!C.keepIsValid||!!C.keepDirtyValues||!t.shouldUnregister&&!Ee(A),n.watch=!!t.shouldUnregister,c.state.next({submitCount:C.keepSubmitCount?a.submitCount:0,isDirty:T?!1:C.keepDirty?a.isDirty:!!(C.keepDefaultValues&&!Qt(x,o)),isSubmitted:C.keepIsSubmitted?a.isSubmitted:!1,dirtyFields:T?{}:C.keepDirtyValues?C.keepDefaultValues&&s?hr(o,s):a.dirtyFields:C.keepDefaultValues&&x?hr(o,x):C.keepDirty?a.dirtyFields:{},touchedFields:C.keepTouched?a.touchedFields:{},errors:C.keepErrors?a.errors:{},isSubmitSuccessful:C.keepIsSubmitSuccessful?a.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Dl=(x,C)=>Tl(nt(x)?x(s):x,C),ym=(x,C={})=>{let w=E(r,x),F=w&&w._f;if(F){let T=F.refs?F.refs[0]:F.ref;T.focus&&(T.focus(),C.shouldSelect&&nt(T.select)&&T.select())}},Cm=x=>{a=h(h({},a),x)},Ml={control:{register:wn,unregister:vn,getFieldState:ge,handleSubmit:Al,setError:it,_subscribe:gr,_runSchema:M,_focusError:bn,_getWatch:z,_getDirty:U,_setValid:g,_setFieldArray:S,_setDisabledField:Rl,_setErrors:I,_getFieldArray:q,_reset:Tl,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(x=>{Dl(x,t.resetOptions),c.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:xm,_subjects:c,_proxyFormState:u,get _fields(){return r},get _formValues(){return s},get _state(){return n},set _state(x){n=x},get _defaultValues(){return o},get _names(){return i},set _names(x){i=x},get _formState(){return a},get _options(){return t},set _options(x){t=h(h({},t),x)}},subscribe:gm,trigger:ue,register:wn,handleSubmit:Al,watch:ba,setValue:ee,getValues:Re,reset:Dl,resetField:Lm,clearErrors:Ye,unregister:vn,setError:it,setFocus:ym,getFieldState:ge};return P(h({},Ml),{formControl:Ml})}function um(e={}){let t=ke.default.useRef(void 0),a=ke.default.useRef(void 0),[r,o]=ke.default.useState({isDirty:!1,isValidating:!1,isLoading:nt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current=P(h({},e.formControl),{formState:r}),e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let n=Ly(e),{formControl:i}=n,d=$(n,["formControl"]);t.current=P(h({},d),{formState:r})}let s=t.current.control;return s._options=e,ay(()=>{let i=s._subscribe({formState:s._proxyFormState,callback:()=>o(h({},s._formState)),reRenderRoot:!0});return o(d=>P(h({},d),{isReady:!0})),s._formState.isReady=!0,i},[s]),ke.default.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ke.default.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ke.default.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ke.default.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ke.default.useEffect(()=>{if(s._proxyFormState.isDirty){let i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),ke.default.useEffect(()=>{var i;e.values&&!Qt(e.values,a.current)?(s._reset(e.values,h({keepFieldsRef:!0},s._options.resetOptions)),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),a.current=e.values,o(d=>h({},d))):s._resetDefaultValues()},[s,e.values]),ke.default.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next(h({},s._formState))),s._removeUnmounted()}),t.current.formState=ty(r,s),t.current}var Fe=require("react/jsx-runtime"),yy=e=>{let{openModal:t,setOpenModal:a,methods:r,row:o,record:s}=e,{openSession:n,setOpeningCashBox:i}=Rp(),[d,l]=(0,wo.useState)(""),[u,f]=(0,wo.useState)(!1),c=(0,wo.useMemo)(()=>{var I,v;return{current_session_id:(v=(I=s.current_session_id)==null?void 0:I.id)!=null?v:"",record_id:s==null?void 0:s.id,current_session_state:s.current_session_state,module_pos_restaurant:s.module_pos_restaurant,name:s.name,id:s.id,cash_control:s.cash_control}},[s]),p=()=>e.setOpenModal(!1),m=Tt(),g=I=>(p(),c.module_pos_restaurant?m(`/pos/tables?${Yt.POS_ID}=${c.id}&${Yt.SESSION_ID}=${I}`):m(`/pos/menus?${Yt.POS_ID}=${c.id}&${Yt.SESSION_ID}=${I}`)),L=(I,v)=>de(null,null,function*(){try{yield i.mutateAsync({cashBoxValue:I,sessionId:Number(v)},{onSuccess:()=>{g(v)}})}catch(b){console.error("Error setting opening cash box:",b)}}),S=()=>de(null,null,function*(){f(!0);try{if(c.current_session_state=="opening_control")yield L(Number(d),Number(c.current_session_id));else{let I=yield n.mutateAsync(Number(c.record_id)),v=Object.keys(Object.fromEntries(I));yield L(Number(d),Number(v[0]))}}catch(I){console.error("Error opening session:",I)}finally{f(!1)}}),y=I=>{let v=I.target.value.replace(/\,/g,"");/^\d*$/.test(v)&&l(v)};return(0,Fe.jsx)(Qs,{isOpen:t,onClose:p,className:"",children:(0,Fe.jsxs)(am,P(h({},r),{children:[(0,Fe.jsxs)("div",{className:"flex flex-col gap-6 border-b border-[--stroke-default] w-[500px] p-6 bg-white",children:[(0,Fe.jsxs)("div",{className:"p-3 flex gap-5 items-center",children:[(0,Fe.jsx)("img",{src:"/assets/images/cashier.svg",alt:"POS Icon",className:"size-12"}),(0,Fe.jsx)("p",{className:"text-base text-[#0E121B] font-semibold",children:o.name})]}),(0,Fe.jsxs)("div",{className:"flex flex-col gap-[6px]",children:[(0,Fe.jsxs)("p",{className:"text-sm font-medium",children:[ze("starting_cash_float")," ",(0,Fe.jsx)("span",{className:"text-[--color-error]",children:"*"})]}),(0,Fe.jsx)("input",{type:"text",value:hu(d),onChange:y,onWheel:I=>I.currentTarget.blur(),className:"border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-gray-400 text-sm",placeholder:"0",inputMode:"numeric"})]})]}),(0,Fe.jsxs)("p",{className:"p-4 flex justify-end gap-4 mt-auto",children:[(0,Fe.jsx)($t,{onClick:()=>a(!1),className:"h-[36px] button-secondary",children:ze("cancel_button")}),(0,Fe.jsx)($t,{disabled:!d||u,onClick:S,className:"h-[36px] button-primary",children:ze("open_session")})]})]}))})},yn=yy;var In=require("react");var dm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Pl=e=>{let t=Cy(e);return t.charAt(0).toUpperCase()+t.slice(1)},Cn=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),fm=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var bo=require("react");var cm={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"};var pm=(0,bo.forwardRef)((l,d)=>{var u=l,{color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:n}=u,i=$(u,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return(0,bo.createElement)("svg",h(h(P(h({ref:d},cm),{width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Cn("lucide",o)}),!s&&!fm(i)&&{"aria-hidden":"true"}),i),[...n.map(([f,c])=>(0,bo.createElement)(f,c)),...Array.isArray(s)?s:[s]])});var mm=(e,t)=>{let a=(0,In.forwardRef)((n,s)=>{var i=n,{className:r}=i,o=$(i,["className"]);return(0,In.createElement)(pm,h({ref:s,iconNode:t,className:Cn(`lucide-${dm(Pl(e))}`,`lucide-${e}`,r)},o))});return a.displayName=Pl(e),a};var Iy=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Po=mm("plus",Iy);var Sn=require("react");var te=require("react/jsx-runtime"),Sy=({row:e,columns:t,onClickRow:a,settings_act_id:r,res_model:o})=>{let s=e.pos_session_state==="opened"||e.pos_session_state==="closing_control",n=Tt(),[i,d]=(0,Sn.useState)(!1),l=um({mode:"onBlur"}),u=(0,Sn.useMemo)(()=>new Date(e.last_session_closing_date),[e]),f=()=>{var S;let p=e.module_pos_restaurant,m=e.current_session_id.id,g=e.id,L=(S=fp({[Yt.POS_ID]:g,[Yt.SESSION_ID]:m}))==null?void 0:S.toString();sessionStorage.setItem("enter_pincode",window.location.href.split("console")[1]),localStorage.setItem("backUrl",window.location.href.split("console")[1]),n(`${p?"/pos/tables":"/pos/menus"}?${L}`)},c=p=>de(null,null,function*(){p.stopPropagation(),c({aid:r,id:e==null?void 0:e.id,model:o})});return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)("div",{className:"relative w-full p-4 border border-[--stroke-default] bg-white rounded-xl shadow-sm flex flex-col overflow-hidden min-h-[200px]",onClick:()=>a(t,e),children:[(0,te.jsxs)("div",{className:"flex items-start justify-between",children:[(0,te.jsxs)("div",{className:"flex space-x-2",children:[(0,te.jsx)("img",{src:"/assets/images/cashier.svg",alt:"POS Icon",className:"size-12"}),(0,te.jsx)("p",{className:"text-base text-[#0E121B] font-semibold",children:e.name})]}),(0,te.jsx)("span",{className:`px-3 py-1 rounded-[4px] text-xs font-medium border ${s?"bg-[#E0FAEB] text-[#12AF53] border-[#1FC163]":"bg-[#FFEBEC] text-[#E93544] border-[#FB2B3D]"}`,children:s?ze("opening"):ze("closed")})]}),(0,te.jsx)("div",{className:"relative py-4",children:(0,te.jsx)(rr,{})}),(0,te.jsxs)("div",{className:"text-sm space-y-2 mt-3 flex-grow",children:[e.last_session_closing_date&&(0,te.jsxs)("div",{className:"flex justify-between",children:[(0,te.jsxs)("span",{className:"text-gray-500",children:[" ",s?ze("opening"):ze("closed")]}),(0,te.jsxs)("span",{className:"font-medium text-[#0E121B]",children:[Eo(u)," \u2022 ",ko(u)]})]}),s&&(0,te.jsxs)("div",{className:"flex justify-between",children:[(0,te.jsx)("span",{className:"text-gray-500",children:ze("balance")}),(0,te.jsxs)("span",{className:"font-medium text-[#0E121B]",children:[e.last_session_closing_cash.toLocaleString("vi-VN"),"\u0111"]})]})]}),(0,te.jsxs)("div",{className:"flex justify-end mt-auto pt-4 gap-[10px]",children:[(0,te.jsxs)("button",{onClick:p=>de(null,null,function*(){c(p)}),type:"button",className:"button-secondary flex gap-2 items-center",children:[(0,te.jsx)(wp,{}),(0,te.jsx)("span",{children:ze("setting")})]}),s?(0,te.jsx)("button",{onClick:p=>{p.stopPropagation(),f()},className:"button-primary",children:ze("continue_selling")}):(0,te.jsxs)("button",{onClick:p=>{p.stopPropagation(),d(!0)},className:"button-primary min-w-[150px] flex gap-2 items-center justify-center",children:[(0,te.jsx)(Po,{className:"w-4 h-4"}),ze("open_session")]})]})]}),i&&(0,te.jsx)(yn,{openModal:i,setOpenModal:d,methods:l,row:e,record:e})]})},hm=Sy;0&&(module.exports={EMenuLink,KitchenTemplate,OpenSessionModal,PosOrderTemplate,PosTemplate});
10
+ /*! Bundled license information:
11
+
12
+ qrcode.react/lib/esm/index.js:
13
+ (**
14
+ * @license QR Code generator library (TypeScript)
15
+ * Copyright (c) Project Nayuki.
16
+ * SPDX-License-Identifier: MIT
17
+ *)
18
+ (**
19
+ * @license qrcode.react
20
+ * Copyright (c) Paul O'Shannessy
21
+ * SPDX-License-Identifier: ISC
22
+ *)
23
+
24
+ @remix-run/router/dist/router.js:
25
+ (**
26
+ * @remix-run/router v1.23.1
27
+ *
28
+ * Copyright (c) Remix Software Inc.
29
+ *
30
+ * This source code is licensed under the MIT license found in the
31
+ * LICENSE.md file in the root directory of this source tree.
32
+ *
33
+ * @license MIT
34
+ *)
35
+
36
+ react-router/dist/index.js:
37
+ (**
38
+ * React Router v6.30.2
39
+ *
40
+ * Copyright (c) Remix Software Inc.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE.md file in the root directory of this source tree.
44
+ *
45
+ * @license MIT
46
+ *)
47
+
48
+ react-router-dom/dist/index.js:
49
+ (**
50
+ * React Router DOM v6.30.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ *)
59
+
60
+ lucide-react/dist/esm/shared/src/utils.js:
61
+ lucide-react/dist/esm/defaultAttributes.js:
62
+ lucide-react/dist/esm/Icon.js:
63
+ lucide-react/dist/esm/createLucideIcon.js:
64
+ lucide-react/dist/esm/icons/plus.js:
65
+ lucide-react/dist/esm/lucide-react.js:
66
+ (**
67
+ * @license lucide-react v0.553.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ *)
72
+ */
2
73
  //# sourceMappingURL=index.js.map