@polintpro/proposit-core 0.8.6 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +2 -0
  2. package/dist/extensions/ieee/formatting.d.ts +2 -14
  3. package/dist/extensions/ieee/formatting.d.ts.map +1 -1
  4. package/dist/extensions/ieee/formatting.js +42 -1038
  5. package/dist/extensions/ieee/formatting.js.map +1 -1
  6. package/dist/extensions/ieee/index.d.ts +1 -0
  7. package/dist/extensions/ieee/index.d.ts.map +1 -1
  8. package/dist/extensions/ieee/index.js +1 -0
  9. package/dist/extensions/ieee/index.js.map +1 -1
  10. package/dist/extensions/ieee/segment-builder.d.ts +9 -0
  11. package/dist/extensions/ieee/segment-builder.d.ts.map +1 -0
  12. package/dist/extensions/ieee/segment-builder.js +98 -0
  13. package/dist/extensions/ieee/segment-builder.js.map +1 -0
  14. package/dist/extensions/ieee/segment-templates.d.ts +58 -0
  15. package/dist/extensions/ieee/segment-templates.d.ts.map +1 -0
  16. package/dist/extensions/ieee/segment-templates.js +1618 -0
  17. package/dist/extensions/ieee/segment-templates.js.map +1 -0
  18. package/dist/lib/core/argument-engine.d.ts +2 -19
  19. package/dist/lib/core/argument-engine.d.ts.map +1 -1
  20. package/dist/lib/core/argument-engine.js +46 -819
  21. package/dist/lib/core/argument-engine.js.map +1 -1
  22. package/dist/lib/core/argument-validation.d.ts +74 -0
  23. package/dist/lib/core/argument-validation.d.ts.map +1 -0
  24. package/dist/lib/core/argument-validation.js +315 -0
  25. package/dist/lib/core/argument-validation.js.map +1 -0
  26. package/dist/lib/core/evaluation/argument-evaluation.d.ts +53 -0
  27. package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -0
  28. package/dist/lib/core/evaluation/argument-evaluation.js +535 -0
  29. package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -0
  30. package/dist/lib/core/parser/formula-gen.js +1 -1
  31. package/dist/lib/index.d.ts +4 -0
  32. package/dist/lib/index.d.ts.map +1 -1
  33. package/dist/lib/index.js +2 -0
  34. package/dist/lib/index.js.map +1 -1
  35. package/package.json +9 -9
@@ -0,0 +1,1618 @@
1
+ // IEEE Citation Segment Templates — declarative config arrays interpreted by buildSegments()
2
+ // ---------------------------------------------------------------------------
3
+ // Templates
4
+ // ---------------------------------------------------------------------------
5
+ // Book: authors, ", ", title(italic), [", ", edition, " ed."], [", ", location], ": ", publisher, ", ", year, ".", [" ", isbn]
6
+ export const BOOK_TEMPLATE = [
7
+ {
8
+ type: "segment",
9
+ source: { kind: "authors", field: "authors" },
10
+ role: "authors",
11
+ style: "plain",
12
+ },
13
+ { type: "separator", text: ", " },
14
+ {
15
+ type: "segment",
16
+ source: { kind: "string", field: "title" },
17
+ role: "title",
18
+ style: "italic",
19
+ },
20
+ {
21
+ type: "conditional",
22
+ field: "edition",
23
+ then: [
24
+ { type: "separator", text: ", " },
25
+ {
26
+ type: "segment",
27
+ source: { kind: "string", field: "edition" },
28
+ role: "edition",
29
+ },
30
+ {
31
+ type: "segment",
32
+ source: { kind: "literal", text: " ed." },
33
+ role: "suffix",
34
+ },
35
+ ],
36
+ },
37
+ {
38
+ type: "conditional",
39
+ field: "location",
40
+ then: [
41
+ { type: "separator", text: ", " },
42
+ {
43
+ type: "segment",
44
+ source: { kind: "string", field: "location" },
45
+ role: "location",
46
+ },
47
+ ],
48
+ },
49
+ { type: "separator", text: ": " },
50
+ {
51
+ type: "segment",
52
+ source: { kind: "string", field: "publisher" },
53
+ role: "publisher",
54
+ },
55
+ { type: "separator", text: ", " },
56
+ {
57
+ type: "segment",
58
+ source: { kind: "string", field: "year" },
59
+ role: "year",
60
+ },
61
+ { type: "separator", text: "." },
62
+ {
63
+ type: "conditional",
64
+ field: "isbn",
65
+ then: [
66
+ { type: "separator", text: " " },
67
+ {
68
+ type: "segment",
69
+ source: { kind: "string", field: "isbn" },
70
+ role: "isbn",
71
+ },
72
+ ],
73
+ },
74
+ ];
75
+ // Website: authors, ". ", pageTitle(quoted), ". ", websiteTitle(italic,misc), ". ", "Accessed: ", accessedDate, ". ", "[Online]. Available: ", url(link)
76
+ export const WEBSITE_TEMPLATE = [
77
+ {
78
+ type: "segment",
79
+ source: { kind: "authors", field: "authors" },
80
+ role: "authors",
81
+ style: "plain",
82
+ },
83
+ { type: "separator", text: ". " },
84
+ {
85
+ type: "segment",
86
+ source: { kind: "string", field: "pageTitle" },
87
+ role: "title",
88
+ style: "quoted",
89
+ },
90
+ { type: "separator", text: ". " },
91
+ {
92
+ type: "segment",
93
+ source: { kind: "string", field: "websiteTitle" },
94
+ role: "misc",
95
+ style: "italic",
96
+ },
97
+ { type: "separator", text: ". " },
98
+ {
99
+ type: "segment",
100
+ source: { kind: "literal", text: "Accessed: " },
101
+ role: "prefix",
102
+ },
103
+ {
104
+ type: "segment",
105
+ source: { kind: "date", field: "accessedDate" },
106
+ role: "accessedDate",
107
+ },
108
+ { type: "separator", text: ". " },
109
+ {
110
+ type: "segment",
111
+ source: { kind: "literal", text: "[Online]. Available: " },
112
+ role: "prefix",
113
+ },
114
+ {
115
+ type: "segment",
116
+ source: { kind: "string", field: "url" },
117
+ role: "url",
118
+ style: "link",
119
+ },
120
+ ];
121
+ // BookChapter: authors, ", ", chapterTitle(quoted), ", in ", bookTitle(italic,bookTitle), [editors+Eds.], ". ", location, ": ", publisher, ", ", year, [", pp. ", pages], ".", [" ", isbn]
122
+ export const BOOK_CHAPTER_TEMPLATE = [
123
+ {
124
+ type: "segment",
125
+ source: { kind: "authors", field: "authors" },
126
+ role: "authors",
127
+ style: "plain",
128
+ },
129
+ { type: "separator", text: ", " },
130
+ {
131
+ type: "segment",
132
+ source: { kind: "string", field: "chapterTitle" },
133
+ role: "title",
134
+ style: "quoted",
135
+ },
136
+ { type: "separator", text: ", in " },
137
+ {
138
+ type: "segment",
139
+ source: { kind: "string", field: "bookTitle" },
140
+ role: "bookTitle",
141
+ style: "italic",
142
+ },
143
+ {
144
+ type: "conditional",
145
+ field: "editors",
146
+ checkLength: true,
147
+ then: [
148
+ { type: "separator", text: ", " },
149
+ {
150
+ type: "segment",
151
+ source: { kind: "authors", field: "editors" },
152
+ role: "misc",
153
+ },
154
+ {
155
+ type: "segment",
156
+ source: { kind: "literal", text: ", Eds." },
157
+ role: "suffix",
158
+ },
159
+ ],
160
+ },
161
+ { type: "separator", text: ". " },
162
+ {
163
+ type: "segment",
164
+ source: { kind: "string", field: "location" },
165
+ role: "location",
166
+ },
167
+ { type: "separator", text: ": " },
168
+ {
169
+ type: "segment",
170
+ source: { kind: "string", field: "publisher" },
171
+ role: "publisher",
172
+ },
173
+ { type: "separator", text: ", " },
174
+ {
175
+ type: "segment",
176
+ source: { kind: "string", field: "year" },
177
+ role: "year",
178
+ },
179
+ {
180
+ type: "conditional",
181
+ field: "pages",
182
+ then: [
183
+ { type: "separator", text: ", " },
184
+ {
185
+ type: "segment",
186
+ source: { kind: "literal", text: "pp. " },
187
+ role: "prefix",
188
+ },
189
+ {
190
+ type: "segment",
191
+ source: { kind: "string", field: "pages" },
192
+ role: "pages",
193
+ },
194
+ ],
195
+ },
196
+ { type: "separator", text: "." },
197
+ {
198
+ type: "conditional",
199
+ field: "isbn",
200
+ then: [
201
+ { type: "separator", text: " " },
202
+ {
203
+ type: "segment",
204
+ source: { kind: "string", field: "isbn" },
205
+ role: "isbn",
206
+ },
207
+ ],
208
+ },
209
+ ];
210
+ // Handbook: title(italic), [", ", edition, " ed."], ". ", location, ": ", publisher, ", ", year, ".", [" ", isbn]
211
+ export const HANDBOOK_TEMPLATE = [
212
+ {
213
+ type: "segment",
214
+ source: { kind: "string", field: "title" },
215
+ role: "title",
216
+ style: "italic",
217
+ },
218
+ {
219
+ type: "conditional",
220
+ field: "edition",
221
+ then: [
222
+ { type: "separator", text: ", " },
223
+ {
224
+ type: "segment",
225
+ source: { kind: "string", field: "edition" },
226
+ role: "edition",
227
+ },
228
+ {
229
+ type: "segment",
230
+ source: { kind: "literal", text: " ed." },
231
+ role: "suffix",
232
+ },
233
+ ],
234
+ },
235
+ { type: "separator", text: ". " },
236
+ {
237
+ type: "segment",
238
+ source: { kind: "string", field: "location" },
239
+ role: "location",
240
+ },
241
+ { type: "separator", text: ": " },
242
+ {
243
+ type: "segment",
244
+ source: { kind: "string", field: "publisher" },
245
+ role: "publisher",
246
+ },
247
+ { type: "separator", text: ", " },
248
+ {
249
+ type: "segment",
250
+ source: { kind: "string", field: "year" },
251
+ role: "year",
252
+ },
253
+ { type: "separator", text: "." },
254
+ {
255
+ type: "conditional",
256
+ field: "isbn",
257
+ then: [
258
+ { type: "separator", text: " " },
259
+ {
260
+ type: "segment",
261
+ source: { kind: "string", field: "isbn" },
262
+ role: "isbn",
263
+ },
264
+ ],
265
+ },
266
+ ];
267
+ // TechnicalReport: authors, ", ", title(quoted), ", ", institution, ", ", location, ", ", "Rep. ", reportNumber, ", ", year, "."
268
+ export const TECHNICAL_REPORT_TEMPLATE = [
269
+ {
270
+ type: "segment",
271
+ source: { kind: "authors", field: "authors" },
272
+ role: "authors",
273
+ style: "plain",
274
+ },
275
+ { type: "separator", text: ", " },
276
+ {
277
+ type: "segment",
278
+ source: { kind: "string", field: "title" },
279
+ role: "title",
280
+ style: "quoted",
281
+ },
282
+ { type: "separator", text: ", " },
283
+ {
284
+ type: "segment",
285
+ source: { kind: "string", field: "institution" },
286
+ role: "institution",
287
+ },
288
+ { type: "separator", text: ", " },
289
+ {
290
+ type: "segment",
291
+ source: { kind: "string", field: "location" },
292
+ role: "location",
293
+ },
294
+ { type: "separator", text: ", " },
295
+ {
296
+ type: "segment",
297
+ source: { kind: "literal", text: "Rep. " },
298
+ role: "prefix",
299
+ },
300
+ {
301
+ type: "segment",
302
+ source: { kind: "string", field: "reportNumber" },
303
+ role: "reportNumber",
304
+ },
305
+ { type: "separator", text: ", " },
306
+ {
307
+ type: "segment",
308
+ source: { kind: "string", field: "year" },
309
+ role: "year",
310
+ },
311
+ { type: "separator", text: "." },
312
+ ];
313
+ // Standard: title(italic), ", ", standardNumber, ", ", organization, ", ", date, "."
314
+ export const STANDARD_TEMPLATE = [
315
+ {
316
+ type: "segment",
317
+ source: { kind: "string", field: "title" },
318
+ role: "title",
319
+ style: "italic",
320
+ },
321
+ { type: "separator", text: ", " },
322
+ {
323
+ type: "segment",
324
+ source: { kind: "string", field: "standardNumber" },
325
+ role: "standardNumber",
326
+ },
327
+ { type: "separator", text: ", " },
328
+ {
329
+ type: "segment",
330
+ source: { kind: "string", field: "organization" },
331
+ role: "organization",
332
+ },
333
+ { type: "separator", text: ", " },
334
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
335
+ { type: "separator", text: "." },
336
+ ];
337
+ // Thesis: authors, ", ", title(quoted), ", ", degree, " thesis", ", ", institution, ", ", location, ", ", year, "."
338
+ export const THESIS_TEMPLATE = [
339
+ {
340
+ type: "segment",
341
+ source: { kind: "authors", field: "authors" },
342
+ role: "authors",
343
+ style: "plain",
344
+ },
345
+ { type: "separator", text: ", " },
346
+ {
347
+ type: "segment",
348
+ source: { kind: "string", field: "title" },
349
+ role: "title",
350
+ style: "quoted",
351
+ },
352
+ { type: "separator", text: ", " },
353
+ {
354
+ type: "segment",
355
+ source: { kind: "string", field: "degree" },
356
+ role: "degree",
357
+ },
358
+ {
359
+ type: "segment",
360
+ source: { kind: "literal", text: " thesis" },
361
+ role: "suffix",
362
+ },
363
+ { type: "separator", text: ", " },
364
+ {
365
+ type: "segment",
366
+ source: { kind: "string", field: "institution" },
367
+ role: "institution",
368
+ },
369
+ { type: "separator", text: ", " },
370
+ {
371
+ type: "segment",
372
+ source: { kind: "string", field: "location" },
373
+ role: "location",
374
+ },
375
+ { type: "separator", text: ", " },
376
+ {
377
+ type: "segment",
378
+ source: { kind: "string", field: "year" },
379
+ role: "year",
380
+ },
381
+ { type: "separator", text: "." },
382
+ ];
383
+ // Patent: inventors(authors), ", ", title(quoted), ", ", country, " Patent ", patentNumber, ", ", date, "."
384
+ export const PATENT_TEMPLATE = [
385
+ {
386
+ type: "segment",
387
+ source: { kind: "authors", field: "inventors" },
388
+ role: "authors",
389
+ style: "plain",
390
+ },
391
+ { type: "separator", text: ", " },
392
+ {
393
+ type: "segment",
394
+ source: { kind: "string", field: "title" },
395
+ role: "title",
396
+ style: "quoted",
397
+ },
398
+ { type: "separator", text: ", " },
399
+ {
400
+ type: "segment",
401
+ source: { kind: "string", field: "country" },
402
+ role: "country",
403
+ },
404
+ {
405
+ type: "segment",
406
+ source: { kind: "literal", text: " Patent " },
407
+ role: "prefix",
408
+ },
409
+ {
410
+ type: "segment",
411
+ source: { kind: "string", field: "patentNumber" },
412
+ role: "patentNumber",
413
+ },
414
+ { type: "separator", text: ", " },
415
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
416
+ { type: "separator", text: "." },
417
+ ];
418
+ // Dictionary: title(italic), ". ", publisher, [", ", edition, " ed."], ", ", year, "."
419
+ export const DICTIONARY_TEMPLATE = [
420
+ {
421
+ type: "segment",
422
+ source: { kind: "string", field: "title" },
423
+ role: "title",
424
+ style: "italic",
425
+ },
426
+ { type: "separator", text: ". " },
427
+ {
428
+ type: "segment",
429
+ source: { kind: "string", field: "publisher" },
430
+ role: "publisher",
431
+ },
432
+ {
433
+ type: "conditional",
434
+ field: "edition",
435
+ then: [
436
+ { type: "separator", text: ", " },
437
+ {
438
+ type: "segment",
439
+ source: { kind: "string", field: "edition" },
440
+ role: "edition",
441
+ },
442
+ {
443
+ type: "segment",
444
+ source: { kind: "literal", text: " ed." },
445
+ role: "suffix",
446
+ },
447
+ ],
448
+ },
449
+ { type: "separator", text: ", " },
450
+ {
451
+ type: "segment",
452
+ source: { kind: "string", field: "year" },
453
+ role: "year",
454
+ },
455
+ { type: "separator", text: "." },
456
+ ];
457
+ // Encyclopedia: title(italic), ". ", publisher, [", ", edition, " ed."], ", ", year, "."
458
+ export const ENCYCLOPEDIA_TEMPLATE = [
459
+ {
460
+ type: "segment",
461
+ source: { kind: "string", field: "title" },
462
+ role: "title",
463
+ style: "italic",
464
+ },
465
+ { type: "separator", text: ". " },
466
+ {
467
+ type: "segment",
468
+ source: { kind: "string", field: "publisher" },
469
+ role: "publisher",
470
+ },
471
+ {
472
+ type: "conditional",
473
+ field: "edition",
474
+ then: [
475
+ { type: "separator", text: ", " },
476
+ {
477
+ type: "segment",
478
+ source: { kind: "string", field: "edition" },
479
+ role: "edition",
480
+ },
481
+ {
482
+ type: "segment",
483
+ source: { kind: "literal", text: " ed." },
484
+ role: "suffix",
485
+ },
486
+ ],
487
+ },
488
+ { type: "separator", text: ", " },
489
+ {
490
+ type: "segment",
491
+ source: { kind: "string", field: "year" },
492
+ role: "year",
493
+ },
494
+ { type: "separator", text: "." },
495
+ ];
496
+ // JournalArticle: authors, ", ", title(quoted), ", ", journalTitle(italic,misc), [", vol. ", volume], [", no. ", issue], [", pp. ", pages], ", ", year, [", doi: ", doi], "."
497
+ export const JOURNAL_ARTICLE_TEMPLATE = [
498
+ {
499
+ type: "segment",
500
+ source: { kind: "authors", field: "authors" },
501
+ role: "authors",
502
+ style: "plain",
503
+ },
504
+ { type: "separator", text: ", " },
505
+ {
506
+ type: "segment",
507
+ source: { kind: "string", field: "title" },
508
+ role: "title",
509
+ style: "quoted",
510
+ },
511
+ { type: "separator", text: ", " },
512
+ {
513
+ type: "segment",
514
+ source: { kind: "string", field: "journalTitle" },
515
+ role: "misc",
516
+ style: "italic",
517
+ },
518
+ {
519
+ type: "conditional",
520
+ field: "volume",
521
+ then: [
522
+ { type: "separator", text: ", vol. " },
523
+ {
524
+ type: "segment",
525
+ source: { kind: "string", field: "volume" },
526
+ role: "volume",
527
+ },
528
+ ],
529
+ },
530
+ {
531
+ type: "conditional",
532
+ field: "issue",
533
+ then: [
534
+ { type: "separator", text: ", no. " },
535
+ {
536
+ type: "segment",
537
+ source: { kind: "string", field: "issue" },
538
+ role: "issue",
539
+ },
540
+ ],
541
+ },
542
+ {
543
+ type: "conditional",
544
+ field: "pages",
545
+ then: [
546
+ { type: "separator", text: ", pp. " },
547
+ {
548
+ type: "segment",
549
+ source: { kind: "string", field: "pages" },
550
+ role: "pages",
551
+ },
552
+ ],
553
+ },
554
+ { type: "separator", text: ", " },
555
+ {
556
+ type: "segment",
557
+ source: { kind: "string", field: "year" },
558
+ role: "year",
559
+ },
560
+ {
561
+ type: "conditional",
562
+ field: "doi",
563
+ then: [
564
+ { type: "separator", text: ", doi: " },
565
+ {
566
+ type: "segment",
567
+ source: { kind: "string", field: "doi" },
568
+ role: "doi",
569
+ },
570
+ ],
571
+ },
572
+ { type: "separator", text: "." },
573
+ ];
574
+ // MagazineArticle: authors, ", ", title(quoted), ", ", magazineTitle(italic,misc), [", vol. ", volume], [", no. ", issue], [", pp. ", pages], ", ", year, "."
575
+ export const MAGAZINE_ARTICLE_TEMPLATE = [
576
+ {
577
+ type: "segment",
578
+ source: { kind: "authors", field: "authors" },
579
+ role: "authors",
580
+ style: "plain",
581
+ },
582
+ { type: "separator", text: ", " },
583
+ {
584
+ type: "segment",
585
+ source: { kind: "string", field: "title" },
586
+ role: "title",
587
+ style: "quoted",
588
+ },
589
+ { type: "separator", text: ", " },
590
+ {
591
+ type: "segment",
592
+ source: { kind: "string", field: "magazineTitle" },
593
+ role: "misc",
594
+ style: "italic",
595
+ },
596
+ {
597
+ type: "conditional",
598
+ field: "volume",
599
+ then: [
600
+ { type: "separator", text: ", vol. " },
601
+ {
602
+ type: "segment",
603
+ source: { kind: "string", field: "volume" },
604
+ role: "volume",
605
+ },
606
+ ],
607
+ },
608
+ {
609
+ type: "conditional",
610
+ field: "issue",
611
+ then: [
612
+ { type: "separator", text: ", no. " },
613
+ {
614
+ type: "segment",
615
+ source: { kind: "string", field: "issue" },
616
+ role: "issue",
617
+ },
618
+ ],
619
+ },
620
+ {
621
+ type: "conditional",
622
+ field: "pages",
623
+ then: [
624
+ { type: "separator", text: ", pp. " },
625
+ {
626
+ type: "segment",
627
+ source: { kind: "string", field: "pages" },
628
+ role: "pages",
629
+ },
630
+ ],
631
+ },
632
+ { type: "separator", text: ", " },
633
+ {
634
+ type: "segment",
635
+ source: { kind: "string", field: "year" },
636
+ role: "year",
637
+ },
638
+ { type: "separator", text: "." },
639
+ ];
640
+ // NewspaperArticle: authors, ", ", title(quoted), ", ", newspaperTitle(italic,misc), ", ", date, [", pp. ", pages], "."
641
+ export const NEWSPAPER_ARTICLE_TEMPLATE = [
642
+ {
643
+ type: "segment",
644
+ source: { kind: "authors", field: "authors" },
645
+ role: "authors",
646
+ style: "plain",
647
+ },
648
+ { type: "separator", text: ", " },
649
+ {
650
+ type: "segment",
651
+ source: { kind: "string", field: "title" },
652
+ role: "title",
653
+ style: "quoted",
654
+ },
655
+ { type: "separator", text: ", " },
656
+ {
657
+ type: "segment",
658
+ source: { kind: "string", field: "newspaperTitle" },
659
+ role: "misc",
660
+ style: "italic",
661
+ },
662
+ { type: "separator", text: ", " },
663
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
664
+ {
665
+ type: "conditional",
666
+ field: "pages",
667
+ then: [
668
+ { type: "separator", text: ", pp. " },
669
+ {
670
+ type: "segment",
671
+ source: { kind: "string", field: "pages" },
672
+ role: "pages",
673
+ },
674
+ ],
675
+ },
676
+ { type: "separator", text: "." },
677
+ ];
678
+ // ConferencePaper: authors, ", ", title(quoted), ", ", "presented at ", conferenceName(italic,misc), ", ", location, ", ", date, [", pp. ", pages], [", doi: ", doi], "."
679
+ export const CONFERENCE_PAPER_TEMPLATE = [
680
+ {
681
+ type: "segment",
682
+ source: { kind: "authors", field: "authors" },
683
+ role: "authors",
684
+ style: "plain",
685
+ },
686
+ { type: "separator", text: ", " },
687
+ {
688
+ type: "segment",
689
+ source: { kind: "string", field: "title" },
690
+ role: "title",
691
+ style: "quoted",
692
+ },
693
+ { type: "separator", text: ", " },
694
+ {
695
+ type: "segment",
696
+ source: { kind: "literal", text: "presented at " },
697
+ role: "prefix",
698
+ },
699
+ {
700
+ type: "segment",
701
+ source: { kind: "string", field: "conferenceName" },
702
+ role: "misc",
703
+ style: "italic",
704
+ },
705
+ { type: "separator", text: ", " },
706
+ {
707
+ type: "segment",
708
+ source: { kind: "string", field: "location" },
709
+ role: "location",
710
+ },
711
+ { type: "separator", text: ", " },
712
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
713
+ {
714
+ type: "conditional",
715
+ field: "pages",
716
+ then: [
717
+ { type: "separator", text: ", pp. " },
718
+ {
719
+ type: "segment",
720
+ source: { kind: "string", field: "pages" },
721
+ role: "pages",
722
+ },
723
+ ],
724
+ },
725
+ {
726
+ type: "conditional",
727
+ field: "doi",
728
+ then: [
729
+ { type: "separator", text: ", doi: " },
730
+ {
731
+ type: "segment",
732
+ source: { kind: "string", field: "doi" },
733
+ role: "doi",
734
+ },
735
+ ],
736
+ },
737
+ { type: "separator", text: "." },
738
+ ];
739
+ // ConferenceProceedings: [editors+", Eds.", ", "], conferenceName(italic,title), ", ", location, ", ", date, ". ", publisher, [". ", isbn], "."
740
+ export const CONFERENCE_PROCEEDINGS_TEMPLATE = [
741
+ {
742
+ type: "conditional",
743
+ field: "editors",
744
+ checkLength: true,
745
+ then: [
746
+ {
747
+ type: "segment",
748
+ source: { kind: "authors", field: "editors" },
749
+ role: "authors",
750
+ style: "plain",
751
+ },
752
+ {
753
+ type: "segment",
754
+ source: { kind: "literal", text: ", Eds." },
755
+ role: "suffix",
756
+ },
757
+ { type: "separator", text: ", " },
758
+ ],
759
+ },
760
+ {
761
+ type: "segment",
762
+ source: { kind: "string", field: "conferenceName" },
763
+ role: "title",
764
+ style: "italic",
765
+ },
766
+ { type: "separator", text: ", " },
767
+ {
768
+ type: "segment",
769
+ source: { kind: "string", field: "location" },
770
+ role: "location",
771
+ },
772
+ { type: "separator", text: ", " },
773
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
774
+ { type: "separator", text: ". " },
775
+ {
776
+ type: "segment",
777
+ source: { kind: "string", field: "publisher" },
778
+ role: "publisher",
779
+ },
780
+ {
781
+ type: "conditional",
782
+ field: "isbn",
783
+ then: [
784
+ { type: "separator", text: ". " },
785
+ {
786
+ type: "segment",
787
+ source: { kind: "string", field: "isbn" },
788
+ role: "isbn",
789
+ },
790
+ ],
791
+ },
792
+ { type: "separator", text: "." },
793
+ ];
794
+ // Dataset: [authors, ", "], title(quoted), ", ", repository(misc), [", ver. ", version(misc)], ", ", year, [", doi: ", doi], ". ", "[Online]. Available: ", url(link)
795
+ export const DATASET_TEMPLATE = [
796
+ {
797
+ type: "conditional",
798
+ field: "authors",
799
+ checkLength: true,
800
+ then: [
801
+ {
802
+ type: "segment",
803
+ source: { kind: "authors", field: "authors" },
804
+ role: "authors",
805
+ style: "plain",
806
+ },
807
+ { type: "separator", text: ", " },
808
+ ],
809
+ },
810
+ {
811
+ type: "segment",
812
+ source: { kind: "string", field: "title" },
813
+ role: "title",
814
+ style: "quoted",
815
+ },
816
+ { type: "separator", text: ", " },
817
+ {
818
+ type: "segment",
819
+ source: { kind: "string", field: "repository" },
820
+ role: "misc",
821
+ },
822
+ {
823
+ type: "conditional",
824
+ field: "version",
825
+ then: [
826
+ { type: "separator", text: ", " },
827
+ {
828
+ type: "segment",
829
+ source: { kind: "literal", text: "ver. " },
830
+ role: "prefix",
831
+ },
832
+ {
833
+ type: "segment",
834
+ source: { kind: "string", field: "version" },
835
+ role: "misc",
836
+ },
837
+ ],
838
+ },
839
+ { type: "separator", text: ", " },
840
+ {
841
+ type: "segment",
842
+ source: { kind: "string", field: "year" },
843
+ role: "year",
844
+ },
845
+ {
846
+ type: "conditional",
847
+ field: "doi",
848
+ then: [
849
+ { type: "separator", text: ", doi: " },
850
+ {
851
+ type: "segment",
852
+ source: { kind: "string", field: "doi" },
853
+ role: "doi",
854
+ },
855
+ ],
856
+ },
857
+ { type: "separator", text: ". " },
858
+ {
859
+ type: "segment",
860
+ source: { kind: "literal", text: "[Online]. Available: " },
861
+ role: "prefix",
862
+ },
863
+ {
864
+ type: "segment",
865
+ source: { kind: "string", field: "url" },
866
+ role: "url",
867
+ style: "link",
868
+ },
869
+ ];
870
+ // Software: [authors, ", "], title(italic), [", ver. ", version(misc)], ", ", year, [". ", publisher], [". ", "doi: ", doi], ". ", "[Online]. Available: ", url(link)
871
+ export const SOFTWARE_TEMPLATE = [
872
+ {
873
+ type: "conditional",
874
+ field: "authors",
875
+ checkLength: true,
876
+ then: [
877
+ {
878
+ type: "segment",
879
+ source: { kind: "authors", field: "authors" },
880
+ role: "authors",
881
+ style: "plain",
882
+ },
883
+ { type: "separator", text: ", " },
884
+ ],
885
+ },
886
+ {
887
+ type: "segment",
888
+ source: { kind: "string", field: "title" },
889
+ role: "title",
890
+ style: "italic",
891
+ },
892
+ {
893
+ type: "conditional",
894
+ field: "version",
895
+ then: [
896
+ { type: "separator", text: ", " },
897
+ {
898
+ type: "segment",
899
+ source: { kind: "literal", text: "ver. " },
900
+ role: "prefix",
901
+ },
902
+ {
903
+ type: "segment",
904
+ source: { kind: "string", field: "version" },
905
+ role: "misc",
906
+ },
907
+ ],
908
+ },
909
+ { type: "separator", text: ", " },
910
+ {
911
+ type: "segment",
912
+ source: { kind: "string", field: "year" },
913
+ role: "year",
914
+ },
915
+ {
916
+ type: "conditional",
917
+ field: "publisher",
918
+ then: [
919
+ { type: "separator", text: ". " },
920
+ {
921
+ type: "segment",
922
+ source: { kind: "string", field: "publisher" },
923
+ role: "publisher",
924
+ },
925
+ ],
926
+ },
927
+ {
928
+ type: "conditional",
929
+ field: "doi",
930
+ then: [
931
+ { type: "separator", text: ". " },
932
+ {
933
+ type: "segment",
934
+ source: { kind: "literal", text: "doi: " },
935
+ role: "prefix",
936
+ },
937
+ {
938
+ type: "segment",
939
+ source: { kind: "string", field: "doi" },
940
+ role: "doi",
941
+ },
942
+ ],
943
+ },
944
+ { type: "separator", text: ". " },
945
+ {
946
+ type: "segment",
947
+ source: { kind: "literal", text: "[Online]. Available: " },
948
+ role: "prefix",
949
+ },
950
+ {
951
+ type: "segment",
952
+ source: { kind: "string", field: "url" },
953
+ role: "url",
954
+ style: "link",
955
+ },
956
+ ];
957
+ // OnlineDocument: [authors, ". "], title(quoted), [". ", publisher], ". ", "Accessed: ", accessedDate, ". ", "[Online]. Available: ", url(link)
958
+ export const ONLINE_DOCUMENT_TEMPLATE = [
959
+ {
960
+ type: "conditional",
961
+ field: "authors",
962
+ checkLength: true,
963
+ then: [
964
+ {
965
+ type: "segment",
966
+ source: { kind: "authors", field: "authors" },
967
+ role: "authors",
968
+ style: "plain",
969
+ },
970
+ { type: "separator", text: ". " },
971
+ ],
972
+ },
973
+ {
974
+ type: "segment",
975
+ source: { kind: "string", field: "title" },
976
+ role: "title",
977
+ style: "quoted",
978
+ },
979
+ {
980
+ type: "conditional",
981
+ field: "publisher",
982
+ then: [
983
+ { type: "separator", text: ". " },
984
+ {
985
+ type: "segment",
986
+ source: { kind: "string", field: "publisher" },
987
+ role: "publisher",
988
+ },
989
+ ],
990
+ },
991
+ { type: "separator", text: ". " },
992
+ {
993
+ type: "segment",
994
+ source: { kind: "literal", text: "Accessed: " },
995
+ role: "prefix",
996
+ },
997
+ {
998
+ type: "segment",
999
+ source: { kind: "date", field: "accessedDate" },
1000
+ role: "accessedDate",
1001
+ },
1002
+ { type: "separator", text: ". " },
1003
+ {
1004
+ type: "segment",
1005
+ source: { kind: "literal", text: "[Online]. Available: " },
1006
+ role: "prefix",
1007
+ },
1008
+ {
1009
+ type: "segment",
1010
+ source: { kind: "string", field: "url" },
1011
+ role: "url",
1012
+ style: "link",
1013
+ },
1014
+ ];
1015
+ // Blog: author(single), ", ", postTitle(quoted), ", ", blogName(italic,misc), ", ", date, ". ", "Accessed: ", accessedDate, ". ", "[Online]. Available: ", url(link)
1016
+ export const BLOG_TEMPLATE = [
1017
+ {
1018
+ type: "segment",
1019
+ source: { kind: "singleAuthor", field: "author" },
1020
+ role: "authors",
1021
+ style: "plain",
1022
+ },
1023
+ { type: "separator", text: ", " },
1024
+ {
1025
+ type: "segment",
1026
+ source: { kind: "string", field: "postTitle" },
1027
+ role: "title",
1028
+ style: "quoted",
1029
+ },
1030
+ { type: "separator", text: ", " },
1031
+ {
1032
+ type: "segment",
1033
+ source: { kind: "string", field: "blogName" },
1034
+ role: "misc",
1035
+ style: "italic",
1036
+ },
1037
+ { type: "separator", text: ", " },
1038
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1039
+ { type: "separator", text: ". " },
1040
+ {
1041
+ type: "segment",
1042
+ source: { kind: "literal", text: "Accessed: " },
1043
+ role: "prefix",
1044
+ },
1045
+ {
1046
+ type: "segment",
1047
+ source: { kind: "date", field: "accessedDate" },
1048
+ role: "accessedDate",
1049
+ },
1050
+ { type: "separator", text: ". " },
1051
+ {
1052
+ type: "segment",
1053
+ source: { kind: "literal", text: "[Online]. Available: " },
1054
+ role: "prefix",
1055
+ },
1056
+ {
1057
+ type: "segment",
1058
+ source: { kind: "string", field: "url" },
1059
+ role: "url",
1060
+ style: "link",
1061
+ },
1062
+ ];
1063
+ // SocialMedia: author(single), ". ", platform, ". ", postDate(date), ". ", "[Online]. Available: ", url(link)
1064
+ export const SOCIAL_MEDIA_TEMPLATE = [
1065
+ {
1066
+ type: "segment",
1067
+ source: { kind: "singleAuthor", field: "author" },
1068
+ role: "authors",
1069
+ style: "plain",
1070
+ },
1071
+ { type: "separator", text: ". " },
1072
+ {
1073
+ type: "segment",
1074
+ source: { kind: "string", field: "platform" },
1075
+ role: "platform",
1076
+ },
1077
+ { type: "separator", text: ". " },
1078
+ {
1079
+ type: "segment",
1080
+ source: { kind: "date", field: "postDate" },
1081
+ role: "date",
1082
+ },
1083
+ { type: "separator", text: ". " },
1084
+ {
1085
+ type: "segment",
1086
+ source: { kind: "literal", text: "[Online]. Available: " },
1087
+ role: "prefix",
1088
+ },
1089
+ {
1090
+ type: "segment",
1091
+ source: { kind: "string", field: "url" },
1092
+ role: "url",
1093
+ style: "link",
1094
+ },
1095
+ ];
1096
+ // Preprint: authors, ", ", title(quoted), ", ", server(italic,misc), ", ", year, [", doi: ", doi], ". ", "[Online]. Available: ", url(link)
1097
+ export const PREPRINT_TEMPLATE = [
1098
+ {
1099
+ type: "segment",
1100
+ source: { kind: "authors", field: "authors" },
1101
+ role: "authors",
1102
+ style: "plain",
1103
+ },
1104
+ { type: "separator", text: ", " },
1105
+ {
1106
+ type: "segment",
1107
+ source: { kind: "string", field: "title" },
1108
+ role: "title",
1109
+ style: "quoted",
1110
+ },
1111
+ { type: "separator", text: ", " },
1112
+ {
1113
+ type: "segment",
1114
+ source: { kind: "string", field: "server" },
1115
+ role: "misc",
1116
+ style: "italic",
1117
+ },
1118
+ { type: "separator", text: ", " },
1119
+ {
1120
+ type: "segment",
1121
+ source: { kind: "string", field: "year" },
1122
+ role: "year",
1123
+ },
1124
+ {
1125
+ type: "conditional",
1126
+ field: "doi",
1127
+ then: [
1128
+ { type: "separator", text: ", doi: " },
1129
+ {
1130
+ type: "segment",
1131
+ source: { kind: "string", field: "doi" },
1132
+ role: "doi",
1133
+ },
1134
+ ],
1135
+ },
1136
+ { type: "separator", text: ". " },
1137
+ {
1138
+ type: "segment",
1139
+ source: { kind: "literal", text: "[Online]. Available: " },
1140
+ role: "prefix",
1141
+ },
1142
+ {
1143
+ type: "segment",
1144
+ source: { kind: "string", field: "url" },
1145
+ role: "url",
1146
+ style: "link",
1147
+ },
1148
+ ];
1149
+ // Video: [authors, ". "], title(italic), ". ", platform, [". ", releaseDate(date)], ". ", "Accessed: ", accessedDate, ". ", "[Online]. Available: ", url(link)
1150
+ export const VIDEO_TEMPLATE = [
1151
+ {
1152
+ type: "conditional",
1153
+ field: "authors",
1154
+ checkLength: true,
1155
+ then: [
1156
+ {
1157
+ type: "segment",
1158
+ source: { kind: "authors", field: "authors" },
1159
+ role: "authors",
1160
+ style: "plain",
1161
+ },
1162
+ { type: "separator", text: ". " },
1163
+ ],
1164
+ },
1165
+ {
1166
+ type: "segment",
1167
+ source: { kind: "string", field: "title" },
1168
+ role: "title",
1169
+ style: "italic",
1170
+ },
1171
+ { type: "separator", text: ". " },
1172
+ {
1173
+ type: "segment",
1174
+ source: { kind: "string", field: "platform" },
1175
+ role: "platform",
1176
+ },
1177
+ {
1178
+ type: "conditional",
1179
+ field: "releaseDate",
1180
+ then: [
1181
+ { type: "separator", text: ". " },
1182
+ {
1183
+ type: "segment",
1184
+ source: { kind: "date", field: "releaseDate" },
1185
+ role: "date",
1186
+ },
1187
+ ],
1188
+ },
1189
+ { type: "separator", text: ". " },
1190
+ {
1191
+ type: "segment",
1192
+ source: { kind: "literal", text: "Accessed: " },
1193
+ role: "prefix",
1194
+ },
1195
+ {
1196
+ type: "segment",
1197
+ source: { kind: "date", field: "accessedDate" },
1198
+ role: "accessedDate",
1199
+ },
1200
+ { type: "separator", text: ". " },
1201
+ {
1202
+ type: "segment",
1203
+ source: { kind: "literal", text: "[Online]. Available: " },
1204
+ role: "prefix",
1205
+ },
1206
+ {
1207
+ type: "segment",
1208
+ source: { kind: "string", field: "url" },
1209
+ role: "url",
1210
+ style: "link",
1211
+ },
1212
+ ];
1213
+ // Podcast: [authors, ". "], episodeTitle(quoted), ", in ", seriesTitle(italic,misc), ". ", platform, ". ", "Accessed: ", accessedDate, ". ", "[Online]. Available: ", url(link)
1214
+ export const PODCAST_TEMPLATE = [
1215
+ {
1216
+ type: "conditional",
1217
+ field: "authors",
1218
+ checkLength: true,
1219
+ then: [
1220
+ {
1221
+ type: "segment",
1222
+ source: { kind: "authors", field: "authors" },
1223
+ role: "authors",
1224
+ style: "plain",
1225
+ },
1226
+ { type: "separator", text: ". " },
1227
+ ],
1228
+ },
1229
+ {
1230
+ type: "segment",
1231
+ source: { kind: "string", field: "episodeTitle" },
1232
+ role: "title",
1233
+ style: "quoted",
1234
+ },
1235
+ { type: "separator", text: ", in " },
1236
+ {
1237
+ type: "segment",
1238
+ source: { kind: "string", field: "seriesTitle" },
1239
+ role: "misc",
1240
+ style: "italic",
1241
+ },
1242
+ { type: "separator", text: ". " },
1243
+ {
1244
+ type: "segment",
1245
+ source: { kind: "string", field: "platform" },
1246
+ role: "platform",
1247
+ },
1248
+ { type: "separator", text: ". " },
1249
+ {
1250
+ type: "segment",
1251
+ source: { kind: "literal", text: "Accessed: " },
1252
+ role: "prefix",
1253
+ },
1254
+ {
1255
+ type: "segment",
1256
+ source: { kind: "date", field: "accessedDate" },
1257
+ role: "accessedDate",
1258
+ },
1259
+ { type: "separator", text: ". " },
1260
+ {
1261
+ type: "segment",
1262
+ source: { kind: "literal", text: "[Online]. Available: " },
1263
+ role: "prefix",
1264
+ },
1265
+ {
1266
+ type: "segment",
1267
+ source: { kind: "string", field: "url" },
1268
+ role: "url",
1269
+ style: "link",
1270
+ },
1271
+ ];
1272
+ // Course: instructor(single), ", ", title(italic), ", ", institution, [", ", courseCode(misc)], ", ", term(misc), ", ", year, "."
1273
+ export const COURSE_TEMPLATE = [
1274
+ {
1275
+ type: "segment",
1276
+ source: { kind: "singleAuthor", field: "instructor" },
1277
+ role: "authors",
1278
+ style: "plain",
1279
+ },
1280
+ { type: "separator", text: ", " },
1281
+ {
1282
+ type: "segment",
1283
+ source: { kind: "string", field: "title" },
1284
+ role: "title",
1285
+ style: "italic",
1286
+ },
1287
+ { type: "separator", text: ", " },
1288
+ {
1289
+ type: "segment",
1290
+ source: { kind: "string", field: "institution" },
1291
+ role: "institution",
1292
+ },
1293
+ {
1294
+ type: "conditional",
1295
+ field: "courseCode",
1296
+ then: [
1297
+ { type: "separator", text: ", " },
1298
+ {
1299
+ type: "segment",
1300
+ source: { kind: "string", field: "courseCode" },
1301
+ role: "misc",
1302
+ },
1303
+ ],
1304
+ },
1305
+ { type: "separator", text: ", " },
1306
+ {
1307
+ type: "segment",
1308
+ source: { kind: "string", field: "term" },
1309
+ role: "misc",
1310
+ },
1311
+ { type: "separator", text: ", " },
1312
+ {
1313
+ type: "segment",
1314
+ source: { kind: "string", field: "year" },
1315
+ role: "year",
1316
+ },
1317
+ { type: "separator", text: "." },
1318
+ ];
1319
+ // Presentation: presenter(single), ", ", title(quoted), ", ", "presented at ", eventTitle(italic,misc), ", ", location, ", ", date, "."
1320
+ export const PRESENTATION_TEMPLATE = [
1321
+ {
1322
+ type: "segment",
1323
+ source: { kind: "singleAuthor", field: "presenter" },
1324
+ role: "authors",
1325
+ style: "plain",
1326
+ },
1327
+ { type: "separator", text: ", " },
1328
+ {
1329
+ type: "segment",
1330
+ source: { kind: "string", field: "title" },
1331
+ role: "title",
1332
+ style: "quoted",
1333
+ },
1334
+ { type: "separator", text: ", " },
1335
+ {
1336
+ type: "segment",
1337
+ source: { kind: "literal", text: "presented at " },
1338
+ role: "prefix",
1339
+ },
1340
+ {
1341
+ type: "segment",
1342
+ source: { kind: "string", field: "eventTitle" },
1343
+ role: "misc",
1344
+ style: "italic",
1345
+ },
1346
+ { type: "separator", text: ", " },
1347
+ {
1348
+ type: "segment",
1349
+ source: { kind: "string", field: "location" },
1350
+ role: "location",
1351
+ },
1352
+ { type: "separator", text: ", " },
1353
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1354
+ { type: "separator", text: "." },
1355
+ ];
1356
+ // Interview: interviewee(single), [", ", "interviewed by ", interviewer(single,misc)], ", ", date, "."
1357
+ export const INTERVIEW_TEMPLATE = [
1358
+ {
1359
+ type: "segment",
1360
+ source: { kind: "singleAuthor", field: "interviewee" },
1361
+ role: "authors",
1362
+ style: "plain",
1363
+ },
1364
+ {
1365
+ type: "conditional",
1366
+ field: "interviewer",
1367
+ then: [
1368
+ { type: "separator", text: ", " },
1369
+ {
1370
+ type: "segment",
1371
+ source: { kind: "literal", text: "interviewed by " },
1372
+ role: "prefix",
1373
+ },
1374
+ {
1375
+ type: "segment",
1376
+ source: { kind: "singleAuthor", field: "interviewer" },
1377
+ role: "misc",
1378
+ },
1379
+ ],
1380
+ },
1381
+ { type: "separator", text: ", " },
1382
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1383
+ { type: "separator", text: "." },
1384
+ ];
1385
+ // PersonalCommunication: person(single), ", ", "personal communication"(misc), ", ", date, "."
1386
+ export const PERSONAL_COMMUNICATION_TEMPLATE = [
1387
+ {
1388
+ type: "segment",
1389
+ source: { kind: "singleAuthor", field: "person" },
1390
+ role: "authors",
1391
+ style: "plain",
1392
+ },
1393
+ { type: "separator", text: ", " },
1394
+ {
1395
+ type: "segment",
1396
+ source: { kind: "literal", text: "personal communication" },
1397
+ role: "misc",
1398
+ },
1399
+ { type: "separator", text: ", " },
1400
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1401
+ { type: "separator", text: "." },
1402
+ ];
1403
+ // Email: sender(single), ", ", "email to ", recipient(single,misc), ", ", date, "."
1404
+ export const EMAIL_TEMPLATE = [
1405
+ {
1406
+ type: "segment",
1407
+ source: { kind: "singleAuthor", field: "sender" },
1408
+ role: "authors",
1409
+ style: "plain",
1410
+ },
1411
+ { type: "separator", text: ", " },
1412
+ {
1413
+ type: "segment",
1414
+ source: { kind: "literal", text: "email to " },
1415
+ role: "prefix",
1416
+ },
1417
+ {
1418
+ type: "segment",
1419
+ source: { kind: "singleAuthor", field: "recipient" },
1420
+ role: "misc",
1421
+ },
1422
+ { type: "separator", text: ", " },
1423
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1424
+ { type: "separator", text: "." },
1425
+ ];
1426
+ // Law: title(italic), ", ", jurisdiction(misc), ", ", dateEnacted(date), "."
1427
+ export const LAW_TEMPLATE = [
1428
+ {
1429
+ type: "segment",
1430
+ source: { kind: "string", field: "title" },
1431
+ role: "title",
1432
+ style: "italic",
1433
+ },
1434
+ { type: "separator", text: ", " },
1435
+ {
1436
+ type: "segment",
1437
+ source: { kind: "string", field: "jurisdiction" },
1438
+ role: "misc",
1439
+ },
1440
+ { type: "separator", text: ", " },
1441
+ {
1442
+ type: "segment",
1443
+ source: { kind: "date", field: "dateEnacted" },
1444
+ role: "date",
1445
+ },
1446
+ { type: "separator", text: "." },
1447
+ ];
1448
+ // CourtCase: caseName(italic,title), ", ", court(misc), [", ", reporter(misc)], ", ", date, "."
1449
+ export const COURT_CASE_TEMPLATE = [
1450
+ {
1451
+ type: "segment",
1452
+ source: { kind: "string", field: "caseName" },
1453
+ role: "title",
1454
+ style: "italic",
1455
+ },
1456
+ { type: "separator", text: ", " },
1457
+ {
1458
+ type: "segment",
1459
+ source: { kind: "string", field: "court" },
1460
+ role: "misc",
1461
+ },
1462
+ {
1463
+ type: "conditional",
1464
+ field: "reporter",
1465
+ then: [
1466
+ { type: "separator", text: ", " },
1467
+ {
1468
+ type: "segment",
1469
+ source: { kind: "string", field: "reporter" },
1470
+ role: "misc",
1471
+ },
1472
+ ],
1473
+ },
1474
+ { type: "separator", text: ", " },
1475
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1476
+ { type: "separator", text: "." },
1477
+ ];
1478
+ // GovernmentPublication: [authors, ", "], title(italic), ", ", agency(organization), ", ", location, [", Rep. ", reportNumber], ", ", date, "."
1479
+ export const GOVERNMENT_PUBLICATION_TEMPLATE = [
1480
+ {
1481
+ type: "conditional",
1482
+ field: "authors",
1483
+ checkLength: true,
1484
+ then: [
1485
+ {
1486
+ type: "segment",
1487
+ source: { kind: "authors", field: "authors" },
1488
+ role: "authors",
1489
+ style: "plain",
1490
+ },
1491
+ { type: "separator", text: ", " },
1492
+ ],
1493
+ },
1494
+ {
1495
+ type: "segment",
1496
+ source: { kind: "string", field: "title" },
1497
+ role: "title",
1498
+ style: "italic",
1499
+ },
1500
+ { type: "separator", text: ", " },
1501
+ {
1502
+ type: "segment",
1503
+ source: { kind: "string", field: "agency" },
1504
+ role: "organization",
1505
+ },
1506
+ { type: "separator", text: ", " },
1507
+ {
1508
+ type: "segment",
1509
+ source: { kind: "string", field: "location" },
1510
+ role: "location",
1511
+ },
1512
+ {
1513
+ type: "conditional",
1514
+ field: "reportNumber",
1515
+ then: [
1516
+ { type: "separator", text: ", " },
1517
+ {
1518
+ type: "segment",
1519
+ source: { kind: "literal", text: "Rep. " },
1520
+ role: "prefix",
1521
+ },
1522
+ {
1523
+ type: "segment",
1524
+ source: { kind: "string", field: "reportNumber" },
1525
+ role: "reportNumber",
1526
+ },
1527
+ ],
1528
+ },
1529
+ { type: "separator", text: ", " },
1530
+ { type: "segment", source: { kind: "date", field: "date" }, role: "date" },
1531
+ { type: "separator", text: "." },
1532
+ ];
1533
+ // Datasheet: title(italic), ", ", manufacturer(publisher), ", ", partNumber(misc), ", ", year, ". ", "[Online]. Available: ", url(link)
1534
+ export const DATASHEET_TEMPLATE = [
1535
+ {
1536
+ type: "segment",
1537
+ source: { kind: "string", field: "title" },
1538
+ role: "title",
1539
+ style: "italic",
1540
+ },
1541
+ { type: "separator", text: ", " },
1542
+ {
1543
+ type: "segment",
1544
+ source: { kind: "string", field: "manufacturer" },
1545
+ role: "publisher",
1546
+ },
1547
+ { type: "separator", text: ", " },
1548
+ {
1549
+ type: "segment",
1550
+ source: { kind: "string", field: "partNumber" },
1551
+ role: "misc",
1552
+ },
1553
+ { type: "separator", text: ", " },
1554
+ {
1555
+ type: "segment",
1556
+ source: { kind: "string", field: "year" },
1557
+ role: "year",
1558
+ },
1559
+ { type: "separator", text: ". " },
1560
+ {
1561
+ type: "segment",
1562
+ source: { kind: "literal", text: "[Online]. Available: " },
1563
+ role: "prefix",
1564
+ },
1565
+ {
1566
+ type: "segment",
1567
+ source: { kind: "string", field: "url" },
1568
+ role: "url",
1569
+ style: "link",
1570
+ },
1571
+ ];
1572
+ // ProductManual: title(italic), ", ", manufacturer(publisher), ", ", model(misc), ", ", year, [". ", "[Online]. Available: ", url(link)], "."
1573
+ export const PRODUCT_MANUAL_TEMPLATE = [
1574
+ {
1575
+ type: "segment",
1576
+ source: { kind: "string", field: "title" },
1577
+ role: "title",
1578
+ style: "italic",
1579
+ },
1580
+ { type: "separator", text: ", " },
1581
+ {
1582
+ type: "segment",
1583
+ source: { kind: "string", field: "manufacturer" },
1584
+ role: "publisher",
1585
+ },
1586
+ { type: "separator", text: ", " },
1587
+ {
1588
+ type: "segment",
1589
+ source: { kind: "string", field: "model" },
1590
+ role: "misc",
1591
+ },
1592
+ { type: "separator", text: ", " },
1593
+ {
1594
+ type: "segment",
1595
+ source: { kind: "string", field: "year" },
1596
+ role: "year",
1597
+ },
1598
+ {
1599
+ type: "conditional",
1600
+ field: "url",
1601
+ then: [
1602
+ { type: "separator", text: ". " },
1603
+ {
1604
+ type: "segment",
1605
+ source: { kind: "literal", text: "[Online]. Available: " },
1606
+ role: "prefix",
1607
+ },
1608
+ {
1609
+ type: "segment",
1610
+ source: { kind: "string", field: "url" },
1611
+ role: "url",
1612
+ style: "link",
1613
+ },
1614
+ ],
1615
+ },
1616
+ { type: "separator", text: "." },
1617
+ ];
1618
+ //# sourceMappingURL=segment-templates.js.map