diff --git a/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.Rmd b/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.Rmd new file mode 100644 index 0000000..a2b1502 --- /dev/null +++ b/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.Rmd @@ -0,0 +1,184 @@ +--- +title: "HW4: Univariate Statistics" +description: | + 2017 Australian Marraige Law dataset: tidying/cleaning the data, discussing the variables, incorporating some visualizations (all for practice) +author: Megan Georges +date: 10-30-2021 +output: + distill::distill_article: + self_contained: false +draft: true +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +library(distill) +library(tidyverse) +library(dplyr) +library(stringr) +library(readxl) +library(ggplot2) +``` + +# Description of the Dataset and Variables + +## 2017 Australian Marraige Law + +A postal survey was sent to Australians asking the question: Should the law be changed to allow same-sex couples to marry? The data was reported by the Australian Bureau of Statistics using Excel. + +## Variables + + +* Divisions (Australian States/Territories) +* Cities (within the Divisions) +* Response_Clear_Yes: those who clearly selected Yes in support of the new marraige law +* Response_Clear_No: those who clearly selected No to the new marraige law +* Response_Not_Clear: those in which researchers could not determine which answer the respondent intended to select +* Non_Response: those who did not return the survey or select any of the responses + +*** + +# Tidying and Cleaning the Data + +## Read the data into R + +```{r} +ausmarraige <- read_excel("../../_data/australian_marriage_law_postal_survey_2017_-_response_final.xls", "Table 2", skip=6) +head(ausmarraige, 10) +``` + +## View column names + +```{r} +colnames(ausmarraige) +``` + +## Select the columns that we want to keep and rename them + +```{r} +ausmarraige1 <- select(ausmarraige, "...1", "no....2", "no....4", "no....11", "no....13")%>% + rename(Cities=...1, Response_Clear_Yes=no....2, Response_Clear_No=no....4, Response_Not_Clear=no....11, Non_Response=no....13)%>% + drop_na(Cities) + +head(ausmarraige1) +``` + +## Remove division totals and footnotes + +```{r} +ausmarraige1 <- ausmarraige1 %>% + filter(!str_detect(Cities, "Total"))%>% + filter(!str_starts(Cities, "\\("))%>% + filter(Cities != "Australia")%>% + filter(!str_starts(Cities, "\\©")) +``` + +## Create new column for the divisions + +```{r} +ausmarraige1 <- ausmarraige1 %>% + mutate(Divisions = case_when( + str_ends(Cities, "Divisions") ~ Cities + )) +ausmarraige2 <- ausmarraige1[, c("Divisions", "Cities", "Response_Clear_Yes", "Response_Clear_No", "Response_Not_Clear", "Non_Response")] +head(ausmarraige2) +``` + +## Continue to fix the Divisions column using fill + +```{r} +ausmarraige2 <- fill(ausmarraige2, Divisions, .direction = c("down")) +``` + +## Remove the Divisions from the Cities column using filter + +```{r} +ausmarraige2 <- filter(ausmarraige2, !str_detect(Cities, "Divisions")) +head(ausmarraige2) +``` + +## Create a column to show Totals for each City + +```{r} +austotals <- ausmarraige2 %>% + mutate(Total=rowsum(Response_Clear_Yes, Response_Clear_No, Response_Not_Clear, Non_Response)) +head (austotals) +``` + +*** + +# Summary Descriptives of the Variables + +## Divisions and Cities + +Australia comprises of 6 states and 2 territories (thus, 8 Divisions). The number of Cities in each Division is displayed below: + +```{r} +select(ausmarraige2, Divisions)%>% + table() +``` + +**The total number of eligible participants, by division:** + +```{r} +divtotals <- select(austotals, Divisions, Total) +divtotals2 <- divtotals %>% + pivot_wider(names_from = Divisions, values_from = Total, values_fn = sum) +head(divtotals2) +``` + +**A proportion table of the eligible participants based on Division:** + +```{r} +prop.table(divtotals2) +``` + +## Participant Responses + +**Descriptive statistics for Response_Clear_Yes:** + +```{r} +summarize(ausmarraige2, Mean = mean(Response_Clear_Yes), Median = median(Response_Clear_Yes), Min = min(Response_Clear_Yes), Max = max(Response_Clear_Yes), SD = sd(Response_Clear_Yes), Var = var(Response_Clear_Yes), IQR = IQR(Response_Clear_Yes)) +``` + +**Descriptive statistics for Response_Clear_No:** + + +```{r} +summarize(ausmarraige2, Mean = mean(Response_Clear_No), Median = median(Response_Clear_No), Min = min(Response_Clear_No), Max = max(Response_Clear_No), SD = sd(Response_Clear_No), Var = var(Response_Clear_No), IQR = IQR(Response_Clear_No)) +``` + +**Descriptive statistics for Response_Not_Clear:** + +```{r} +summarize(ausmarraige2, Mean = mean(Response_Not_Clear), Median = median(Response_Not_Clear), Min = min(Response_Not_Clear), Max = max(Response_Not_Clear), SD = sd(Response_Not_Clear), Var = var(Response_Not_Clear), IQR = IQR(Response_Not_Clear)) +``` + +**Descriptive statistics for Non_Response:** + +```{r} +summarize(ausmarraige2, Mean = mean(Non_Response), Median = median(Non_Response), Min = min(Non_Response), Max = max(Non_Response), SD = sd(Non_Response), Var = var(Non_Response), IQR = IQR(Non_Response)) +``` + +# Experimenting with a Visualization + +**Bar graph modeling the total number of each response:** + +```{r} +responsetotals <- ausmarraige2 %>% + select(Response_Clear_Yes, Response_Clear_No, Response_Not_Clear, Non_Response)%>% + summarise(Yes=sum(Response_Clear_Yes), No=sum(Response_Clear_No), NotClear=sum(Response_Not_Clear), NonResponse=sum(Non_Response)) +rownames(responsetotals) <- c("Total") + +responsetotals <- pivot_longer(responsetotals, Yes:NonResponse, names_to = "Response", values_to = "Total") + +ggplot(data = responsetotals) + + geom_bar(mapping = aes(x = Response, y = Total), stat = "identity") + + labs(title = "Should Australian Law Change to Allow Same-Sex Marraige?", subtitle = "2017 postal survey of Australians", x = "Type of Response", y = "Total # of Responses") +``` + + + + + + diff --git a/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.html b/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.html new file mode 100644 index 0000000..f9976e8 --- /dev/null +++ b/_posts/2021-10-30-hw4-post-georges/hw4-post-georges.html @@ -0,0 +1,1770 @@ + + + + +
+ + + + + + + + + + + + + + +2017 Australian Marraige Law dataset: tidying/cleaning the data, discussing the variables, incorporating some visualizations (all for practice)
+A postal survey was sent to Australians asking the question: Should the law be changed to allow same-sex couples to marry? The data was reported by the Australian Bureau of Statistics using Excel.
+ausmarraige <- read_excel("../../_data/australian_marriage_law_postal_survey_2017_-_response_final.xls", "Table 2", skip=6)
+head(ausmarraige, 10)
+
+# A tibble: 10 x 16
+ ...1 no....2 `%...3` no....4 `%...5` no....6 `%...7` ...8 no....9
+ <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl> <dbl>
+ 1 New ~ NA NA NA NA NA NA NA NA
+ 2 Banks 37736 44.9 46343 55.1 84079 100 NA 84079
+ 3 Bart~ 37153 43.6 47984 56.4 85137 100 NA 85137
+ 4 Benn~ 42943 49.8 43215 50.2 86158 100 NA 86158
+ 5 Bero~ 48471 54.6 40369 45.4 88840 100 NA 88840
+ 6 Blax~ 20406 26.1 57926 73.9 78332 100 NA 78332
+ 7 Brad~ 53681 60.6 34927 39.4 88608 100 NA 88608
+ 8 Cala~ 54091 60.2 35779 39.8 89870 100 NA 89870
+ 9 Chif~ 32871 41.3 46702 58.7 79573 100 NA 79573
+10 Cook 47505 55 38804 45 86309 100 NA 86309
+# ... with 7 more variables: %...10 <dbl>, no....11 <dbl>,
+# %...12 <dbl>, no....13 <dbl>, %...14 <dbl>, no....15 <dbl>,
+# %...16 <dbl>
+colnames(ausmarraige)
+
+ [1] "...1" "no....2" "%...3" "no....4" "%...5" "no....6"
+ [7] "%...7" "...8" "no....9" "%...10" "no....11" "%...12"
+[13] "no....13" "%...14" "no....15" "%...16"
+ausmarraige1 <- select(ausmarraige, "...1", "no....2", "no....4", "no....11", "no....13")%>%
+ rename(Cities=...1, Response_Clear_Yes=no....2, Response_Clear_No=no....4, Response_Not_Clear=no....11, Non_Response=no....13)%>%
+ drop_na(Cities)
+
+head(ausmarraige1)
+
+# A tibble: 6 x 5
+ Cities Response_Clear_~ Response_Clear_~ Response_Not_Cl~
+ <chr> <dbl> <dbl> <dbl>
+1 New South Wales Divisions NA NA NA
+2 Banks 37736 46343 247
+3 Barton 37153 47984 226
+4 Bennelong 42943 43215 244
+5 Berowra 48471 40369 212
+6 Blaxland 20406 57926 220
+# ... with 1 more variable: Non_Response <dbl>
+ausmarraige1 <- ausmarraige1 %>%
+ filter(!str_detect(Cities, "Total"))%>%
+ filter(!str_starts(Cities, "\\("))%>%
+ filter(Cities != "Australia")%>%
+ filter(!str_starts(Cities, "\\©"))
+
+ausmarraige1 <- ausmarraige1 %>%
+ mutate(Divisions = case_when(
+ str_ends(Cities, "Divisions") ~ Cities
+ ))
+ausmarraige2 <- ausmarraige1[, c("Divisions", "Cities", "Response_Clear_Yes", "Response_Clear_No", "Response_Not_Clear", "Non_Response")]
+head(ausmarraige2)
+
+# A tibble: 6 x 6
+ Divisions Cities Response_Clear_~ Response_Clear_~ Response_Not_Cl~
+ <chr> <chr> <dbl> <dbl> <dbl>
+1 New South~ New S~ NA NA NA
+2 <NA> Banks 37736 46343 247
+3 <NA> Barton 37153 47984 226
+4 <NA> Benne~ 42943 43215 244
+5 <NA> Berow~ 48471 40369 212
+6 <NA> Blaxl~ 20406 57926 220
+# ... with 1 more variable: Non_Response <dbl>
+ausmarraige2 <- filter(ausmarraige2, !str_detect(Cities, "Divisions"))
+head(ausmarraige2)
+
+# A tibble: 6 x 6
+ Divisions Cities Response_Clear_~ Response_Clear_~ Response_Not_Cl~
+ <chr> <chr> <dbl> <dbl> <dbl>
+1 New South~ Banks 37736 46343 247
+2 New South~ Barton 37153 47984 226
+3 New South~ Benne~ 42943 43215 244
+4 New South~ Berow~ 48471 40369 212
+5 New South~ Blaxl~ 20406 57926 220
+6 New South~ Bradf~ 53681 34927 202
+# ... with 1 more variable: Non_Response <dbl>
+austotals <- ausmarraige2 %>%
+ mutate(Total=rowsum(Response_Clear_Yes, Response_Clear_No, Response_Not_Clear, Non_Response))
+head (austotals)
+
+# A tibble: 6 x 7
+ Divisions Cities Response_Clear_~ Response_Clear_~ Response_Not_Cl~
+ <chr> <chr> <dbl> <dbl> <dbl>
+1 New South~ Banks 37736 46343 247
+2 New South~ Barton 37153 47984 226
+3 New South~ Benne~ 42943 43215 244
+4 New South~ Berow~ 48471 40369 212
+5 New South~ Blaxl~ 20406 57926 220
+6 New South~ Bradf~ 53681 34927 202
+# ... with 2 more variables: Non_Response <dbl>, Total <dbl[,1]>
+Australia comprises of 6 states and 2 territories (thus, 8 Divisions). The number of Cities in each Division is displayed below:
+.
+Australian Capital Territory Divisions
+ 2
+ New South Wales Divisions
+ 47
+ Northern Territory Divisions
+ 2
+ Queensland Divisions
+ 30
+ South Australia Divisions
+ 11
+ Tasmania Divisions
+ 5
+ Victoria Divisions
+ 37
+ Western Australia Divisions
+ 16
+The total number of eligible participants, by division:
+divtotals <- select(austotals, Divisions, Total)
+divtotals2 <- divtotals %>%
+ pivot_wider(names_from = Divisions, values_from = Total, values_fn = sum)
+head(divtotals2)
+
+# A tibble: 1 x 8
+ `New South Wales~ `Victoria Divis~ `Queensland Div~ `South Australi~
+ <dbl> <dbl> <dbl> <dbl>
+1 2711012 2092928 1501247 527426
+# ... with 4 more variables: Western Australia Divisions <dbl>,
+# Tasmania Divisions <dbl>, Northern Territory Divisions <dbl>,
+# Australian Capital Territory Divisions <dbl>
+A proportion table of the eligible participants based on Division:
+prop.table(divtotals2)
+
+ New South Wales Divisions Victoria Divisions Queensland Divisions
+1 0.3467988 0.2677321 0.1920429
+ South Australia Divisions Western Australia Divisions
+1 0.06746953 0.0914524
+ Tasmania Divisions Northern Territory Divisions
+1 0.02110833 0.007598327
+ Australian Capital Territory Divisions
+1 0.005797565
+Descriptive statistics for Response_Clear_Yes:
+summarize(ausmarraige2, Mean = mean(Response_Clear_Yes), Median = median(Response_Clear_Yes), Min = min(Response_Clear_Yes), Max = max(Response_Clear_Yes), SD = sd(Response_Clear_Yes), Var = var(Response_Clear_Yes), IQR = IQR(Response_Clear_Yes))
+
+# A tibble: 1 x 7
+ Mean Median Min Max SD Var IQR
+ <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+1 52115. 51782. 19026 89590 12315. 151661815. 15259
+Descriptive statistics for Response_Clear_No:
+summarize(ausmarraige2, Mean = mean(Response_Clear_No), Median = median(Response_Clear_No), Min = min(Response_Clear_No), Max = max(Response_Clear_No), SD = sd(Response_Clear_No), Var = var(Response_Clear_No), IQR = IQR(Response_Clear_No))
+
+# A tibble: 1 x 7
+ Mean Median Min Max SD Var IQR
+ <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+1 32493. 31654. 14860 57926 8263. 68273681. 8274.
+Descriptive statistics for Response_Not_Clear:
+summarize(ausmarraige2, Mean = mean(Response_Not_Clear), Median = median(Response_Not_Clear), Min = min(Response_Not_Clear), Max = max(Response_Not_Clear), SD = sd(Response_Not_Clear), Var = var(Response_Not_Clear), IQR = IQR(Response_Not_Clear))
+
+# A tibble: 1 x 7
+ Mean Median Min Max SD Var IQR
+ <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+1 245. 240 106 377 55.9 3124. 68.8
+Descriptive statistics for Non_Response:
+summarize(ausmarraige2, Mean = mean(Non_Response), Median = median(Non_Response), Min = min(Non_Response), Max = max(Non_Response), SD = sd(Non_Response), Var = var(Non_Response), IQR = IQR(Non_Response))
+
+# A tibble: 1 x 7
+ Mean Median Min Max SD Var IQR
+ <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+1 21855. 21416. 13092 35841 4197. 17618721. 5562.
+Bar graph modeling the total number of each response:
+responsetotals <- ausmarraige2 %>%
+ select(Response_Clear_Yes, Response_Clear_No, Response_Not_Clear, Non_Response)%>%
+ summarise(Yes=sum(Response_Clear_Yes), No=sum(Response_Clear_No), NotClear=sum(Response_Not_Clear), NonResponse=sum(Non_Response))
+rownames(responsetotals) <- c("Total")
+
+responsetotals <- pivot_longer(responsetotals, Yes:NonResponse, names_to = "Response", values_to = "Total")
+
+ggplot(data = responsetotals) +
+ geom_bar(mapping = aes(x = Response, y = Total), stat = "identity") +
+ labs(title = "Should Australian Law Change to Allow Same-Sex Marraige?", subtitle = "2017 postal survey of Australians", x = "Type of Response", y = "Total # of Responses")
+
+
`,e.githubCompareUpdatesUrl&&(t+=`View all changes to this article since it was first published.`),t+=` + If you see mistakes or want to suggest changes, please create an issue on GitHub.
+ `);const n=e.journal;return'undefined'!=typeof n&&'Distill'===n.title&&(t+=` +Diagrams and text are licensed under Creative Commons Attribution CC-BY 4.0 with the source available on GitHub, unless noted otherwise. The figures that have been reused from other sources don’t fall under this license and can be recognized by a note in their caption: “Figure from …”.
+ `),'undefined'!=typeof e.publishedDate&&(t+=` +For attribution in academic contexts, please cite this work as
+${e.concatenatedAuthors}, "${e.title}", Distill, ${e.publishedYear}.
+ BibTeX citation
+${m(e)}
+ `),t}var An=Math.sqrt,En=Math.atan2,Dn=Math.sin,Mn=Math.cos,On=Math.PI,Un=Math.abs,In=Math.pow,Nn=Math.LN10,jn=Math.log,Rn=Math.max,qn=Math.ceil,Fn=Math.floor,Pn=Math.round,Hn=Math.min;const zn=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],Bn=['Jan.','Feb.','March','April','May','June','July','Aug.','Sept.','Oct.','Nov.','Dec.'],Wn=(e)=>10>e?'0'+e:e,Vn=function(e){const t=zn[e.getDay()].substring(0,3),n=Wn(e.getDate()),i=Bn[e.getMonth()].substring(0,3),a=e.getFullYear().toString(),d=e.getUTCHours().toString(),r=e.getUTCMinutes().toString(),o=e.getUTCSeconds().toString();return`${t}, ${n} ${i} ${a} ${d}:${r}:${o} Z`},$n=function(e){const t=Array.from(e).reduce((e,[t,n])=>Object.assign(e,{[t]:n}),{});return t},Jn=function(e){const t=new Map;for(var n in e)e.hasOwnProperty(n)&&t.set(n,e[n]);return t};class Qn{constructor(e){this.name=e.author,this.personalURL=e.authorURL,this.affiliation=e.affiliation,this.affiliationURL=e.affiliationURL,this.affiliations=e.affiliations||[]}get firstName(){const e=this.name.split(' ');return e.slice(0,e.length-1).join(' ')}get lastName(){const e=this.name.split(' ');return e[e.length-1]}}class Gn{constructor(){this.title='unnamed article',this.description='',this.authors=[],this.bibliography=new Map,this.bibliographyParsed=!1,this.citations=[],this.citationsCollected=!1,this.journal={},this.katex={},this.publishedDate=void 0}set url(e){this._url=e}get url(){if(this._url)return this._url;return this.distillPath&&this.journal.url?this.journal.url+'/'+this.distillPath:this.journal.url?this.journal.url:void 0}get githubUrl(){return this.githubPath?'https://github.com/'+this.githubPath:void 0}set previewURL(e){this._previewURL=e}get previewURL(){return this._previewURL?this._previewURL:this.url+'/thumbnail.jpg'}get publishedDateRFC(){return Vn(this.publishedDate)}get updatedDateRFC(){return Vn(this.updatedDate)}get publishedYear(){return this.publishedDate.getFullYear()}get publishedMonth(){return Bn[this.publishedDate.getMonth()]}get publishedDay(){return this.publishedDate.getDate()}get publishedMonthPadded(){return Wn(this.publishedDate.getMonth()+1)}get publishedDayPadded(){return Wn(this.publishedDate.getDate())}get publishedISODateOnly(){return this.publishedDate.toISOString().split('T')[0]}get volume(){const e=this.publishedYear-2015;if(1>e)throw new Error('Invalid publish date detected during computing volume');return e}get issue(){return this.publishedDate.getMonth()+1}get concatenatedAuthors(){if(2 tag. We found the following text: '+t);const n=document.createElement('span');n.innerHTML=e.nodeValue,e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e)}}}}).observe(this,{childList:!0})}}var Ti='undefined'==typeof window?'undefined'==typeof global?'undefined'==typeof self?{}:self:global:window,_i=f(function(e,t){(function(e){function t(){this.months=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'],this.notKey=[',','{','}',' ','='],this.pos=0,this.input='',this.entries=[],this.currentEntry='',this.setInput=function(e){this.input=e},this.getEntries=function(){return this.entries},this.isWhitespace=function(e){return' '==e||'\r'==e||'\t'==e||'\n'==e},this.match=function(e,t){if((void 0==t||null==t)&&(t=!0),this.skipWhitespace(t),this.input.substring(this.pos,this.pos+e.length)==e)this.pos+=e.length;else throw'Token mismatch, expected '+e+', found '+this.input.substring(this.pos);this.skipWhitespace(t)},this.tryMatch=function(e,t){return(void 0==t||null==t)&&(t=!0),this.skipWhitespace(t),this.input.substring(this.pos,this.pos+e.length)==e},this.matchAt=function(){for(;this.input.length>this.pos&&'@'!=this.input[this.pos];)this.pos++;return!('@'!=this.input[this.pos])},this.skipWhitespace=function(e){for(;this.isWhitespace(this.input[this.pos]);)this.pos++;if('%'==this.input[this.pos]&&!0==e){for(;'\n'!=this.input[this.pos];)this.pos++;this.skipWhitespace(e)}},this.value_braces=function(){var e=0;this.match('{',!1);for(var t=this.pos,n=!1;;){if(!n)if('}'==this.input[this.pos]){if(0 =k&&(++x,i=k);if(d[x]instanceof n||d[T-1].greedy)continue;w=T-x,y=e.slice(i,k),v.index-=i}if(v){g&&(h=v[1].length);var S=v.index+h,v=v[0].slice(h),C=S+v.length,_=y.slice(0,S),L=y.slice(C),A=[x,w];_&&A.push(_);var E=new n(o,u?a.tokenize(v,u):v,b,v,f);A.push(E),L&&A.push(L),Array.prototype.splice.apply(d,A)}}}}}return d},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var d,r=0;d=n[r++];)d(t)}}},i=a.Token=function(e,t,n,i,a){this.type=e,this.content=t,this.alias=n,this.length=0|(i||'').length,this.greedy=!!a};if(i.stringify=function(e,t,n){if('string'==typeof e)return e;if('Array'===a.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join('');var d={type:e.type,content:i.stringify(e.content,t,n),tag:'span',classes:['token',e.type],attributes:{},language:t,parent:n};if('comment'==d.type&&(d.attributes.spellcheck='true'),e.alias){var r='Array'===a.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(d.classes,r)}a.hooks.run('wrap',d);var l=Object.keys(d.attributes).map(function(e){return e+'="'+(d.attributes[e]||'').replace(/"/g,'"')+'"'}).join(' ');return'<'+d.tag+' class="'+d.classes.join(' ')+'"'+(l?' '+l:'')+'>'+d.content+''+d.tag+'>'},!t.document)return t.addEventListener?(t.addEventListener('message',function(e){var n=JSON.parse(e.data),i=n.language,d=n.code,r=n.immediateClose;t.postMessage(a.highlight(d,a.languages[i],i)),r&&t.close()},!1),t.Prism):t.Prism;var d=document.currentScript||[].slice.call(document.getElementsByTagName('script')).pop();return d&&(a.filename=d.src,document.addEventListener&&!d.hasAttribute('data-manual')&&('loading'===document.readyState?document.addEventListener('DOMContentLoaded',a.highlightAll):window.requestAnimationFrame?window.requestAnimationFrame(a.highlightAll):window.setTimeout(a.highlightAll,16))),t.Prism}();e.exports&&(e.exports=n),'undefined'!=typeof Ti&&(Ti.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.hooks.add('wrap',function(e){'entity'===e.type&&(e.attributes.title=e.content.replace(/&/,'&'))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore('markup','tag',{style:{pattern:/(
+
+
+ ${e.map(l).map((e)=>`
`)}}const Mi=`
+d-citation-list {
+ contain: layout style;
+}
+
+d-citation-list .references {
+ grid-column: text;
+}
+
+d-citation-list .references .title {
+ font-weight: 500;
+}
+`;class Oi extends HTMLElement{static get is(){return'd-citation-list'}connectedCallback(){this.hasAttribute('distill-prerendered')||(this.style.display='none')}set citations(e){x(this,e)}}var Ui=f(function(e){var t='undefined'==typeof window?'undefined'!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}:window,n=function(){var e=/\blang(?:uage)?-(\w+)\b/i,n=0,a=t.Prism={util:{encode:function(e){return e instanceof i?new i(e.type,a.util.encode(e.content),e.alias):'Array'===a.util.type(e)?e.map(a.util.encode):e.replace(/&/g,'&').replace(/e.length)break tokenloop;if(!(y instanceof n)){c.lastIndex=0;var v=c.exec(y),w=1;if(!v&&f&&x!=d.length-1){if(c.lastIndex=i,v=c.exec(e),!v)break;for(var S=v.index+(g?v[1].length:0),C=v.index+v[0].length,T=x,k=i,p=d.length;T
+
+`);class Ni extends ei(Ii(HTMLElement)){renderContent(){if(this.languageName=this.getAttribute('language'),!this.languageName)return void console.warn('You need to provide a language attribute to your Footnotes
+
+`,!1);class Fi extends qi(HTMLElement){connectedCallback(){super.connectedCallback(),this.list=this.root.querySelector('ol'),this.root.style.display='none'}set footnotes(e){if(this.list.innerHTML='',e.length){this.root.style.display='';for(const t of e){const e=document.createElement('li');e.id=t.id+'-listing',e.innerHTML=t.innerHTML;const n=document.createElement('a');n.setAttribute('class','footnote-backlink'),n.textContent='[\u21A9]',n.href='#'+t.id,e.appendChild(n),this.list.appendChild(e)}}else this.root.style.display='none'}}const Pi=ti('d-hover-box',`
+
+
+