hypnagaga/docs/assets/GraphicBlock-a49943f2.js
2023-10-03 18:07:23 +00:00

4 lines
14 KiB
JavaScript

import{S as M,i as P,s as U,k as N,d as b,v as W,h as u,w as L,t as c,f as g,l as A,u as I,p as V,q as S,o as T,b as Y,g as w,m as $,j as v,x as te,y as H,n as E,z as ie,e as le,A as ne,H as Z}from"./index-8e2228d6.js";import{B as x}from"./Block-9ace8085.js";import{P as G}from"./PaddingReset-fee7ab45.js";import{m as F}from"./marked.esm-76161808.js";function se(s){let t;const l=s[2].default,e=A(l,s,s[1],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&2)&&I(e,l,i,i[1],t?S(l,i[1],n,null):V(i[1]),null)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function oe(s){let t,l;const e=s[2].default,i=A(e,s,s[1],null);return{c(){t=T("div"),i&&i.c(),Y(t,"aria-hidden","true")},m(n,o){b(n,t,o),i&&i.m(t,null),l=!0},p(n,o){i&&i.p&&(!l||o&2)&&I(i,e,n,n[1],l?S(e,n[1],o,null):V(n[1]),null)},i(n){l||(c(i,n),l=!0)},o(n){u(i,n),l=!1},d(n){n&&g(t),i&&i.d(n)}}}function re(s){let t,l,e,i;const n=[oe,se],o=[];function f(r,d){return r[0]?0:1}return t=f(s),l=o[t]=n[t](s),{c(){l.c(),e=N()},m(r,d){o[t].m(r,d),b(r,e,d),i=!0},p(r,[d]){let k=t;t=f(r),t===k?o[t].p(r,d):(W(),u(o[k],1,1,()=>{o[k]=null}),L(),l=o[t],l?l.p(r,d):(l=o[t]=n[t](r),l.c()),c(l,1),l.m(e.parentNode,e))},i(r){i||(c(l),i=!0)},o(r){u(l),i=!1},d(r){r&&g(e),o[t].d(r)}}}function ae(s,t,l){let{$$slots:e={},$$scope:i}=t,{hidden:n=!1}=t;return s.$$set=o=>{"hidden"in o&&l(0,n=o.hidden),"$$scope"in o&&l(1,i=o.$$scope)},[n,i,e]}class ee extends M{constructor(t){super(),P(this,t,ae,re,U,{hidden:0})}}ee.__docgen={version:3,name:"AriaHidden.svelte",data:[{keywords:[],visibility:"public",description:"Whether to wrap the graphic with an aria hidden tag.",name:"hidden",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default"}],refs:[]};function fe(s){let t;const l=s[1].default,e=A(l,s,s[2],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&4)&&I(e,l,i,i[2],t?S(l,i[2],n,null):V(i[2]),null)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function ce(s){let t,l;return t=new x({props:{width:s[0],class:"notes fmy-0",$$slots:{default:[ue]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.width=e[0]),i&4&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ue(s){let t;const l=s[1].default,e=A(l,s,s[2],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&4)&&I(e,l,i,i[2],t?S(l,i[2],n,null):V(i[2]),null)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function de(s){let t,l,e,i;const n=[ce,fe],o=[];function f(r,d){return r[0]?0:1}return t=f(s),l=o[t]=n[t](s),{c(){l.c(),e=N()},m(r,d){o[t].m(r,d),b(r,e,d),i=!0},p(r,[d]){let k=t;t=f(r),t===k?o[t].p(r,d):(W(),u(o[k],1,1,()=>{o[k]=null}),L(),l=o[t],l?l.p(r,d):(l=o[t]=n[t](r),l.c()),c(l,1),l.m(e.parentNode,e))},i(r){i||(c(l),i=!0)},o(r){u(l),i=!1},d(r){r&&g(e),o[t].d(r)}}}function pe(s,t,l){let{$$slots:e={},$$scope:i}=t,{width:n=null}=t;return s.$$set=o=>{"width"in o&&l(0,n=o.width),"$$scope"in o&&l(2,i=o.$$scope)},[n,e,i]}class D extends M{constructor(t){super(),P(this,t,pe,de,U,{width:0})}}D.__docgen={version:3,name:"TextBlock.svelte",data:[{keywords:[],visibility:"public",description:"Width of the component within the text well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default"}],refs:[]};const _e=s=>({}),J=s=>({}),me=s=>({}),K=s=>({}),ke=s=>({}),O=s=>({});function be(s){let t,l;return t=new G({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[ye]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8640&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ge(s){let t,l;return t=new G({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[$e]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8256&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Q(s){let t,l=F(s[8])+"",e;return{c(){t=new Z(!1),e=N(),t.a=e},m(i,n){t.m(l,i,n),b(i,e,n)},p(i,n){n&256&&l!==(l=F(i[8])+"")&&t.p(l)},d(i){i&&(g(e),t.d())}}}function he(s){let t,l,e,i,n=s[8]&&Q(s);return{c(){t=T("h3"),l=ie(s[7]),e=H(),n&&n.c(),i=N()},m(o,f){b(o,t,f),le(t,l),b(o,e,f),n&&n.m(o,f),b(o,i,f)},p(o,f){f&128&&ne(l,o[7]),o[8]?n?n.p(o,f):(n=Q(o),n.c(),n.m(i.parentNode,i)):n&&(n.d(1),n=null)},d(o){o&&(g(t),g(e),g(i)),n&&n.d(o)}}}function ye(s){let t,l;return t=new D({props:{width:s[6],$$slots:{default:[he]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8576&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function we(s){let t;const l=s[12].title,e=A(l,s,s[13],O);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?S(l,i[13],n,ke):V(i[13]),O)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function $e(s){let t,l;return t=new D({props:{width:s[6],$$slots:{default:[we]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8192&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function ve(s){let t;const l=s[12].default,e=A(l,s,s[13],null);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?S(l,i[13],n,null):V(i[13]),null)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function X(s){let t,l,e,i;const n=[Ie,Ae],o=[];function f(r,d){return r[11].aria?0:1}return l=f(s),e=o[l]=n[l](s),{c(){t=T("div"),e.c(),Y(t,"class","visually-hidden")},m(r,d){b(r,t,d),o[l].m(t,null),i=!0},p(r,d){let k=l;l=f(r),l===k?o[l].p(r,d):(W(),u(o[k],1,1,()=>{o[k]=null}),L(),e=o[l],e?e.p(r,d):(e=o[l]=n[l](r),e.c()),c(e,1),e.m(t,null))},i(r){i||(c(e),i=!0)},o(r){u(e),i=!1},d(r){r&&g(t),o[l].d()}}}function Ae(s){let t,l=F(s[10])+"",e;return{c(){t=new Z(!1),e=N(),t.a=e},m(i,n){t.m(l,i,n),b(i,e,n)},p(i,n){n&1024&&l!==(l=F(i[10])+"")&&t.p(l)},i:E,o:E,d(i){i&&(g(e),t.d())}}}function Ie(s){let t;const l=s[12].aria,e=A(l,s,s[13],K);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?S(l,i[13],n,me):V(i[13]),K)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function Ve(s){let t,l;return t=new G({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Le]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8288&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Se(s){let t,l;return t=new G({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Ne]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&1&&(n.containerIsFluid=e[0]==="fluid"),i&8256&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function We(s){let t,l=F(s[5])+"";return{c(){t=T("aside")},m(e,i){b(e,t,i),t.innerHTML=l},p(e,i){i&32&&l!==(l=F(e[5])+"")&&(t.innerHTML=l)},d(e){e&&g(t)}}}function Le(s){let t,l;return t=new D({props:{width:s[6],$$slots:{default:[We]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8224&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Fe(s){let t;const l=s[12].notes,e=A(l,s,s[13],J);return{c(){e&&e.c()},m(i,n){e&&e.m(i,n),t=!0},p(i,n){e&&e.p&&(!t||n&8192)&&I(e,l,i,i[13],t?S(l,i[13],n,_e):V(i[13]),J)},i(i){t||(c(e,i),t=!0)},o(i){u(e,i),t=!1},d(i){e&&e.d(i)}}}function Ne(s){let t,l;return t=new D({props:{width:s[6],$$slots:{default:[Fe]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,i){const n={};i&64&&(n.width=e[6]),i&8192&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Re(s){let t,l,e,i,n,o,f,r,d,k;const R=[ge,be],h=[];function B(a,m){return a[11].title?0:a[7]?1:-1}~(t=B(s))&&(l=h[t]=R[t](s)),i=new ee({props:{hidden:!!s[11].aria||!!s[10],$$slots:{default:[ve]},$$scope:{ctx:s}}});let _=(s[11].aria||s[10])&&X(s);const C=[Se,Ve],y=[];function p(a,m){return a[11].notes?0:a[5]?1:-1}return~(f=p(s))&&(r=y[f]=C[f](s)),{c(){l&&l.c(),e=H(),w(i.$$.fragment),n=H(),_&&_.c(),o=H(),r&&r.c(),d=N()},m(a,m){~t&&h[t].m(a,m),b(a,e,m),$(i,a,m),b(a,n,m),_&&_.m(a,m),b(a,o,m),~f&&y[f].m(a,m),b(a,d,m),k=!0},p(a,m){let z=t;t=B(a),t===z?~t&&h[t].p(a,m):(l&&(W(),u(h[z],1,1,()=>{h[z]=null}),L()),~t?(l=h[t],l?l.p(a,m):(l=h[t]=R[t](a),l.c()),c(l,1),l.m(e.parentNode,e)):l=null);const j={};m&3072&&(j.hidden=!!a[11].aria||!!a[10]),m&8192&&(j.$$scope={dirty:m,ctx:a}),i.$set(j),a[11].aria||a[10]?_?(_.p(a,m),m&3072&&c(_,1)):(_=X(a),_.c(),c(_,1),_.m(o.parentNode,o)):_&&(W(),u(_,1,1,()=>{_=null}),L());let q=f;f=p(a),f===q?~f&&y[f].p(a,m):(r&&(W(),u(y[q],1,1,()=>{y[q]=null}),L()),~f?(r=y[f],r?r.p(a,m):(r=y[f]=C[f](a),r.c()),c(r,1),r.m(d.parentNode,d)):r=null)},i(a){k||(c(l),c(i.$$.fragment,a),c(_),c(r),k=!0)},o(a){u(l),u(i.$$.fragment,a),u(_),u(r),k=!1},d(a){a&&(g(e),g(n),g(o),g(d)),~t&&h[t].d(a),v(i,a),_&&_.d(a),~f&&y[f].d(a)}}}function Be(s){let t,l;return t=new x({props:{id:s[1],snap:s[3],role:s[4],width:s[0],ariaLabel:s[9],class:"graphic fmy-6 "+s[2],$$slots:{default:[Re]},$$scope:{ctx:s}}}),{c(){w(t.$$.fragment)},m(e,i){$(t,e,i),l=!0},p(e,[i]){const n={};i&2&&(n.id=e[1]),i&8&&(n.snap=e[3]),i&16&&(n.role=e[4]),i&1&&(n.width=e[0]),i&512&&(n.ariaLabel=e[9]),i&4&&(n.class="graphic fmy-6 "+e[2]),i&11745&&(n.$$scope={dirty:i,ctx:e}),t.$set(n)},i(e){l||(c(t.$$.fragment,e),l=!0)},o(e){u(t.$$.fragment,e),l=!1},d(e){v(t,e)}}}function Ce(s,t,l){let{$$slots:e={},$$scope:i}=t;const n=te(e);let{width:o="normal"}=t,{id:f=""}=t,{class:r=""}=t,{snap:d=!1}=t,{role:k=null}=t,{notes:R=null}=t,{textWidth:h="normal"}=t,{title:B=null}=t,{description:_=null}=t,{ariaLabel:C="chart"}=t,{ariaDescription:y=null}=t;return s.$$set=p=>{"width"in p&&l(0,o=p.width),"id"in p&&l(1,f=p.id),"class"in p&&l(2,r=p.class),"snap"in p&&l(3,d=p.snap),"role"in p&&l(4,k=p.role),"notes"in p&&l(5,R=p.notes),"textWidth"in p&&l(6,h=p.textWidth),"title"in p&&l(7,B=p.title),"description"in p&&l(8,_=p.description),"ariaLabel"in p&&l(9,C=p.ariaLabel),"ariaDescription"in p&&l(10,y=p.ariaDescription),"$$scope"in p&&l(13,i=p.$$scope)},[o,f,r,d,k,R,h,B,_,C,y,n,e,i]}class De extends M{constructor(t){super(),P(this,t,Ce,Be,U,{width:0,id:1,class:2,snap:3,role:4,notes:5,textWidth:6,title:7,description:8,ariaLabel:9,ariaDescription:10})}}De.__docgen={version:3,name:"GraphicBlock.svelte",data:[{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Width of the component within the text well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[{name:"type",description:"{string}"}],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Snap block to column widths, rather than fluidly resizing them.",name:"snap",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Notes to the graphic, passed in as a markdown string.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:`Set a different width for the text within the text well, for example,
"normal" to keep the title, description and notes inline with the rest
of the text well. Can't ever be wider than \`width\`.`,name:"textWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Title of the graphic",name:"title",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Description of the graphic, passed in as a markdown string.",name:"description",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block",name:"ariaLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"chart"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA description, passed in as a markdown string.",name:"ariaDescription",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Custom title content",name:"title"},{keywords:[],visibility:"public",description:"Graphic content",name:"default"},{keywords:[],visibility:"public",description:"Custom ARIA markup",name:"aria"},{keywords:[],visibility:"public",description:"Custom notes content",name:"notes"}],refs:[]};export{De as G};
//# sourceMappingURL=GraphicBlock-a49943f2.js.map