@sap-ux/ui-components
Version:
SAP UI Components Library
3 lines (2 loc) • 29.6 kB
JavaScript
(()=>{var Ie=Object.defineProperty,xe=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var Me=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var D=(e,r,t)=>r in e?Ie(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Z=(e,r)=>{for(var t in r||(r={}))Me.call(r,t)&&D(e,t,r[t]);if(H)for(var t of H(r))Pe.call(r,t)&&D(e,t,r[t]);return e},G=(e,r)=>xe(e,Te(r));var T=(e,r,t)=>D(e,typeof r!="symbol"?r+"":r,t);var I=(e,r,t)=>new Promise((i,n)=>{var a=c=>{try{s(t.next(c))}catch(f){n(f)}},o=c=>{try{s(t.throw(c))}catch(f){n(f)}},s=c=>c.done?i(c.value):Promise.resolve(c.value).then(a,o);s((t=t.apply(e,r)).next())});const _t={};var pe=class{constructor(){T(this,"registryByUrl",new Map);T(this,"registryById",new Map)}clear(){this.registryByUrl.clear(),this.registryById.clear()}keys(){return this.registryByUrl.keys()}add(e){this.registryByUrl.set(e.url,e),this.registryById.set(e.id,e)}register(e,r,t,i,n){let a=typeof e=="object"?e.type:e;if(typeof e=="object"){let o=e;if(o instanceof q||o instanceof F||o instanceof Q||o instanceof U)throw new TypeError(`[vitest] Cannot register a mock that is already defined. Expected a JSON representation from \`MockedModule.toJSON\`, instead got "${o.type}". Use "registry.add()" to update a mock instead.`);if(o.type==="automock"){let s=q.fromJSON(o);return this.add(s),s}else if(o.type==="autospy"){let s=F.fromJSON(o);return this.add(s),s}else if(o.type==="redirect"){let s=U.fromJSON(o);return this.add(s),s}else throw o.type==="manual"?new Error("Cannot set serialized manual mock. Define a factory function manually with `ManualMockedModule.fromJSON()`."):new Error(`Unknown mock type: ${o.type}`)}if(typeof r!="string")throw new TypeError("[vitest] Mocks require a raw string.");if(typeof i!="string")throw new TypeError("[vitest] Mocks require a url string.");if(typeof t!="string")throw new TypeError("[vitest] Mocks require an id string.");if(a==="manual"){if(typeof n!="function")throw new TypeError("[vitest] Manual mocks require a factory function.");let o=new Q(r,t,i,n);return this.add(o),o}else if(a==="automock"||a==="autospy"){let o=a==="automock"?new q(r,t,i):new F(r,t,i);return this.add(o),o}else if(a==="redirect"){if(typeof n!="string")throw new TypeError("[vitest] Redirect mocks require a redirect string.");let o=new U(r,t,i,n);return this.add(o),o}else throw new Error(`[vitest] Unknown mock type: ${a}`)}delete(e){this.registryByUrl.delete(e)}get(e){return this.registryByUrl.get(e)}getById(e){return this.registryById.get(e)}has(e){return this.registryByUrl.has(e)}},q=class{constructor(e,r,t){T(this,"type","automock");this.raw=e,this.id=r,this.url=t}static fromJSON(e){return new F(e.raw,e.id,e.url)}toJSON(){return{type:this.type,url:this.url,raw:this.raw,id:this.id}}},F=class he{constructor(r,t,i){T(this,"type","autospy");this.raw=r,this.id=t,this.url=i}static fromJSON(r){return new he(r.raw,r.id,r.url)}toJSON(){return{type:this.type,url:this.url,id:this.id,raw:this.raw}}},U=class ye{constructor(r,t,i,n){T(this,"type","redirect");this.raw=r,this.id=t,this.url=i,this.redirect=n}static fromJSON(r){return new ye(r.raw,r.id,r.url,r.redirect)}toJSON(){return{type:this.type,url:this.url,raw:this.raw,id:this.id,redirect:this.redirect}}},Q=class me{constructor(r,t,i,n){T(this,"cache");T(this,"type","manual");this.raw=r,this.id=t,this.url=i,this.factory=n}resolve(){return I(this,null,function*(){if(this.cache)return this.cache;let r;try{r=yield this.factory()}catch(t){let i=new Error('[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock');throw i.cause=t,i}if(r===null||typeof r!="object"||Array.isArray(r))throw new TypeError(`[vitest] vi.mock("${this.raw}", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?`);return this.cache=r})}static fromJSON(r,t){return new me(r.raw,r.id,r.url,t)}toJSON(){return{type:this.type,url:this.url,id:this.id,raw:this.raw}}};function Re(e,r,t={}){let i=new Array,n=new $e,a=(c,f,y)=>{try{return c[f]=y,!0}catch(m){return!1}},o=(c,f)=>{let y=z(c),m=y==="Module"||!!c.__esModule;for(let{key:v,descriptor:b}of ee(c,m,e.globalConstructors)){if(!m&&b.get){try{Object.defineProperty(f,v,b)}catch(A){}continue}if(Ae(v,y))continue;let g=c[v],l=n.getId(g);if(l!==void 0){i.push(()=>a(f,v,n.getMockedValue(l)));continue}let u=z(g);if(Array.isArray(g)){a(f,v,[]);continue}let M=u.includes("Function")&&typeof g=="function";if((!M||g._isMockFunction)&&u!=="Object"&&u!=="Module"){a(f,v,g);continue}if(a(f,v,M?g:{})){if(M){let A=function(){if(this instanceof f[v])for(let{key:x,descriptor:O}of ee(this,!1,e.globalConstructors)){if(O.get)continue;let N=this[x];if(z(N).includes("Function")&&typeof N=="function"){let p=this[x],h=E(this,x).mockImplementation(p),X=h.mockReset;h.mockRestore=h.mockReset=()=>(X.call(h),h.mockImplementation(p),h)}}};if(!e.spyOn)throw new Error("[@vitest/mocker] `spyOn` is not defined. This is a Vitest error. Please open a new issue with reproduction.");let E=e.spyOn,R=E(f,v);if(e.type==="automock"){R.mockImplementation(A);let x=R.mockReset;R.mockRestore=R.mockReset=()=>(x.call(R),R.mockImplementation(A),R)}Object.defineProperty(f[v],"length",{value:0})}n.track(g,f[v]),o(g,f[v])}}},s=t;o(r,s);for(let c of i)c();return s}var $e=class{constructor(){T(this,"idMap",new Map);T(this,"mockedValueMap",new Map)}getId(e){return this.idMap.get(e)}getMockedValue(e){return this.mockedValueMap.get(e)}track(e,r){let t=this.idMap.size;return this.idMap.set(e,t),this.mockedValueMap.set(t,r),t}};function z(e){return Object.prototype.toString.apply(e).slice(8,-1)}function Ae(e,r){return r.includes("Function")&&typeof e=="string"&&["arguments","callee","caller","length","name"].includes(e)}function ee(e,r,t){let{Map:i,Object:n,Function:a,RegExp:o,Array:s}=t,c=new i,f=e;do{if(f===n.prototype||f===a.prototype||f===o.prototype)break;Oe(f,y=>{let m=n.getOwnPropertyDescriptor(f,y);m&&c.set(y,{key:y,descriptor:m})})}while(f=n.getPrototypeOf(f));if(r&&!c.has("default")&&"default"in e){let y=n.getOwnPropertyDescriptor(e,"default");y&&c.set("default",{key:"default",descriptor:y})}return s.from(c.values())}function Oe(e,r){let t=typeof r=="function"?r:i=>r.add(i);Object.getOwnPropertyNames(e).forEach(t),Object.getOwnPropertySymbols(e).forEach(t)}var Ce=/^[A-Za-z]:\//;function ge(e=""){return e&&e.replace(/\\/g,"/").replace(Ce,r=>r.toUpperCase())}var Ne=/^[/\\]{2}/,Le=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Je=/^[A-Za-z]:$/,Be=/.(\.[^./]+|\.)$/,Xe=function(e){if(e.length===0)return".";e=ge(e);let r=e.match(Ne),t=te(e),i=e[e.length-1]==="/";return e=Fe(e,!t),e.length===0?t?"/":i?"./":".":(i&&(e+="/"),Je.test(e)&&(e+="/"),r?t?`//${e}`:`//./${e}`:t&&!te(e)?`/${e}`:e)},qe=function(...e){let r="";for(let t of e)if(t)if(r.length>0){let i=r[r.length-1]==="/",n=t[0]==="/";i&&n?r+=t.slice(1):r+=i||n?t:`/${t}`}else r+=t;return Xe(r)};function Fe(e,r){let t="",i=0,n=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(n===s-1||a===1))if(a===2){if(t.length<2||i!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=s,a=0;continue}else if(t.length>0){t="",i=0,n=s,a=0;continue}}r&&(t+=t.length>0?"/..":"..",i=2)}else t.length>0?t+=`/${e.slice(n+1,s)}`:t=e.slice(n+1,s),i=s-n-1;n=s,a=0}else o==="."&&a!==-1?++a:a=-1}return t}var te=function(e){return Le.test(e)},Ue=function(e){if(e==="..")return"";let r=Be.exec(ge(e));return r&&r[1]||""},De={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},ze=Object.entries(De);function Y(e){return String(e)}Y.open="";Y.close="";function Ve(e=!1){let r=typeof process<"u"?process:void 0,t=(r==null?void 0:r.env)||{},i=(r==null?void 0:r.argv)||[];return!("NO_COLOR"in t||i.includes("--no-color"))&&("FORCE_COLOR"in t||i.includes("--color")||(r==null?void 0:r.platform)==="win32"||e&&t.TERM!=="dumb"||"CI"in t)||typeof window<"u"&&!!window.chrome}function We(e=!1){let r=Ve(e),t=(o,s,c,f)=>{let y="",m=0;do y+=o.substring(m,f)+c,m=f+s.length,f=o.indexOf(s,m);while(~f);return y+o.substring(m)},i=(o,s,c=o)=>{let f=y=>{let m=String(y),v=m.indexOf(s,o.length);return~v?o+t(m,s,c,v)+s:o+m+s};return f.open=o,f.close=s,f},n={isColorSupported:r},a=o=>`\x1B[${o}m`;for(let[o,s]of ze)n[o]=r?i(a(s[0]),a(s[1]),s[2]):Y;return n}We();function we(e,r){return r.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(i){if(i!=="default"&&!(i in e)){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})}),Object.freeze(e)}function ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re={exports:{}},k={},ne;function je(){if(ne)return k;ne=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.view_transition"),b=Symbol.for("react.client.reference");function g(l){if(typeof l=="object"&&l!==null){var u=l.$$typeof;switch(u){case e:switch(l=l.type,l){case t:case n:case i:case c:case f:case v:return l;default:switch(l=l&&l.$$typeof,l){case o:case s:case m:case y:return l;case a:return l;default:return u}}case r:return u}}}return k.ContextConsumer=a,k.ContextProvider=o,k.Element=e,k.ForwardRef=s,k.Fragment=t,k.Lazy=m,k.Memo=y,k.Portal=r,k.Profiler=n,k.StrictMode=i,k.Suspense=c,k.SuspenseList=f,k.isContextConsumer=function(l){return g(l)===a},k.isContextProvider=function(l){return g(l)===o},k.isElement=function(l){return typeof l=="object"&&l!==null&&l.$$typeof===e},k.isForwardRef=function(l){return g(l)===s},k.isFragment=function(l){return g(l)===t},k.isLazy=function(l){return g(l)===m},k.isMemo=function(l){return g(l)===y},k.isPortal=function(l){return g(l)===r},k.isProfiler=function(l){return g(l)===n},k.isStrictMode=function(l){return g(l)===i},k.isSuspense=function(l){return g(l)===c},k.isSuspenseList=function(l){return g(l)===f},k.isValidElementType=function(l){return typeof l=="string"||typeof l=="function"||l===t||l===n||l===i||l===c||l===f||typeof l=="object"&&l!==null&&(l.$$typeof===m||l.$$typeof===y||l.$$typeof===o||l.$$typeof===a||l.$$typeof===s||l.$$typeof===b||l.getModuleId!==void 0)},k.typeOf=g,k}var ie;function Ye(){return ie||(ie=1,re.exports=je()),re.exports}var ke=Ye(),Ke=ve(ke),He=we({__proto__:null,default:Ke},[ke]),oe={exports:{}},w={},se;function Ze(){if(se)return w;se=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function l(u){if(typeof u=="object"&&u!==null){var M=u.$$typeof;switch(M){case e:switch(u=u.type,u){case t:case n:case i:case f:case y:return u;default:switch(u=u&&u.$$typeof,u){case s:case o:case c:case v:case m:case a:return u;default:return M}}case r:return M}}}return w.ContextConsumer=o,w.ContextProvider=a,w.Element=e,w.ForwardRef=c,w.Fragment=t,w.Lazy=v,w.Memo=m,w.Portal=r,w.Profiler=n,w.StrictMode=i,w.Suspense=f,w.SuspenseList=y,w.isAsyncMode=function(){return!1},w.isConcurrentMode=function(){return!1},w.isContextConsumer=function(u){return l(u)===o},w.isContextProvider=function(u){return l(u)===a},w.isElement=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===e},w.isForwardRef=function(u){return l(u)===c},w.isFragment=function(u){return l(u)===t},w.isLazy=function(u){return l(u)===v},w.isMemo=function(u){return l(u)===m},w.isPortal=function(u){return l(u)===r},w.isProfiler=function(u){return l(u)===n},w.isStrictMode=function(u){return l(u)===i},w.isSuspense=function(u){return l(u)===f},w.isSuspenseList=function(u){return l(u)===y},w.isValidElementType=function(u){return typeof u=="string"||typeof u=="function"||u===t||u===n||u===i||u===f||u===y||u===b||typeof u=="object"&&u!==null&&(u.$$typeof===v||u.$$typeof===m||u.$$typeof===a||u.$$typeof===o||u.$$typeof===c||u.$$typeof===g||u.getModuleId!==void 0)},w.typeOf=l,w}var ae;function Ge(){return ae||(ae=1,oe.exports=Ze()),oe.exports}var Se=Ge(),Qe=ve(Se),et=we({__proto__:null,default:Qe},[Se]),tt=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"];Object.fromEntries(tt.map(e=>[e,r=>et[e](r)||He[e](r)]));var rt=()=>"Promise{\u2026}";try{let{getPromiseDetails:e,kPending:r,kRejected:t}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(rt=(i,n)=>{let[a,o]=e(i);return a===r?"Promise{<pending>}":`Promise${a===t?"!":""}{${n.inspect(o,n)}}`})}catch(e){}function nt(e){let{message:r="$$stack trace error",stackTraceLimit:t=1}=e||{},i=Error.stackTraceLimit,n=Error.prepareStackTrace;Error.stackTraceLimit=t,Error.prepareStackTrace=o=>o.stack;let a=new Error(r).stack||"";return Error.prepareStackTrace=n,Error.stackTraceLimit=i,a}var V,le;function it(){if(le)return V;le=1;var e,r,t,i,n,a,o,s,c,f,y,m,v,b,g,l,u,M,A;return v=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy,m=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy,g=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,y=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,l=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,A=/[\t\v\f\ufeff\p{Zs}]+/uy,s=/\r?\n|[\r\u2028\u2029]/y,c=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,b=/\/\/.*/y,t=/[<>.:={}]|\/(?![\/*])/y,r=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy,i=/(['"])(?:(?!\1)[^])*(\1)?/y,n=/[^<>{}]+/y,M=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,u=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,a=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,o=/^(?:return|throw|yield)$/,f=RegExp(s.source),V=function*(E,{jsx:R=!1}={}){var x,O,N,p,h,X,d,$,K,P,L,S,J,_;for({length:X}=E,p=0,h="",_=[{tag:"JS"}],x=[],L=0,S=!1;p<X;){switch($=_[_.length-1],$.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(E[p]==="/"&&(M.test(h)||a.test(h))&&(v.lastIndex=p,d=v.exec(E))){p=v.lastIndex,h=d[0],S=!0,yield{type:"RegularExpressionLiteral",value:d[0],closed:d[1]!==void 0&&d[1]!=="\\"};continue}if(m.lastIndex=p,d=m.exec(E)){switch(J=d[0],K=m.lastIndex,P=J,J){case"(":h==="?NonExpressionParenKeyword"&&_.push({tag:"JSNonExpressionParen",nesting:L}),L++,S=!1;break;case")":L--,S=!0,$.tag==="JSNonExpressionParen"&&L===$.nesting&&(_.pop(),P="?NonExpressionParenEnd",S=!1);break;case"{":m.lastIndex=0,N=!u.test(h)&&(M.test(h)||a.test(h)),x.push(N),S=!1;break;case"}":switch($.tag){case"InterpolationInTemplate":if(x.length===$.nesting){l.lastIndex=p,d=l.exec(E),p=l.lastIndex,h=d[0],d[1]==="${"?(h="?InterpolationInTemplate",S=!1,yield{type:"TemplateMiddle",value:d[0]}):(_.pop(),S=!0,yield{type:"TemplateTail",value:d[0],closed:d[1]==="`"});continue}break;case"InterpolationInJSX":if(x.length===$.nesting){_.pop(),p+=1,h="}",yield{type:"JSXPunctuator",value:"}"};continue}}S=x.pop(),P=S?"?ExpressionBraceEnd":"}";break;case"]":S=!0;break;case"++":case"--":P=S?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(R&&(M.test(h)||a.test(h))){_.push({tag:"JSXTag"}),p+=1,h="<",yield{type:"JSXPunctuator",value:J};continue}S=!1;break;default:S=!1}p=K,h=P,yield{type:"Punctuator",value:J};continue}if(e.lastIndex=p,d=e.exec(E)){switch(p=e.lastIndex,P=d[0],d[0]){case"for":case"if":case"while":case"with":h!=="."&&h!=="?."&&(P="?NonExpressionParenKeyword")}h=P,S=!a.test(d[0]),yield{type:d[1]==="#"?"PrivateIdentifier":"IdentifierName",value:d[0]};continue}if(g.lastIndex=p,d=g.exec(E)){p=g.lastIndex,h=d[0],S=!0,yield{type:"StringLiteral",value:d[0],closed:d[2]!==void 0};continue}if(y.lastIndex=p,d=y.exec(E)){p=y.lastIndex,h=d[0],S=!0,yield{type:"NumericLiteral",value:d[0]};continue}if(l.lastIndex=p,d=l.exec(E)){p=l.lastIndex,h=d[0],d[1]==="${"?(h="?InterpolationInTemplate",_.push({tag:"InterpolationInTemplate",nesting:x.length}),S=!1,yield{type:"TemplateHead",value:d[0]}):(S=!0,yield{type:"NoSubstitutionTemplate",value:d[0],closed:d[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(t.lastIndex=p,d=t.exec(E)){switch(p=t.lastIndex,P=d[0],d[0]){case"<":_.push({tag:"JSXTag"});break;case">":_.pop(),h==="/"||$.tag==="JSXTagEnd"?(P="?JSX",S=!0):_.push({tag:"JSXChildren"});break;case"{":_.push({tag:"InterpolationInJSX",nesting:x.length}),P="?InterpolationInJSX",S=!1;break;case"/":h==="<"&&(_.pop(),_[_.length-1].tag==="JSXChildren"&&_.pop(),_.push({tag:"JSXTagEnd"}))}h=P,yield{type:"JSXPunctuator",value:d[0]};continue}if(r.lastIndex=p,d=r.exec(E)){p=r.lastIndex,h=d[0],yield{type:"JSXIdentifier",value:d[0]};continue}if(i.lastIndex=p,d=i.exec(E)){p=i.lastIndex,h=d[0],yield{type:"JSXString",value:d[0],closed:d[2]!==void 0};continue}break;case"JSXChildren":if(n.lastIndex=p,d=n.exec(E)){p=n.lastIndex,h=d[0],yield{type:"JSXText",value:d[0]};continue}switch(E[p]){case"<":_.push({tag:"JSXTag"}),p++,h="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":_.push({tag:"InterpolationInJSX",nesting:x.length}),p++,h="?InterpolationInJSX",S=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(A.lastIndex=p,d=A.exec(E)){p=A.lastIndex,yield{type:"WhiteSpace",value:d[0]};continue}if(s.lastIndex=p,d=s.exec(E)){p=s.lastIndex,S=!1,o.test(h)&&(h="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:d[0]};continue}if(c.lastIndex=p,d=c.exec(E)){p=c.lastIndex,f.test(d[0])&&(S=!1,o.test(h)&&(h="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:d[0],closed:d[1]!==void 0};continue}if(b.lastIndex=p,d=b.exec(E)){p=b.lastIndex,S=!1,yield{type:"SingleLineComment",value:d[0]};continue}O=String.fromCodePoint(E.codePointAt(p)),p+=O.length,h=O,S=!1,yield{type:$.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:O}}},V}it();var Ee={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(Ee.keyword);new Set(Ee.strict);var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot=new Uint8Array(64),st=new Uint8Array(128);for(let e=0;e<ce.length;e++){let r=ce.charCodeAt(e);ot[e]=r,st[r]=e}var ue;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})(ue||(ue={}));var at=/^[A-Za-z]:\//;function lt(e=""){return e&&e.replace(/\\/g,"/").replace(at,r=>r.toUpperCase())}var ct=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function ut(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}var dt=function(...e){e=e.map(i=>lt(i));let r="",t=!1;for(let i=e.length-1;i>=-1&&!t;i--){let n=i>=0?e[i]:ut();!n||n.length===0||(r=`${n}/${r}`,t=de(n))}return r=ft(r,!t),t&&!de(r)?`/${r}`:r.length>0?r:"."};function ft(e,r){let t="",i=0,n=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o==="/")break;o="/"}if(o==="/"){if(!(n===s-1||a===1))if(a===2){if(t.length<2||i!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=s,a=0;continue}else if(t.length>0){t="",i=0,n=s,a=0;continue}}r&&(t+=t.length>0?"/..":"..",i=2)}else t.length>0?t+=`/${e.slice(n+1,s)}`:t=e.slice(n+1,s),i=s-n-1;n=s,a=0}else o==="."&&a!==-1?++a:a=-1}return t}var de=function(e){return ct.test(e)},_e=/^\s*at .*(?:\S:\d+|\(native\))/m,pt=/^(?:eval@)?(?:\[native code\])?$/;function be(e){if(!e.includes(":"))return[e];let r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!r)return[e];let t=r[1];if(t.startsWith("async ")&&(t=t.slice(6)),t.startsWith("http:")||t.startsWith("https:")){let i=new URL(t);i.searchParams.delete("import"),i.searchParams.delete("browserv"),t=i.pathname+i.hash+i.search}if(t.startsWith("/@fs/")){let i=/^\/@fs\/[a-zA-Z]:\//.test(t);t=t.slice(i?5:4)}return[t,r[2]||void 0,r[3]||void 0]}function ht(e){let r=e.trim();if(pt.test(r)||(r.includes(" > eval")&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!r.includes("@")&&!r.includes(":")))return null;let t=/((.*".+"[^@]*)?[^@]*)(@)/,i=r.match(t),n=i&&i[1]?i[1]:void 0,[a,o,s]=be(r.replace(t,""));return!a||!o||!s?null:{file:a,method:n||"",line:Number.parseInt(o),column:Number.parseInt(s)}}function yt(e){let r=e.trim();return _e.test(r)?mt(r):ht(r)}function mt(e){let r=e.trim();if(!_e.test(r))return null;r.includes("(eval ")&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let t=r.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),i=t.match(/ (\(.+\)$)/);t=i?t.replace(i[0],""):t;let[n,a,o]=be(i?i[1]:t),s=i&&t||"",c=n&&["eval","<anonymous>"].includes(n)?void 0:n;return!c||!a||!o?null:(s.startsWith("async ")&&(s=s.slice(6)),c.startsWith("file://")&&(c=c.slice(7)),c=c.startsWith("node:")||c.startsWith("internal:")?c:dt(c),s&&(s=s.replace(/__vite_ssr_import_\d+__\./g,"")),{method:s,file:c,line:Number.parseInt(a),column:Number.parseInt(o)})}function gt(e){let r=(e==null?void 0:e.globalThisKey)||"__vitest_mocker__";function t(){return typeof globalThis[r]<"u"?globalThis[r]:new Proxy({},{get(n,a){throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(a)}() is forbidden.`)}})}return{hoisted(n){if(typeof n!="function")throw new TypeError(`vi.hoisted() expects a function, but received a ${typeof n}`);return n()},mock(n,a){if(typeof n!="string")throw new TypeError(`vi.mock() expects a string path, but received a ${typeof n}`);let o=C("mock");t().queueMock(n,o,typeof a=="function"?()=>a(()=>t().importActual(n,o)):a)},unmock(n){if(typeof n!="string")throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof n}`);t().queueUnmock(n,C("unmock"))},doMock(n,a){if(typeof n!="string")throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof n}`);let o=C("doMock");t().queueMock(n,o,typeof a=="function"?()=>a(()=>t().importActual(n,o)):a)},doUnmock(n){if(typeof n!="string")throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof n}`);t().queueUnmock(n,C("doUnmock"))},importActual(n){return I(this,null,function*(){return t().importActual(n,C("importActual"))})},importMock(n){return I(this,null,function*(){return t().importMock(n,C("importMock"))})}}}function C(e){let r=nt({stackTraceLimit:5}).split(`
`),t=r.findIndex(n=>n.includes(` at Object.${e}`)||n.includes(`${e}@`)),i=yt(r[t+1]);return(i==null?void 0:i.file)||""}var It=_t.hot||{on:W,off:W,send:W};function W(){console.warn("Vitest mocker cannot work if Vite didn't establish WS connection.")}var{now:fe}=Date,wt=class{constructor(e,r,t,i){T(this,"registry",new pe);T(this,"queue",new Set);T(this,"mockedIds",new Set);this.interceptor=e,this.rpc=r,this.spyOn=t,this.config=i}prepare(){return I(this,null,function*(){this.queue.size&&(yield Promise.all([...this.queue.values()]))})}resolveFactoryModule(e){return I(this,null,function*(){let r=this.registry.get(e);if(!r||r.type!=="manual")throw new Error(`Mock ${e} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);return yield r.resolve()})}getFactoryModule(e){let r=this.registry.get(e);if(!r||r.type!=="manual")throw new Error(`Mock ${e} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);if(!r.cache)throw new Error(`Mock ${e} wasn't resolved. This is probably a Vitest error. Please, open a new issue with reproduction.`);return r.cache}invalidate(){return I(this,null,function*(){let e=Array.from(this.mockedIds);e.length&&(yield this.rpc.invalidate(e),yield this.interceptor.invalidate(),this.registry.clear())})}importActual(e,r){return I(this,null,function*(){let t=yield this.rpc.resolveId(e,r);if(t==null)throw new Error(`[vitest] Cannot resolve "${e}" imported from "${r}"`);let i=Ue(t.id),n=new URL(t.url,location.href),a=`_vitest_original&ext${i}`,o=`${n.pathname}${n.search?`${n.search}&${a}`:`?${a}`}${n.hash}`;return this.wrapDynamicImport(()=>import(o)).then(s=>{if(!t.optimized||typeof s.default>"u")return s;let c=s.default;return c!=null&&c.__esModule?c:G(Z({},typeof c=="object"&&!Array.isArray(c)||typeof c=="function"?c:{}),{default:c})})})}importMock(e,r){return I(this,null,function*(){yield this.prepare();let{resolvedId:t,resolvedUrl:i,redirectUrl:n}=yield this.rpc.resolveMock(e,r,{mock:"auto"}),a=this.resolveMockPath(B(i)),o=this.registry.get(a);if(!o)if(n){let s=new URL(this.resolveMockPath(B(n)),location.href).toString();o=new U(e,t,a,s)}else o=new q(e,t,a);if(o.type==="manual")return yield o.resolve();if(o.type==="automock"||o.type==="autospy"){let s=new URL(`/@id/${t}`,location.href),c=s.search?`${s.search}&t=${fe()}`:`?t=${fe()}`,f=yield import(`${s.pathname}${c}&mock=${o.type}${s.hash}`);return this.mockObject(f,o.type)}return import(o.redirect)})}mockObject(e,r="automock"){return Re({globalConstructors:{Object,Function,Array,Map,RegExp},spyOn:this.spyOn,type:r},e)}queueMock(e,r,t){let i=this.rpc.resolveMock(e,r,{mock:typeof t=="function"?"factory":t!=null&&t.spy?"spy":"auto"}).then(f=>I(this,[f],function*({redirectUrl:n,resolvedId:a,resolvedUrl:o,needsInterop:s,mockType:c}){let y=this.resolveMockPath(B(o));this.mockedIds.add(a);let m=typeof t=="function"?()=>I(this,null,function*(){let g=yield t();return s?{default:g}:g}):void 0,v=typeof n=="string"?new URL(this.resolveMockPath(B(n)),location.href).toString():null,b;c==="manual"?b=this.registry.register("manual",e,a,y,m):c==="autospy"?b=this.registry.register("autospy",e,a,y):c==="redirect"?b=this.registry.register("redirect",e,a,y,v):b=this.registry.register("automock",e,a,y),yield this.interceptor.register(b)})).finally(()=>{this.queue.delete(i)});this.queue.add(i)}queueUnmock(e,r){let t=this.rpc.resolveId(e,r).then(i=>I(this,null,function*(){if(!i)return;let n=this.resolveMockPath(B(i.url));this.mockedIds.add(i.id),this.registry.delete(n),yield this.interceptor.delete(n)})).finally(()=>{this.queue.delete(t)});this.queue.add(t)}wrapDynamicImport(e){return typeof e=="function"?new Promise((r,t)=>{this.prepare().finally(()=>{e().then(r,t)})}):e}resolveMockPath(e){let r=this.config,t=qe("/@fs/",r.root);return e.startsWith(r.root)?e.slice(r.root.length):e.startsWith(t)?e.slice(t.length):e}},vt=/(\?|&)v=\w{8}/;function B(e){return e.replace(vt,"")}var kt=class{constructor(){T(this,"mocks",new pe)}register(e){return I(this,null,function*(){this.mocks.add(e)})}delete(e){return I(this,null,function*(){this.mocks.delete(e)})}invalidate(){return I(this,null,function*(){this.mocks.clear()})}},j=e=>{switch(e){case"resolveId":return Promise.resolve({id:"",url:"",optimized:!1});case"resolveMock":return Promise.resolve({mockType:"dummy",resolvedId:"",resolvedUrl:"",redirectUrl:"",needsInterop:!1});case"invalidate":return Promise.resolve()}},St=class extends wt{queueMock(){}};function Et(e){let r=new St(e("__vitest_mocker__"),{resolveId(i,n){return j("resolveId",{id:i,importer:n})},resolveMock(i,n,a){return j("resolveMock",{id:i,importer:n,options:a})},invalidate(i){return I(this,null,function*(){return j("invalidate",{ids:i})})}},(...i)=>globalThis.__STORYBOOK_MODULE_TEST__.spyOn(...i),{root:""});return globalThis.__vitest_mocker__=r,gt({globalThisKey:"__vitest_mocker__"})}globalThis.__STORYBOOK_MOCKER__=Et(()=>new kt);})();