From a8a45482bed1b0e876a86bc76e81ac3bcdac964c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 12 Nov 2024 10:58:35 +0100 Subject: [PATCH] chore: bundle assets --- views/js/loader/taoMediaManager.min.js.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/js/loader/taoMediaManager.min.js.map b/views/js/loader/taoMediaManager.min.js.map index e5c058f7..4600f322 100644 --- a/views/js/loader/taoMediaManager.min.js.map +++ b/views/js/loader/taoMediaManager.min.js.map @@ -1 +1 @@ -{"version":3,"names":["define","hb","template","Handlebars","depth0","helpers","partials","data","program1","stack1","buffer","escapeExpression","label","apply","compilerInfo","merge","helper","functionType","self","inUsageMessage","call","hash","each","items","inverse","noop","fn","program","confirmationMessage","options","helperMissing","__","name","_","$","binder","uri","section","request","router","loggerFactory","feedback","confirmDialog","alertDialog","urlUtil","relatedItemsPopupTpl","relatedItemsClassPopupTpl","forbiddenClassActionTpl","callConfirmModal","actionContext","message","url","resolve","reject","accept","cancel","callAlertModal","method","dataType","then","response","success","deleted","tree","trigger","id","classUri","msg","logger","register","instanciate","decode","JSON","stringify","parent","cssClass","type","catch","err","isUndefined","error","sharedStimulusAuthoring","updateContentBlock","create","content","visible","show","$panel","attr","dispatch","remove","mediaRelationsData","context","sourceId","classId","signature","Promise","route","noToken","responseRelated","haveItemReferences","relations","text","trim","length","number","errorObject","code","Item","_generateIdentifier","pos","lastIndexOf","substr","creatorDummyItemData","sharedStimulusData","newItem","itemData","Object","assign","bdy","rootElement","body","qtiClass","responseProcessing","attributes","responseRules","serial","class","handleStylesheetLoad","e","path","composedPath","linkTag","stylesheetUrl","href","split","rdf_styles","reverse","assets","h","asset","assetClassName","children","className","match","_formatStyles","sheet","_hideStyles","stylesheetSerial","dataset","passagesItem","passages","passageWrapper","find","passageItemClassName","passagesPreview","passagePreviewClassName","cssRules","CSSStyleSheet","values","map","index","rule","deleteRule","classNameFormated","scopedCssRules","_scopeStyles","newRules","insertRule","scopeSelector","toReplace","replacementSelector","scopedStyles","selectorText","rulesInBrackets","cssText","selectors","scopedSelectors","singleSelectorText","includes","numRepeat","toReplaceSelector","replace","RegExp","containsScopeSelector","startsWith","endsWith","push","join","filter","str","Loader","qtiClasses","formatStyles","qtiNamespace","qtiSchemaLocation","\"http://www.imsglobal.org/xsd/imsqti_v2p2\"","languagesUrl","creatorLoader","loadSharedStimulus","config","callback","languagesList","assetData","assetDataUrl","assetStyles","assetDataStyles","all","loader","forEach","stylesheet","link","stylesheets","media","title","onload","getComposingElements","setClassesLocation","loadItemData","loadedItem","namespaces","getNamespaces","setNamespaces","setSchemaLocations","getLoadedClasses","commonRenderConfig","assetManagerFactory","assetStrategies","assetManager","taomedia","external","base64","baseUrl","locations","defaults","_container","_tooltip","assessmentItem","figure","img","figcaption","math","object","table","Renderer","build","dom","creatorRenderer","get","reset","areaBroker","$bodyEltForm","properties","getOption","contains","lang","shuffleChoices","itemOptionForm","bodyElementOptionForm","getElementPropertyPanelArea","textOptionForm","mediaManager","appendContainer","browseUrl","getFilesUrl","uploadUrl","fileUploadUrl","deleteUrl","fileDeleteUrl","downloadUrl","fileDownloadUrl","fileExistsUrl","root","qtiCreatorContext","getAssetManager","setData","setAreaBroker","getCreatorContext","setOption","value","setOptions","load","done","isFunction","_len","arguments","rest","Array","_key","order","editLabelTxt","deleteTxt","downloadTxt","UrlParser","cssTpl","featuresService","styleSheetManagerVisibilityKey","itemConfig","globalConfig","_getUri","action","_basename","substring","mainClassSelector","hashClassSelector","taoHashClassPrefix","currentItem","hashClass","mainClass","style","customStylesheet","$styleElem","styleElem","empty","append","common","preparingMessageHtml","failMessageHtml","isInValidLocalTxt","erase","dontAppend","mSelector","mProp","css","isEmpty","value1","key1","value2","key2","isPlainObject","selector","property","itemBodyClass","document","querySelector","classList","searchClass","groups","size","verifyInit","Error","save","extend","cssJson","stylesheetUri","deleteStylesheet","download","styleName","groupName","decodeURIComponent","fetch","resp","blob","window","URL","createObjectURL","a","createElement","display","appendChild","click","revokeObjectURL","addStylesheet","loadStylesheet","linkElement","stylesheetObject","isLocal","isValid","serialNumber","isInvalidLocal","tplData","fileName","listEntry","listLinks","insertedInList","before","addClass","cssLinks","inserted","serialCur","setTimeout","isInit","pendingStylesheetsInit","initializing","parser","isString","createStyleSheet","_link","render","_href","_sep","indexOf","Date","getTime","toString","checkCORS","when","ajax","addItemStylesheets","currentStylesheet","removeOrphanedStylesheets","getItem","init","item","_style","keys","key","selectorWithoutMainClass","isVisible","getStyle","getHashClass","getMainClass","setHashClass","setMainClass","generateHashClass","Math","random","generateMainClass","replaceHashClass","replaceMainClass","clearCache","off","styleEditor","Stylesheet","genericFeedbackPopup","$doc","styleSheetToggler","_createInfoBox","$messageBox","closeTrigger","on","fadeOut","cssToggler","uploader","customCssToggler","getContext","li","closest","stylesheetObj","input","labelBox","prev","val","isCustomCss","isDisabled","hasClass","cssUri","resourcemgr","pathParam","params","filters","select","files","styleListNames","styleList","i","styleGroup","cssRes","l","file","deleteFile","hide","downloadStylesheet","saveLabel","html","handleAvailability","disabled","removeClass","toggleClass","myLink","ready","target","parentElement","keyCode","fontStacks","fontSelector","$container","$selector","normalize","font","clean","resetButton","toLabel","$1","toUpperCase","format","state","originalOption","element","select2","applyToStylesEditor","styles","selectedFontFamily","optGroup","normalizeFont","option","fontFamily","formatResult","formatSelection","width","first","rgbToHex","color","toHexPair","inp","parseInt","slice","rgbArr","exec","isArray","additionalStylesToObject","additional","additionalStyles","keyValue","colorSelector","colorPicker","widget","widgetBox","titleElement","resetButtons","colorTriggers","colorTriggerLabels","widgetObj","currentProperty","setTitle","setTriggerColor","$trigger","targetOld","collectCommonAdditionalStyles","farbtastic","linkTo","add","$tmpTrigger","nodeName","toLowerCase","prop","setColor","is","has","$this","$colorTrigger","needToRemove","fontSizeChanger","$fontSizeChanger","itemSelector","figcaptionSelector","$resetBtn","parents","$input","itemFontSize","itemSelectorOld","resizeFont","figcaptionSize","min","preventDefault","blur","c","panel","setUpInteractionPanel","initSidebarAccordion","initFormVisibilityListener","elementClass","$passageEditor","handle","normalizeStrategy","XmlRenderer","Element","_xmlRenderer","_render","xml","interactionsToolbar","tagTitles","inlineInteractions","interactions","icon","description","short","tags","group","toggleInlineInteractionGroup","eventifier","qtiCreatorContextFactory","sharedStimulusLoader","commonRenderer","propertiesPanel","eventHelper","xmlRenderer","xmlNsHandler","interactionPanel","sharedStimulusCreatorFactory","pluginFactories","sharedStimulusCreator","plugins","pluginRun","execStack","plugin","TypeError","pluginFactory","getName","silent","restoreNs","contentType","getItemPanelArea","destroy","isObject","getUsedClasses","setContext","getInteractionPanelArea","elt","getRootElement","$itemContainer","isA","setRenderer","postRender","clone","getContainer","getPropertyPanelArea","initElementToWidgetListeners","getSharedStimulusId","getConfig","componentFactory","pluginLoaderFactory","areaBrokerFactory","componentTpl","sharedStimulusAuthoringFactory","container","defaultPlugins","pluginLoader","api","getAreaBroker","setTemplate","module","exclude","bundle","getElement","menu","menuLeft","menuRight","contentCreatorPanel","editorBar","editorWrapper","toolbar","propertyPanel","itemPanel","itemPropertyPanel","itemStylePanel","modalContainer","elementPropertyPanel","getPlugins","spread","defer","category","serviceController","serviceExtension","manageMediaController","start","assetId","previewEnabled","permissions","loadCssUrl","saveCssUrl","downloadCssUrl","previewerFactory","qtiItemPreviewerFactory","testRunnerConfig","testDefinition","serviceCallId","providers","runner","proxy","communicator","view","readOnly","fullPage","pluginsOptions","hideActionBars","proxyProvider","loadFromBundle","itemState","itemRunner","setState","itemUri","loadItem","previewer","loadingBar","$previewer","mime","isPreviewEnabled","isPassage","stop","containerClass","binding","classuri","_resourceContext","MediaManager","deps","actions","editInstance","authoring","sharedStimulusId","promiseQueue","install","queue","identifier","_ref","cssFile","styleSheets","containerHelper","gridContentHelper","contentHelper","createElements","$dummy","getContent","newElts","$placeholder","$widget","$original","bind","changeInnerWidgetState","_changeInnerWidgetState","outerWidget","innerWidget","changeState","stateFactory","checkIfWidgetShouldSleep","outerContainer","getEditorBarArea","$modalFeedbacksArea","_widget","getContentCreatorPanelArea","Active","beforeStateInit","composingElts","getSerial","stopPropagation","offEvents","ckConfigurator","mathJax","_defaults","qtiImage","qtiMedia","qtiInclude","underline","removePlugins","horizontalRule","furiganaPlugin","editor","toolbarType","CKEditor","features","deletingHelper","featureFlag","languages","_buildEditor","$editable","$editableContainer","$toolbarArea","getToolbarArea","placeholder","removePluginName","languagePluginEnabled","ckConfig","dtdMode","autoParagraph","enterMode","ENTER_P","floatSpaceDockedOffsetY","language_list","sharedSpaces","top","taoQtiItem","insert","tempWidget","$newContent","$newImgPlaceholder","insertAfter","_htmlEncode","getData","createdWidget","createdElement","initContainer","rebuild","_activateInnerWidget","focusManager","instanceReady","widgets","debounce","markupChanged","_detectWidgetDeletion","change","leading","managePlaceholder","_rebuildWidgets","restoreState","shieldInnerContent","_shieldInnerContent","autofocus","_focus","focus","configLoaded","getTooltypeFromContainer","highlight","afterPaste","inline","togglePlaceholder","nonEmptyContent","removePlaceholder","placeholderClass","disableCellAlignment","_find","dataAttribute","$collection","elements","currentState","getCurrentState","widgetInner","_findWidgetContainer","w","undoCmd","getCommand","createInfoBox","resetUndo","undoManager","undo","addShield","$shield","containerWidget","listenToWidgetCreation","event","targetWidget","delay","encodedStr","editable","parentNode","range","createRange","moveToElementEditablePosition","getSelection","selectRanges","passthroughInnerContent","editorFactory","disableAutoInline","hasEditor","buildEditor","editorOptions","getList","useCKEFormatting","languagesData","buildTasks","destroyEditor","destructTasks","removeAttr","removeData","escape","textBlockCssClass","htmlEditor","formElement","formTpl","wrapperCls","TextActive","buildStylesEditor","initForm","destroyStylesEditor","$form","prototype","changeCallback","getChangeCallback","$block","wrapInner","blockCls","test","$textEditor","regex","unwrap","initWidget","setChangeCallbacks","factory","states","createBundle","Widget","toolbarTpl","TextWidget","initCreator","registerStates","buildContainer","$wrap","\"data-serial\"","\"data-qti-class\"","\"data-html-editable\"","createToolbar","$tlb","adderTpl","$editorPanel","_getItemBody","_initInsertion","_wrap","$colRow","wrap","after","_placeholder","prepend","_insertElement","_endInsertion","_done","_appendButton","$adder","$widgetParent","qtiElement","\"data-new\"","getBody","creator","$widgetElem","widgetElem","$colParent","replaceWith","$textBlock","Container","allQtiClasses","simpleParser","mathNs","parse","ns","htmls","markup","markupSelector","extractHtmlFromMarkup","loadRequiredClasses","containerEditors","renderer","setElement","setRootElement","metadata","related","loadContainer","resetRenderer","_ns","getNs","getNsModel","throttle","editorContent","cleanup","createFakeWidget","markupStr","$found","ret","blockAdder","getHost","hider","buttonTpl","SharedStimulusCreator","sharedStimulusConfig","$element","testId","disable","enable","getMenuArea","removeProp","history","back","backHandler","getMenuLeftArea","Figcaption","CreatorFigcaption","ActiveState","inlineHelper","FigureStateActive","alignmentHelper","FigureWidget","DISABLE_FIGURE_WIDGET","featureFlags","FEATURE_FLAG_DISABLE_FIGURE_WIDGET","elem","initAlignment","checkFileExists","src","getRequiredOptions","buildBlockContainer","buildInlineContainer","$img","Figure","CreatorFigure","imageElem","metaData","ImgStateActive","ImgWidget","height","setAttribute","removeAttribute","FigureModel","findParentElement","CreatorImg","siblings","removeElement","figureRenderer","getRenderer","programWithDepth","program2","depth1","equal","program3","ItemStateActive","enterActiveState","\"xml:lang\"","getAttributeChangeCallback","devTools","hasUnsupportedInteraction","$qti","ItemWidget","saveItemUrl","initTextWidgets","initGridEditor","debug","initUiComponents","$saveBtn","invalid","$itemBody","$itemEditorPanel","gridEditor","$eltWidget","eltwWdget","initTextWidget","_detachElements","containerElements","elementSerial","$originalContainer","subContainers","$row","$col","isTextBlock","contents","nodeType","nodeValue","$subElement","$subWidget","$clonedContainer","$originalTextBlock","textBlockId","$subContainer","subContainerElements","serializeElements","subContainerBody","serializedItemBody","itemBody","containerData","shift","setElements","listenStateChange","$code","$pre","liveXmlPreview","CommonRenderer","tpl","wrapTpl","CreatorItem","_normalizeItemBody","$child","mediaEditorComponent","_Mathmin","mediaEditor","$panelObjectSize","$panelMediaSize","_config","renderingThrottle","fileFilters","ObjectStateActive","refreshRendering","obj","previewOptions","resolveUrl","setMediaSizeEditor","_Mathmax","max","_Mathround","round","qtiObject","mediaplayer","originalSize","getMediaOriginalSize","containerWidth","scaleHeight","scaleWidth","scale","onChange","nMedia","newWidth","resize","$node","responsive","mediaDimension","active","showResponsiveToggle","hideShowPanels","_initUpload","$uploadTrigger","$src","_openResourceMgr","mediaSourcesUrl","open","close","alt","isNaN","qtiObjectAlt","align","qtiObjectAlign","positionFloat","ObjectWidget","CreatorObject","ckEditor","tableModelFactory","tableActionsFactory","replaceElementByItsContent","$elem","$tableTagContent","$pseudoContainer","newBody","addClassOnCurrentRow","currentCellPos","getCurrentCellPos","$currentCol","tableModel","getRowCells","y","addClassOnCurrentCol","getColCells","x","clearCellClasses","updateTable","update","getRowCount","rowActions","hideDelete","showDelete","getColCount","colActions","displayTableActions","hideTableActions","$tableContainer","selectedCells","$currentCell","hAlignWith","vAlignWith","currentCell","cellIndex","rowIndex","selection","tabletools","CKEDITOR","getSelectedCells","deleteColRow","insertRowAfter","insertColAfter","hAlignCenter","hAlignRight","TableStateActive","exit","$caption","$first","$curCap","$paragraphsInCaption","$p","classNames","hAlignOptions","selected","hAlign","t","$itemPanel","$tablePropTrigger","openTableProperties","execCommand","insertCol","deleteTitle","insertRow","currentSelection","$toolbars","eq","TableWidget","CreatorTable","program4","program6","program8","program10","defaultData","schemaLocations","xsi","forIn","getSchemaLocations","adaptive","timeDependent","mapValues","d","s","getElementsByTagName","styleSheet","createTextNode"],"sources":["/Users/oat/Projects/terre/tr-enterprise/files/delivery/tao/views/build/config-wrap-start-default.js","../qtiCreator/tpl/relatedItemsPopup!tpl","../qtiCreator/tpl/relatedItemsClassPopup!tpl","../qtiCreator/tpl/forbiddenClassAction!tpl","../../taoMediaManagerCss/media!css","../controller/actions.js","../qtiCreator/helper/createDummyItemData.js","../qtiCreator/helper/formatStyles.js","../qtiCreator/helper/sharedStimulusLoader.js","../qtiCreator/renderers/config.js","../qtiCreator/renderers/Renderer.js","../qtiCreator/helper/creatorRenderer.js","../qtiCreator/tpl/toolbars/cssToggler!tpl","../qtiCreator/editor/styleEditor/styleEditor.js","../qtiCreator/editor/styleEditor/styleSheetToggler.js","../qtiCreator/editor/styleEditor/fontSelector.js","../qtiCreator/editor/styleEditor/colorSelector.js","../qtiCreator/editor/styleEditor/fontSizeChanger.js","../qtiCreator/editor/propertiesPanel.js","../qtiXmlRenderer/renderers/config.js","../qtiXmlRenderer/renderers/Renderer.js","../qtiCreator/helper/xmlRenderer.js","../qtiCreator/editor/interactionsPanel.js","../qtiCreator/sharedStimulusCreator.js","../qtiCreator/component/tpl/sharedStimulusAuthoring!tpl","../qtiCreator/component/sharedStimulusAuthoring.js","../controller/authoring.js","../previewer/component/qtiSharedStimulusItem.js","../controller/editInstance.js","../controller/routes.js","../previewer/adapter/item/qtiSharedStimulusItem.js","../previewer/proxy/qtiSharedStimulusItem.js","../qtiCreator/widgets/helpers/content.js","../qtiCreator/widgets/states/Active.js","../qtiCreator/widgets/static/states/Active.js","../qtiCreator/helper/ckConfigurator.js","../qtiCreator/editor/ckEditor/htmlEditor.js","../qtiCreator/tpl/forms/static/text!tpl","../qtiCreator/widgets/static/text/states/Active.js","../qtiCreator/widgets/static/text/states/states.js","../qtiCreator/widgets/static/text/Widget.js","../qtiCreator/editor/blockAdder/blockAdder.js","../qtiCreator/editor/containerEditor.js","../qtiCreator/plugins/content/blockAdder.js","../qtiCreator/plugins/menu/preview.js","../qtiCreator/plugins/menu/save.js","../qtiCreator/plugins/navigation/back.js","../qtiCreator/renderers/Figcaption.js","../qtiCreator/widgets/static/figure/states/Active.js","../qtiCreator/widgets/static/figure/states/states.js","../qtiCreator/widgets/static/figure/Widget.js","../qtiCreator/renderers/Figure.js","../qtiCreator/widgets/static/img/states/Active.js","../qtiCreator/widgets/static/img/states/states.js","../qtiCreator/widgets/static/img/Widget.js","../qtiCreator/renderers/Img.js","../qtiCreator/tpl/forms/item!tpl","../qtiCreator/widgets/item/states/Active.js","../qtiCreator/widgets/item/states/states.js","../qtiCreator/widgets/item/Widget.js","../qtiCreator/renderers/tpl/wrap!tpl","../qtiCreator/renderers/Item.js","../qtiCreator/widgets/static/object/states/Active.js","../qtiCreator/widgets/static/object/states/states.js","../qtiCreator/widgets/static/object/Widget.js","../qtiCreator/renderers/Object.js","../qtiCreator/widgets/static/table/states/Active.js","../qtiCreator/widgets/static/table/states/states.js","../qtiCreator/widgets/static/table/Widget.js","../qtiCreator/renderers/Table.js","../qtiXmlRenderer/tpl/item!tpl","../qtiXmlRenderer/renderers/Item.js","onLayerEnd0.js","module-create.js","/Users/oat/Projects/terre/tr-enterprise/files/delivery/tao/views/build/config-wrap-end-default.js"],"sourcesContent":["\n","\ndefine('tpl!taoMediaManager/qtiCreator/tpl/relatedItemsPopup', ['handlebars'], function(hb){ return hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n \n var buffer = \"\", stack1;\n buffer += \"
  • \"\n + escapeExpression(((stack1 = (depth0 && depth0.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n + \"
  • \";\n return buffer;\n }\n\n if (helper = helpers.inUsageMessage) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.inUsageMessage); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"\\n\\n\";\n if (helper = helpers.confirmationMessage) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.confirmationMessage); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1);\n return buffer;\n }); });\n","\ndefine('tpl!taoMediaManager/qtiCreator/tpl/relatedItemsClassPopup', ['handlebars'], function(hb){ return hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType=\"function\";\n\n\n buffer += \"\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"Warning\", options) : helperMissing.call(depth0, \"__\", \"Warning\", options)))\n + \"

    \\n\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"You are about to delete the class\", options) : helperMissing.call(depth0, \"__\", \"You are about to delete the class\", options)))\n + \" \";\n if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \", \"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"which contains assets that are in use elsewhere.\", options) : helperMissing.call(depth0, \"__\", \"which contains assets that are in use elsewhere.\", options)))\n + \"\\n\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"Deleting this class will break the items and the tests that are currently using them.\", options) : helperMissing.call(depth0, \"__\", \"Deleting this class will break the items and the tests that are currently using them.\", options)))\n + \"

    \\n\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"Are you sure you want to delete this class and all of its content?\", options) : helperMissing.call(depth0, \"__\", \"Are you sure you want to delete this class and all of its content?\", options)));\n return buffer;\n }); });\n","\ndefine('tpl!taoMediaManager/qtiCreator/tpl/forbiddenClassAction', ['handlebars'], function(hb){ return hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, functionType=\"function\";\n\n\n buffer += \"\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"Forbidden action\", options) : helperMissing.call(depth0, \"__\", \"Forbidden action\", options)))\n + \"

    \\n\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"The class\", options) : helperMissing.call(depth0, \"__\", \"The class\", options)))\n + \" \";\n if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \" \"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"you are trying to delete is too large and contains too many subclasses.\", options) : helperMissing.call(depth0, \"__\", \"you are trying to delete is too large and contains too many subclasses.\", options)))\n + \"
    \\n\"\n + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, \"Please delete the subclasses before.\", options) : helperMissing.call(depth0, \"__\", \"Please delete the subclasses before.\", options)));\n return buffer;\n }); });\n","\ndefine('css!taoMediaManagerCss/media',[],function(){});\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA ;\n */\n\n/**\n * @author Juan Luis Gutierrez Dos Santos \n */\n\ndefine('taoMediaManager/controller/actions',[\n 'lodash',\n 'jquery',\n 'i18n',\n 'layout/actions/binder',\n 'uri',\n 'layout/section',\n 'core/request',\n 'core/router',\n 'core/logger',\n 'ui/feedback',\n 'ui/dialog/confirm',\n 'ui/dialog/alert',\n 'util/url',\n 'tpl!taoMediaManager/qtiCreator/tpl/relatedItemsPopup',\n 'tpl!taoMediaManager/qtiCreator/tpl/relatedItemsClassPopup',\n 'tpl!taoMediaManager/qtiCreator/tpl/forbiddenClassAction',\n 'css!taoMediaManagerCss/media.css'\n], function (\n _,\n $,\n __,\n binder,\n uri,\n section,\n request,\n router,\n loggerFactory,\n feedback,\n confirmDialog,\n alertDialog,\n urlUtil,\n relatedItemsPopupTpl,\n relatedItemsClassPopupTpl,\n forbiddenClassActionTpl\n) {\n 'use strict';\n\n const logger = loggerFactory('taoMediaManager/manageMedia');\n\n binder.register('newSharedStimulus', function instanciate(actionContext) {\n const self = this;\n const classUri = uri.decode(actionContext.classUri);\n\n return request({\n url: self.url,\n data: JSON.stringify({ classUri: classUri }),\n method: 'POST'\n })\n .then(function (response) {\n //backward compat format for jstree\n if (actionContext.tree) {\n $(actionContext.tree).trigger('addnode.taotree', [\n {\n uri: uri.decode(response.data.id),\n label: response.data.name,\n parent: uri.decode(actionContext.classUri),\n cssClass: 'node-instance'\n }\n ]);\n }\n\n //return format (resourceSelector)\n return {\n uri: uri.decode(response.data.id),\n label: response.data.name,\n classUri: uri.decode(actionContext.classUri),\n type: 'instance'\n };\n })\n .catch(err => {\n if (!_.isUndefined(err.message)) {\n feedback().error(err.message);\n }\n logger.error(err);\n });\n });\n binder.register('sharedStimulusAuthoring', function sharedStimulusAuthoring(actionContext) {\n section\n .updateContentBlock('')\n .create({\n id: 'authoring',\n name: __('Authoring'),\n url: this.url,\n content: ' ',\n visible: false\n })\n .show();\n const $panel = $('#panel-authoring');\n $panel.attr('data-id', actionContext.id);\n $panel.attr('data-uri', actionContext.uri);\n // duplicate behaviour of $doc.ajaxComplete in tao/views/js/controller/backoffice.js\n // as in old way - request html from server\n router.dispatch(`${this.url}?id=${actionContext.id}`);\n });\n binder.register('deleteSharedStimulus', function remove(actionContext) {\n const self = this;\n let data = {};\n let mediaRelationsData = {type: 'media'};\n\n if (actionContext.context[0] === 'instance') {\n mediaRelationsData.sourceId = actionContext.id\n } else {\n mediaRelationsData.classId = actionContext.id\n }\n data.uri = uri.decode(actionContext.uri);\n data.classUri = uri.decode(actionContext.classUri);\n data.id = actionContext.id;\n data.signature = actionContext.signature;\n return new Promise(function (resolve, reject) {\n request({\n url: urlUtil.route('index', 'ResourceRelations', 'tao'),\n data: mediaRelationsData,\n method: 'GET',\n noToken: true\n }).then(function (responseRelated) {\n let message;\n const haveItemReferences = responseRelated.data.relations;\n const name = $('a.clicked', actionContext.tree).text().trim();\n if (actionContext.context[0] === 'instance') {\n if (haveItemReferences.length === 0) {\n message = `${__('Are you sure you want to delete this')} ${name}?`;\n } else {\n message = relatedItemsPopupTpl({\n name,\n inUsageMessage: __('This \"%s\" is currently used in %d item(s)', name, haveItemReferences.length),\n confirmationMessage: __('Are you sure you want to delete this \"%s\"?', name),\n items: haveItemReferences\n });\n }\n } else if (actionContext.context[0] !== 'instance') {\n if (haveItemReferences.length === 0) {\n message = `${__('Are you sure you want to delete this class and all of its content?')}`;\n } else if (haveItemReferences.length !== 0) {\n message = relatedItemsClassPopupTpl({\n name,\n number: haveItemReferences.length,\n items: haveItemReferences\n });\n }\n }\n callConfirmModal(actionContext, message, self.url, data, resolve, reject)\n }).catch(errorObject => {\n let message;\n if (actionContext.context[0] === 'class' && errorObject.response.code === 999) {\n message = forbiddenClassActionTpl();\n }\n callAlertModal(actionContext, message, reject)\n });\n });\n });\n\n function callConfirmModal(actionContext, message, url, data, resolve, reject) {\n confirmDialog(\n message,\n () => accept(actionContext, url, data, resolve, reject),\n () => cancel(reject)\n );\n }\n\n function callAlertModal(actionContext, message, reject) {\n alertDialog(\n message,\n () => cancel(reject)\n );\n }\n\n function accept(actionContext, url, data, resolve, reject) {\n return request({\n url: url,\n method: 'POST',\n data: data,\n dataType: 'json'\n }).then(function (response) {\n if (response.success && response.deleted) {\n feedback().success(response.message || __('Resource deleted'));\n\n if (actionContext.tree) {\n $(actionContext.tree).trigger('removenode.taotree', [\n {\n id: actionContext.uri || actionContext.classUri\n }\n ]);\n }\n return resolve({\n uri: actionContext.uri || actionContext.classUri\n });\n } else {\n if (response.success && !response.deleted) {\n $(actionContext.tree).trigger('refresh.taotree');\n reject(response.msg\n || response.message\n || __('Unable to delete the selected resource because you do not have the required rights to delete part of its content.'));\n }\n\n reject(response.msg\n || response.message\n || __('Unable to delete the selected resource'));\n }\n });\n }\n\n function cancel(reject) {\n reject({ cancel: true });\n }\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA ;\n */\n\ndefine('taoMediaManager/qtiCreator/helper/createDummyItemData',[\n 'taoQtiItem/qtiCreator/model/Item'\n], function(Item) {\n 'use strict';\n\n const _generateIdentifier = function _generateIdentifier(uri) {\n const pos = uri.lastIndexOf('#');\n return uri.substr(pos + 1);\n };\n\n const creatorDummyItemData = function(sharedStimulusData) {\n const newItem = new Item().id(_generateIdentifier(sharedStimulusData.id)).attr('title', sharedStimulusData.name);\n newItem.data('new', true);\n newItem.data('dummy', true);\n\n const itemData = Object.assign({}, newItem);\n delete itemData.bdy;\n delete itemData.rootElement;\n\n itemData.body = sharedStimulusData.body.body;\n itemData.qtiClass = 'assessmentItem';\n itemData.responseProcessing = {\n attributes: {},\n qtiClass: \"responseProcessing\",\n responseRules: [],\n serial: `response_${sharedStimulusData.body.serial}`\n };\n itemData.response = {};\n if (sharedStimulusData.body.attributes['xml:lang']) {\n itemData.attributes['xml:lang'] = sharedStimulusData.body.attributes['xml:lang'];\n }\n if (sharedStimulusData.body.attributes.class) {\n itemData.attributes.class = sharedStimulusData.body.attributes.class;\n }\n\n return itemData;\n };\n return creatorDummyItemData;\n});\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2022 (original work) Open Assessment Technologies SA ;\n */\ndefine('taoMediaManager/qtiCreator/helper/formatStyles',[\n 'jquery'\n], function ($) {\n 'use strict';\n\n function handleStylesheetLoad(e) {\n // get cssRules from owner link tag, referenced in load event\n const path = e && e.composedPath && e.composedPath();\n const linkTag = path[0];\n\n if (linkTag) {\n\n const stylesheetUrl = linkTag.href.split('&stylesheet=');\n const rdf_styles = stylesheetUrl[0].split('%23').reverse()[0];\n\n // Asset & Asset Preview\n const assets = $(`[data-identifier='${rdf_styles}']`);\n if (assets.length) {\n assets.each((h, asset) => {\n const assetClassName = asset.children[0].className.match(/[\\w-]*tao-[\\w-]*/g) || asset.children[1].className.match(/[\\w-]*tao-[\\w-]*/g);\n if (assetClassName) {\n _formatStyles(linkTag.sheet, assetClassName[0]);\n } else {\n _hideStyles(linkTag.sheet);\n }\n });\n return;\n }\n\n // Passage on Item\n const stylesheetSerial = linkTag.dataset.serial;\n const passagesItem = $(`div[data-serial*='${stylesheetSerial}']`);\n if (passagesItem.length) {\n passagesItem.each((h, passages) => {\n const passageWrapper = $(passages).find('.qti-include > div');\n const passageItemClassName = passageWrapper[0] && passageWrapper[0].className && passageWrapper[0].className.match(/[\\w-]*tao-[\\w-]*/g);\n if (passageItemClassName) {\n _formatStyles(linkTag.sheet, passageItemClassName[0]);\n }\n });\n return;\n }\n\n // Item Preview\n const passagesPreview = $(`[data-href*='${rdf_styles}']`);\n if (passagesPreview.length) {\n passagesPreview.each((h, passages) => {\n const passagePreviewClassName = passages.className.match(/[\\w-]*tao-[\\w-]*/g);\n if (passagePreviewClassName) {\n _formatStyles(linkTag.sheet, passagePreviewClassName[0]);\n }\n });\n return;\n }\n }\n }\n\n function _hideStyles(linkTag) {\n /**\n * @type {CSSRuleList}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList\n */\n const { cssRules } = linkTag || {};\n const CSSStyleSheet = linkTag || {};\n\n if (cssRules) {\n Object.values(cssRules).map((index, rule) => {\n CSSStyleSheet.deleteRule(index);\n });\n }\n\n return;\n }\n\n function _formatStyles(linkTag, className) {\n /**\n * @type {CSSRuleList}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList\n */\n const { cssRules } = linkTag || {};\n const CSSStyleSheet = linkTag || {};\n const classNameFormated = className && className.length ? `.${className}` : '';\n\n // prefix rules\n const scopedCssRules = _scopeStyles(cssRules, classNameFormated, ['body', 'html', 'div.qti-item']);\n\n if (cssRules && scopedCssRules) {\n Object.values(cssRules).map((index, rule) => {\n CSSStyleSheet.deleteRule(index);\n });\n const newRules = scopedCssRules.split('\\n');\n Object.values(newRules).map(rule => {\n CSSStyleSheet.insertRule(rule);\n });\n }\n\n return;\n };\n\n /**\n * Apply selector replacement and scope prefixing to a set of style rules\n * @param {CSSRuleList} cssRules\n * @param {String} scopeSelector - applied as prefix; also used as replacementSelector if none specified\n * @param {String[]} toReplace - list of selectors to be replaced by replacementSelector\n * @param {String} replacementSelector\n * @returns {String} styles, with scopeSelector prefix applied\n */\n function _scopeStyles (cssRules, scopeSelector, toReplace, replacementSelector) {\n if (!cssRules) {\n return '';\n }\n\n if (!replacementSelector) {\n replacementSelector = scopeSelector;\n }\n\n const scopedStyles = Object.values(cssRules).map(rule => {\n // avoid @import, @media, @keyframes etc\n\n if (!rule.selectorText) {\n return '';\n }\n\n /**\n * Need to split selectorList apart from rules, before splitting it by comma\n * @example CSS:\n * selector1, selector2 { rules; }\n */\n const rulesInBrackets = rule.cssText.substr(rule.selectorText.length).trim();\n const selectors = rule.selectorText.split(/\\s*,\\s*/);\n\n const scopedSelectors = [];\n\n for (let singleSelectorText of selectors) {\n // avoid the most obvious top level single selectors that won't work even if scoped\n if (['html', 'body', 'div.qti-item'].includes(singleSelectorText)) {\n continue;\n }\n\n // make the replacements\n let numRepeat = 0;\n if (scopeSelector && toReplace) {\n for (let toReplaceSelector of toReplace) {\n if (singleSelectorText.includes(toReplaceSelector)) {\n if (numRepeat > 0) {\n replacementSelector = '';\n }\n singleSelectorText = singleSelectorText.replace(\n new RegExp(toReplaceSelector, 'ig'),\n replacementSelector\n );\n numRepeat++;\n }\n }\n }\n\n // has desired scoping been applied to the rule?\n const containsScopeSelector =\n singleSelectorText.includes(`${scopeSelector} `) ||\n singleSelectorText.startsWith(scopeSelector) ||\n singleSelectorText.endsWith(scopeSelector);\n\n // scope unscoped rule by the scope selector\n if (scopeSelector && !containsScopeSelector) {\n scopedSelectors.push(`${scopeSelector} ${singleSelectorText}`);\n } else {\n scopedSelectors.push(singleSelectorText);\n }\n }\n\n if (scopedSelectors.length) {\n return `${scopedSelectors.join(',')} ${rulesInBrackets}`;\n }\n return '';\n });\n\n return scopedStyles.filter(str => str.length > 0).join('\\n');\n }\n\n return {\n handleStylesheetLoad\n };\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA ;\n */\n\ndefine('taoMediaManager/qtiCreator/helper/sharedStimulusLoader',[\n 'jquery',\n 'taoQtiItem/qtiItem/core/Loader',\n 'taoQtiItem/qtiCreator/model/qtiClasses',\n 'taoMediaManager/qtiCreator/helper/createDummyItemData',\n 'core/dataProvider/request',\n 'util/url',\n 'taoMediaManager/qtiCreator/helper/formatStyles'\n], function ($, Loader, qtiClasses, creatorDummyItemData, request, urlUtil, formatStyles ) {\n 'use strict';\n\n const qtiNamespace = 'http://www.imsglobal.org/xsd/imsqti_v2p2';\n\n const qtiSchemaLocation = {\n 'http://www.imsglobal.org/xsd/imsqti_v2p2' : 'http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd'\n };\n\n const languagesUrl = urlUtil.route('index', 'Languages', 'tao');\n\n const creatorLoader = {\n loadSharedStimulus(config, callback) {\n\n if (config.id) {\n const languagesList = request(languagesUrl);\n const assetData = request(config.assetDataUrl, { id: config.id });\n const assetStyles = request(config.assetDataStyles, { uri: config.id });\n Promise.all([languagesList, assetData, assetStyles]).then((values) => {\n let loader, itemData;\n\n itemData = creatorDummyItemData(values[1]);\n\n if (values[2].children.length) {\n values[2].children.forEach((stylesheet, index) => {\n if (stylesheet.name !== 'tao-user-styles.css') {\n const serial = `creator_${index}`;\n const link = urlUtil.route('loadStylesheet', 'SharedStimulusStyling', 'taoMediaManager', {\n uri: config.id,\n stylesheet: stylesheet.name\n });\n // avoid adding the CSS file on Preview list everytime Asset is clicked\n itemData.stylesheets[serial] = {\n qtiClass: 'stylesheet',\n attributes: {\n href: link,\n media: 'all',\n title: stylesheet.name,\n type: 'text/css',\n onload: (e => formatStyles.handleStylesheetLoad(e))\n },\n serial,\n getComposingElements: () => ({})\n };\n }\n });\n }\n\n\n loader = new Loader().setClassesLocation(qtiClasses);\n loader.loadItemData(itemData, function(loadedItem) {\n let namespaces;\n\n // convert item to current QTI version\n namespaces = loadedItem.getNamespaces();\n namespaces[''] = qtiNamespace;\n loadedItem.setNamespaces(namespaces);\n loadedItem.setSchemaLocations(qtiSchemaLocation);\n\n //add languages list to the item\n if (languagesList) {\n loadedItem.data('languagesList', values[0]);\n }\n\n callback(loadedItem, this.getLoadedClasses());\n });\n });\n }\n }\n };\n\n return creatorLoader;\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA;\n */\n\ndefine('taoMediaManager/qtiCreator/renderers/config',[\n 'lodash',\n 'taoQtiItem/qtiCommonRenderer/renderers/config',\n 'taoItems/assets/manager',\n 'taoItems/assets/strategies'\n], function (_, commonRenderConfig, assetManagerFactory, assetStrategies) {\n 'use strict';\n\n //asset manager using base url\n const assetManager = assetManagerFactory(\n [assetStrategies.taomedia, assetStrategies.external, assetStrategies.base64, assetStrategies.baseUrl],\n { baseUrl: '' }\n );\n\n const locations = _.defaults(\n {\n _container: 'taoQtiItem/qtiCreator/renderers/Container',\n _tooltip: 'taoQtiItem/qtiCreator/renderers/Tooltip',\n assessmentItem: 'taoMediaManager/qtiCreator/renderers/Item',\n figure: 'taoMediaManager/qtiCreator/renderers/Figure',\n img: 'taoMediaManager/qtiCreator/renderers/Img',\n figcaption: 'taoMediaManager/qtiCreator/renderers/Figcaption',\n math: 'taoQtiItem/qtiCreator/renderers/Math',\n object: 'taoMediaManager/qtiCreator/renderers/Object',\n table: 'taoMediaManager/qtiCreator/renderers/Table'\n },\n commonRenderConfig.locations\n );\n\n return {\n name: 'creatorRenderer',\n locations: locations,\n options: {\n assetManager: assetManager\n }\n };\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA;\n */\n\n/**\n * Define the Qti Item Creator Renderer\n */\ndefine('taoMediaManager/qtiCreator/renderers/Renderer',[\n 'taoQtiItem/qtiRunner/core/Renderer',\n 'taoMediaManager/qtiCreator/renderers/config'\n], function(Renderer, config){\n 'use strict';\n\n return Renderer.build(config.locations, config.name, config.options);\n});\n\n","/**\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);\n */\n\ndefine('taoMediaManager/qtiCreator/helper/creatorRenderer',[\n 'jquery',\n 'lodash',\n 'taoMediaManager/qtiCreator/renderers/Renderer',\n 'taoItems/assets/manager',\n 'taoItems/assets/strategies',\n 'util/dom'\n], function ($, _, Renderer, assetManagerFactory, assetStrategies, dom) {\n 'use strict';\n\n //configure and instanciate once only:\n let creatorRenderer = null;\n\n /**\n * Get a preconfigured renderer singleton\n *\n * @param {Boolean} reset\n * @param {Object} config\n * @param {Object} areaBroker - the QtiCreator area broker\n * @returns {Object} - a configured instance of creatorRenderer\n */\n const get = function (reset, config, areaBroker) {\n let $bodyEltForm;\n\n config = config || {};\n config.properties = config.properties || {};\n\n if (!creatorRenderer || reset) {\n $bodyEltForm = creatorRenderer ? creatorRenderer.getOption('bodyElementOptionForm') : null;\n if (reset || !$bodyEltForm || !$bodyEltForm.length || !dom.contains($bodyEltForm)) {\n // Renderer with binded locations from taoMediaManager/qtiCreator/renderers/config.js\n creatorRenderer = new Renderer({\n lang: '',\n uri: '',\n shuffleChoices: false,\n itemOptionForm: $('#item-editor-item-property-bar #sidebar-right-passage-properties .panel'),\n bodyElementOptionForm: areaBroker.getElementPropertyPanelArea(),\n textOptionForm: $('#item-editor-text-property-bar #sidebar-right-text-block-properties .panel'),\n mediaManager: {\n appendContainer: '#mediaManager',\n browseUrl: config.properties.getFilesUrl,\n uploadUrl: config.properties.fileUploadUrl,\n deleteUrl: config.properties.fileDeleteUrl,\n downloadUrl: config.properties.fileDownloadUrl,\n fileExistsUrl: config.properties.fileExistsUrl,\n path: config.properties.path,\n root: config.properties.root\n },\n qtiCreatorContext: config.qtiCreatorContext,\n locations: config.properties.locations\n });\n\n //update the resolver baseUrl\n creatorRenderer.getAssetManager().setData({ baseUrl: config.properties.baseUrl || '' });\n\n creatorRenderer.setAreaBroker(areaBroker);\n\n // extend creator renderer to give access to the creator context\n _.assign(creatorRenderer, {\n getCreatorContext: function getCreatorContext() {\n return this.getOption('qtiCreatorContext');\n }\n });\n }\n }\n\n return creatorRenderer;\n };\n\n return {\n get: get,\n\n setOption: function (name, value) {\n return get().setOption(name, value);\n },\n setOptions: function (options) {\n return get().setOptions(options);\n },\n load: function (qtiClasses, done) {\n return get().load(function (...rest) {\n if (_.isFunction(done)) {\n done.apply(this, rest);\n }\n }, qtiClasses);\n }\n };\n});\n\n","\ndefine('tpl!taoMediaManager/qtiCreator/tpl/toolbars/cssToggler', ['handlebars'], function(hb){ return hb.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, functionType=\"function\", escapeExpression=this.escapeExpression;\n\n\n buffer += \"
  • \\n \\n \";\n if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"\\n \\n \\n \\n
  • \";\n return buffer;\n }); });\n","/*\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; under version 2\n * of the License (non-upgradable).\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n * Copyright (c) 2021 (original work) Open Assessment Technologies SA ;\n *\n */\n\n/**\n * @author dieter \n * @author Hanna Dzmitryieva \n */\n\ndefine('taoMediaManager/qtiCreator/editor/styleEditor/styleEditor',[\n 'jquery',\n 'lodash',\n 'i18n',\n 'util/urlParser',\n 'core/dataProvider/request',\n 'tpl!taoMediaManager/qtiCreator/tpl/toolbars/cssToggler',\n 'taoMediaManager/qtiCreator/helper/formatStyles',\n 'util/url',\n 'services/features',\n 'jquery.fileDownload'\n], function ($, _, __, UrlParser, request, cssTpl, formatStyles, urlUtil, featuresService) {\n 'use strict';\n\n const styleSheetManagerVisibilityKey = 'taoMediaManager/creator/StyleSheetManager';\n let itemConfig;\n\n /**\n * qtiItemCreator config provided from QtiCreator\n * used for generation of the ajax uri\n */\n let globalConfig;\n\n /**\n * generate Ajax URI\n * @param {String} action\n * @returns {*}\n */\n const _getUri = function (action) {\n return globalConfig[`${action}CssUrl`];\n };\n\n /**\n * Extract the file name from a path\n * @param {String} path\n * @returns {*}\n * @private\n */\n const _basename = function (path) {\n return path.substring(path.lastIndexOf('/') + 1);\n };\n\n // hash class for shared stimulus styles\n const mainClassSelector = 'mainClass';\n const hashClassSelector = 'hashClass';\n const taoHashClassPrefix = 'tao-';\n let hashClass = '';\n let mainClass = '';\n\n // stylesheet as object\n let style = {},\n currentItem,\n customStylesheet = '';\n // DOM element to hold the style\n const $styleElem = (function () {\n let styleElem = $('#item-editor-user-styles');\n if (!styleElem.length) {\n styleElem = $('