Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/manager-api

Package Overview
Dependencies
Maintainers
29
Versions
811
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/manager-api - npm Package Compare versions

Comparing version 7.0.0-alpha.57 to 7.0.0-alpha.58

2

dist/index.js

@@ -15,2 +15,2 @@ var jt=Object.create;var Q=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var o in t)Q(e,o,{get:t[o],enumerable:!0})},He=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ht(t))!Ut.call(e,l)&&l!==o&&Q(e,l,{get:()=>t[l],enumerable:!(s=Kt(t,l))||s.enumerable});return e};var b=(e,t,o)=>(o=e!=null?jt(Gt(e)):{},He(t||!e||!e.__esModule?Q(o,"default",{value:e,enumerable:!0}):o,e)),Vt=e=>He(Q({},"__esModule",{value:!0}),e);var Ho={};E(Ho,{ActiveTabs:()=>wo,Consumer:()=>Mt,ManagerContext:()=>B,Provider:()=>se,addons:()=>kt,combineParameters:()=>ge,controlOrMetaKey:()=>mo,controlOrMetaSymbol:()=>yo,eventMatchesShortcut:()=>ho,eventToShortcut:()=>Z,isMacLike:()=>X,isShortcutTaken:()=>go,keyToSymbol:()=>Pt,merge:()=>x,mockChannel:()=>oe,optionOrAltSymbol:()=>ht,shortcutMatchesShortcut:()=>ee,shortcutToHumanString:()=>Po,types:()=>ne.Addon_TypesEnum,useAddonState:()=>Mo,useArgTypes:()=>Ko,useArgs:()=>Lo,useChannel:()=>Nt,useGlobalTypes:()=>Fo,useGlobals:()=>No,useParameter:()=>Do,useSharedState:()=>Ft,useStoryPrepared:()=>ko,useStorybookApi:()=>k,useStorybookState:()=>Oo});module.exports=Vt(Ho);var h=b(require("react")),Dt=b(require("lodash/mergeWith")),C=require("@storybook/core-events");var Ge=require("react"),Ue=({api:e,state:t})=>(0,Ge.createContext)({api:e,state:t});var N=b(require("store2"));var Y=require("telejson"),Ve=e=>{e.fn("set",function(t,o){return e.set(this._area,this._in(t),(0,Y.stringify)(o,{maxDepth:50}))}),e.fn("get",function(t,o){let s=e.get(this._area,this._in(t));return s!==null?(0,Y.parse)(s):o||s})};Ve(N.default._);var $e="@storybook/manager/store";function ce(e){return e.get($e)||{}}function $t(e,t){return e.set($e,t)}function qt(e,t){let o=ce(e);return $t(e,{...o,...t})}var H=class{constructor({setState:t,getState:o}){this.upstreamSetState=t,this.upstreamGetState=o}getInitialState(t){return{...t,...ce(N.default.local),...ce(N.default.session)}}getState(){return this.upstreamGetState()}async setState(t,o,s){let l,p;typeof o=="function"?(l=o,p=s):p=o;let{persistence:c="none"}=p||{},r={},u={};typeof t=="function"?r=n=>(u=t(n),u):(r=t,u=r);let i=await new Promise(n=>{this.upstreamSetState(r,n)});if(c!=="none"){let n=c==="session"?N.default.session:N.default.local;await qt(n,u)}return l&&l(i),i}};var qe=b(require("lodash/mergeWith")),Be=b(require("lodash/isEqual")),Qe=require("@storybook/client-logger"),x=(e,t)=>(0,qe.default)({},e,t,(o,s)=>{if(Array.isArray(s)&&Array.isArray(o))return s.forEach(l=>{o.find(c=>c===l||(0,Be.default)(c,l))||o.push(l)}),o;if(Array.isArray(o))return Qe.logger.log(["the types mismatch, picking",o]),o});var Bt=(...e)=>e.reduce((t,o)=>x(t,o),{}),W=Bt;var le={};E(le,{init:()=>Qt});var Qt=({provider:e,fullAPI:t})=>({api:e.renderPreview?{renderPreview:e.renderPreview}:{},state:{},init:()=>{e.handleAPI(t)}});var de={};E(de,{ensurePanel:()=>ue,init:()=>Yt});var Ye=require("@storybook/types");function ue(e,t,o){let s=Object.keys(e);return s.indexOf(t)>=0?t:s.length?s[0]:o}var Yt=({provider:e,store:t,fullAPI:o})=>{let s={getElements:l=>e.getElements(l),getPanels:()=>s.getElements(Ye.Addon_TypesEnum.PANEL),getStoryPanels:()=>{let l=s.getPanels(),{storyId:p}=t.getState(),c=o.getData(p);if(!l||!c||c.type!=="story")return l;let{parameters:r}=c,u={};return Object.entries(l).forEach(([i,n])=>{let{paramKey:a}=n;a&&r&&r[a]&&r[a].disable||(u[i]=n)}),u},getSelectedPanel:()=>{let{selectedPanel:l}=t.getState();return ue(s.getPanels(),l,l)},setSelectedPanel:l=>{t.setState({selectedPanel:l},{persistence:"session"})},setAddonState(l,p,c){let r,{addons:u}=t.getState();return typeof p=="function"?r=p(s.getAddonState(l)):r=p,t.setState({addons:{...u,[l]:r}},c).then(()=>s.getAddonState(l))},getAddonState:l=>t.getState().addons[l]};return{api:s,state:{selectedPanel:ue(s.getPanels(),t.getState().selectedPanel),addons:{}}}};var pe={};E(pe,{init:()=>Wt});var z=require("@storybook/core-events"),Wt=({provider:e})=>{let t={getChannel:()=>e.channel,on:(o,s)=>(e.channel.addListener(o,s),()=>e.channel.removeListener(o,s)),off:(o,s)=>e.channel.removeListener(o,s),once:(o,s)=>e.channel.once(o,s),emit:(o,s,...l)=>{var p;((p=s==null?void 0:s.options)==null?void 0:p.target)&&s.options.target!=="storybook-preview-iframe"&&!s.options.target.startsWith("storybook-ref-")&&(s.options.target=s.options.target!=="storybook_internal"?`storybook-ref-${s.options.target}`:"storybook-preview-iframe"),e.channel.emit(o,s,...l)},collapseAll:()=>{e.channel.emit(z.STORIES_COLLAPSE_ALL,{})},expandAll:()=>{t.emit(z.STORIES_EXPAND_ALL)}};return{api:t,state:{}}};var fe={};E(fe,{init:()=>zt});var zt=({store:e})=>{let t={addNotification:s=>{t.clearNotification(s.id);let{notifications:l}=e.getState();e.setState({notifications:[...l,s]})},clearNotification:s=>{let{notifications:l}=e.getState();e.setState({notifications:l.filter(c=>c.id!==s)});let p=l.find(c=>c.id===s);p&&p.onClear&&p.onClear()}};return{api:t,state:{notifications:[]}}};var Se={};E(Se,{init:()=>Jt});var Jt=({store:e,navigate:t,fullAPI:o})=>{let s=()=>{let{path:p}=o.getUrlState();return!!(p||"").match(/^\/settings/)};return{state:{settings:{lastTrackedStoryId:null}},api:{closeSettings:()=>{let{settings:{lastTrackedStoryId:p}}=e.getState();p?o.selectStory(p):o.selectFirstStory()},changeSettingsTab:p=>{t(`/settings/${p}`)},isSettingsScreenActive:s,navigateToSettingsPage:async p=>{if(!s()){let{settings:c,storyId:r}=e.getState();await e.setState({settings:{...c,lastTrackedStoryId:r}})}t(p)}}}};var ye={};E(ye,{init:()=>eo});var We=b(require("global")),ze=b(require("memoizerific")),{RELEASE_NOTES_DATA:Xt}=We.default,Zt=(0,ze.default)(1)(()=>{try{return{...JSON.parse(Xt)||{}}}catch{return{}}}),eo=({store:e})=>{let t=Zt(),o=()=>{let{releaseNotesViewed:l}=e.getState();return l||[]};return{state:{releaseNotesViewed:[]},api:{releaseNotesVersion:()=>t.currentVersion,setDidViewReleaseNotes:()=>{let l=o();l.includes(t.currentVersion)||e.setState({releaseNotesViewed:[...l,t.currentVersion]},{persistence:"permanent"})},showReleaseNotesOnLaunch:()=>{if(!t.currentVersion)return!1;let p=o().includes(t.currentVersion);return t.showOnFirstLaunch&&!p}}}};var ve={};E(ve,{init:()=>po});var dt=b(require("global")),M=require("@storybook/csf"),A=require("@storybook/core-events"),pt=require("@storybook/client-logger");var ut=require("@storybook/client-logger");var Ie={};E(Ie,{defaultStoryMapper:()=>lt,getSourceType:()=>Ae,init:()=>io});var Pe=b(require("global")),ct=require("ts-dedent");var me=b(require("memoizerific")),Je=require("ts-dedent"),Xe=b(require("lodash/countBy")),Ze=require("@storybook/csf"),et=b(require("lodash/mapValues"));var to=/\s*\/\s*/,tt=({globalParameters:e,kindParameters:t,stories:o})=>(0,et.default)(o,s=>({...s,parameters:ge(e,t[s.kind],s.parameters)})),ot=(e,{provider:t,docsOptions:o})=>G(oo(e),{provider:t,docsOptions:o}),oo=e=>{let t=Object.entries(e).reduce((o,[s,l])=>{if(!l)return o;let{docsOnly:p,fileName:c,...r}=l.parameters,u={title:l.kind,id:s,name:l.name,importPath:c};if(p)o[s]={type:"docs",standalone:!1,storiesImports:[],...u};else{let{argTypes:i,args:n,initialArgs:a}=l;o[s]={type:"story",...u,parameters:r,argTypes:i,args:n,initialArgs:a}}return o},{});return{v:4,entries:t}},ro=e=>{let t=(0,Xe.default)(Object.values(e.stories),"title");return{v:4,entries:Object.values(e.stories).reduce((o,s)=>{var p;let l="story";return(((p=s.parameters)==null?void 0:p.docsOnly)||s.name==="Page"&&t[s.title]===1)&&(l="docs"),o[s.id]={type:l,...l==="docs"&&{standalone:!1,storiesImports:[]},...s},o},{})}},G=(e,{provider:t,docsOptions:o})=>{if(!e.v)throw new Error("Composition: Missing stories.json version");let s=e.v===4?e:ro(e),l=Object.values(s.entries),{sidebar:p={}}=t.getConfig(),{showRoots:c,collapsedRoots:r=[],renderLabel:u}=p,i=typeof c<"u",n=Object.values(l).reduce((d,S)=>{if(o.docsMode&&S.type!=="docs")return d;let{title:y}=S,m=y.trim().split(to),g=(!i||c)&&m.length>1?[m.shift()]:[],_=[...g,...m],I=_.reduce((P,v,D)=>{let ae=D>0&&P[D-1],ie=(0,Ze.sanitize)(ae?`${ae}-${v}`:v);if(ae===ie)throw new Error(Je.dedent`

Please check your dev-tools network tab.
`});let I=u.versions&&Object.keys(u.versions).length?u.versions:S.versions;await p.setRef(i,{id:i,url:n,...S,...I?{versions:I}:{},type:S.storyIndex?"lazy":"auto-inject"})},getRefs:()=>{let{refs:u={}}=e.getState();return u},setRef:(u,{storyIndex:i,setStoriesData:n,...a},f=!1)=>{if(o)return;let{storyMapper:d=lt}=t.getConfig(),S=p.getRefs()[u],y;n?y=ot(ao(n,S,{storyMapper:d}),{provider:t,docsOptions:s}):i&&(y=G(i,{provider:t,docsOptions:s})),y&&(y=so(y,S)),p.updateRef(u,{stories:y,...a,ready:f})},updateRef:(u,i)=>{let{[u]:n,...a}=p.getRefs();a[u]={...n,...i};let f=Object.keys(r).reduce((d,S)=>(d[S]=a[S],d),{});e.setState({refs:f})}},c=!o&&Pe.default.REFS||{},r=c;return l&&Object.entries(c).forEach(([u,i])=>{p.checkRef({...i,stories:{}})}),{api:p,state:{refs:r}}};var w=(e,t)=>{let{source:o,refId:s,type:l}=e,[p,c]=Ae(o,s),r=s&&t.getRefs()[s]?t.getRefs()[s]:t.findRef(c),u={source:o,sourceType:p,sourceLocation:c,refId:s,ref:r,type:l};switch(!0){case typeof s=="string":case p==="local":case p==="external":return u;default:return ut.logger.warn(`Received a ${l} frame that was not configured as a ref`),null}};var{FEATURES:be,fetch:co}=dt.default,lo="./index.json",uo=["enableShortcuts","theme","showRoots"];function _e(e){if(!e||typeof e=="string")return e;let t={...e};return uo.forEach(o=>{o in t&&delete t[o]}),t}var po=({fullAPI:e,store:t,navigate:o,provider:s,storyId:l,viewMode:p,docsOptions:c={}})=>{let r={storyId:M.toId,getData:(i,n)=>{let a=r.resolveStory(i,n);if((a==null?void 0:a.type)==="story"||(a==null?void 0:a.type)==="docs")return a},isPrepared:(i,n)=>{let a=r.getData(i,n);return a.type==="story"?a.prepared:!0},resolveStory:(i,n)=>{let{refs:a,storiesHash:f}=t.getState();return n?a[n].stories?a[n].stories[i]:void 0:f?f[i]:void 0},getCurrentStoryData:()=>{let{storyId:i,refId:n}=t.getState();return r.getData(i,n)},getParameters:(i,n)=>{let{storyId:a,refId:f}=typeof i=="string"?{storyId:i,refId:void 0}:i,d=r.getData(a,f);if((d==null?void 0:d.type)==="story"){let{parameters:S}=d;if(S)return n?S[n]:S}return null},getCurrentParameter:i=>{let{storyId:n,refId:a}=t.getState();return r.getParameters({storyId:n,refId:a},i)||void 0},jumpToComponent:i=>{let{storiesHash:n,storyId:a,refs:f,refId:d}=t.getState();if(!r.getData(a,d))return;let y=d?f[d].stories||{}:n,m=r.findSiblingStoryId(a,y,i,!0);m&&r.selectStory(m,void 0,{ref:d})},jumpToStory:i=>{let{storiesHash:n,storyId:a,refs:f,refId:d}=t.getState(),S=r.getData(a,d);if(!S)return;let y=S.refId?f[S.refId].stories:n,m=r.findSiblingStoryId(a,y,i,!1);m&&r.selectStory(m,void 0,{ref:d})},selectFirstStory:()=>{let{storiesHash:i}=t.getState(),n=Object.keys(i).find(a=>i[a].type==="story");if(n){r.selectStory(n);return}o("/")},selectStory:(i=void 0,n=void 0,a={})=>{let{ref:f}=a,{storyId:d,storiesHash:S,refs:y}=t.getState(),m=f?y[f].stories:S,g=d==null?void 0:d.split("--",2)[0];if(n)if(i){let _=f?`${f}_${(0,M.toId)(i,n)}`:(0,M.toId)(i,n);if(m[_])r.selectStory(_,void 0,a);else{let I=m[(0,M.sanitize)(i)];if((I==null?void 0:I.type)==="component"){let P=I.children.find(v=>m[v].name===n);P&&r.selectStory(P,void 0,a)}}}else{let _=(0,M.toId)(g,n);r.selectStory(_,void 0,a)}else{let _=i?m[i]||m[(0,M.sanitize)(i)]:m[g];if(!_)throw new Error(`Unknown id or title: '${i}'`);let I=r.findLeafEntry(m,_.id),P=I.refId?`${I.refId}_${I.id}`:I.id;o(`/${I.type}/${P}`)}},findLeafEntry(i,n){let a=i[n];if(a.type==="docs"||a.type==="story")return a;let f=a.children[0];return r.findLeafEntry(i,f)},findLeafStoryId(i,n){var a;return(a=r.findLeafEntry(i,n))==null?void 0:a.id},findSiblingStoryId(i,n,a,f){if(f){let y=nt(n),m=y.findIndex(g=>g.includes(i));return m===y.length-1&&a>0||m===0&&a<0?void 0:y[m+a]?y[m+a][0]:void 0}let d=st(n),S=d.indexOf(i);if(!(S===d.length-1&&a>0)&&!(S===0&&a<0))return d[S+a]},updateStoryArgs:(i,n)=>{let{id:a,refId:f}=i;e.emit(A.UPDATE_STORY_ARGS,{storyId:a,updatedArgs:n,options:{target:f}})},resetStoryArgs:(i,n)=>{let{id:a,refId:f}=i;e.emit(A.RESET_STORY_ARGS,{storyId:a,argNames:n,options:{target:f}})},fetchIndex:async()=>{try{let i=await co(lo);if(i.status!==200)throw new Error(await i.text());let n=await i.json();if(n.v<3){pt.logger.warn(`Skipping story index with version v${n.v}, awaiting SET_STORIES.`);return}await e.setIndex(n)}catch(i){t.setState({storiesConfigured:!0,storiesFailed:i})}},setIndex:async i=>{let n=G(i,{provider:s,docsOptions:c}),a=t.getState().storiesHash;await t.setState({storiesHash:rt(n,a),storiesConfigured:!0,storiesFailed:null})},updateStory:async(i,n,a)=>{if(a){let{id:f,stories:d}=a;d[i]={...d[i],...n},await e.updateRef(f,{stories:d})}else{let{storiesHash:f}=t.getState();f[i]={...f[i],...n},await t.setState({storiesHash:f})}}};return{api:r,state:{storiesHash:{},storyId:l,viewMode:p,storiesConfigured:!1,hasCalledSetOptions:!1},init:async()=>{var i;e.on(A.STORY_SPECIFIED,function({storyId:a,viewMode:f}){let{sourceType:d}=w(this,e);if(!e.isSettingsScreenActive()&&d==="local"){let S=t.getState();(S.storyId!==a||S.viewMode!==f)&&o(`/${f}/${a}`)}}),e.on(A.STORY_CHANGED,function(){let{sourceType:a}=w(this,e);if(a==="local"){let f=e.getCurrentParameter("options");f&&e.setOptions(_e(f))}}),e.on(A.STORY_PREPARED,function({id:a,...f}){let{ref:d,sourceType:S}=w(this,e);if(e.updateStory(a,{...f,prepared:!0},d),d)e.updateRef(d.id,{ready:!0});else if(!t.getState().hasCalledSetOptions){let{options:y}=f.parameters;e.setOptions(_e(y)),t.setState({hasCalledSetOptions:!0})}if(S==="local"){let{storyId:y,storiesHash:m,refId:g}=t.getState(),_=Array.from(new Set([r.findSiblingStoryId(y,m,1,!0),r.findSiblingStoryId(y,m,-1,!0)])).filter(Boolean);e.emit(A.PRELOAD_ENTRIES,{ids:_,options:{target:g}})}}),e.on(A.SET_INDEX,function(a){let{ref:f}=w(this,e);if(f)e.setRef(f.id,{...f,storyIndex:a},!0);else{e.setIndex(a);let d=e.getCurrentParameter("options");e.setOptions(_e(d))}}),e.on(A.SET_STORIES,function(a){let{ref:f}=w(this,e),d=a.v?tt(a):a.stories;if(f)e.setRef(f.id,{...f,setStoriesData:d},!0);else throw new Error("Cannot call SET_STORIES for local frame")}),e.on(A.SELECT_STORY,function({kind:a,story:f,storyId:d,...S}){let{ref:y}=w(this,e);y?e.selectStory(d||a,f,{...S,ref:y.id}):e.selectStory(d||a,f,S)}),e.on(A.STORY_ARGS_UPDATED,function({storyId:a,args:f}){let{ref:d}=w(this,e);e.updateStory(a,{args:f},d)}),e.on(A.CONFIG_ERROR,function(a){t.setState({storiesConfigured:!0,storiesFailed:a})}),be!=null&&be.storyStoreV7&&((i=s.serverChannel)==null||i.on(A.STORY_INDEX_INVALIDATED,()=>e.fetchIndex()),await e.fetchIndex())}}};var J={};E(J,{ActiveTabs:()=>mt,focusableUIElements:()=>V,init:()=>So});var ft=b(require("global")),F=b(require("lodash/pick")),U=require("dequal"),St=require("@storybook/theming/create"),yt=require("@storybook/core-events");var{document:fo}=ft.default,mt={SIDEBAR:"sidebar",CANVAS:"canvas",ADDONS:"addons"},L={ui:{enableShortcuts:!0},layout:{initialActive:mt.CANVAS,showToolbar:!0,isFullscreen:!1,showPanel:!0,showNav:!0,panelPosition:"bottom",showTabs:!0},selectedPanel:void 0,theme:(0,St.create)()},V={storySearchField:"storybook-explorer-searchfield",storyListMenu:"storybook-explorer-menu",storyPanelRoot:"storybook-panel-root"},So=({store:e,provider:t,singleStory:o,fullAPI:s})=>{let l={toggleFullscreen(c){return e.setState(r=>{let{showNav:u}=r.layout,i=typeof c=="boolean"?c:!r.layout.isFullscreen,n=u===!1&&i===!1;return{layout:{...r.layout,isFullscreen:i,showNav:!o&&n?!0:u}}},{persistence:"session"})},togglePanel(c){return e.setState(r=>{let{showNav:u,isFullscreen:i}=r.layout,n=typeof c<"u"?c:!r.layout.showPanel,a=u===!1&&n===!1;return{layout:{...r.layout,showPanel:n,isFullscreen:a?!0:i}}},{persistence:"session"})},togglePanelPosition(c){return typeof c<"u"?e.setState(r=>({layout:{...r.layout,panelPosition:c}}),{persistence:"permanent"}):e.setState(r=>({layout:{...r.layout,panelPosition:r.layout.panelPosition==="right"?"bottom":"right"}}),{persistence:"permanent"})},toggleNav(c){return e.setState(r=>{if(o)return{layout:r.layout};let{showPanel:u,isFullscreen:i}=r.layout,n=typeof c<"u"?c:!r.layout.showNav,a=u===!1&&n===!1;return{layout:{...r.layout,showNav:n,isFullscreen:a?!0:!n&&i}}},{persistence:"session"})},toggleToolbar(c){return e.setState(r=>{let u=typeof c<"u"?c:!r.layout.showToolbar;return{layout:{...r.layout,showToolbar:u}}},{persistence:"session"})},resetLayout(){return e.setState(c=>({layout:{...c.layout,showNav:!1,showPanel:!1,isFullscreen:!1}}),{persistence:"session"})},focusOnUIElement(c,r){if(!c)return;let u=fo.getElementById(c);u&&(u.focus(),r&&u.select())},getInitialOptions(){let{theme:c,selectedPanel:r,...u}=t.getConfig();return{...L,layout:{...L.layout,...(0,F.default)(u,Object.keys(L.layout)),...o&&{showNav:!1}},ui:{...L.ui,...(0,F.default)(u,Object.keys(L.ui))},selectedPanel:r||L.selectedPanel,theme:c||L.theme}},setOptions:c=>{let{layout:r,ui:u,selectedPanel:i,theme:n}=e.getState();if(c){let a={...r,...(0,F.default)(c,Object.keys(r)),...o&&{showNav:!1}},f={...u,...(0,F.default)(c,Object.keys(u))},d={...n,...c.theme},S={};(0,U.dequal)(u,f)||(S.ui=f),(0,U.dequal)(r,a)||(S.layout=a),c.selectedPanel&&!(0,U.dequal)(i,c.selectedPanel)&&(S.selectedPanel=c.selectedPanel),Object.keys(S).length&&e.setState(S,{persistence:"permanent"}),(0,U.dequal)(n,d)||e.setState({theme:d})}}},p=(0,F.default)(e.getState(),"layout","ui","selectedPanel");return{api:l,state:x(l.getInitialOptions(),p),init:()=>{l.setOptions(x(l.getInitialOptions(),p)),s.on(yt.SET_CONFIG,()=>{l.setOptions(x(l.getInitialOptions(),p))})}}};var Te={};E(Te,{controlOrMetaKey:()=>te,defaultShortcuts:()=>j,init:()=>Io,isMacLike:()=>_t,keys:()=>we});var It=b(require("global")),bt=require("@storybook/core-events");var gt=b(require("global")),{navigator:Ee}=gt.default,X=()=>Ee&&Ee.platform?!!Ee.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,yo=()=>X()?"\u2318":"ctrl",mo=()=>X()?"meta":"control",ht=()=>X()?"\u2325":"alt",go=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Z=e=>{if(["Meta","Alt","Control","Shift"].includes(e.key))return null;let t=[];return e.altKey&&t.push("alt"),e.ctrlKey&&t.push("control"),e.metaKey&&t.push("meta"),e.shiftKey&&t.push("shift"),e.key&&e.key.length===1&&e.key!==" "&&t.push(e.key.toUpperCase()),e.key===" "&&t.push("space"),e.key==="Escape"&&t.push("escape"),e.key==="ArrowRight"&&t.push("ArrowRight"),e.key==="ArrowDown"&&t.push("ArrowDown"),e.key==="ArrowUp"&&t.push("ArrowUp"),e.key==="ArrowLeft"&&t.push("ArrowLeft"),t.length>0?t:null},ee=(e,t)=>!e||!t||(e.join("")==="shift/"&&e.shift(),e.length!==t.length)?!1:!e.find((o,s)=>o!==t[s]),ho=(e,t)=>ee(Z(e),t),Pt=e=>e==="alt"?ht():e==="control"?"\u2303":e==="meta"?"\u2318":e==="shift"?"\u21E7\u200B":e==="Enter"||e==="Backspace"||e==="Esc"||e==="escape"?"":e===" "?"SPACE":e==="ArrowUp"?"\u2191":e==="ArrowDown"?"\u2193":e==="ArrowLeft"?"\u2190":e==="ArrowRight"?"\u2192":e.toUpperCase(),Po=e=>e.map(Pt).join(" ");var{navigator:Ce,document:At}=It.default,_t=()=>Ce&&Ce.platform?!!Ce.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,te=()=>_t()?"meta":"control";function we(e){return Object.keys(e)}var j=Object.freeze({fullScreen:["F"],togglePanel:["A"],panelPosition:["D"],toggleNav:["S"],toolbar:["T"],search:["/"],focusNav:["1"],focusIframe:["2"],focusPanel:["3"],prevComponent:["alt","ArrowUp"],nextComponent:["alt","ArrowDown"],prevStory:["alt","ArrowLeft"],nextStory:["alt","ArrowRight"],shortcutsPage:[te(),"shift",","],aboutPage:[","],escape:["escape"],collapseAll:[te(),"shift","ArrowUp"],expandAll:[te(),"shift","ArrowDown"]}),xe={};function Ao(e){let t=e.target;return/input|textarea/i.test(t.tagName)||t.getAttribute("contenteditable")!==null}var Io=({store:e,fullAPI:t})=>{let o={getShortcutKeys(){return e.getState().shortcuts},getDefaultShortcuts(){return{...j,...o.getAddonsShortcutDefaults()}},getAddonsShortcuts(){return xe},getAddonsShortcutLabels(){let c={};return Object.entries(o.getAddonsShortcuts()).forEach(([r,{label:u}])=>{c[r]=u}),c},getAddonsShortcutDefaults(){let c={};return Object.entries(o.getAddonsShortcuts()).forEach(([r,{defaultShortcut:u}])=>{c[r]=u}),c},async setShortcuts(c){return await e.setState({shortcuts:c},{persistence:"permanent"}),c},async restoreAllDefaultShortcuts(){return o.setShortcuts(o.getDefaultShortcuts())},async setShortcut(c,r){let u=o.getShortcutKeys();return await o.setShortcuts({...u,[c]:r}),r},async setAddonShortcut(c,r){let u=o.getShortcutKeys();return await o.setShortcuts({...u,[`${c}-${r.actionName}`]:r.defaultShortcut}),xe[`${c}-${r.actionName}`]=r,r},async restoreDefaultShortcut(c){let r=o.getDefaultShortcuts()[c];return o.setShortcut(c,r)},handleKeydownEvent(c){let r=Z(c),u=o.getShortcutKeys(),n=we(u).find(a=>ee(r,u[a]));n&&(c!=null&&c.preventDefault&&c.preventDefault(),o.handleShortcutFeature(n))},handleShortcutFeature(c){let{layout:{isFullscreen:r,showNav:u,showPanel:i},ui:{enableShortcuts:n}}=e.getState();if(!!n)switch(c){case"escape":{r?t.toggleFullscreen():u||t.toggleNav();break}case"focusNav":{r&&t.toggleFullscreen(),u||t.toggleNav(),t.focusOnUIElement(V.storyListMenu);break}case"search":{r&&t.toggleFullscreen(),u||t.toggleNav(),setTimeout(()=>{t.focusOnUIElement(V.storySearchField,!0)},0);break}case"focusIframe":{let a=At.getElementById("storybook-preview-iframe");if(a)try{a.contentWindow.focus()}catch{}break}case"focusPanel":{r&&t.toggleFullscreen(),i||t.togglePanel(),t.focusOnUIElement(V.storyPanelRoot);break}case"nextStory":{t.jumpToStory(1);break}case"prevStory":{t.jumpToStory(-1);break}case"nextComponent":{t.jumpToComponent(1);break}case"prevComponent":{t.jumpToComponent(-1);break}case"fullScreen":{t.toggleFullscreen();break}case"togglePanel":{r&&(t.toggleFullscreen(),t.resetLayout()),t.togglePanel();break}case"toggleNav":{r&&(t.toggleFullscreen(),t.resetLayout()),t.toggleNav();break}case"toolbar":{t.toggleToolbar();break}case"panelPosition":{r&&t.toggleFullscreen(),i||t.togglePanel(),t.togglePanelPosition();break}case"aboutPage":{t.navigate("/settings/about");break}case"shortcutsPage":{t.navigate("/settings/shortcuts");break}case"collapseAll":{t.collapseAll();break}case"expandAll":{t.expandAll();break}default:xe[c].action();break}}},{shortcuts:s=j}=e.getState(),l={shortcuts:we(j).reduce((c,r)=>({...c,[r]:s[r]||j[r]}),j)};return{api:o,state:l,init:()=>{At.addEventListener("keydown",c=>{Ao(c)||t.handleKeydownEvent(c)}),t.on(bt.PREVIEW_KEYDOWN,c=>{t.handleKeydownEvent(c.event)})}}};var De={};E(De,{init:()=>_o});var R=require("@storybook/core-events"),q=require("@storybook/router"),ke=require("dequal"),vt=b(require("global")),{window:Re}=vt.default,$=e=>{if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1},Oe,bo=({state:{location:e,path:t,viewMode:o,storyId:s},singleStory:l})=>{let{full:p,panel:c,nav:r,shortcuts:u,addonPanel:i,tabs:n,path:a,...f}=(0,q.queryFromLocation)(e),d={isFullscreen:$(p),showNav:!l&&$(r),showPanel:$(c),panelPosition:["right","bottom"].includes(c)?c:void 0,showTabs:$(n)},S={enableShortcuts:$(u)},y=i||void 0,m=s,g=(0,ke.dequal)(Oe,f)?Oe:f;return Oe=g,{viewMode:o,layout:d,ui:S,selectedPanel:y,location:e,path:t,customQueryParams:g,storyId:m}},_o=({store:e,navigate:t,state:o,provider:s,fullAPI:l,...p})=>{let c=(i,n={},a={})=>{let f=Object.entries(n).filter(([,S])=>S).sort(([S],[y])=>S<y?-1:1).map(([S,y])=>`${S}=${y}`),d=[i,...f].join("&");return t(d,a)},r={getQueryParam(i){let{customQueryParams:n}=e.getState();return n?n[i]:void 0},getUrlState(){let{path:i,customQueryParams:n,storyId:a,url:f,viewMode:d}=e.getState();return{path:i,queryParams:n,storyId:a,url:f,viewMode:d}},setQueryParams(i){let{customQueryParams:n}=e.getState(),a={},f={...n,...Object.entries(i).reduce((d,[S,y])=>(y!==null&&(d[S]=y),d),a)};(0,ke.dequal)(n,f)||(e.setState({customQueryParams:f}),l.emit(R.UPDATE_QUERY_PARAMS,f))},navigateUrl(i,n){t(i,{...n,plain:!0})}},u=()=>{let i=()=>{let{path:a,queryParams:f,viewMode:d}=l.getUrlState();if(d!=="story")return;let S=l.getCurrentStoryData();if((S==null?void 0:S.type)!=="story")return;let{args:y,initialArgs:m}=S,g=(0,q.buildArgsParam)(m,y);c(a,{...f,args:g},{replace:!0}),r.setQueryParams({args:g})};l.on(R.SET_CURRENT_STORY,()=>i());let n;l.on(R.STORY_ARGS_UPDATED,()=>{"requestIdleCallback"in Re?(n&&Re.cancelIdleCallback(n),n=Re.requestIdleCallback(i,{timeout:1e3})):(n&&clearTimeout(n),setTimeout(i,100))}),l.on(R.GLOBALS_UPDATED,({globals:a,initialGlobals:f})=>{let{path:d,queryParams:S}=l.getUrlState(),y=(0,q.buildArgsParam)(f,a);c(d,{...S,globals:y},{replace:!0}),r.setQueryParams({globals:y})}),l.on(R.NAVIGATE_URL,(a,f)=>{l.navigateUrl(a,f)}),l.showReleaseNotesOnLaunch()&&t("/settings/release-notes")};return{api:r,state:bo({store:e,navigate:t,state:o,provider:s,fullAPI:l,...p}),init:u}};var Me={};E(Me,{init:()=>Eo});var xt=b(require("global")),T=b(require("semver")),wt=b(require("memoizerific"));var Et="7.0.0-alpha.57";var{VERSIONCHECK:vo}=xt.default,Ct=(0,wt.default)(1)(()=>{try{return{...JSON.parse(vo).data||{}}}catch{return{}}}),Eo=({store:e,mode:t,fullAPI:o})=>{let{dismissedVersionNotification:s}=e.getState(),l={versions:{current:{version:Et},...Ct()},dismissedVersionNotification:s},p={getCurrentVersion:()=>{let{versions:{current:r}}=e.getState();return r},getLatestVersion:()=>{let{versions:{latest:r,next:u,current:i}}=e.getState();return i&&T.default.prerelease(i.version)&&u?r&&T.default.gt(r.version,u.version)?r:u:r},versionUpdateAvailable:()=>{let r=p.getLatestVersion(),u=p.getCurrentVersion();if(r){if(!r.version||!u.version)return!0;let n=!!T.default.prerelease(u.version)?`${T.default.major(u.version)}.${T.default.minor(u.version)}.${T.default.patch(u.version)}`:u.version,a=T.default.diff(n,r.version);return T.default.gt(r.version,n)&&a!=="patch"&&!a.includes("pre")}return!1}};return{init:async()=>{let{versions:r={}}=e.getState(),{latest:u,next:i}=Ct();if(await e.setState({versions:{...r,latest:u,next:i}}),p.versionUpdateAvailable()){let n=p.getLatestVersion().version,a=T.default.diff(r.current.version,r.latest.version);n!==s&&a!=="patch"&&!T.default.prerelease(n)&&t!=="production"&&o.addNotification({id:"update",link:"/settings/about",content:{headline:`Storybook ${n} is available!`,subHeadline:`Your current version is: ${r.current.version}`},icon:{name:"book"},onClear(){e.setState({dismissedVersionNotification:n},{persistence:"permanent"})}})}},state:l,api:p}};var Fe={};E(Fe,{init:()=>Co});var K=require("@storybook/core-events"),Le=require("@storybook/client-logger"),Ne=require("dequal");var Co=({store:e,fullAPI:t})=>{let o={getGlobals(){return e.getState().globals},getGlobalTypes(){return e.getState().globalTypes},updateGlobals(c){t.emit(K.UPDATE_GLOBALS,{globals:c,options:{target:"storybook-preview-iframe"}})}},s={globals:{},globalTypes:{}},l=c=>{var u;let r=(u=e.getState())==null?void 0:u.globals;(0,Ne.dequal)(c,r)||e.setState({globals:c})};return{api:o,state:s,init:()=>{t.on(K.GLOBALS_UPDATED,function({globals:r}){let{ref:u}=w(this,t);u?Le.logger.warn("received a GLOBALS_UPDATED from a non-local ref. This is not currently supported."):l(r)}),t.on(K.SET_GLOBALS,function({globals:r,globalTypes:u}){var a;let{ref:i}=w(this,t),n=(a=e.getState())==null?void 0:a.globals;i?Object.keys(r).length>0&&Le.logger.warn("received globals from a non-local ref. This is not currently supported."):e.setState({globals:r,globalTypes:u}),n&&Object.keys(n).length!==0&&!(0,Ne.dequal)(r,n)&&o.updateGlobals(n)})}}};var re=b(require("global")),Rt=require("@storybook/core-events"),ne=require("@storybook/types"),Ot=require("@storybook/client-logger");var Tt=require("@storybook/channels");function oe(){let e={setHandler:()=>{},send:()=>{}};return new Tt.Channel({transport:e})}var Ke=class{constructor(){this.loaders={};this.elements={};this.config={};this.getChannel=()=>(this.channel||this.setChannel(oe()),this.channel);this.getServerChannel=()=>{if(!this.serverChannel)throw new Error("Accessing non-existent serverChannel");return this.serverChannel};this.ready=()=>this.promise;this.hasChannel=()=>!!this.channel;this.hasServerChannel=()=>!!this.serverChannel;this.setChannel=t=>{this.channel=t,this.resolve()};this.setServerChannel=t=>{this.serverChannel=t};this.getElements=t=>(this.elements[t]||(this.elements[t]={}),this.elements[t]);this.addPanel=(t,o)=>{this.add(t,{type:ne.Addon_TypesEnum.PANEL,...o})};this.add=(t,o)=>{let{type:s}=o,l=this.getElements(s);l[t]={id:t,...o}};this.setConfig=t=>{Object.assign(this.config,t),this.hasChannel()&&this.getChannel().emit(Rt.SET_CONFIG,t)};this.getConfig=()=>this.config;this.register=(t,o)=>{this.loaders[t]&&Ot.logger.warn(`${t} was loaded twice, this could have bad side-effects`),this.loaders[t]=o};this.loadAddons=t=>{Object.values(this.loaders).forEach(o=>o(t))};this.promise=new Promise(t=>{this.resolve=()=>t(this.getChannel())})}},je="__STORYBOOK_ADDONS_MANAGER";function xo(){return re.default[je]||(re.default[je]=new Ke),re.default[je]}var kt=xo();var{ActiveTabs:wo}=J;var B=Ue({api:void 0,state:W({})}),ge=(...e)=>(0,Dt.default)({},...e,(t,o)=>{if(Array.isArray(o))return o}),se=class extends h.Component{constructor(o){super(o);this.api={};this.initModules=()=>{this.modules.forEach(o=>{"init"in o&&o.init()})};let{location:s,path:l,refId:p,viewMode:c=o.docsOptions.docsMode?"docs":"story",singleStory:r,storyId:u,docsOptions:i,navigate:n}=o,a=new H({getState:()=>this.state,setState:(g,_)=>this.setState(g,_)}),f={location:s,path:l,viewMode:c,singleStory:r,storyId:u,refId:p},d={docsOptions:i};this.state=a.getInitialState(W({...f,...d}));let S={navigate:n,store:a,provider:o.provider};this.modules=[le,pe,de,J,fe,Se,ye,Te,ve,Ie,Fe,De,Me].map(g=>g.init({...f,...d,...S,state:this.state,fullAPI:this.api}));let y=W(this.state,...this.modules.map(g=>g.state)),m=Object.assign(this.api,{navigate:n},...this.modules.map(g=>g.api));this.state=y,this.api=m}static getDerivedStateFromProps(o,s){return s.path!==o.path?{...s,location:o.location,path:o.path,refId:o.refId,viewMode:o.viewMode,storyId:o.storyId}:null}shouldComponentUpdate(o,s){let l=this.state,p=this.props;return l!==s||p.path!==o.path}render(){let{children:o}=this.props,s={state:this.state,api:this.api};return h.default.createElement(To,{effect:this.initModules},h.default.createElement(B.Provider,{value:s},h.default.createElement(Mt,null,o)))}};se.displayName="Manager";var To=({children:e,effect:t})=>(h.default.useEffect(t,[]),e),Ro=e=>e;function Mt({filter:e=Ro,children:t}){let o=(0,h.useContext)(B),s=(0,h.useRef)(t),l=(0,h.useRef)(e);if(typeof s.current!="function")return h.default.createElement(h.Fragment,null,s.current);let p=l.current(o),c=(0,h.useMemo)(()=>[...Object.entries(p).reduce((r,u)=>r.concat(u),[])],[o.state]);return(0,h.useMemo)(()=>{let r=s.current;return h.default.createElement(r,{...p})},c)}function Oo(){let{state:e}=(0,h.useContext)(B);return e}function k(){let{api:e}=(0,h.useContext)(B);return e}function Lt(e,t){return typeof e>"u"?t:e}var Nt=(e,t=[])=>{let o=k();return(0,h.useEffect)(()=>(Object.entries(e).forEach(([s,l])=>o.on(s,l)),()=>{Object.entries(e).forEach(([s,l])=>o.off(s,l))}),t),o.emit};function ko(e){return k().isPrepared(e)}function Do(e,t){let s=k().getCurrentParameter(e);return Lt(s,t)}var O={};function Ft(e,t){let o=k(),s=o.getAddonState(e),l=Lt(s,O[e]?O[e]:t),p=(u,i)=>{O[e]&&(O[e]=u),o.setAddonState(e,u,i)},c=(0,h.useMemo)(()=>{let u={[`${C.SHARED_STATE_CHANGED}-client-${e}`]:n=>p(n),[`${C.SHARED_STATE_SET}-client-${e}`]:n=>p(n)},i={[C.SET_STORIES]:()=>{let n=o.getAddonState(e);n?(O[e]=n,o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,n)):O[e]?(p(O[e]),o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,O[e])):t!==void 0&&(p(t),O[e]=t,o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,t))},[C.STORY_CHANGED]:()=>{let n=o.getAddonState(e);n!==void 0&&o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,n)}};return{...u,...i}},[e]),r=Nt(c);return[l,(u,i)=>{p(u,i),r(`${C.SHARED_STATE_CHANGED}-manager-${e}`,u)}]}function Mo(e,t){return Ft(e,t)}function Lo(){let{getCurrentStoryData:e,updateStoryArgs:t,resetStoryArgs:o}=k(),s=e(),l=s.type==="story"?s.args:{},p=(0,h.useCallback)(r=>t(s,r),[s,t]),c=(0,h.useCallback)(r=>o(s,r),[s,o]);return[l,p,c]}function No(){let e=k();return[e.getGlobals(),e.updateGlobals]}function Fo(){return k().getGlobalTypes()}function jo(){let{getCurrentStoryData:e}=k();return e()}function Ko(){let e=jo();return(e==null?void 0:e.type)==="story"&&e.argTypes||{}}0&&(module.exports={ActiveTabs,Consumer,ManagerContext,Provider,addons,combineParameters,controlOrMetaKey,controlOrMetaSymbol,eventMatchesShortcut,eventToShortcut,isMacLike,isShortcutTaken,keyToSymbol,merge,mockChannel,optionOrAltSymbol,shortcutMatchesShortcut,shortcutToHumanString,types,useAddonState,useArgTypes,useArgs,useChannel,useGlobalTypes,useGlobals,useParameter,useSharedState,useStoryPrepared,useStorybookApi,useStorybookState});
`});let I=u.versions&&Object.keys(u.versions).length?u.versions:S.versions;await p.setRef(i,{id:i,url:n,...S,...I?{versions:I}:{},type:S.storyIndex?"lazy":"auto-inject"})},getRefs:()=>{let{refs:u={}}=e.getState();return u},setRef:(u,{storyIndex:i,setStoriesData:n,...a},f=!1)=>{if(o)return;let{storyMapper:d=lt}=t.getConfig(),S=p.getRefs()[u],y;n?y=ot(ao(n,S,{storyMapper:d}),{provider:t,docsOptions:s}):i&&(y=G(i,{provider:t,docsOptions:s})),y&&(y=so(y,S)),p.updateRef(u,{stories:y,...a,ready:f})},updateRef:(u,i)=>{let{[u]:n,...a}=p.getRefs();a[u]={...n,...i};let f=Object.keys(r).reduce((d,S)=>(d[S]=a[S],d),{});e.setState({refs:f})}},c=!o&&Pe.default.REFS||{},r=c;return l&&Object.entries(c).forEach(([u,i])=>{p.checkRef({...i,stories:{}})}),{api:p,state:{refs:r}}};var w=(e,t)=>{let{source:o,refId:s,type:l}=e,[p,c]=Ae(o,s),r=s&&t.getRefs()[s]?t.getRefs()[s]:t.findRef(c),u={source:o,sourceType:p,sourceLocation:c,refId:s,ref:r,type:l};switch(!0){case typeof s=="string":case p==="local":case p==="external":return u;default:return ut.logger.warn(`Received a ${l} frame that was not configured as a ref`),null}};var{FEATURES:be,fetch:co}=dt.default,lo="./index.json",uo=["enableShortcuts","theme","showRoots"];function _e(e){if(!e||typeof e=="string")return e;let t={...e};return uo.forEach(o=>{o in t&&delete t[o]}),t}var po=({fullAPI:e,store:t,navigate:o,provider:s,storyId:l,viewMode:p,docsOptions:c={}})=>{let r={storyId:M.toId,getData:(i,n)=>{let a=r.resolveStory(i,n);if((a==null?void 0:a.type)==="story"||(a==null?void 0:a.type)==="docs")return a},isPrepared:(i,n)=>{let a=r.getData(i,n);return a.type==="story"?a.prepared:!0},resolveStory:(i,n)=>{let{refs:a,storiesHash:f}=t.getState();return n?a[n].stories?a[n].stories[i]:void 0:f?f[i]:void 0},getCurrentStoryData:()=>{let{storyId:i,refId:n}=t.getState();return r.getData(i,n)},getParameters:(i,n)=>{let{storyId:a,refId:f}=typeof i=="string"?{storyId:i,refId:void 0}:i,d=r.getData(a,f);if((d==null?void 0:d.type)==="story"){let{parameters:S}=d;if(S)return n?S[n]:S}return null},getCurrentParameter:i=>{let{storyId:n,refId:a}=t.getState();return r.getParameters({storyId:n,refId:a},i)||void 0},jumpToComponent:i=>{let{storiesHash:n,storyId:a,refs:f,refId:d}=t.getState();if(!r.getData(a,d))return;let y=d?f[d].stories||{}:n,m=r.findSiblingStoryId(a,y,i,!0);m&&r.selectStory(m,void 0,{ref:d})},jumpToStory:i=>{let{storiesHash:n,storyId:a,refs:f,refId:d}=t.getState(),S=r.getData(a,d);if(!S)return;let y=S.refId?f[S.refId].stories:n,m=r.findSiblingStoryId(a,y,i,!1);m&&r.selectStory(m,void 0,{ref:d})},selectFirstStory:()=>{let{storiesHash:i}=t.getState(),n=Object.keys(i).find(a=>i[a].type==="story");if(n){r.selectStory(n);return}o("/")},selectStory:(i=void 0,n=void 0,a={})=>{let{ref:f}=a,{storyId:d,storiesHash:S,refs:y}=t.getState(),m=f?y[f].stories:S,g=d==null?void 0:d.split("--",2)[0];if(n)if(i){let _=f?`${f}_${(0,M.toId)(i,n)}`:(0,M.toId)(i,n);if(m[_])r.selectStory(_,void 0,a);else{let I=m[(0,M.sanitize)(i)];if((I==null?void 0:I.type)==="component"){let P=I.children.find(v=>m[v].name===n);P&&r.selectStory(P,void 0,a)}}}else{let _=(0,M.toId)(g,n);r.selectStory(_,void 0,a)}else{let _=i?m[i]||m[(0,M.sanitize)(i)]:m[g];if(!_)throw new Error(`Unknown id or title: '${i}'`);let I=r.findLeafEntry(m,_.id),P=I.refId?`${I.refId}_${I.id}`:I.id;o(`/${I.type}/${P}`)}},findLeafEntry(i,n){let a=i[n];if(a.type==="docs"||a.type==="story")return a;let f=a.children[0];return r.findLeafEntry(i,f)},findLeafStoryId(i,n){var a;return(a=r.findLeafEntry(i,n))==null?void 0:a.id},findSiblingStoryId(i,n,a,f){if(f){let y=nt(n),m=y.findIndex(g=>g.includes(i));return m===y.length-1&&a>0||m===0&&a<0?void 0:y[m+a]?y[m+a][0]:void 0}let d=st(n),S=d.indexOf(i);if(!(S===d.length-1&&a>0)&&!(S===0&&a<0))return d[S+a]},updateStoryArgs:(i,n)=>{let{id:a,refId:f}=i;e.emit(A.UPDATE_STORY_ARGS,{storyId:a,updatedArgs:n,options:{target:f}})},resetStoryArgs:(i,n)=>{let{id:a,refId:f}=i;e.emit(A.RESET_STORY_ARGS,{storyId:a,argNames:n,options:{target:f}})},fetchIndex:async()=>{try{let i=await co(lo);if(i.status!==200)throw new Error(await i.text());let n=await i.json();if(n.v<3){pt.logger.warn(`Skipping story index with version v${n.v}, awaiting SET_STORIES.`);return}await e.setIndex(n)}catch(i){t.setState({storiesConfigured:!0,storiesFailed:i})}},setIndex:async i=>{let n=G(i,{provider:s,docsOptions:c}),a=t.getState().storiesHash;await t.setState({storiesHash:rt(n,a),storiesConfigured:!0,storiesFailed:null})},updateStory:async(i,n,a)=>{if(a){let{id:f,stories:d}=a;d[i]={...d[i],...n},await e.updateRef(f,{stories:d})}else{let{storiesHash:f}=t.getState();f[i]={...f[i],...n},await t.setState({storiesHash:f})}}};return{api:r,state:{storiesHash:{},storyId:l,viewMode:p,storiesConfigured:!1,hasCalledSetOptions:!1},init:async()=>{var i;e.on(A.STORY_SPECIFIED,function({storyId:a,viewMode:f}){let{sourceType:d}=w(this,e);if(!e.isSettingsScreenActive()&&d==="local"){let S=t.getState();(S.storyId!==a||S.viewMode!==f)&&o(`/${f}/${a}`)}}),e.on(A.STORY_CHANGED,function(){let{sourceType:a}=w(this,e);if(a==="local"){let f=e.getCurrentParameter("options");f&&e.setOptions(_e(f))}}),e.on(A.STORY_PREPARED,function({id:a,...f}){let{ref:d,sourceType:S}=w(this,e);if(e.updateStory(a,{...f,prepared:!0},d),d)e.updateRef(d.id,{ready:!0});else if(!t.getState().hasCalledSetOptions){let{options:y}=f.parameters;e.setOptions(_e(y)),t.setState({hasCalledSetOptions:!0})}if(S==="local"){let{storyId:y,storiesHash:m,refId:g}=t.getState(),_=Array.from(new Set([r.findSiblingStoryId(y,m,1,!0),r.findSiblingStoryId(y,m,-1,!0)])).filter(Boolean);e.emit(A.PRELOAD_ENTRIES,{ids:_,options:{target:g}})}}),e.on(A.SET_INDEX,function(a){let{ref:f}=w(this,e);if(f)e.setRef(f.id,{...f,storyIndex:a},!0);else{e.setIndex(a);let d=e.getCurrentParameter("options");e.setOptions(_e(d))}}),e.on(A.SET_STORIES,function(a){let{ref:f}=w(this,e),d=a.v?tt(a):a.stories;if(f)e.setRef(f.id,{...f,setStoriesData:d},!0);else throw new Error("Cannot call SET_STORIES for local frame")}),e.on(A.SELECT_STORY,function({kind:a,story:f,storyId:d,...S}){let{ref:y}=w(this,e);y?e.selectStory(d||a,f,{...S,ref:y.id}):e.selectStory(d||a,f,S)}),e.on(A.STORY_ARGS_UPDATED,function({storyId:a,args:f}){let{ref:d}=w(this,e);e.updateStory(a,{args:f},d)}),e.on(A.CONFIG_ERROR,function(a){t.setState({storiesConfigured:!0,storiesFailed:a})}),be!=null&&be.storyStoreV7&&((i=s.serverChannel)==null||i.on(A.STORY_INDEX_INVALIDATED,()=>e.fetchIndex()),await e.fetchIndex())}}};var J={};E(J,{ActiveTabs:()=>mt,focusableUIElements:()=>V,init:()=>So});var ft=b(require("global")),F=b(require("lodash/pick")),U=require("dequal"),St=require("@storybook/theming/create"),yt=require("@storybook/core-events");var{document:fo}=ft.default,mt={SIDEBAR:"sidebar",CANVAS:"canvas",ADDONS:"addons"},L={ui:{enableShortcuts:!0},layout:{initialActive:mt.CANVAS,showToolbar:!0,isFullscreen:!1,showPanel:!0,showNav:!0,panelPosition:"bottom",showTabs:!0},selectedPanel:void 0,theme:(0,St.create)()},V={storySearchField:"storybook-explorer-searchfield",storyListMenu:"storybook-explorer-menu",storyPanelRoot:"storybook-panel-root"},So=({store:e,provider:t,singleStory:o,fullAPI:s})=>{let l={toggleFullscreen(c){return e.setState(r=>{let{showNav:u}=r.layout,i=typeof c=="boolean"?c:!r.layout.isFullscreen,n=u===!1&&i===!1;return{layout:{...r.layout,isFullscreen:i,showNav:!o&&n?!0:u}}},{persistence:"session"})},togglePanel(c){return e.setState(r=>{let{showNav:u,isFullscreen:i}=r.layout,n=typeof c<"u"?c:!r.layout.showPanel,a=u===!1&&n===!1;return{layout:{...r.layout,showPanel:n,isFullscreen:a?!0:i}}},{persistence:"session"})},togglePanelPosition(c){return typeof c<"u"?e.setState(r=>({layout:{...r.layout,panelPosition:c}}),{persistence:"permanent"}):e.setState(r=>({layout:{...r.layout,panelPosition:r.layout.panelPosition==="right"?"bottom":"right"}}),{persistence:"permanent"})},toggleNav(c){return e.setState(r=>{if(o)return{layout:r.layout};let{showPanel:u,isFullscreen:i}=r.layout,n=typeof c<"u"?c:!r.layout.showNav,a=u===!1&&n===!1;return{layout:{...r.layout,showNav:n,isFullscreen:a?!0:!n&&i}}},{persistence:"session"})},toggleToolbar(c){return e.setState(r=>{let u=typeof c<"u"?c:!r.layout.showToolbar;return{layout:{...r.layout,showToolbar:u}}},{persistence:"session"})},resetLayout(){return e.setState(c=>({layout:{...c.layout,showNav:!1,showPanel:!1,isFullscreen:!1}}),{persistence:"session"})},focusOnUIElement(c,r){if(!c)return;let u=fo.getElementById(c);u&&(u.focus(),r&&u.select())},getInitialOptions(){let{theme:c,selectedPanel:r,...u}=t.getConfig();return{...L,layout:{...L.layout,...(0,F.default)(u,Object.keys(L.layout)),...o&&{showNav:!1}},ui:{...L.ui,...(0,F.default)(u,Object.keys(L.ui))},selectedPanel:r||L.selectedPanel,theme:c||L.theme}},setOptions:c=>{let{layout:r,ui:u,selectedPanel:i,theme:n}=e.getState();if(c){let a={...r,...(0,F.default)(c,Object.keys(r)),...o&&{showNav:!1}},f={...u,...(0,F.default)(c,Object.keys(u))},d={...n,...c.theme},S={};(0,U.dequal)(u,f)||(S.ui=f),(0,U.dequal)(r,a)||(S.layout=a),c.selectedPanel&&!(0,U.dequal)(i,c.selectedPanel)&&(S.selectedPanel=c.selectedPanel),Object.keys(S).length&&e.setState(S,{persistence:"permanent"}),(0,U.dequal)(n,d)||e.setState({theme:d})}}},p=(0,F.default)(e.getState(),"layout","ui","selectedPanel");return{api:l,state:x(l.getInitialOptions(),p),init:()=>{l.setOptions(x(l.getInitialOptions(),p)),s.on(yt.SET_CONFIG,()=>{l.setOptions(x(l.getInitialOptions(),p))})}}};var Te={};E(Te,{controlOrMetaKey:()=>te,defaultShortcuts:()=>j,init:()=>Io,isMacLike:()=>_t,keys:()=>we});var It=b(require("global")),bt=require("@storybook/core-events");var gt=b(require("global")),{navigator:Ee}=gt.default,X=()=>Ee&&Ee.platform?!!Ee.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,yo=()=>X()?"\u2318":"ctrl",mo=()=>X()?"meta":"control",ht=()=>X()?"\u2325":"alt",go=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Z=e=>{if(["Meta","Alt","Control","Shift"].includes(e.key))return null;let t=[];return e.altKey&&t.push("alt"),e.ctrlKey&&t.push("control"),e.metaKey&&t.push("meta"),e.shiftKey&&t.push("shift"),e.key&&e.key.length===1&&e.key!==" "&&t.push(e.key.toUpperCase()),e.key===" "&&t.push("space"),e.key==="Escape"&&t.push("escape"),e.key==="ArrowRight"&&t.push("ArrowRight"),e.key==="ArrowDown"&&t.push("ArrowDown"),e.key==="ArrowUp"&&t.push("ArrowUp"),e.key==="ArrowLeft"&&t.push("ArrowLeft"),t.length>0?t:null},ee=(e,t)=>!e||!t||(e.join("")==="shift/"&&e.shift(),e.length!==t.length)?!1:!e.find((o,s)=>o!==t[s]),ho=(e,t)=>ee(Z(e),t),Pt=e=>e==="alt"?ht():e==="control"?"\u2303":e==="meta"?"\u2318":e==="shift"?"\u21E7\u200B":e==="Enter"||e==="Backspace"||e==="Esc"||e==="escape"?"":e===" "?"SPACE":e==="ArrowUp"?"\u2191":e==="ArrowDown"?"\u2193":e==="ArrowLeft"?"\u2190":e==="ArrowRight"?"\u2192":e.toUpperCase(),Po=e=>e.map(Pt).join(" ");var{navigator:Ce,document:At}=It.default,_t=()=>Ce&&Ce.platform?!!Ce.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,te=()=>_t()?"meta":"control";function we(e){return Object.keys(e)}var j=Object.freeze({fullScreen:["F"],togglePanel:["A"],panelPosition:["D"],toggleNav:["S"],toolbar:["T"],search:["/"],focusNav:["1"],focusIframe:["2"],focusPanel:["3"],prevComponent:["alt","ArrowUp"],nextComponent:["alt","ArrowDown"],prevStory:["alt","ArrowLeft"],nextStory:["alt","ArrowRight"],shortcutsPage:[te(),"shift",","],aboutPage:[","],escape:["escape"],collapseAll:[te(),"shift","ArrowUp"],expandAll:[te(),"shift","ArrowDown"]}),xe={};function Ao(e){let t=e.target;return/input|textarea/i.test(t.tagName)||t.getAttribute("contenteditable")!==null}var Io=({store:e,fullAPI:t})=>{let o={getShortcutKeys(){return e.getState().shortcuts},getDefaultShortcuts(){return{...j,...o.getAddonsShortcutDefaults()}},getAddonsShortcuts(){return xe},getAddonsShortcutLabels(){let c={};return Object.entries(o.getAddonsShortcuts()).forEach(([r,{label:u}])=>{c[r]=u}),c},getAddonsShortcutDefaults(){let c={};return Object.entries(o.getAddonsShortcuts()).forEach(([r,{defaultShortcut:u}])=>{c[r]=u}),c},async setShortcuts(c){return await e.setState({shortcuts:c},{persistence:"permanent"}),c},async restoreAllDefaultShortcuts(){return o.setShortcuts(o.getDefaultShortcuts())},async setShortcut(c,r){let u=o.getShortcutKeys();return await o.setShortcuts({...u,[c]:r}),r},async setAddonShortcut(c,r){let u=o.getShortcutKeys();return await o.setShortcuts({...u,[`${c}-${r.actionName}`]:r.defaultShortcut}),xe[`${c}-${r.actionName}`]=r,r},async restoreDefaultShortcut(c){let r=o.getDefaultShortcuts()[c];return o.setShortcut(c,r)},handleKeydownEvent(c){let r=Z(c),u=o.getShortcutKeys(),n=we(u).find(a=>ee(r,u[a]));n&&(c!=null&&c.preventDefault&&c.preventDefault(),o.handleShortcutFeature(n))},handleShortcutFeature(c){let{layout:{isFullscreen:r,showNav:u,showPanel:i},ui:{enableShortcuts:n}}=e.getState();if(!!n)switch(c){case"escape":{r?t.toggleFullscreen():u||t.toggleNav();break}case"focusNav":{r&&t.toggleFullscreen(),u||t.toggleNav(),t.focusOnUIElement(V.storyListMenu);break}case"search":{r&&t.toggleFullscreen(),u||t.toggleNav(),setTimeout(()=>{t.focusOnUIElement(V.storySearchField,!0)},0);break}case"focusIframe":{let a=At.getElementById("storybook-preview-iframe");if(a)try{a.contentWindow.focus()}catch{}break}case"focusPanel":{r&&t.toggleFullscreen(),i||t.togglePanel(),t.focusOnUIElement(V.storyPanelRoot);break}case"nextStory":{t.jumpToStory(1);break}case"prevStory":{t.jumpToStory(-1);break}case"nextComponent":{t.jumpToComponent(1);break}case"prevComponent":{t.jumpToComponent(-1);break}case"fullScreen":{t.toggleFullscreen();break}case"togglePanel":{r&&(t.toggleFullscreen(),t.resetLayout()),t.togglePanel();break}case"toggleNav":{r&&(t.toggleFullscreen(),t.resetLayout()),t.toggleNav();break}case"toolbar":{t.toggleToolbar();break}case"panelPosition":{r&&t.toggleFullscreen(),i||t.togglePanel(),t.togglePanelPosition();break}case"aboutPage":{t.navigate("/settings/about");break}case"shortcutsPage":{t.navigate("/settings/shortcuts");break}case"collapseAll":{t.collapseAll();break}case"expandAll":{t.expandAll();break}default:xe[c].action();break}}},{shortcuts:s=j}=e.getState(),l={shortcuts:we(j).reduce((c,r)=>({...c,[r]:s[r]||j[r]}),j)};return{api:o,state:l,init:()=>{At.addEventListener("keydown",c=>{Ao(c)||t.handleKeydownEvent(c)}),t.on(bt.PREVIEW_KEYDOWN,c=>{t.handleKeydownEvent(c.event)})}}};var De={};E(De,{init:()=>_o});var R=require("@storybook/core-events"),q=require("@storybook/router"),ke=require("dequal"),vt=b(require("global")),{window:Re}=vt.default,$=e=>{if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1},Oe,bo=({state:{location:e,path:t,viewMode:o,storyId:s},singleStory:l})=>{let{full:p,panel:c,nav:r,shortcuts:u,addonPanel:i,tabs:n,path:a,...f}=(0,q.queryFromLocation)(e),d={isFullscreen:$(p),showNav:!l&&$(r),showPanel:$(c),panelPosition:["right","bottom"].includes(c)?c:void 0,showTabs:$(n)},S={enableShortcuts:$(u)},y=i||void 0,m=s,g=(0,ke.dequal)(Oe,f)?Oe:f;return Oe=g,{viewMode:o,layout:d,ui:S,selectedPanel:y,location:e,path:t,customQueryParams:g,storyId:m}},_o=({store:e,navigate:t,state:o,provider:s,fullAPI:l,...p})=>{let c=(i,n={},a={})=>{let f=Object.entries(n).filter(([,S])=>S).sort(([S],[y])=>S<y?-1:1).map(([S,y])=>`${S}=${y}`),d=[i,...f].join("&");return t(d,a)},r={getQueryParam(i){let{customQueryParams:n}=e.getState();return n?n[i]:void 0},getUrlState(){let{path:i,customQueryParams:n,storyId:a,url:f,viewMode:d}=e.getState();return{path:i,queryParams:n,storyId:a,url:f,viewMode:d}},setQueryParams(i){let{customQueryParams:n}=e.getState(),a={},f={...n,...Object.entries(i).reduce((d,[S,y])=>(y!==null&&(d[S]=y),d),a)};(0,ke.dequal)(n,f)||(e.setState({customQueryParams:f}),l.emit(R.UPDATE_QUERY_PARAMS,f))},navigateUrl(i,n){t(i,{...n,plain:!0})}},u=()=>{let i=()=>{let{path:a,queryParams:f,viewMode:d}=l.getUrlState();if(d!=="story")return;let S=l.getCurrentStoryData();if((S==null?void 0:S.type)!=="story")return;let{args:y,initialArgs:m}=S,g=(0,q.buildArgsParam)(m,y);c(a,{...f,args:g},{replace:!0}),r.setQueryParams({args:g})};l.on(R.SET_CURRENT_STORY,()=>i());let n;l.on(R.STORY_ARGS_UPDATED,()=>{"requestIdleCallback"in Re?(n&&Re.cancelIdleCallback(n),n=Re.requestIdleCallback(i,{timeout:1e3})):(n&&clearTimeout(n),setTimeout(i,100))}),l.on(R.GLOBALS_UPDATED,({globals:a,initialGlobals:f})=>{let{path:d,queryParams:S}=l.getUrlState(),y=(0,q.buildArgsParam)(f,a);c(d,{...S,globals:y},{replace:!0}),r.setQueryParams({globals:y})}),l.on(R.NAVIGATE_URL,(a,f)=>{l.navigateUrl(a,f)}),l.showReleaseNotesOnLaunch()&&t("/settings/release-notes")};return{api:r,state:bo({store:e,navigate:t,state:o,provider:s,fullAPI:l,...p}),init:u}};var Me={};E(Me,{init:()=>Eo});var xt=b(require("global")),T=b(require("semver")),wt=b(require("memoizerific"));var Et="7.0.0-alpha.58";var{VERSIONCHECK:vo}=xt.default,Ct=(0,wt.default)(1)(()=>{try{return{...JSON.parse(vo).data||{}}}catch{return{}}}),Eo=({store:e,mode:t,fullAPI:o})=>{let{dismissedVersionNotification:s}=e.getState(),l={versions:{current:{version:Et},...Ct()},dismissedVersionNotification:s},p={getCurrentVersion:()=>{let{versions:{current:r}}=e.getState();return r},getLatestVersion:()=>{let{versions:{latest:r,next:u,current:i}}=e.getState();return i&&T.default.prerelease(i.version)&&u?r&&T.default.gt(r.version,u.version)?r:u:r},versionUpdateAvailable:()=>{let r=p.getLatestVersion(),u=p.getCurrentVersion();if(r){if(!r.version||!u.version)return!0;let n=!!T.default.prerelease(u.version)?`${T.default.major(u.version)}.${T.default.minor(u.version)}.${T.default.patch(u.version)}`:u.version,a=T.default.diff(n,r.version);return T.default.gt(r.version,n)&&a!=="patch"&&!a.includes("pre")}return!1}};return{init:async()=>{let{versions:r={}}=e.getState(),{latest:u,next:i}=Ct();if(await e.setState({versions:{...r,latest:u,next:i}}),p.versionUpdateAvailable()){let n=p.getLatestVersion().version,a=T.default.diff(r.current.version,r.latest.version);n!==s&&a!=="patch"&&!T.default.prerelease(n)&&t!=="production"&&o.addNotification({id:"update",link:"/settings/about",content:{headline:`Storybook ${n} is available!`,subHeadline:`Your current version is: ${r.current.version}`},icon:{name:"book"},onClear(){e.setState({dismissedVersionNotification:n},{persistence:"permanent"})}})}},state:l,api:p}};var Fe={};E(Fe,{init:()=>Co});var K=require("@storybook/core-events"),Le=require("@storybook/client-logger"),Ne=require("dequal");var Co=({store:e,fullAPI:t})=>{let o={getGlobals(){return e.getState().globals},getGlobalTypes(){return e.getState().globalTypes},updateGlobals(c){t.emit(K.UPDATE_GLOBALS,{globals:c,options:{target:"storybook-preview-iframe"}})}},s={globals:{},globalTypes:{}},l=c=>{var u;let r=(u=e.getState())==null?void 0:u.globals;(0,Ne.dequal)(c,r)||e.setState({globals:c})};return{api:o,state:s,init:()=>{t.on(K.GLOBALS_UPDATED,function({globals:r}){let{ref:u}=w(this,t);u?Le.logger.warn("received a GLOBALS_UPDATED from a non-local ref. This is not currently supported."):l(r)}),t.on(K.SET_GLOBALS,function({globals:r,globalTypes:u}){var a;let{ref:i}=w(this,t),n=(a=e.getState())==null?void 0:a.globals;i?Object.keys(r).length>0&&Le.logger.warn("received globals from a non-local ref. This is not currently supported."):e.setState({globals:r,globalTypes:u}),n&&Object.keys(n).length!==0&&!(0,Ne.dequal)(r,n)&&o.updateGlobals(n)})}}};var re=b(require("global")),Rt=require("@storybook/core-events"),ne=require("@storybook/types"),Ot=require("@storybook/client-logger");var Tt=require("@storybook/channels");function oe(){let e={setHandler:()=>{},send:()=>{}};return new Tt.Channel({transport:e})}var Ke=class{constructor(){this.loaders={};this.elements={};this.config={};this.getChannel=()=>(this.channel||this.setChannel(oe()),this.channel);this.getServerChannel=()=>{if(!this.serverChannel)throw new Error("Accessing non-existent serverChannel");return this.serverChannel};this.ready=()=>this.promise;this.hasChannel=()=>!!this.channel;this.hasServerChannel=()=>!!this.serverChannel;this.setChannel=t=>{this.channel=t,this.resolve()};this.setServerChannel=t=>{this.serverChannel=t};this.getElements=t=>(this.elements[t]||(this.elements[t]={}),this.elements[t]);this.addPanel=(t,o)=>{this.add(t,{type:ne.Addon_TypesEnum.PANEL,...o})};this.add=(t,o)=>{let{type:s}=o,l=this.getElements(s);l[t]={id:t,...o}};this.setConfig=t=>{Object.assign(this.config,t),this.hasChannel()&&this.getChannel().emit(Rt.SET_CONFIG,t)};this.getConfig=()=>this.config;this.register=(t,o)=>{this.loaders[t]&&Ot.logger.warn(`${t} was loaded twice, this could have bad side-effects`),this.loaders[t]=o};this.loadAddons=t=>{Object.values(this.loaders).forEach(o=>o(t))};this.promise=new Promise(t=>{this.resolve=()=>t(this.getChannel())})}},je="__STORYBOOK_ADDONS_MANAGER";function xo(){return re.default[je]||(re.default[je]=new Ke),re.default[je]}var kt=xo();var{ActiveTabs:wo}=J;var B=Ue({api:void 0,state:W({})}),ge=(...e)=>(0,Dt.default)({},...e,(t,o)=>{if(Array.isArray(o))return o}),se=class extends h.Component{constructor(o){super(o);this.api={};this.initModules=()=>{this.modules.forEach(o=>{"init"in o&&o.init()})};let{location:s,path:l,refId:p,viewMode:c=o.docsOptions.docsMode?"docs":"story",singleStory:r,storyId:u,docsOptions:i,navigate:n}=o,a=new H({getState:()=>this.state,setState:(g,_)=>this.setState(g,_)}),f={location:s,path:l,viewMode:c,singleStory:r,storyId:u,refId:p},d={docsOptions:i};this.state=a.getInitialState(W({...f,...d}));let S={navigate:n,store:a,provider:o.provider};this.modules=[le,pe,de,J,fe,Se,ye,Te,ve,Ie,Fe,De,Me].map(g=>g.init({...f,...d,...S,state:this.state,fullAPI:this.api}));let y=W(this.state,...this.modules.map(g=>g.state)),m=Object.assign(this.api,{navigate:n},...this.modules.map(g=>g.api));this.state=y,this.api=m}static getDerivedStateFromProps(o,s){return s.path!==o.path?{...s,location:o.location,path:o.path,refId:o.refId,viewMode:o.viewMode,storyId:o.storyId}:null}shouldComponentUpdate(o,s){let l=this.state,p=this.props;return l!==s||p.path!==o.path}render(){let{children:o}=this.props,s={state:this.state,api:this.api};return h.default.createElement(To,{effect:this.initModules},h.default.createElement(B.Provider,{value:s},h.default.createElement(Mt,null,o)))}};se.displayName="Manager";var To=({children:e,effect:t})=>(h.default.useEffect(t,[]),e),Ro=e=>e;function Mt({filter:e=Ro,children:t}){let o=(0,h.useContext)(B),s=(0,h.useRef)(t),l=(0,h.useRef)(e);if(typeof s.current!="function")return h.default.createElement(h.Fragment,null,s.current);let p=l.current(o),c=(0,h.useMemo)(()=>[...Object.entries(p).reduce((r,u)=>r.concat(u),[])],[o.state]);return(0,h.useMemo)(()=>{let r=s.current;return h.default.createElement(r,{...p})},c)}function Oo(){let{state:e}=(0,h.useContext)(B);return e}function k(){let{api:e}=(0,h.useContext)(B);return e}function Lt(e,t){return typeof e>"u"?t:e}var Nt=(e,t=[])=>{let o=k();return(0,h.useEffect)(()=>(Object.entries(e).forEach(([s,l])=>o.on(s,l)),()=>{Object.entries(e).forEach(([s,l])=>o.off(s,l))}),t),o.emit};function ko(e){return k().isPrepared(e)}function Do(e,t){let s=k().getCurrentParameter(e);return Lt(s,t)}var O={};function Ft(e,t){let o=k(),s=o.getAddonState(e),l=Lt(s,O[e]?O[e]:t),p=(u,i)=>{O[e]&&(O[e]=u),o.setAddonState(e,u,i)},c=(0,h.useMemo)(()=>{let u={[`${C.SHARED_STATE_CHANGED}-client-${e}`]:n=>p(n),[`${C.SHARED_STATE_SET}-client-${e}`]:n=>p(n)},i={[C.SET_STORIES]:()=>{let n=o.getAddonState(e);n?(O[e]=n,o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,n)):O[e]?(p(O[e]),o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,O[e])):t!==void 0&&(p(t),O[e]=t,o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,t))},[C.STORY_CHANGED]:()=>{let n=o.getAddonState(e);n!==void 0&&o.emit(`${C.SHARED_STATE_SET}-manager-${e}`,n)}};return{...u,...i}},[e]),r=Nt(c);return[l,(u,i)=>{p(u,i),r(`${C.SHARED_STATE_CHANGED}-manager-${e}`,u)}]}function Mo(e,t){return Ft(e,t)}function Lo(){let{getCurrentStoryData:e,updateStoryArgs:t,resetStoryArgs:o}=k(),s=e(),l=s.type==="story"?s.args:{},p=(0,h.useCallback)(r=>t(s,r),[s,t]),c=(0,h.useCallback)(r=>o(s,r),[s,o]);return[l,p,c]}function No(){let e=k();return[e.getGlobals(),e.updateGlobals]}function Fo(){return k().getGlobalTypes()}function jo(){let{getCurrentStoryData:e}=k();return e()}function Ko(){let e=jo();return(e==null?void 0:e.type)==="story"&&e.argTypes||{}}0&&(module.exports={ActiveTabs,Consumer,ManagerContext,Provider,addons,combineParameters,controlOrMetaKey,controlOrMetaSymbol,eventMatchesShortcut,eventToShortcut,isMacLike,isShortcutTaken,keyToSymbol,merge,mockChannel,optionOrAltSymbol,shortcutMatchesShortcut,shortcutToHumanString,types,useAddonState,useArgTypes,useArgs,useChannel,useGlobalTypes,useGlobals,useParameter,useSharedState,useStoryPrepared,useStorybookApi,useStorybookState});
{
"name": "@storybook/manager-api",
"version": "7.0.0-alpha.57",
"version": "7.0.0-alpha.58",
"description": "Core Storybook API & Context",

@@ -44,9 +44,9 @@ "keywords": [

"dependencies": {
"@storybook/channels": "7.0.0-alpha.57",
"@storybook/client-logger": "7.0.0-alpha.57",
"@storybook/core-events": "7.0.0-alpha.57",
"@storybook/channels": "7.0.0-alpha.58",
"@storybook/client-logger": "7.0.0-alpha.58",
"@storybook/core-events": "7.0.0-alpha.58",
"@storybook/csf": "next",
"@storybook/router": "7.0.0-alpha.57",
"@storybook/theming": "7.0.0-alpha.57",
"@storybook/types": "7.0.0-alpha.57",
"@storybook/router": "7.0.0-alpha.58",
"@storybook/theming": "7.0.0-alpha.58",
"@storybook/types": "7.0.0-alpha.58",
"dequal": "^2.0.2",

@@ -81,3 +81,3 @@ "global": "^4.4.0",

},
"gitHead": "5a87a203fd293c1199ca5303af1923892a1fccae"
"gitHead": "c7f8e3e8486ab5caf3da0ef016acfd2065f0dc05"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc