@livepreso/api 6.57.0 → 6.57.1

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 (84) hide show
  1. package/.rush/temp/chunked-rush-logs/api.build.chunks.jsonl +5 -15
  2. package/.rush/temp/operation/build/all.log +5 -15
  3. package/.rush/temp/operation/build/error.log +3 -13
  4. package/.rush/temp/operation/build/log-chunks.jsonl +5 -15
  5. package/.rush/temp/operation/build/state.json +1 -1
  6. package/.rush/temp/shrinkwrap-deps.json +11 -11
  7. package/CHANGELOG.json +23 -0
  8. package/CHANGELOG.md +10 -1
  9. package/cjs/collections/adjunct-sub-slides.js +13 -1
  10. package/cjs/collections/adjunct-sub-slides.js.map +1 -1
  11. package/cjs/fixtures.js +13 -2
  12. package/cjs/fixtures.js.map +1 -1
  13. package/cjs/models/base.js +12 -3
  14. package/cjs/models/base.js.map +1 -1
  15. package/cjs/models/deck-version.js +2 -0
  16. package/cjs/models/deck-version.js.map +1 -1
  17. package/cjs/models/dispatch.js +1 -1
  18. package/cjs/models/dispatch.js.map +1 -1
  19. package/cjs/models/room.js +4 -0
  20. package/cjs/models/room.js.map +1 -1
  21. package/cjs/models/user.js +1 -1
  22. package/cjs/models/user.js.map +1 -1
  23. package/cjs/presentation/base-presentation-model.js +6 -6
  24. package/cjs/presentation/base-presentation-model.js.map +1 -1
  25. package/cjs/presentation/presentation-deck.js +82 -27
  26. package/cjs/presentation/presentation-deck.js.map +1 -1
  27. package/cjs/presentation/presentation-section.js +42 -47
  28. package/cjs/presentation/presentation-section.js.map +1 -1
  29. package/cjs/presentation/presentation-slide.js +35 -39
  30. package/cjs/presentation/presentation-slide.js.map +1 -1
  31. package/cjs/utils.js +9 -6
  32. package/cjs/utils.js.map +1 -1
  33. package/package.json +3 -3
  34. package/rush-logs/api.build.error.log +3 -13
  35. package/rush-logs/api.build.log +5 -15
  36. package/src/collections/adjunct-sub-slides.js +13 -0
  37. package/src/fixtures.js +16 -2
  38. package/src/models/base.js +16 -3
  39. package/src/models/deck-version.js +2 -0
  40. package/src/models/dispatch.js +1 -1
  41. package/src/models/room.js +5 -0
  42. package/src/models/user.js +4 -4
  43. package/src/presentation/base-presentation-model.js +14 -6
  44. package/src/presentation/presentation-deck.js +63 -24
  45. package/src/presentation/presentation-section.js +31 -50
  46. package/src/presentation/presentation-slide.js +36 -43
  47. package/src/utils.js +9 -6
  48. package/.rush/temp/1aebf46f78ad5c45f82f8147751890adb37bef9d.log +0 -10
  49. package/.rush/temp/256021b5963b4c0221d3dec247b697b9691a9b2c.log +0 -10
  50. package/.rush/temp/2a322f00f12cf9d1e64afe81275cc78d01c49050.log +0 -10
  51. package/.rush/temp/30061f1865447dcbb3f20a305061205f3dbe6091.log +0 -10
  52. package/.rush/temp/3cdc82c352e8ed90607952873f3aa4c200490874.log +0 -10
  53. package/.rush/temp/45522aea0dee8cb2be1a53248ba45bd235743b43.log +0 -10
  54. package/.rush/temp/5489ab737e406518983c16c57fc3e1edc07c0341.log +0 -10
  55. package/.rush/temp/58fcbb7f15a76326d40e0839ab179755da82a891.log +0 -10
  56. package/.rush/temp/5bc0bba70b733baa4dd976667ba0a1386e516186.log +0 -10
  57. package/.rush/temp/64f1bb696f8d7d7e72907b80df316b127f72e23e.log +0 -10
  58. package/.rush/temp/6f640f951414ea68adb65c17e4ed7527cde54faf.log +0 -10
  59. package/.rush/temp/7c7b958682d4ab5697530be47d0aac62efe1adf1.log +0 -10
  60. package/.rush/temp/82bfb987463fbcfebf04022e6ed00015c73879c8.log +0 -10
  61. package/.rush/temp/844034aa6e542115075e8f3dc5ffc640973e0064.log +0 -10
  62. package/.rush/temp/8b42957a7c15da1f29cb57bee125f13affa70dca.log +0 -10
  63. package/.rush/temp/924652444ab5a6063f328a2217123a2227058896.log +0 -10
  64. package/.rush/temp/9f2030f96d62f3e38052e35201819a216566f14f.log +0 -10
  65. package/.rush/temp/a769db9d81a23000c0e9b1bf4f1a9a9e721d0d7c.log +0 -10
  66. package/.rush/temp/a87d3a8b4ece87ec66f27c86226a9f205617681f.log +0 -10
  67. package/.rush/temp/bb7a5bdcc4af4ad1507f81f33774b31f5b4e4fb7.log +0 -10
  68. package/.rush/temp/build-cache-tar.log +0 -7
  69. package/.rush/temp/c20e29ccaaa9231b38a28bb24451b4ce7562cdc0.log +0 -10
  70. package/.rush/temp/chunked-rush-logs/api.test.chunks.jsonl +0 -1
  71. package/.rush/temp/e21303db8f59b4625fd184c9114377d781fd24f8.log +0 -10
  72. package/.rush/temp/e6d303862765b6a5f41dd483d0f9ae083a1fae10.log +0 -10
  73. package/.rush/temp/eaf69fbc059d2f1258d7569136180d4a1d3c7072.log +0 -10
  74. package/.rush/temp/f85d279e2674966daaec83e1c3986a96f86ef304.log +0 -10
  75. package/.rush/temp/fc0a332c5b34c6b90006850cf2d93a48fb4b9a6e.log +0 -10
  76. package/.rush/temp/operation/test/all.log +0 -21
  77. package/.rush/temp/operation/test/log-chunks.jsonl +0 -21
  78. package/.rush/temp/operation/test/state.json +0 -3
  79. package/.rush/temp/package-deps_build.json +0 -185
  80. package/api.build.log +0 -9
  81. package/api.test.cache.log +0 -1
  82. package/api.test.log +0 -19
  83. package/rush-logs/api.test.cache.log +0 -1
  84. package/rush-logs/api.test.log +0 -1
