Anvil/assets/entry-preview-16b20cee.js
André Jaenisch e5b80964ed
Updates
2024-02-23 14:08:28 +01:00

5 lines
7.4 KiB
JavaScript

import{a as Y,b as j}from"./utils-09ff0c0e.js";import{e as _,i as O,d as v,o as K,w}from"./lifecycle-9898a056.js";import{S as B,i as L,b as d,e as E,t as m,g as R,f as M,c as y,a as T,m as h,d as g}from"./index-d94d5794.js";import{g as k,a as b}from"./spread-8a54911c.js";import{d as W}from"./index-356e4a49.js";function q(s){let e,n,i;const a=[s[2]];var r=s[1];function f(t,o){let l={};if(o!==void 0&&o&4)l=k(a,[b(t[2])]);else for(let c=0;c<a.length;c+=1)l=j(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[8](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&T(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),O(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){R();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),E()}r?(e=w(r,f(t,o)),t[8](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?k(a,[b(t[2])]):{};e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&v(n),s[8](null),e&&g(e,t)}}}function z(s){let e,n,i;const a=[s[0].props];var r=s[0].Component;function f(t,o){let l={$$slots:{default:[G]},$$scope:{ctx:t}};if(o!==void 0&&o&1)l=k(a,[b(t[0].props)]);else for(let c=0;c<a.length;c+=1)l=j(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[7](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&T(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),O(t,n,o),i=!0},p(t,o){if(o&1&&r!==(r=t[0].Component)){if(e){R();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),E()}r?(e=w(r,f(t,o)),t[7](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&1?k(a,[b(t[0].props)]):{};o&1038&&(l.$$scope={dirty:o,ctx:t}),e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&v(n),s[7](null),e&&g(e,t)}}}function G(s){let e,n,i;const a=[s[2]];var r=s[1];function f(t,o){let l={};if(o!==void 0&&o&4)l=k(a,[b(t[2])]);else for(let c=0;c<a.length;c+=1)l=j(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[6](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&T(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),O(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){R();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),E()}r?(e=w(r,f(t,o)),t[6](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?k(a,[b(t[2])]):{};e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&v(n),s[6](null),e&&g(e,t)}}}function H(s){let e,n,i,a;const r=[z,q],f=[];function t(o,l){return o[0]?0:1}return e=t(s),n=f[e]=r[e](s),{c(){n.c(),i=_()},l(o){n.l(o),i=_()},m(o,l){f[e].m(o,l),O(o,i,l),a=!0},p(o,[l]){let c=e;e=t(o),e===c?f[e].p(o,l):(R(),d(f[c],1,1,()=>{f[c]=null}),E(),n=f[e],n?n.p(o,l):(n=f[e]=r[e](o),n.c()),m(n,1),n.m(i.parentNode,i))},i(o){a||(m(n),a=!0)},o(o){d(n),a=!1},d(o){o&&v(i),f[e].d(o)}}}function J(s,e,n){let{decorator:i=void 0}=e,{Component:a}=e,{props:r={}}=e,{on:f=void 0}=e,t,o;function l(){return t||o}f&&Object.keys(f).forEach(p=>{K(()=>l().$on(p,f[p]))});function c(p){M[p?"unshift":"push"](()=>{t=p,n(3,t)})}function S(p){M[p?"unshift":"push"](()=>{o=p,n(4,o)})}function D(p){M[p?"unshift":"push"](()=>{t=p,n(3,t)})}return s.$$set=p=>{"decorator"in p&&n(0,i=p.decorator),"Component"in p&&n(1,a=p.Component),"props"in p&&n(2,r=p.props),"on"in p&&n(5,f=p.on)},[i,a,r,t,o,f,c,S,D]}class A extends B{constructor(e){super(),L(this,e,J,H,Y,{decorator:0,Component:1,props:2,on:5})}}A.__docgen={version:3,name:"SlotDecorator.svelte",data:[{visibility:"public",description:null,keywords:[],name:"decorator",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"Component",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"props",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{visibility:"public",description:null,keywords:[],name:"on",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Q(s){let e,n;return e=new A({props:{Component:s[0],props:s[1],on:{...s[3],...s[2]}}}),{c(){y(e.$$.fragment)},l(i){T(e.$$.fragment,i)},m(i,a){h(e,i,a),n=!0},p(i,[a]){const r={};a&1&&(r.Component=i[0]),a&2&&(r.props=i[1]),a&4&&(r.on={...i[3],...i[2]}),e.$set(r)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){d(e.$$.fragment,i),n=!1},d(i){g(e,i)}}}function X(s,e,n){let{name:i}=e,{kind:a}=e,{storyFn:r}=e,{showError:f}=e,{storyContext:t}=e,{Component:o,props:l={},on:c}=r(),S=!0;function D(u){return S?(S=!1,{Component:o,props:l,on:c}):u()}const p=Object.fromEntries(Object.entries(t.argTypes).filter(([u,F])=>F.action&&l[u]!=null).map(([u,F])=>[F.action,l[u]]));return o||f({title:`Expecting a Svelte component from the story: "${i}" of "${a}".`,description:W`
Did you forget to return the Svelte component configuration from the story?
Use "() => ({ Component: YourComponent, props: {} })"
when defining the story.
`}),s.$$set=u=>{"name"in u&&n(4,i=u.name),"kind"in u&&n(5,a=u.kind),"storyFn"in u&&n(6,r=u.storyFn),"showError"in u&&n(7,f=u.showError),"storyContext"in u&&n(8,t=u.storyContext)},s.$$.update=()=>{s.$$.dirty&64&&n(0,{Component:o,props:l={},on:c}=D(r),o,(n(1,l),n(6,r)),(n(2,c),n(6,r)))},[o,l,c,p,i,a,r,f,t]}class V extends B{constructor(e){super(),L(this,e,X,Q,Y,{name:4,kind:5,storyFn:6,showError:7,storyContext:8})}}V.__docgen={version:3,name:"PreviewRender.svelte",data:[{visibility:"public",description:null,keywords:[],name:"name",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"kind",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"storyFn",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"showError",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"storyContext",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const{addons:Z,sanitizeStoryContextUpdate:$}=__STORYBOOK_MODULE_PREVIEW_API__,{RESET_STORY_ARGS:x}=__STORYBOOK_MODULE_CORE_EVENTS__;function I(s){return s&&typeof s=="object"&&"default"in s?s.default:s}function N(s,e,n){let i=I(e),a=n&&I(n),r;return!i||Object.keys(i).length===0?r={Component:s.component}:i.Component?r=i:r={Component:i},a?{Component:A,props:{...a,decorator:r}}:r}function ie(s,e){return e.reduce((n,i)=>a=>{let r,f=i(t=>(r=n({...a,...$(t)}),r),a);return r||(r=n(a)),f===r?r:N(a,f,r)},n=>N(n,s(n)))}var C=new Map;function P(s){C.has(s)&&(C.get(s).$destroy(),s.innerHTML="",C.delete(s))}var U=new Set;Z.getChannel().on(x,({storyId:s})=>{U.add(s)});function se({storyFn:s,kind:e,name:n,showMain:i,showError:a,storyContext:r,forceRemount:f},t){let o=C.get(t),l=f;if(U.has(r.id)&&(l=!0,U.delete(r.id)),l&&P(t),!o||l){let c=new V({target:t,props:{storyFn:s,storyContext:r,name:n,kind:e,showError:a}});C.set(t,c)}else o.$set({storyFn:s,storyContext:r,name:n,kind:e,showError:a});return i(),()=>{P(t)}}var le=(s,e)=>{let{id:n,component:i}=e;if(!i)throw new Error(`Unable to render story ${n} as the component annotation is missing from the default export`);return{Component:i,props:s}},ae={renderer:"svelte"};export{ie as applyDecorators,ae as parameters,le as render,se as renderToCanvas};