@histoire/plugin-svelte
Version:
Histoire plugin for Svelte support
2 lines (1 loc) • 2.49 kB
JavaScript
import{create_slot as p,get_all_dirty_from_scope as d,get_slot_changes as g,update_slot_base as b,transition_in as f,transition_out as a,assign as m,create_component as y,mount_component as C,get_spread_object as $,get_spread_update as j,destroy_component as I,empty as M,insert as P,detach as q,compute_rest_props as k,compute_slots as F,exclude_internal_props as O,SvelteComponent as V,safe_not_equal as z,init as A}from"svelte/internal";import"svelte/internal/disclose-version";import{omitInheritStoryProps as B}from"@histoire/shared";import{getContext as D,setContext as v}from"svelte";import E from"./MountVariant.svelte.js";const G=s=>({}),S=s=>({slot:"controls"});function H(s){let o;const r=s[3].default,e=p(r,s,s[4],null);return{c(){e&&e.c()},m(t,n){e&&e.m(t,n),o=!0},p(t,n){e&&e.p&&(!o||n&16)&&b(e,r,t,t[4],o?g(r,t[4],n,null):d(t[4]),null)},i(t){o||(f(e,t),o=!0)},o(t){a(e,t),o=!1},d(t){e&&e.d(t)}}}function J(s){let o,r;const e=[s[0],s[2],{implicit:!0}];let t={$$slots:{controls:[L],default:[K]},$$scope:{ctx:s}};for(let n=0;n<e.length;n+=1)t=m(t,e[n]);return o=new E({props:t}),{c(){y(o.$$.fragment)},m(n,l){C(o,n,l),r=!0},p(n,l){const c=l&5?j(e,[l&1&&$(n[0]),l&4&&$(n[2]),e[2]]):{};l&16&&(c.$$scope={dirty:l,ctx:n}),o.$set(c)},i(n){r||(f(o.$$.fragment,n),r=!0)},o(n){a(o.$$.fragment,n),r=!1},d(n){I(o,n)}}}function K(s){let o;const r=s[3].default,e=p(r,s,s[4],null);return{c(){e&&e.c()},m(t,n){e&&e.m(t,n),o=!0},p(t,n){e&&e.p&&(!o||n&16)&&b(e,r,t,t[4],o?g(r,t[4],n,null):d(t[4]),null)},i(t){o||(f(e,t),o=!0)},o(t){a(e,t),o=!1},d(t){e&&e.d(t)}}}function L(s){let o;const r=s[3].controls,e=p(r,s,s[4],S);return{c(){e&&e.c()},m(t,n){e&&e.m(t,n),o=!0},p(t,n){e&&e.p&&(!o||n&16)&&b(e,r,t,t[4],o?g(r,t[4],n,G):d(t[4]),S)},i(t){o||(f(e,t),o=!0)},o(t){a(e,t),o=!1},d(t){e&&e.d(t)}}}function N(s){let o,r,e,t;const n=[J,H],l=[];function c(u,i){return u[1].variants.length===1&&u[1].variants[0].id==="_default"?0:1}return o=c(s,-1),r=l[o]=n[o](s),{c(){r.c(),e=M()},m(u,i){l[o].m(u,i),P(u,e,i),t=!0},p(u,[i]){r.p(u,i)},i(u){t||(f(r),t=!0)},o(u){a(r),t=!1},d(u){u&&q(e),l[o].d(u)}}}function Q(s,o,r){let e;const t=[];let n=k(o,t),{$$slots:l={},$$scope:c}=o;const u=F(l),i=D("__hstStory");return v("__hstIndex",{value:0}),v("__hstSlots",u),s.$$set=_=>{o=m(m({},o),O(_)),r(2,n=k(o,t)),"$$scope"in _&&r(4,c=_.$$scope)},r(0,e=Object.keys(i).filter(_=>!B.includes(_)).reduce((_,h)=>(_[h]=i[h],_),{})),[e,i,n,l,c]}class Z extends V{constructor(o){super(),A(this,o,Q,N,z,{})}}export{Z as default};