@@ -135,11 +135,11 @@ BasePresentationModel.getVisibilityAndSequence = function (model) {
135
135
  if (choicelist) {
136
136
  // All items should have a choicelist entry - if it's not in
137
137
  // the choicelist, it's not in the preso
138
- var choice = choicelist.find(function (item) {
138
+ var choice = options.choicelistMap ? options.choicelistMap.get(url) : choicelist.find(function (item) {
139
139
  return item.url === url;
140
140
  });
141
141
  if (choice) {
142
- config.sequence = choicelist.indexOf(choice);
142
+ config.sequence = options.choicelistMap ? choice._idx : choicelist.indexOf(choice);
143
143
  config.visible = choice.visible;
144
144
  } else {
145
145
  config.visible = false;
@@ -148,7 +148,7 @@ BasePresentationModel.getVisibilityAndSequence = function (model) {
148
148
  // Non-adjunct subslides and adjunct sections/slides/subslides
149
149
  // have no selections - they fall through here using their
150
150
  // model's values
151
- var selection = selections.find(function (selection) {
151
+ var selection = options.selectionsMap ? options.selectionsMap.get(url) : selections.find(function (selection) {
152
152
  return selection.url === url;
153
153
  });
154
154
  if (selection) {
@@ -163,10 +163,10 @@ BasePresentationModel.getVisibilityAndSequence = function (model) {
163
163
 
164
164
  return config;
165
165
  };
166
- var getAppointmentTags = function getAppointmentTags(model, tags) {
166
+ var getAppointmentTags = function getAppointmentTags(model, tags, options) {
167
167
  var _model$adjunct;
168
168
  var url = ((_model$adjunct = model.adjunct) === null || _model$adjunct === void 0 ? void 0 : _model$adjunct.url()) || model.url();
169
- var tagItem = tags.find(function (tag) {
169
+ var tagItem = options !== null && options !== void 0 && options.appointmentTagsMap ? options.appointmentTagsMap.get(url) : tags.find(function (tag) {
170
170
  return tag.content_url === url;
171
171
  });
172
172
  if (tagItem) {
@@ -212,7 +212,7 @@ var getDeckTags = function getDeckTags(model, tags) {
212
212
  BasePresentationModel.getTags = function (model) {
213
213
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
214
214
  if (options.appointmentTags) {
215
- return getAppointmentTags(model, options.appointmentTags);
215
+ return getAppointmentTags(model, options.appointmentTags, options);
216
216
  }
217
217
  if (options.deckTags) {
218
218
  return getDeckTags(model, options.deckTags);
@@ -1 +1 @@
1
- {"version":3,"file":"base-presentation-model.js","names":["_base","require","_deckVersionScreenshots","_scenario2","_lodash","_interopRequireDefault","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","from","test","ownKeys","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","BasePresentationModel","exports","BaseModel","extend","url","screenshotsToMap","screenshots","models","reduce","result","model","subject","Error","image_256","getThumbnail","filterScreenshotsByScenario","_screenshots","_scenario","undefined","DeckVersionScreenshotCollection","scenario","ScenarioModel","id","globalScreenshots","screen","map","toJSON","scenarioScreenshots","_iterator","_step","scenarioScreen","existingGlobalIndex","_","findIndex","err","ordered","orderBy","getVisibilityAndSequence","options","_options$choicelist","choicelist","_options$selections","selections","config","visible","enabled","sequence","selectionID","choice","find","item","indexOf","adjunct","selection","getAppointmentTags","tags","_model$adjunct","tagItem","tag","content_url","getDeckTags","namespaced_key","isAutoAdjunct","key","includes","splitKey","split","deck","getTags","appointmentTags","deckTags","canBeEmpty"],"sources":["../../src/presentation/base-presentation-model.js"],"sourcesContent":["import { BaseModel } from \"../models/base.js\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport { ScenarioModel } from \"../models/scenario.js\";\nimport _ from \"lodash\";\n\n/**\n * @constructor\n * @alias presentation.BasePresentationModel\n * @extends presentation.BaseModel\n */\nexport const BasePresentationModel = BaseModel.extend(\n\t/** @lends presentation.BasePresentationModel# */ {\n\t\turl() {\n\t\t\treturn null;\n\t\t},\n\t},\n);\n\nBasePresentationModel.screenshotsToMap = function (screenshots) {\n\tif (!screenshots?.models) {\n\t\treturn screenshots;\n\t}\n\n\treturn screenshots.reduce((result, model) => {\n\t\tif (result[model.subject]) {\n\t\t\tthrow new Error(`\n\t\t\t\tFound multiple screenshots that could match this subject. If there is a scenario\n\t\t\t\tand a global, be sure to remove the screenshot that you don't need.\n\t\t\t`);\n\t\t}\n\t\tresult[model.subject] = model.image_256;\n\t\treturn result;\n\t}, {});\n};\n\n/**\n * Logic to pick a thumbnail based on either the model itself or from\n * and overriding screenshot if one exists.\n */\nBasePresentationModel.getThumbnail = function (model, screenshots) {\n\tif (screenshots?.models) {\n\t\tthrow new Error(\"Expected map file\");\n\t}\n\n\tif (!model) {\n\t\treturn null;\n\t}\n\n\treturn screenshots[model.url()] || model.image_256;\n};\n\n/**\n * Takes a list of screenshots and filters it to only be a list used by a single scenario\n * (or company wide).\n *\n * The logic should be like this:\n *\n *\t* If the scenario is null, we just return all global screenshots (scenario = null)\n *\t* If we select a scenario, we take those global screenshots and replace any that have a\n *\t\tscenario specific version of that screenshot. If none is found, the\n *\t\tscenario will want to see the same global version. Obviously only one\n *\t\tscenario's screenshots should be available.\n */\nBasePresentationModel.filterScreenshotsByScenario = function (\n\t_screenshots,\n\t_scenario = null,\n) {\n\tconst screenshots = new DeckVersionScreenshotCollection(_screenshots);\n\tconst scenario = _scenario ? new ScenarioModel({ id: _scenario }) : null;\n\n\tconst globalScreenshots = screenshots\n\t\t.filter((screen) => screen.scenario === null)\n\t\t.map((screen) => screen.toJSON());\n\n\tconst result = globalScreenshots;\n\n\tif (scenario) {\n\t\tconst scenarioScreenshots = screenshots\n\t\t\t.filter(\n\t\t\t\t(screen) => screen.scenario && screen.scenario.url() === scenario.url(),\n\t\t\t)\n\t\t\t.map((screen) => ({\n\t\t\t\t...screen.toJSON(),\n\t\t\t\tscenario: screen.scenario.url(),\n\t\t\t}));\n\n\t\tfor (const scenarioScreen of scenarioScreenshots) {\n\t\t\tconst existingGlobalIndex = _.findIndex(result, {\n\t\t\t\tsubject: scenarioScreen.subject,\n\t\t\t});\n\n\t\t\tif (existingGlobalIndex === -1) {\n\t\t\t\t// If there isn't an existing global version, just add the scenario\n\t\t\t\t// screenshot to the list\n\t\t\t\tresult.push(scenarioScreen);\n\t\t\t} else {\n\t\t\t\t// Otherwise we should use the scenario version instead of the global version\n\t\t\t\tresult[existingGlobalIndex] = scenarioScreen;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Try to return it in the same order every time\n\tconst ordered = _.orderBy(result, [\"scenario\", \"subject\"], [\"desc\", \"asc\"]);\n\treturn new DeckVersionScreenshotCollection(ordered);\n};\n\n/**\n * Standard function for retrieving the visibility and sequence of a model\n * from a choicelist or section & slide selections. If a choicelist is\n * provided we prefer the choicelist, otherwise we use selections.\n * Adjuncts are included in choicelists but not in selections so we use the\n * model's state to determine sequence & vis when selections are used.\n */\nBasePresentationModel.getVisibilityAndSequence = function (\n\tmodel,\n\toptions = {},\n) {\n\tconst { choicelist = null, selections = null } = options;\n\tconst url = model.url();\n\n\tconst config = {\n\t\tvisible: model.visible || model.enabled || false,\n\t\tsequence: model.sequence,\n\t\tselectionID: null,\n\t};\n\n\tif (choicelist) {\n\t\t// All items should have a choicelist entry - if it's not in\n\t\t// the choicelist, it's not in the preso\n\t\tconst choice = choicelist.find((item) => item.url === url);\n\n\t\tif (choice) {\n\t\t\tconfig.sequence = choicelist.indexOf(choice);\n\t\t\tconfig.visible = choice.visible;\n\t\t} else {\n\t\t\tconfig.visible = false;\n\t\t}\n\t} else if (selections && !model.adjunct) {\n\t\t// Non-adjunct subslides and adjunct sections/slides/subslides\n\t\t// have no selections - they fall through here using their\n\t\t// model's values\n\t\tconst selection = selections.find((selection) => selection.url === url);\n\n\t\tif (selection) {\n\t\t\tconfig.visible = selection.visible;\n\t\t\tconfig.sequence = selection.sequence;\n\t\t\tconfig.selectionID = selection.id;\n\t\t}\n\t}\n\n\t// If neither a choicelist nor selections are available, the\n\t// values on the model will be used.\n\n\treturn config;\n};\n\nconst getAppointmentTags = function (model, tags) {\n\tconst url = model.adjunct?.url() || model.url();\n\tconst tagItem = tags.find((tag) => tag.content_url === url);\n\n\tif (tagItem) {\n\t\treturn tagItem.tags || [];\n\t}\n\n\t// Subslide tags currently aren't included in the\n\t// appointmentTags data.\n\treturn model.tags || [];\n};\n\nconst getDeckTags = function (model, tags) {\n\t// All non-adjunct sections, slides and subslides have namespaced_key\n\tif (model.namespaced_key) {\n\t\treturn tags[model.namespaced_key] || model.tags || [];\n\t} else if (model.adjunct || model.isAutoAdjunct) {\n\t\t// Autoadjunct keys are unique and move around so we search for them\n\t\t// and ignore the rest of the namespaced key\n\t\tconst keys = Object.keys(tags).filter((key) => {\n\t\t\tif (key.includes(\"/\")) {\n\t\t\t\tconst splitKey = key.split(\"/\");\n\n\t\t\t\treturn splitKey[splitKey.length - 1] === model.key;\n\t\t\t}\n\t\t\treturn key === model.key;\n\t\t});\n\t\treturn keys.length ? tags[keys[0]] : [];\n\t} else if (model.deck) {\n\t\t// The deck's namespaced key is always \"\" - this is because the\n\t\t// namespaced key format is section-key/slide-key, but the\n\t\t// deck sits above sections.\n\t\treturn tags[\"\"] || model.tags || [];\n\t}\n\n\treturn model.tags || [];\n};\n\n// Retrieve the tags for the model.\n// If appointmentTags is passed through in the options, we call the\n// getAppointmentTags function above to retrieve the appointment tags\n// for the model.\n// if there are no appointmentTags but deckTags are passed\n// through then we call the getDeckTags function.\n// In the future we will always use one of these two methods and\n// references to model.tags should be removed.\nBasePresentationModel.getTags = function (model, options = {}) {\n\tif (options.appointmentTags) {\n\t\treturn getAppointmentTags(model, options.appointmentTags);\n\t}\n\n\tif (options.deckTags) {\n\t\treturn getDeckTags(model, options.deckTags);\n\t}\n\n\treturn model.tags || [];\n};\n\nBasePresentationModel.canBeEmpty = true;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAuB,SAAAK,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,CAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAQ,MAAA,IAAAN,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAO,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAT,CAAA,CAAAQ,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EA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,WAAW,CAAClD,KAAK,EAAE4B,OAAO,CAACgC,QAAQ,CAAC;EAC5C;EAEA,OAAO5D,KAAK,CAAC6C,IAAI,IAAI,EAAE;AACxB,CAAC;AAEDvD,qBAAqB,CAACuE,UAAU,GAAG,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"base-presentation-model.js","names":["_base","require","_deckVersionScreenshots","_scenario2","_lodash","_interopRequireDefault","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","from","test","ownKeys","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","BasePresentationModel","exports","BaseModel","extend","url","screenshotsToMap","screenshots","models","reduce","result","model","subject","Error","image_256","getThumbnail","filterScreenshotsByScenario","_screenshots","_scenario","undefined","DeckVersionScreenshotCollection","scenario","ScenarioModel","id","globalScreenshots","screen","map","toJSON","scenarioScreenshots","_iterator","_step","scenarioScreen","existingGlobalIndex","_","findIndex","err","ordered","orderBy","getVisibilityAndSequence","options","_options$choicelist","choicelist","_options$selections","selections","config","visible","enabled","sequence","selectionID","choice","choicelistMap","get","find","item","_idx","indexOf","adjunct","selection","selectionsMap","getAppointmentTags","tags","_model$adjunct","tagItem","appointmentTagsMap","tag","content_url","getDeckTags","namespaced_key","isAutoAdjunct","key","includes","splitKey","split","deck","getTags","appointmentTags","deckTags","canBeEmpty"],"sources":["../../src/presentation/base-presentation-model.js"],"sourcesContent":["import { BaseModel } from \"../models/base.js\";\nimport { DeckVersionScreenshotCollection } from \"../collections/deck-version-screenshots.js\";\nimport { ScenarioModel } from \"../models/scenario.js\";\nimport _ from \"lodash\";\n\n/**\n * @constructor\n * @alias presentation.BasePresentationModel\n * @extends presentation.BaseModel\n */\nexport const BasePresentationModel = BaseModel.extend(\n\t/** @lends presentation.BasePresentationModel# */ {\n\t\turl() {\n\t\t\treturn null;\n\t\t},\n\t},\n);\n\nBasePresentationModel.screenshotsToMap = function (screenshots) {\n\tif (!screenshots?.models) {\n\t\treturn screenshots;\n\t}\n\n\treturn screenshots.reduce((result, model) => {\n\t\tif (result[model.subject]) {\n\t\t\tthrow new Error(`\n\t\t\t\tFound multiple screenshots that could match this subject. If there is a scenario\n\t\t\t\tand a global, be sure to remove the screenshot that you don't need.\n\t\t\t`);\n\t\t}\n\t\tresult[model.subject] = model.image_256;\n\t\treturn result;\n\t}, {});\n};\n\n/**\n * Logic to pick a thumbnail based on either the model itself or from\n * and overriding screenshot if one exists.\n */\nBasePresentationModel.getThumbnail = function (model, screenshots) {\n\tif (screenshots?.models) {\n\t\tthrow new Error(\"Expected map file\");\n\t}\n\n\tif (!model) {\n\t\treturn null;\n\t}\n\n\treturn screenshots[model.url()] || model.image_256;\n};\n\n/**\n * Takes a list of screenshots and filters it to only be a list used by a single scenario\n * (or company wide).\n *\n * The logic should be like this:\n *\n *\t* If the scenario is null, we just return all global screenshots (scenario = null)\n *\t* If we select a scenario, we take those global screenshots and replace any that have a\n *\t\tscenario specific version of that screenshot. If none is found, the\n *\t\tscenario will want to see the same global version. Obviously only one\n *\t\tscenario's screenshots should be available.\n */\nBasePresentationModel.filterScreenshotsByScenario = function (\n\t_screenshots,\n\t_scenario = null,\n) {\n\tconst screenshots = new DeckVersionScreenshotCollection(_screenshots);\n\tconst scenario = _scenario ? new ScenarioModel({ id: _scenario }) : null;\n\n\tconst globalScreenshots = screenshots\n\t\t.filter((screen) => screen.scenario === null)\n\t\t.map((screen) => screen.toJSON());\n\n\tconst result = globalScreenshots;\n\n\tif (scenario) {\n\t\tconst scenarioScreenshots = screenshots\n\t\t\t.filter(\n\t\t\t\t(screen) => screen.scenario && screen.scenario.url() === scenario.url(),\n\t\t\t)\n\t\t\t.map((screen) => ({\n\t\t\t\t...screen.toJSON(),\n\t\t\t\tscenario: screen.scenario.url(),\n\t\t\t}));\n\n\t\tfor (const scenarioScreen of scenarioScreenshots) {\n\t\t\tconst existingGlobalIndex = _.findIndex(result, {\n\t\t\t\tsubject: scenarioScreen.subject,\n\t\t\t});\n\n\t\t\tif (existingGlobalIndex === -1) {\n\t\t\t\t// If there isn't an existing global version, just add the scenario\n\t\t\t\t// screenshot to the list\n\t\t\t\tresult.push(scenarioScreen);\n\t\t\t} else {\n\t\t\t\t// Otherwise we should use the scenario version instead of the global version\n\t\t\t\tresult[existingGlobalIndex] = scenarioScreen;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Try to return it in the same order every time\n\tconst ordered = _.orderBy(result, [\"scenario\", \"subject\"], [\"desc\", \"asc\"]);\n\treturn new DeckVersionScreenshotCollection(ordered);\n};\n\n/**\n * Standard function for retrieving the visibility and sequence of a model\n * from a choicelist or section & slide selections. If a choicelist is\n * provided we prefer the choicelist, otherwise we use selections.\n * Adjuncts are included in choicelists but not in selections so we use the\n * model's state to determine sequence & vis when selections are used.\n */\nBasePresentationModel.getVisibilityAndSequence = function (\n\tmodel,\n\toptions = {},\n) {\n\tconst { choicelist = null, selections = null } = options;\n\tconst url = model.url();\n\n\tconst config = {\n\t\tvisible: model.visible || model.enabled || false,\n\t\tsequence: model.sequence,\n\t\tselectionID: null,\n\t};\n\n\tif (choicelist) {\n\t\t// All items should have a choicelist entry - if it's not in\n\t\t// the choicelist, it's not in the preso\n\t\tconst choice = options.choicelistMap\n\t\t\t? options.choicelistMap.get(url)\n\t\t\t: choicelist.find((item) => item.url === url);\n\n\t\tif (choice) {\n\t\t\tconfig.sequence = options.choicelistMap\n\t\t\t\t? choice._idx\n\t\t\t\t: choicelist.indexOf(choice);\n\t\t\tconfig.visible = choice.visible;\n\t\t} else {\n\t\t\tconfig.visible = false;\n\t\t}\n\t} else if (selections && !model.adjunct) {\n\t\t// Non-adjunct subslides and adjunct sections/slides/subslides\n\t\t// have no selections - they fall through here using their\n\t\t// model's values\n\t\tconst selection = options.selectionsMap\n\t\t\t? options.selectionsMap.get(url)\n\t\t\t: selections.find((selection) => selection.url === url);\n\n\t\tif (selection) {\n\t\t\tconfig.visible = selection.visible;\n\t\t\tconfig.sequence = selection.sequence;\n\t\t\tconfig.selectionID = selection.id;\n\t\t}\n\t}\n\n\t// If neither a choicelist nor selections are available, the\n\t// values on the model will be used.\n\n\treturn config;\n};\n\nconst getAppointmentTags = function (model, tags, options) {\n\tconst url = model.adjunct?.url() || model.url();\n\tconst tagItem = options?.appointmentTagsMap\n\t\t? options.appointmentTagsMap.get(url)\n\t\t: tags.find((tag) => tag.content_url === url);\n\n\tif (tagItem) {\n\t\treturn tagItem.tags || [];\n\t}\n\n\t// Subslide tags currently aren't included in the\n\t// appointmentTags data.\n\treturn model.tags || [];\n};\n\nconst getDeckTags = function (model, tags) {\n\t// All non-adjunct sections, slides and subslides have namespaced_key\n\tif (model.namespaced_key) {\n\t\treturn tags[model.namespaced_key] || model.tags || [];\n\t} else if (model.adjunct || model.isAutoAdjunct) {\n\t\t// Autoadjunct keys are unique and move around so we search for them\n\t\t// and ignore the rest of the namespaced key\n\t\tconst keys = Object.keys(tags).filter((key) => {\n\t\t\tif (key.includes(\"/\")) {\n\t\t\t\tconst splitKey = key.split(\"/\");\n\n\t\t\t\treturn splitKey[splitKey.length - 1] === model.key;\n\t\t\t}\n\t\t\treturn key === model.key;\n\t\t});\n\t\treturn keys.length ? tags[keys[0]] : [];\n\t} else if (model.deck) {\n\t\t// The deck's namespaced key is always \"\" - this is because the\n\t\t// namespaced key format is section-key/slide-key, but the\n\t\t// deck sits above sections.\n\t\treturn tags[\"\"] || model.tags || [];\n\t}\n\n\treturn model.tags || [];\n};\n\n// Retrieve the tags for the model.\n// If appointmentTags is passed through in the options, we call the\n// getAppointmentTags function above to retrieve the appointment tags\n// for the model.\n// if there are no appointmentTags but deckTags are passed\n// through then we call the getDeckTags function.\n// In the future we will always use one of these two methods and\n// references to model.tags should be removed.\nBasePresentationModel.getTags = function (model, options = {}) {\n\tif (options.appointmentTags) {\n\t\treturn getAppointmentTags(model, options.appointmentTags, options);\n\t}\n\n\tif (options.deckTags) {\n\t\treturn getDeckTags(model, options.deckTags);\n\t}\n\n\treturn model.tags || [];\n};\n\nBasePresentationModel.canBeEmpty = true;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAuB,SAAAK,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,CAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAQ,MAAA,IAAAN,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAO,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAT,CAAA,CAAAQ,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAd,CAAA,CAAAS,EAAA,UAAAR,CAAA,WAAAA,EAAAD,CAAA,UAAAA,CAAA,KAAAe,CAAA,EAAAL,CAAA,gBAAAM,SAAA,iJAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,gBAAAR,CAAA,WAAAA,EAAA,IAAAT,CAAA,GAAAA,CAAA,CAAAkB,IAAA,CAAApB,CAAA,MAAAY,CAAA,WAAAA,EAAA,QAAAZ,CAAA,GAAAE,CAAA,CAAAmB,IAAA,WAAAH,CAAA,GAAAlB,CAAA,CAAAa,IAAA,EAAAb,CAAA,KAAAC,CAAA,WAAAA,EAAAD,CAAA,IAAAmB,CAAA,OAAAF,CAAA,GAAA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C;EAC5C;EAEA,OAAOjE,KAAK,CAACiD,IAAI,IAAI,EAAE;AACxB,CAAC;AAED3D,qBAAqB,CAAC4E,UAAU,GAAG,IAAI","ignoreList":[]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.PresentationDeck = void 0;
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  require("./presentation-sections.js");
11
12
  var collections = _interopRequireWildcard(require("../collections"));
@@ -19,6 +20,9 @@ var _index = require("../index.js");
19
20
  var _log = _interopRequireDefault(require("../log.js"));
20
21
  var _stateRegister = require("../state-register");
21
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
24
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
25
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
26
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
27
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
28
  /**
@@ -124,22 +128,19 @@ var PresentationDeck = exports.PresentationDeck = _basePresentationModel.BasePre
124
128
  * @returns {presentation.PresentationDeck}
125
129
  */
126
130
  PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
127
- var _deckVersionModel$nam;
131
+ var _options$index, _options$autoAdjuncts, _options$adjunctSecti, _options$adjunctSlide, _options$adjunctSubSl, _options$sectionSelec, _options$slideSelecti, _options$rootAssetPat, _options$templates, _options$choicelist, _options$screenshots, _deckVersionModel$nam;
128
132
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
129
- _lodash.default.defaults(options, {
130
- index: 0,
131
- autoAdjuncts: new collections.AutoAdjunctCollection(),
132
- adjunctSections: new collections.AdjunctSectionCollection(),
133
- adjunctSlides: new collections.AdjunctSlideCollection(),
134
- adjunctSubSlides: new collections.AdjunctSubSlideCollection(),
135
- sectionSelections: new collections.SectionSelectionCollection(),
136
- slideSelections: new collections.SlideSelectionCollection(),
137
- screenshots: new collections.DeckVersionScreenshotCollection(),
138
- rootAssetPath: null,
139
- templates: null,
140
- choicelist: null
141
- });
142
- options.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);
133
+ (_options$index = options.index) !== null && _options$index !== void 0 ? _options$index : options.index = 0;
134
+ (_options$autoAdjuncts = options.autoAdjuncts) !== null && _options$autoAdjuncts !== void 0 ? _options$autoAdjuncts : options.autoAdjuncts = new collections.AutoAdjunctCollection();
135
+ (_options$adjunctSecti = options.adjunctSections) !== null && _options$adjunctSecti !== void 0 ? _options$adjunctSecti : options.adjunctSections = new collections.AdjunctSectionCollection();
136
+ (_options$adjunctSlide = options.adjunctSlides) !== null && _options$adjunctSlide !== void 0 ? _options$adjunctSlide : options.adjunctSlides = new collections.AdjunctSlideCollection();
137
+ (_options$adjunctSubSl = options.adjunctSubSlides) !== null && _options$adjunctSubSl !== void 0 ? _options$adjunctSubSl : options.adjunctSubSlides = new collections.AdjunctSubSlideCollection();
138
+ (_options$sectionSelec = options.sectionSelections) !== null && _options$sectionSelec !== void 0 ? _options$sectionSelec : options.sectionSelections = new collections.SectionSelectionCollection();
139
+ (_options$slideSelecti = options.slideSelections) !== null && _options$slideSelecti !== void 0 ? _options$slideSelecti : options.slideSelections = new collections.SlideSelectionCollection();
140
+ (_options$rootAssetPat = options.rootAssetPath) !== null && _options$rootAssetPat !== void 0 ? _options$rootAssetPat : options.rootAssetPath = null;
141
+ (_options$templates = options.templates) !== null && _options$templates !== void 0 ? _options$templates : options.templates = null;
142
+ (_options$choicelist = options.choicelist) !== null && _options$choicelist !== void 0 ? _options$choicelist : options.choicelist = null;
143
+ options.screenshots = PresentationDeck.screenshotsToMap((_options$screenshots = options.screenshots) !== null && _options$screenshots !== void 0 ? _options$screenshots : new collections.DeckVersionScreenshotCollection());
143
144
  var assetRoot = (0, _index.getAssetRoot)(deckVersionModel.index_asset.url());
144
145
  var html;
145
146
  var css;
@@ -197,10 +198,57 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
197
198
  id: selection.id
198
199
  };
199
200
  }));
201
+ options.selectionsMap = new Map(options.selections.map(function (s) {
202
+ return [s.url, s];
203
+ }));
204
+ if (options.appointmentTags) {
205
+ options.appointmentTagsMap = new Map(options.appointmentTags.map(function (t) {
206
+ return [t.content_url, t];
207
+ }));
208
+ }
209
+ if (options.rootAssetPath) {
210
+ options.baseRoot = (0, _index.getAssetRoot)(deckVersionModel.index_asset.url());
211
+ }
212
+ options.adjunctSlidesBySection = new Map();
213
+ var _iterator = _createForOfIteratorHelper(options.adjunctSlides.models),
214
+ _step;
215
+ try {
216
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
217
+ var slide = _step.value;
218
+ if (slide.section) {
219
+ var key = slide.section.id;
220
+ if (!options.adjunctSlidesBySection.has(key)) {
221
+ options.adjunctSlidesBySection.set(key, []);
222
+ }
223
+ options.adjunctSlidesBySection.get(key).push(slide);
224
+ }
225
+ }
226
+ } catch (err) {
227
+ _iterator.e(err);
228
+ } finally {
229
+ _iterator.f();
230
+ }
231
+ options.adjunctSubSlidesBySlide = new Map();
232
+ var _iterator2 = _createForOfIteratorHelper(options.adjunctSubSlides.models),
233
+ _step2;
234
+ try {
235
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
236
+ var subslide = _step2.value;
237
+ var _key = subslide.slide.id;
238
+ if (!options.adjunctSubSlidesBySlide.has(_key)) {
239
+ options.adjunctSubSlidesBySlide.set(_key, []);
240
+ }
241
+ options.adjunctSubSlidesBySlide.get(_key).push(subslide);
242
+ }
200
243
 
201
- // We want all adjuncts to have fake ids that can't possibly overlap with the ids of
202
- // normal sections, slides and subslides, so we make a base ID that is larger than
203
- // all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID
244
+ // We want all adjuncts to have fake ids that can't possibly overlap with the ids of
245
+ // normal sections, slides and subslides, so we make a base ID that is larger than
246
+ // all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID
247
+ } catch (err) {
248
+ _iterator2.e(err);
249
+ } finally {
250
+ _iterator2.f();
251
+ }
204
252
  var maxID = (0, _utils.getMaxID)(deckVersionModel);
205
253
  options.getUniqueAdjunctID = function () {
206
254
  return ++maxID;
@@ -220,12 +268,11 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
220
268
  // the selections or choicelist data.
221
269
 
222
270
  deckVersionModel.section_set.forEach(function (sectionModel) {
271
+ var _options$adjunctSlide2;
223
272
  var section = _presentationSection.PresentationSection.createFromSection(sectionModel, options);
224
273
  section.addSlides(sectionModel.slide_set, options);
225
274
  deck.sections.add(section);
226
- var adjunctSlides = options.adjunctSlides.filter(function (slide) {
227
- return slide.section && slide.section.id === section.id;
228
- });
275
+ var adjunctSlides = (_options$adjunctSlide2 = options.adjunctSlidesBySection.get(section.id)) !== null && _options$adjunctSlide2 !== void 0 ? _options$adjunctSlide2 : [];
229
276
  section.addSlides(adjunctSlides, options);
230
277
  });
231
278
  options.adjunctSections.forEach(function (adjunctSection) {
@@ -278,10 +325,16 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
278
325
  // slides with the sequence > 110 then I know that all slides with a sequence > 110
279
326
  // are valid. I then remove those slides from the slides array and move down to the
280
327
  // next section.
328
+ slides.sort(function (a, b) {
329
+ return b.sequence - a.sequence;
330
+ });
331
+ var slideIdx = 0;
281
332
  deck.sections.models.reverse().forEach(function (section) {
282
- var sectionSlides = slides.filter(function (slide) {
283
- return slide.sequence > section.sequence;
284
- });
333
+ var sectionSlides = [];
334
+ while (slideIdx < slides.length && slides[slideIdx].sequence > section.sequence) {
335
+ sectionSlides.push(slides[slideIdx]);
336
+ slideIdx++;
337
+ }
285
338
  section.slides.add(sectionSlides);
286
339
 
287
340
  // Slides have a "section" on their model that represents the section
@@ -293,8 +346,8 @@ PresentationDeck.createFromDeckVersion = function (deckVersionModel) {
293
346
  section.slides.forEach(function (slide) {
294
347
  slide.section = section.id;
295
348
  });
296
- slides = slides.filter(function (slide) {
297
- return slide.sequence <= section.sequence;
349
+ sectionSlides.forEach(function (slide) {
350
+ slide._values.section = section.id;
298
351
  });
299
352
  });
300
353
 
@@ -419,7 +472,9 @@ PresentationDeck.createFromManifestJSON = function (manifestJSON, project) {
419
472
  cmsvalkey_set: cmsvals
420
473
  });
421
474
  });
422
- var minID = _lodash.default.max(_lodash.default.map(deck.sections.toJSON(), "id"));
475
+ var minID = Math.max.apply(Math, (0, _toConsumableArray2.default)(deck.sections.map(function (s) {
476
+ return s.id;
477
+ })));
423
478
  deck.sections.add(templates.map(function (template, index) {
424
479
  var _project$templates2, _project$templates2$f;
425
480
  var section = _presentationSection.PresentationSection.createFromTemplate(template, index, minID);
@@ -1 +1 @@
1
- {"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","titleEditable","notesEditable","tagsEditable","tags","version","namespacedKey","cmsvalkey_set","isWelcome","isSlide","isSection","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","sections","url","_url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_deckVersionModel$nam","options","undefined","_","defaults","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","screenshots","DeckVersionScreenshotCollection","rootAssetPath","templates","choicelist","screenshotsToMap","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","models","reverse","sectionSlides","Math","floor","template","createFromTemplate","autoSections","auto","Error","createFromAutoAdjunct","deckversionID","setSequentialSequences","createFromManifestJSON","manifestJSON","project","_project$welcome$edit","_project$welcome","parseInt","uniqueId","resolveURL","getAssetPath","welcome","editables","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","slice","createFromManifestImpostor","sectionKeys","_project$templates$fi","_project$templates","_project$templates$fi2","_project$templates$fi3","cmsvals","find","getTemplateAssetPath","minID","max","_project$templates2","_project$templates2$f","projTemplate","s","replace","autoAdjunctID","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport { resolveURL } from \"../utils.js\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttitleEditable: \"boolean\",\n\t\t\tnotesEditable: \"boolean\",\n\t\t\ttagsEditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t\tisWelcome: { type: \"boolean\", default: true },\n\t\t\tisSlide: { type: \"boolean\", default: false },\n\t\t\tisSection: { type: \"boolean\", default: false },\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\t_.defaults(options, {\n\t\tindex: 0,\n\t\tautoAdjuncts: new collections.AutoAdjunctCollection(),\n\t\tadjunctSections: new collections.AdjunctSectionCollection(),\n\t\tadjunctSlides: new collections.AdjunctSlideCollection(),\n\t\tadjunctSubSlides: new collections.AdjunctSubSlideCollection(),\n\t\tsectionSelections: new collections.SectionSelectionCollection(),\n\t\tslideSelections: new collections.SlideSelectionCollection(),\n\t\tscreenshots: new collections.DeckVersionScreenshotCollection(),\n\t\trootAssetPath: null,\n\t\ttemplates: null,\n\t\tchoicelist: null,\n\t});\n\n\toptions.screenshots = PresentationDeck.screenshotsToMap(options.screenshots);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttitleEditable: false,\n\t\tnotesEditable: true,\n\t\ttagsEditable: true,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides = options.adjunctSlides.filter((slide) => {\n\t\t\t\treturn slide.section && slide.section.id === section.id;\n\t\t\t});\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = slides.filter(\n\t\t\t\t(slide) => slide.sequence > section.sequence,\n\t\t\t);\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\n\t\t\tslides = slides.filter((slide) => slide.sequence <= section.sequence);\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromAutoAdjunct(auto, {\n\t\t\t\tindex: deck.sections.length + index,\n\t\t\t\tdeckversionID: deck.id,\n\t\t\t});\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON, project) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: resolveURL(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: resolveURL(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: project?.welcome?.editables ?? [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: resolveURL(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: resolveURL(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(\n\t\t\t\t\tsection,\n\t\t\t\t\tproject,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(\n\t\t\titems[0],\n\t\t\tproject,\n\t\t);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tproject,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\tconst cmsvals =\n\t\t\t\tproject?.templates?.find?.((t) => t.key === key)?.editables ?? [];\n\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: resolveURL(manifestJSON.getTemplateAssetPath(key), \"index.html\"),\n\t\t\t\t},\n\t\t\t\tcmsvalkey_set: cmsvals,\n\t\t\t};\n\t\t});\n\n\t\tconst minID = _.max(_.map(deck.sections.toJSON(), \"id\"));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tindex,\n\t\t\t\t\tminID,\n\t\t\t\t);\n\t\t\t\tconst projTemplate = project?.templates?.find?.(\n\t\t\t\t\t(s) => s.key === section.key.replace(\"template-\", \"\"),\n\t\t\t\t);\n\t\t\t\tif (projTemplate?.editables) {\n\t\t\t\t\tsection.cmsvalkey_set = projTemplate.editables.map((key) => {\n\t\t\t\t\t\treturn `${key}-autoadjunct-${section.autoAdjunctID}`;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn section;\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAA6C,SAAAE,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,wBAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QA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AC0C,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAExDR,IAAI,CAAClC,QAAQ,CAACyD,GAAG,CAChB/B,SAAS,CAACkB,GAAG,CAAC,UAACgC,QAAQ,EAAEtG,KAAK,EAAK;MAAA,IAAAgJ,mBAAA,EAAAC,qBAAA;MAClC,IAAMxE,OAAO,GAAGjD,wCAAmB,CAAC+E,kBAAkB,CACrDD,QAAQ,EACRtG,KAAK,EACL8I,KACD,CAAC;MACD,IAAMI,YAAY,GAAGlC,OAAO,aAAPA,OAAO,wBAAAgC,mBAAA,GAAPhC,OAAO,CAAE5D,SAAS,cAAA4F,mBAAA,wBAAAC,qBAAA,GAAlBD,mBAAA,CAAoBJ,IAAI,cAAAK,qBAAA,uBAAxBA,qBAAA,CAAA5K,IAAA,CAAA2K,mBAAA,EACpB,UAACG,CAAC;QAAA,OAAKA,CAAC,CAAC/I,GAAG,KAAKqE,OAAO,CAACrE,GAAG,CAACgJ,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;MAAA,CACtD,CAAC;MACD,IAAIF,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAE1B,SAAS,EAAE;QAC5B/C,OAAO,CAAC1D,aAAa,GAAGmI,YAAY,CAAC1B,SAAS,CAAClD,GAAG,CAAC,UAAClE,GAAG,EAAK;UAC3D,UAAAsD,MAAA,CAAUtD,GAAG,mBAAAsD,MAAA,CAAgBe,OAAO,CAAC4E,aAAa;QACnD,CAAC,CAAC;MACH;MACA,OAAO5E,OAAO;IACf,CAAC,CACF,CAAC;EACF;EAEA,OAAOb,IAAI;AACZ,CAAC;AAED,IAAA0F,uBAAQ,EAAC,kBAAkB,EAAE/J,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"presentation-deck.js","names":["require","collections","_interopRequireWildcard","_utils","_basePresentationModel","_models","_presentationSection","_presentationSlide","_lodash","_interopRequireDefault","_index","_log","_stateRegister","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","TypeError","a","u","next","return","_arrayLikeToArray","toString","slice","constructor","name","from","test","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","PresentationDeck","exports","BasePresentationModel","extend","props","html","css","id","deckID","index","thumbnail","visible","type","key","common","title","usesImpostorSections","editable","titleEditable","notesEditable","tagsEditable","tags","version","namespacedKey","cmsvalkey_set","isWelcome","isSlide","isSection","children","realSection","derived","welcomeSlide","fn","PresentationSection","getAttributes","sections","url","_url","DeckVersionModel","createFromDeckVersion","deckVersionModel","_options$index","_options$autoAdjuncts","_options$adjunctSecti","_options$adjunctSlide","_options$adjunctSubSl","_options$sectionSelec","_options$slideSelecti","_options$rootAssetPat","_options$templates","_options$choicelist","_options$screenshots","_deckVersionModel$nam","options","undefined","autoAdjuncts","AutoAdjunctCollection","adjunctSections","AdjunctSectionCollection","adjunctSlides","AdjunctSlideCollection","adjunctSubSlides","AdjunctSubSlideCollection","sectionSelections","SectionSelectionCollection","slideSelections","SlideSelectionCollection","rootAssetPath","templates","choicelist","screenshots","screenshotsToMap","DeckVersionScreenshotCollection","assetRoot","getAssetRoot","index_asset","concat","getTags","deck","getThumbnail","manifest_json","indexOf","isImpostorDeck","namespaced_key","log","warn","toJSON","selections","map","selection","sequence","section","slide","selectionsMap","Map","appointmentTags","appointmentTagsMap","content_url","baseRoot","adjunctSlidesBySection","_iterator","models","_step","err","adjunctSubSlidesBySlide","_iterator2","_step2","subslide","maxID","getMaxID","getUniqueAdjunctID","section_set","sectionModel","_options$adjunctSlide2","createFromSection","addSlides","slide_set","add","adjunctSection","createFromAdjunctSection","first","adjunctSlideLimit","adjunctslide_limit","slides","slideModel","isImpostor","createFromImpostorSection","PresentationSlide","createFromSlide","adjunctSlideModel","createFromAdjunctSlide","sort","b","slideIdx","reverse","sectionSlides","_values","Math","floor","template","createFromTemplate","autoSections","auto","Error","createFromAutoAdjunct","deckversionID","setSequentialSequences","createFromManifestJSON","manifestJSON","project","_project$welcome$edit","_project$welcome","parseInt","_","uniqueId","resolveURL","getAssetPath","welcome","editables","some","items","titles","ordering","splitKey","split","newKey","sortBy","item","startIndex","endIndex","createFromManifestImpostor","sectionKeys","_project$templates$fi","_project$templates","_project$templates$fi2","_project$templates$fi3","cmsvals","find","getTemplateAssetPath","minID","max","_toConsumableArray2","_project$templates2","_project$templates2$f","projTemplate","replace","autoAdjunctID","register"],"sources":["../../src/presentation/presentation-deck.js"],"sourcesContent":["import \"./presentation-sections.js\";\n\nimport * as collections from \"../collections\";\n\nimport {\n\tgetMaxID,\n\tisImpostor,\n\tisImpostorDeck,\n\tsetSequentialSequences,\n} from \"../utils.js\";\n\nimport { BasePresentationModel } from \"./base-presentation-model\";\nimport { DeckVersionModel } from \"../models\";\nimport { PresentationSection } from \"./presentation-section\";\nimport { PresentationSlide } from \"./presentation-slide\";\nimport _ from \"lodash\";\nimport { getAssetRoot } from \"../index.js\";\nimport log from \"../log.js\";\nimport { register } from \"../state-register\";\nimport { resolveURL } from \"../utils.js\";\n\n/**\n * @constructor\n * @alias presentation.PresentationDeck\n * @extends presentation.BasePresentationModel\n */\nexport const PresentationDeck = BasePresentationModel.extend(\n\t/** @lends presentation.PresentationDeck# */ {\n\t\t/**\n\t\t * @property {string} html\n\t\t * @property {string} css\n\t\t * @property {number} id\n\t\t * @property {number} deckID\n\t\t * @property {number} index\n\t\t * @property {string} thumbnail\n\t\t * @property {boolean} visible\n\t\t * @property {string} key\n\t\t * @property {object} common\n\t\t * @property {string} title\n\t\t * @property {boolean} usesImpostorSections\n\t\t * @property {boolean} editable\n\t\t * @property {array} tags\n\t\t * @property {number} version\n\t\t * @property {string} namespacedKey\n\t\t * @property {string[]} cmsvalkey_set\n\t\t */\n\t\tprops: {\n\t\t\thtml: \"string\",\n\t\t\tcss: \"string\",\n\t\t\tid: \"number\",\n\t\t\tdeckID: \"number\",\n\t\t\tindex: \"number\",\n\t\t\tthumbnail: \"string\",\n\t\t\tvisible: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tvisible: true,\n\t\t\t},\n\t\t\tkey: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\ttitle: \"string\",\n\t\t\tusesImpostorSections: \"boolean\",\n\t\t\teditable: \"boolean\",\n\t\t\ttitleEditable: \"boolean\",\n\t\t\tnotesEditable: \"boolean\",\n\t\t\ttagsEditable: \"boolean\",\n\t\t\ttags: \"array\",\n\t\t\tversion: \"number\",\n\t\t\tnamespacedKey: \"string\",\n\t\t\tcmsvalkey_set: \"array\",\n\t\t\tisWelcome: { type: \"boolean\", default: true },\n\t\t\tisSlide: { type: \"boolean\", default: false },\n\t\t\tisSection: { type: \"boolean\", default: false },\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSection} realSection\n\t\t */\n\t\tchildren: {\n\t\t\trealSection: \"PresentationSection\",\n\t\t},\n\n\t\tderived: {\n\t\t\twelcomeSlide: {\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn new PresentationSection({\n\t\t\t\t\t\t...this.getAttributes({ props: true }),\n\t\t\t\t\t\tisWelcome: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * @property {presentation.PresentationSectionCollection} sections\n\t\t */\n\t\tcollections: {\n\t\t\tsections: \"PresentationSectionCollection\",\n\t\t},\n\n\t\turl() {\n\t\t\tif (!this._url) {\n\t\t\t\tthis._url = new DeckVersionModel({ id: this.id }).url();\n\t\t\t}\n\n\t\t\treturn this._url;\n\t\t},\n\t},\n);\n\n/**\n * @function createFromURL\n * @memberof presentation.PresentationDeck\n * @param {models.DeckVersionModel} deckVersionModel\n * @param {object} [options]\n * @param {number} [options.index = 0]\n * @param {collections.AdjunctSectionCollection}} [adjunctSections]\n * @returns {presentation.PresentationDeck}\n */\nPresentationDeck.createFromDeckVersion = function (\n\tdeckVersionModel,\n\toptions = {},\n) {\n\toptions.index ??= 0;\n\toptions.autoAdjuncts ??= new collections.AutoAdjunctCollection();\n\toptions.adjunctSections ??= new collections.AdjunctSectionCollection();\n\toptions.adjunctSlides ??= new collections.AdjunctSlideCollection();\n\toptions.adjunctSubSlides ??= new collections.AdjunctSubSlideCollection();\n\toptions.sectionSelections ??= new collections.SectionSelectionCollection();\n\toptions.slideSelections ??= new collections.SlideSelectionCollection();\n\toptions.rootAssetPath ??= null;\n\toptions.templates ??= null;\n\toptions.choicelist ??= null;\n\toptions.screenshots = PresentationDeck.screenshotsToMap(\n\t\toptions.screenshots ?? new collections.DeckVersionScreenshotCollection(),\n\t);\n\n\tconst assetRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\tlet html;\n\tlet css;\n\n\tif (options.rootAssetPath) {\n\t\thtml = `${options.rootAssetPath}index.html`;\n\t\tcss = `${options.rootAssetPath}slide.css`;\n\t} else {\n\t\thtml = `${assetRoot}index.html`;\n\t\tcss = `${assetRoot}slide.css`;\n\t}\n\n\tconst tags = PresentationDeck.getTags(deckVersionModel, options);\n\n\tconst deck = new PresentationDeck({\n\t\thtml,\n\t\tcss,\n\t\tid: deckVersionModel.id,\n\t\tindex: options.index,\n\t\tthumbnail: PresentationDeck.getThumbnail(\n\t\t\tdeckVersionModel,\n\t\t\toptions.screenshots,\n\t\t),\n\t\tdeckID: deckVersionModel.deck.id,\n\t\tvisible: true,\n\t\tkey: deckVersionModel.deck.key,\n\t\tcommon: deckVersionModel.manifest_json.common,\n\t\ttitle: deckVersionModel.deck.title,\n\t\teditable: tags.indexOf(\"editable\") > -1,\n\t\ttitleEditable: false,\n\t\tnotesEditable: true,\n\t\ttagsEditable: true,\n\t\ttags,\n\t\tversion: deckVersionModel.version,\n\t\tusesImpostorSections: isImpostorDeck(deckVersionModel),\n\t\tcmsvalkey_set: deckVersionModel.cmsvalkey_set || [],\n\n\t\t// Prefer getting the value from the server, but if, for example, it's an old\n\t\t// cached version that doesn't have a namespaced key, we can make a very good\n\t\t// guess at a default!\n\t\tnamespacedKey: deckVersionModel.namespaced_key ?? \"\",\n\t});\n\n\tif (!deck.key) {\n\t\tlog.warn(\n\t\t\t\"Deck key not available to presentation\",\n\t\t\tdeckVersionModel.deck.toJSON(),\n\t\t);\n\t}\n\n\t// Convert the selections to an easier format to use later\n\tconst sectionSelections = options.sectionSelections;\n\tconst slideSelections = options.slideSelections;\n\n\toptions.selections = sectionSelections\n\t\t.map((selection) => {\n\t\t\treturn {\n\t\t\t\tsequence: selection.sequence,\n\t\t\t\tvisible: selection.visible,\n\t\t\t\turl: selection.section.url(),\n\t\t\t\tid: selection.id,\n\t\t\t};\n\t\t})\n\t\t.concat(\n\t\t\tslideSelections.map((selection) => {\n\t\t\t\treturn {\n\t\t\t\t\tsequence: selection.sequence,\n\t\t\t\t\tvisible: selection.visible,\n\t\t\t\t\turl: selection.slide.url(),\n\t\t\t\t\tid: selection.id,\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\toptions.selectionsMap = new Map(options.selections.map((s) => [s.url, s]));\n\n\tif (options.appointmentTags) {\n\t\toptions.appointmentTagsMap = new Map(\n\t\t\toptions.appointmentTags.map((t) => [t.content_url, t]),\n\t\t);\n\t}\n\n\tif (options.rootAssetPath) {\n\t\toptions.baseRoot = getAssetRoot(deckVersionModel.index_asset.url());\n\t}\n\n\toptions.adjunctSlidesBySection = new Map();\n\tfor (const slide of options.adjunctSlides.models) {\n\t\tif (slide.section) {\n\t\t\tconst key = slide.section.id;\n\t\t\tif (!options.adjunctSlidesBySection.has(key)) {\n\t\t\t\toptions.adjunctSlidesBySection.set(key, []);\n\t\t\t}\n\t\t\toptions.adjunctSlidesBySection.get(key).push(slide);\n\t\t}\n\t}\n\n\toptions.adjunctSubSlidesBySlide = new Map();\n\tfor (const subslide of options.adjunctSubSlides.models) {\n\t\tconst key = subslide.slide.id;\n\t\tif (!options.adjunctSubSlidesBySlide.has(key)) {\n\t\t\toptions.adjunctSubSlidesBySlide.set(key, []);\n\t\t}\n\t\toptions.adjunctSubSlidesBySlide.get(key).push(subslide);\n\t}\n\n\t// We want all adjuncts to have fake ids that can't possibly overlap with the ids of\n\t// normal sections, slides and subslides, so we make a base ID that is larger than\n\t// all existing IDs then use the getUniqueAdjunctID function to retrieve an incremented ID\n\tlet maxID = getMaxID(deckVersionModel);\n\n\toptions.getUniqueAdjunctID = function () {\n\t\treturn ++maxID;\n\t};\n\n\t// We have four different ways to create a presentation structure here - we are\n\t// using either selections or a choicelist, and the deck is either a normal\n\t// deck or an impostor deck. Setting up a non-impostor deck is easier, so I've\n\t// split this up into two primary methods to cover those two branches, and the models\n\t// internally retrieve the correct sequence & visibility data depending on whether\n\t// we're using selections or a choicelist.\n\n\tif (!deck.usesImpostorSections) {\n\t\t// Non impostor deck using selections or a choicelist. Slides are already\n\t\t// associated with the correct sections, so all we have to do is turn\n\t\t// everything into a presentation model and pass the options through with\n\t\t// the selections or choicelist data.\n\n\t\tdeckVersionModel.section_set.forEach((sectionModel) => {\n\t\t\tconst section = PresentationSection.createFromSection(\n\t\t\t\tsectionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tsection.addSlides(sectionModel.slide_set, options);\n\n\t\t\tdeck.sections.add(section);\n\n\t\t\tconst adjunctSlides =\n\t\t\t\toptions.adjunctSlidesBySection.get(section.id) ?? [];\n\n\t\t\tsection.addSlides(adjunctSlides, options);\n\t\t});\n\n\t\toptions.adjunctSections.forEach((adjunctSection) => {\n\t\t\tconst section = PresentationSection.createFromAdjunctSection(\n\t\t\t\tadjunctSection,\n\t\t\t\tDeckVersionModel,\n\t\t\t\toptions,\n\t\t\t);\n\n\t\t\tdeck.sections.add(section);\n\t\t});\n\t} else {\n\t\t// Impostor deck using selections or a choicelist. The deckversion.section_set\n\t\t// only contains one section, which is the \"real\" section but is not used in\n\t\t// the presentation. Some slides have the tag \"section-header\", and these slides\n\t\t// will be turned into sections and may be given sets of slides.\n\n\t\tconst realSection = deckVersionModel.section_set.first();\n\n\t\tdeck.realSection = new PresentationSection({\n\t\t\tid: realSection.id,\n\t\t\tkey: realSection.key,\n\t\t\tadjunctSlideLimit: realSection.adjunctslide_limit,\n\t\t});\n\n\t\tlet slides = [];\n\n\t\t// First we go through all slides and separate the impostor sections from the\n\t\t// normal slides. If a slide is a \"section header\" then we turn it into a presentation\n\t\t// section; if it is just a slide then we add it to the slides array, which will contain\n\t\t// all slides. We can't allocate slides to sections yet because we don't know\n\t\t// which section a slide belongs to.\n\t\trealSection.slide_set.forEach((slideModel) => {\n\t\t\tconst isSection = isImpostor(slideModel);\n\n\t\t\tif (isSection) {\n\t\t\t\tconst section = PresentationSection.createFromImpostorSection(\n\t\t\t\t\tslideModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(section);\n\t\t\t} else {\n\t\t\t\tconst slide = PresentationSlide.createFromSlide(slideModel, options);\n\t\t\t\tslides.push(slide);\n\t\t\t}\n\t\t});\n\n\t\t// We filter the adjunct slides and add all the non-section slides to the slides array too.\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => !isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst slide = PresentationSlide.createFromAdjunctSlide(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tnull,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tslides.push(slide);\n\t\t\t});\n\n\t\t// Next we go through the sections backwards and use the sequence to find all slides\n\t\t// which belong to a section. Doing this backwards means that we only need to know\n\t\t// one section's sequence at a time, e.g. if I went forwards and the first section\n\t\t// had the sequence 1, I know that I can start looking for slides with sequence > 1\n\t\t// but I don't know where to stop. If I start with the last section and look for\n\t\t// slides with the sequence > 110 then I know that all slides with a sequence > 110\n\t\t// are valid. I then remove those slides from the slides array and move down to the\n\t\t// next section.\n\t\tslides.sort((a, b) => b.sequence - a.sequence);\n\n\t\tlet slideIdx = 0;\n\t\tdeck.sections.models.reverse().forEach((section) => {\n\t\t\tconst sectionSlides = [];\n\t\t\twhile (\n\t\t\t\tslideIdx < slides.length &&\n\t\t\t\tslides[slideIdx].sequence > section.sequence\n\t\t\t) {\n\t\t\t\tsectionSlides.push(slides[slideIdx]);\n\t\t\t\tslideIdx++;\n\t\t\t}\n\n\t\t\tsection.slides.add(sectionSlides);\n\n\t\t\t// Slides have a \"section\" on their model that represents the section\n\t\t\t// that they belong to. Because this is an impostor deck, there's a\n\t\t\t// good chance that the section is now incorrect for normal slides,\n\t\t\t// and a 100% chance that it's incorrect for adjunct slides as we\n\t\t\t// didn't populate the section field when we created the adjunct slides.\n\t\t\t// We update those now with the correct section.\n\t\t\tsection.slides.forEach((slide) => {\n\t\t\t\tslide.section = section.id;\n\t\t\t});\n\t\t\tsectionSlides.forEach((slide) => {\n\t\t\t\tslide._values.section = section.id;\n\t\t\t});\n\t\t});\n\n\t\t// Average the adjunct slide limit used across the entire deck over each section\n\t\t// in the deck. We do this before we add the adjunct impostor sections, 'cause you\n\t\t// can't add custom slides to those.\n\t\tdeck.sections.forEach((section) => {\n\t\t\tsection.adjunctSlideLimit = section.adjunctSlideLimit\n\t\t\t\t? section.adjunctSlideLimit\n\t\t\t\t: Math.floor(realSection.adjunctSlideLimit / deck.sections.length);\n\t\t});\n\n\t\t// Return the sections to the correct order\n\t\tdeck.sections.models.reverse();\n\n\t\t// Finally, we add the adjunct impostor sections. These are adjunct slides with\n\t\t// the \"section-header\" tag and they work the same way as the slide impostors,\n\t\t// but because adjunct sections can't have slides we're adding them after the\n\t\t// slide-assigning process\n\t\toptions.adjunctSlides\n\t\t\t.filter((slide) => isImpostor(slide))\n\t\t\t.forEach((adjunctSlideModel) => {\n\t\t\t\tconst adjunctSection = PresentationSection.createFromAdjunctSection(\n\t\t\t\t\tadjunctSlideModel,\n\t\t\t\t\tDeckVersionModel,\n\t\t\t\t\toptions,\n\t\t\t\t);\n\n\t\t\t\tdeck.sections.add(adjunctSection);\n\t\t\t});\n\t}\n\n\t// Add templates as sections if present. This is only used by the CDK.\n\tif (options.templates && options.templates.length > 0) {\n\t\tdeck.sections.add(\n\t\t\toptions.templates.map((template, index) => {\n\t\t\t\treturn PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tdeck.sections.length + index,\n\t\t\t\t\toptions.getUniqueAdjunctID(),\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// This is generally only used by screenshots\n\tif (options.autoAdjuncts) {\n\t\tconst autoSections = options.autoAdjuncts.map((auto, index) => {\n\t\t\t// We already have the template on the deckversion, so we can find it here.\n\t\t\tif (!auto.template) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Attempted to use an autoadjunct that has no template.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst section = PresentationSection.createFromAutoAdjunct(auto, {\n\t\t\t\tindex: deck.sections.length + index,\n\t\t\t\tdeckversionID: deck.id,\n\t\t\t});\n\n\t\t\treturn section;\n\t\t});\n\n\t\tdeck.sections.add(autoSections);\n\t}\n\n\tsetSequentialSequences(deck);\n\n\treturn deck;\n};\n\nPresentationDeck.createFromManifestJSON = function (manifestJSON, project) {\n\tconst deck = new PresentationDeck({\n\t\tid: parseInt(_.uniqueId(), 10),\n\t\tindex: 0,\n\t\tvisible: true,\n\t\tkey: manifestJSON.key || \"manifest_deck\",\n\t\thtml: resolveURL(manifestJSON.getAssetPath(), \"index.html\"),\n\t\tcss: resolveURL(manifestJSON.getAssetPath(), \"slide.css\"),\n\t\tcommon: manifestJSON.common,\n\t\tthumbnail: null,\n\t\tdeckID: 1,\n\t\ttitle: \"Local\",\n\t\tversion: 1,\n\t\ttags: manifestJSON.tags[\"\"] || [],\n\t\tcmsvalkey_set: project?.welcome?.editables ?? [],\n\t});\n\n\tconst usesImpostorSections = _.some(\n\t\tmanifestJSON.tags,\n\t\t(tags) => tags.indexOf(\"section-header\") !== -1,\n\t);\n\tdeck.usesImpostorSections = usesImpostorSections;\n\n\tif (usesImpostorSections) {\n\t\tdeck.usesImpostorSections = true;\n\n\t\tlet items = Object.keys(manifestJSON.titles).map((key) => {\n\t\t\tconst sequence = manifestJSON.toJSON().ordering[key];\n\t\t\tconst splitKey = key.split(\"/\");\n\t\t\tconst newKey = splitKey[splitKey.length - 1];\n\n\t\t\treturn {\n\t\t\t\tkey: newKey,\n\t\t\t\tsequence,\n\t\t\t\thtml: resolveURL(manifestJSON.getAssetPath(key), \"index.html\"),\n\t\t\t\tcss: resolveURL(manifestJSON.getAssetPath(key), \"slide.css\"),\n\t\t\t\ttitle: manifestJSON.titles[key],\n\t\t\t\ttags: manifestJSON.tags[key] || [],\n\t\t\t\tcmsvalkey_set: [],\n\t\t\t};\n\t\t});\n\n\t\titems = _.sortBy(items, \"sequence\");\n\n\t\tconst sections = items.filter(\n\t\t\t(item) => item.tags.indexOf(\"section-header\") !== -1,\n\t\t);\n\n\t\tsections.forEach((item, index) => {\n\t\t\tconst startIndex = items.indexOf(item) + 1;\n\t\t\tconst endIndex = sections[index + 1]\n\t\t\t\t? items.indexOf(sections[index + 1])\n\t\t\t\t: items.length;\n\n\t\t\tconst slides = items.slice(startIndex, endIndex);\n\n\t\t\titem.slides = slides;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsections.map((section, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestImpostor(\n\t\t\t\t\tsection,\n\t\t\t\t\tproject,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\n\t\tdeck.realSection = PresentationSection.createFromManifestImpostor(\n\t\t\titems[0],\n\t\t\tproject,\n\t\t);\n\t} else {\n\t\tconst sectionKeys = Object.keys(manifestJSON.titles).filter((title) => {\n\t\t\treturn title.split(\"/\").length === 1;\n\t\t});\n\n\t\tdeck.sections.add(\n\t\t\tsectionKeys.map((key, index) => {\n\t\t\t\treturn PresentationSection.createFromManifestJSON(\n\t\t\t\t\tmanifestJSON,\n\t\t\t\t\tproject,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (manifestJSON.templates) {\n\t\tconst templates = Object.keys(manifestJSON.templates).map((key) => {\n\t\t\tconst cmsvals =\n\t\t\t\tproject?.templates?.find?.((t) => t.key === key)?.editables ?? [];\n\n\t\t\treturn {\n\t\t\t\t...manifestJSON.templates[key],\n\t\t\t\tkey,\n\t\t\t\tsequence: manifestJSON.templates[key].ordering,\n\t\t\t\tindex_asset: {\n\t\t\t\t\turl: resolveURL(manifestJSON.getTemplateAssetPath(key), \"index.html\"),\n\t\t\t\t},\n\t\t\t\tcmsvalkey_set: cmsvals,\n\t\t\t};\n\t\t});\n\n\t\tconst minID = Math.max(...deck.sections.map((s) => s.id));\n\n\t\tdeck.sections.add(\n\t\t\ttemplates.map((template, index) => {\n\t\t\t\tconst section = PresentationSection.createFromTemplate(\n\t\t\t\t\ttemplate,\n\t\t\t\t\tindex,\n\t\t\t\t\tminID,\n\t\t\t\t);\n\t\t\t\tconst projTemplate = project?.templates?.find?.(\n\t\t\t\t\t(s) => s.key === section.key.replace(\"template-\", \"\"),\n\t\t\t\t);\n\t\t\t\tif (projTemplate?.editables) {\n\t\t\t\t\tsection.cmsvalkey_set = projTemplate.editables.map((key) => {\n\t\t\t\t\t\treturn `${key}-autoadjunct-${section.autoAdjunctID}`;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn section;\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn deck;\n};\n\nregister(\"PresentationDeck\", PresentationDeck);\n"],"mappings":";;;;;;;;;;AAAAA,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IA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