From 22a65dfbedaefbdad1f0eb348e2d2012934a1038 Mon Sep 17 00:00:00 2001 From: Carlo Vespa Date: Fri, 9 Apr 2021 12:40:26 +0200 Subject: [PATCH] Added support for django-croppable-image fields. --- nested_admin/static/nested_admin/dist/nested_admin.js | 2 +- nested_admin/static/nested_admin/dist/nested_admin.js.map | 2 +- nested_admin/static/nested_admin/dist/nested_admin.min.js | 4 ++-- .../static/nested_admin/dist/nested_admin.min.js.map | 2 +- nested_admin/static/nested_admin/src/nested-admin/utils.js | 6 +++++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/nested_admin/static/nested_admin/dist/nested_admin.js b/nested_admin/static/nested_admin/dist/nested_admin.js index edd4f4b..b42ebc6 100644 --- a/nested_admin/static/nested_admin/dist/nested_admin.js +++ b/nested_admin/static/nested_admin/dist/nested_admin.js @@ -3886,7 +3886,7 @@ DJNesting.updateFormAttributes = function ($elem, search, replace, selector) { var addBackMethod = $.fn.addBack ? 'addBack' : 'andSelf'; $elem.find(selector)[addBackMethod]().each(function () { var $node = $(this), - attrs = ['id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset']; + attrs = ['id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset', 'django-croppable-image-for', 'django-croppable-crop-for']; $.each(attrs, function (i, attrName) { var attrVal = $node.attr(attrName); diff --git a/nested_admin/static/nested_admin/dist/nested_admin.js.map b/nested_admin/static/nested_admin/dist/nested_admin.js.map index 07b84c6..756e483 100644 --- a/nested_admin/static/nested_admin/dist/nested_admin.js.map +++ b/nested_admin/static/nested_admin/dist/nested_admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../webpack/bootstrap","../src/nested-admin/grp$.js","../src/nested-admin/index.js","../src/nested-admin/jquery.djangoformset.js","../src/nested-admin/jquery.djnutils.js","../src/nested-admin/jquery.shim.js","../src/nested-admin/jquery.ui.djnsortable.js","../src/nested-admin/jquery.ui.nestedsortable.js","../src/nested-admin/regexquote.js","../src/nested-admin/sortable.js","../src/nested-admin/utils.js","webpack://DJNesting/./nested_admin/static/nested_admin/src/nested_admin.scss?4513","../../../../node_modules/core-js/modules/_a-function.js","../../../../node_modules/core-js/modules/_add-to-unscopables.js","../../../../node_modules/core-js/modules/_an-object.js","../../../../node_modules/core-js/modules/_array-methods.js","../../../../node_modules/core-js/modules/_array-species-constructor.js","../../../../node_modules/core-js/modules/_array-species-create.js","../../../../node_modules/core-js/modules/_cof.js","../../../../node_modules/core-js/modules/_core.js","../../../../node_modules/core-js/modules/_ctx.js","../../../../node_modules/core-js/modules/_defined.js","../../../../node_modules/core-js/modules/_descriptors.js","../../../../node_modules/core-js/modules/_dom-create.js","../../../../node_modules/core-js/modules/_export.js","../../../../node_modules/core-js/modules/_fails.js","../../../../node_modules/core-js/modules/_fix-re-wks.js","../../../../node_modules/core-js/modules/_global.js","../../../../node_modules/core-js/modules/_has.js","../../../../node_modules/core-js/modules/_hide.js","../../../../node_modules/core-js/modules/_ie8-dom-define.js","../../../../node_modules/core-js/modules/_iobject.js","../../../../node_modules/core-js/modules/_is-array.js","../../../../node_modules/core-js/modules/_is-object.js","../../../../node_modules/core-js/modules/_is-regexp.js","../../../../node_modules/core-js/modules/_object-dp.js","../../../../node_modules/core-js/modules/_property-desc.js","../../../../node_modules/core-js/modules/_redefine.js","../../../../node_modules/core-js/modules/_shared.js","../../../../node_modules/core-js/modules/_strict-method.js","../../../../node_modules/core-js/modules/_to-integer.js","../../../../node_modules/core-js/modules/_to-length.js","../../../../node_modules/core-js/modules/_to-object.js","../../../../node_modules/core-js/modules/_to-primitive.js","../../../../node_modules/core-js/modules/_uid.js","../../../../node_modules/core-js/modules/_wks.js","../../../../node_modules/core-js/modules/es6.array.find.js","../../../../node_modules/core-js/modules/es6.array.sort.js","../../../../node_modules/core-js/modules/es6.function.name.js","../../../../node_modules/core-js/modules/es6.regexp.match.js","../../../../node_modules/core-js/modules/es6.regexp.replace.js","../../../../node_modules/core-js/modules/es6.regexp.split.js","../../../../external \"grappelli\"","../../../../external \"grp\""],"names":["$","require","grp$","$sel","window","grp","jQuery","fn","init","$grpSel","prevObject","module","exports","grappelli","DJNesting","DjangoFormset","document","ready","filter","i","element","childNodes","length","css","not","closest","addClass","on","onMutate","e","$inline","$items","find","$rows","children","removeClass","each","row","n","rootGroup","djangoFormset","updatePositions","djangoFormsetPrefix","trigger","regexQuote","pluginName","inline","opts","emptyClass","predeleteClass","prefix","_$totalForms","attr","_$template","inlineModelClassName","djnData","extend","childTypes","data","options","formsetFkModel","addButtonSelector","removeButtonSelector","deleteButtonSelector","formClass","formClassSelector","initRelatedFields","initAutocompleteFields","_setupPolymorphic","_bindEvents","_initializeForms","is","createSortable","Error","menu","forEach","c","type","name","$addButton","$menu","after","totalForms","mgmtVal","maxForms","parents","hide","_initializeForm","form","$form","formPrefix","djangoFormPrefix","hasClass","toggleClass","minForms","self","hideRemoveButton","djangoFormsetForms","showHideMethod","$el","off","preventDefault","stopPropagation","next","add","hideMenu","show","$menuButtons","parent","polymorphicType","target","remove","deleteClickHandler","stopImmediatePropagation","$deleteInput","undelete","$deleteButton","index","djangoFormIndex","isInitial","innerHTML","_fillGap","delete","checked","$childInline","childFormset","removeAttr","spliceIndex","ctype","$template","clone","id","isNested","replace","append","createContainerElement","updateFormAttributes","RegExp","$firstTemplate","eq","compatibleParents","el","fkModel","compatModels","parentModel","isPolymorphic","indexOf","input","value","setAttribute","parentNode","appendChild","removeChild","insertBefore","isNumeric","spliceInto","reinitDateTimeFields","DjangoInlines","initPrepopulatedFields","reinitDateTimeShortCuts","updateSelectFilter","grp_collapsible","addBackMethod","addBack","toggle_handler_slctr","closed_css","open_css","on_toggle","curated_content_type","formsetModelClassName","$buttons","$initialForm","$newForm","formsets","toArray","sort","a","b","oldIndex","oldFormPrefixRegex","_makeRoomForInsert","initialFormCount","totalFormCount","gapIndex","$existingForm","isNewAddition","oldFormsetPrefix","newFormsetPrefix","newIndex","$before","currentPosition","prevAll","$oldInline","$currentFormInline","oldDjangoFormset","$parentInline","$parentForm","parentPkField","pk","$parentPk","djangoFormField","val","setTimeout","newValue","$field","parseInt","args","arguments","makeArray","slice","prototype","prefixCache","inlineFormsetData","nestedOptions","djangoPrefixIndex","$this","first","forattr","$group","groupId","cacheKey","match","substr","getElementById","prefixIndex","filterDjangoFormsetForms","formsetPrefix","formId","getAttribute","formIndex","forms","$forms","sortedForms","Array","push","apply","pushStack","fieldName","$empty","matches","isNaN","namePrefix","fieldPart","substring","fieldNameData","prefixAndIndex","filterDjangoField","djRegexCache","fieldId","django","ui","undefined","t","s","r","o","nodeName","toLowerCase","href","test","disabled","expr","filters","visible","version","keyCode","BACKSPACE","COMMA","DELETE","DOWN","END","ENTER","ESCAPE","HOME","LEFT","NUMPAD_ADD","NUMPAD_DECIMAL","NUMPAD_DIVIDE","NUMPAD_ENTER","NUMPAD_MULTIPLY","NUMPAD_SUBTRACT","PAGE_DOWN","PAGE_UP","PERIOD","RIGHT","SPACE","TAB","UP","focus","call","scrollParent","ie","zIndex","uniqueId","removeUniqueId","createPseudo","focusable","tabbable","outerWidth","jquery","parseFloat","innerWidth","innerHeight","outerHeight","removeData","camelCase","exec","navigator","userAgent","support","selectstart","createElement","disableSelection","bind","enableSelection","unbind","plugin","plugins","nodeType","hasScroll","cleanData","triggerHandler","widget","h","l","u","split","Widget","_createWidget","_proto","_childConstructors","isFunction","_super","_superApply","widgetEventPrefix","constructor","namespace","widgetName","widgetFullName","bridge","hasOwnProperty","isPlainObject","concat","charAt","get","error","option","_init","defaultElement","create","uuid","eventNamespace","_getCreateOptions","bindings","hoverable","_on","destroy","style","ownerDocument","defaultView","parentWindow","_create","_trigger","_getCreateEventData","noop","_destroy","shift","pop","_setOptions","_setOption","enable","disable","guid","delegate","_off","join","undelegate","_delay","_hoverable","mouseenter","currentTarget","mouseleave","_focusable","focusin","focusout","Event","originalEvent","isDefaultPrevented","effect","duration","isEmptyObject","complete","delay","effects","easing","queue","mouseup","cancel","distance","_mouseInit","_mouseDown","started","_mouseDestroy","_mouseMoveDelegate","_mouseUpDelegate","_mouseStarted","_mouseUp","_mouseDownEvent","which","_mouseCapture","mouseDelayMet","_mouseDelayTimer","_mouseDistanceMet","_mouseDelayMet","_mouseStart","_mouseMove","documentMode","button","_mouseDrag","_mouseStop","Math","max","abs","pageX","pageY","p","width","height","offset","top","left","isWindow","scrollTop","scrollLeft","round","d","f","position","scrollbarWidth","offsetWidth","clientWidth","getScrollInfo","scrollWidth","scrollHeight","getWithinInfo","of","m","g","v","y","_","within","x","k","collision","w","at","D","T","M","S","my","offsetFractions","marginLeft","marginTop","targetWidth","targetHeight","elemWidth","elemHeight","collisionPosition","collisionWidth","collisionHeight","elem","using","horizontal","vertical","important","fit","flip","flipfit","getElementsByTagName","visibility","border","margin","background","documentElement","firstChild","cssText","mouse","appendTo","axis","connectWith","containment","cursor","cursorAt","dropOnEmpty","forcePlaceholderSize","forceHelperSize","grid","handle","helper","items","opacity","placeholder","revert","scroll","scrollSensitivity","scrollSpeed","scope","tolerance","_isOverAxis","reference","size","containerCache","refresh","floating","item","key","event","overrideHandle","that","reverting","_refreshItems","currentItem","nodes","validHandle","_removeCurrentsFromItems","noActivation","currentContainer","refreshPositions","_createHelper","_cacheHelperProportions","_cacheMargins","margins","click","_getParentOffset","relative","_getRelativeOffset","cssPosition","originalPosition","_generatePosition","originalPageX","originalPageY","_adjustOffsetFromHelper","domPosition","prev","_createPlaceholder","_setContainment","_storedCursor","_storedOpacity","_storedZIndex","tagName","overflowOffset","_uiHash","_preserveHelperProportions","containers","ddmanager","current","dropBehaviour","prepareOffsets","dragging","positionAbs","_convertPositionTo","lastPositionAbs","scrolled","offsetHeight","itemElement","intersection","_intersectsWithPointer","instance","contains","direction","_intersectsWithSides","_rearrange","_contactContainers","drag","noPropagation","drop","cur","animate","offsetParent","body","_clear","_storedCSS","over","_noFinalSort","prepend","serialize","_getItemsAsjQuery","connected","str","res","attribute","expression","ret","_intersectsWith","x1","x2","helperProportions","y1","y2","dyClick","dxClick","isOverElement","forcePointerForContainers","isOverElementHeight","isOverElementWidth","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","isOverBottomHalf","isOverRightHalf","delta","_connectWith","String","queries","j","inst","list","grep","targetData","_queries","queriesLength","fast","toleranceElement","custom","refreshContainers","className","update","container","innermostContainer","innermostIndex","dist","itemWithLeastDistance","posProperty","sizeProperty","base","nearBottom","obj","isArray","right","bottom","po","ce","co","pos","mod","scrollIsRootNode","hardRefresh","nextSibling","counter","delayedTriggers","before","fromOutside","cancelHelperRemoval","handler","handlerProxy","_inst","sender","nearest","selector","node","parentsUntil","expando","random","createChildNestedSortable","childContainer","$childContainer","widgetConstructor","newInstance","$otherContainer","addToConnectWith","otherInstance","djnsortable","tabSize","disableNesting","errorClass","nestedContainerSelector","doNotClear","containerElementSelector","listItemSelector","maxLevels","revertOnError","protectRoot","rootID","rtl","fixedNestingDepth","showErrorDiv","keepInParent","isAllowed","canConnectWith","container1","container2","model1","model2","instance2","container1Level","_getLevel","container2Level","$element","dataOptions","_connectWithMap","$document","originalConnectWith","lastItemElement","$itemElement","containerSel","$childItems","itemElementClosestContainer","_clearEmpty","_parentItem","parentItem","level","childLevels","_getChildLevels","placeholderClassName","phClassSearch","phOrigClassName","phOrigClassNameEndPos","previousItem","previousSibling","nextItem","beyondMaxLevels","containerInstance","_isAllowed","$previousItemChildContainer","lastRearrangedElement","placeholderParentItem","comparisonElement","previousTopOffset","sDepth","startDepthCount","_recursiveArray","depth","pid","$item","childContainers","result","child","levels","isRoot","origConnectWith","$elements","splice","newContainer","nestedSortable","count","groupData","fieldNames","groupFkName","formsetFkName","parentPkVal","parentPrefix","sortableOptions","sortableExcludes","$parentGroup","parentFieldNames","parentPkFieldName","regex","$inlineLabel","html","$fields","$positionField","setPosition","hasValue","siblings","inArray","$currentItem","$originalTr","trTagName","prop","$tr","$originalTd","tdTagName","numColumns","td","$placeholder","$currItem","paddingTop","paddingBottom","paddingLeft","paddingRight","childModels","currentModel","isPolymorphicChild","start","stop","receive","$nextItem","nextAll","$elem","search","$node","attrs","attrName","attrVal","JSON","parse","dependencyIds","map","LOOKUP_URLS","related","lookupUrls","lookupFields","lookupRelated","fk","grp_related_fk","lookup_url","m2m","grp_related_m2m","generic","contentType","objectId","grp_related_generic","content_type","object_id","lookupAutocomplete","grp_autocomplete_fk","autocomplete_lookup_url","autocomplete","grp_autocomplete_m2m","grp_autocomplete_generic","field","$input","dependencyList","dependencies","prepopulate","DateTimeShortcuts","SelectFilter","namearr","patchSelectFilter","oldFn","field_id","field_name","is_stacked","djangoFuncs","funcName","patchDjangoFunction","callCount","django_fn_patch","grpFuncs","patchGrpFunction","grp_fn_patch"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;ACnEA,IAAMA,IAAI,mBAAAC,CAAA,4FAAAA,CAAV;AAEA;;;;;;;;AAMA,SAASC,IAAT,CAAcC,IAAd,EAAoB;AAClB,MAAI,OAAOC,OAAOC,GAAd,KAAsB,WAA1B,EAAuC;AACrC,WAAOL,EAAEG,IAAF,CAAP;AACD;;AACD,MAAIC,OAAOC,GAAP,CAAWC,MAAX,CAAkBC,EAAlB,CAAqBC,IAArB,KAA8BR,EAAEO,EAAF,CAAKC,IAAvC,EAA6C;AAC3C,WAAOR,EAAEG,IAAF,CAAP;AACD;;AACD,MAAMM,UAAUL,OAAOC,GAAP,CAAWC,MAAX,CAAkBH,IAAlB,CAAhB;;AACA,MAAIA,KAAKO,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ACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG,iEAAiE;AACjE,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,eAAe;AACf,eAAe;AACf,eAAe;AACf,gBAAgB;AAChB;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,UAAU;AACvC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;;;;;;;;;;;ACLzC,uBAAuB;AACvB;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;;;;;;;;;;;ACPA;AACA,uIAAsE,mBAAmB,UAAU,EAAE,EAAE;AACvG,CAAC;;;;;;;;;;;;ACFD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;;;;;;;;;;;;AC9BD;AACA;AACA,kDAAkD;AAClD;AACA,uCAAuC;AACvC;;;;;;;;;;;;;ACLA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,cAAc;AACvD,GAAG;AACH;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACtBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;ACtED,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,gCAAgC,EAAE,I","file":"nested_admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const $ = require('jquery');\n\n/**\n * For grappelli 2.14, converts a django.jQuery instance to a grp.jQuery\n * instance. Otherwise (if grappelli is not present, or for grappelli <= 2.13,\n * where the grappelli jQuery instance is the same as django's), returns the\n * object that was passed in, unchanged.\n */\nfunction grp$($sel) {\n if (typeof window.grp === 'undefined') {\n return $($sel);\n }\n if (window.grp.jQuery.fn.init === $.fn.init) {\n return $($sel);\n }\n const $grpSel = window.grp.jQuery($sel);\n if ($sel.prevObject) {\n $grpSel.prevObject = grp$($sel.prevObject);\n }\n return $grpSel;\n}\n\nmodule.exports = grp$;\n","const $ = require('jquery');\nconst grappelli = require('grappelli');\nconst DJNesting = require('./utils');\nDJNesting.DjangoFormset = require('./jquery.djangoformset');\n\n$(document).ready(function() {\n // Remove the border on any empty fieldsets\n $('fieldset.grp-module, fieldset.module').filter(function(i, element) {\n return element.childNodes.length == 0;\n }).css('border-width', '0');\n\n // Set predelete class on any form elements with the DELETE input checked.\n // These can occur on forms rendered after a validation error.\n $('input[name$=\"-DELETE\"]:checked').not('[name*=\"__prefix__\"]').closest('.djn-inline-form').addClass('grp-predelete');\n\n $(document).on('djnesting:initialized djnesting:mutate', function onMutate(e, $inline) {\n var $items = $inline.find('> .djn-items, > .tabular > .module > .djn-items');\n var $rows = $items.children('.djn-tbody');\n $rows.removeClass('row1 row2');\n $rows.each(function(i, row) {\n var n = 1 + (i % 2);\n $(row).addClass('row' + n);\n });\n });\n\n // Register the nested formset on top level djnesting-stacked elements.\n // It will handle recursing down the nested inlines.\n $('.djn-group-root').each(function(i, rootGroup) {\n $(rootGroup).djangoFormset();\n });\n\n $('form').on('submit.djnesting', function(e) {\n $('.djn-group').each(function() {\n DJNesting.updatePositions($(this).djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$(this).djangoFormset().$inline]);\n });\n });\n});\n\nmodule.exports = DJNesting;\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nconst DJNesting = require('./utils');\nconst grappelli = require('grappelli');\nconst grp = require('grp');\nconst grp$ = require('./grp$');\n\nvar pluginName = 'djangoFormset';\n\nclass DjangoFormset {\n constructor(inline) {\n this.opts = {\n emptyClass: 'empty-form grp-empty-form djn-empty-form',\n predeleteClass: 'grp-predelete'\n };\n this.$inline = $(inline);\n this.prefix = this.$inline.djangoFormsetPrefix();\n this._$totalForms = this.$inline.find('#id_' + this.prefix + '-TOTAL_FORMS');\n this._$totalForms.attr('autocomplete', 'off');\n this._$template = $('#' + this.prefix + '-empty');\n\n var inlineModelClassName = this.$inline.djnData('inlineModel');\n\n this.opts = $.extend({}, this.opts, {\n childTypes: this.$inline.data('inlineFormset').options.childTypes,\n formsetFkModel: this.$inline.djnData('formsetFkModel'),\n addButtonSelector: '.djn-add-handler.djn-model-' + inlineModelClassName,\n removeButtonSelector: '.djn-remove-handler.djn-model-' + inlineModelClassName,\n deleteButtonSelector: '.djn-delete-handler.djn-model-' + inlineModelClassName,\n formClass: 'dynamic-form grp-dynamic-form djn-dynamic-form-' + inlineModelClassName,\n formClassSelector: '.djn-dynamic-form-' + inlineModelClassName\n });\n\n DJNesting.initRelatedFields(this.prefix, this.$inline.djnData());\n DJNesting.initAutocompleteFields(this.prefix, this.$inline.djnData());\n\n if (this.opts.childTypes) {\n this._setupPolymorphic();\n }\n this._bindEvents();\n\n this._initializeForms();\n\n this.$inline.find('.djn-items:not([id*=\"-empty\"])').trigger('djnesting:init');\n\n // initialize nested formsets\n this.$inline.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n if (this.$inline.is('.djn-group-root')) {\n DJNesting.createSortable(this.$inline);\n }\n\n $(document).trigger('djnesting:initialized', [this.$inline, this]);\n }\n _setupPolymorphic() {\n if (!this.opts.childTypes) {\n throw Error('The polymorphic fieldset options.childTypes is not defined!');\n }\n let menu = '
';\n const $addButton = this.$inline.find(this.opts.addButtonSelector);\n const $menu = $(menu);\n $addButton.after($menu);\n }\n\n _initializeForms() {\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n if (maxForms <= totalForms) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n for (var i = 0; i < totalForms; i++) {\n this._initializeForm('#' + this.prefix + '-' + i);\n }\n }\n _initializeForm(form) {\n var $form = $(form);\n var formPrefix = $form.djangoFormPrefix();\n $form.addClass(this.opts.formClass);\n if ($form.hasClass('has_original')) {\n $('#id_' + formPrefix + 'DELETE:checked').toggleClass(this.opts.predeleteClass);\n }\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n }\n _bindEvents($el) {\n var self = this;\n if (typeof $el == 'undefined') {\n $el = this.$inline;\n }\n const $addButton = $el.find(this.opts.addButtonSelector);\n $addButton.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const $menu = $(this).next('.polymorphic-type-menu');\n if (!$menu.length) {\n self.add();\n } else {\n if (!$menu.is(':visible')) {\n function hideMenu() {\n $menu.hide();\n $(document).off('click', hideMenu);\n }\n $(document).on('click', hideMenu);\n }\n $menu.show();\n }\n });\n const $menuButtons = $addButton.parent().find('> .polymorphic-type-menu a');\n $menuButtons.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const polymorphicType = $(this).attr('data-type');\n self.add(null, polymorphicType);\n const $menu = $(e.target).closest('.polymorphic-type-menu');\n if ($menu.is(':visible')) {\n $menu.hide();\n }\n });\n $el.find(this.opts.removeButtonSelector).filter(function() {\n return !$(this).closest('.djn-empty-form').length;\n }).off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n self.remove($form);\n });\n\n var deleteClickHandler = function(e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n var $deleteInput = $('#id_' + $form.djangoFormPrefix() + 'DELETE');\n if (!$deleteInput.is(':checked')) {\n self['delete']($form);\n } else {\n self.undelete($form);\n }\n };\n\n var $deleteButton = $el.find(this.opts.deleteButtonSelector)\n .filter(function() { return !$(this).closest('.djn-empty-form').length; });\n\n $deleteButton.off('click.djnesting').on('click.djnesting', deleteClickHandler);\n $deleteButton.find('[id$=\"-DELETE\"]').on('mousedown.djnesting', deleteClickHandler);\n }\n remove(form) {\n var $form = $(form);\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var index = $form.djangoFormIndex();\n var isInitial = $form.data('isInitial');\n\n // Clearing out the form HTML itself using DOM APIs is much faster\n // than using jQuery to remove the element. Using jQuery is so\n // slow that it hangs the page.\n $form[0].innerHTML = \"\";\n $form.remove();\n\n totalForms -= 1;\n this.mgmtVal('TOTAL_FORMS', totalForms);\n\n if (maxForms - totalForms >= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').show();\n }\n\n this._fillGap(index, isInitial);\n\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:removed', [$form, this.prefix]);\n }\n delete(form) {\n var self = this,\n $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.hasClass(this.opts.predeleteClass)) {\n return;\n }\n\n if (!$form.data('isInitial')) {\n return;\n }\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n $form.addClass(this.opts.predeleteClass);\n\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).hasClass(self.opts.predeleteClass)) {\n $(this).data('alreadyDeleted', true);\n } else {\n childFormset.delete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:deleted', [$form, this.prefix]);\n }\n undelete(form) {\n var $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.parent().closest('.' + this.opts.predeleteClass).length) {\n return;\n }\n if ($form.hasClass('has_original')) {\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n $form.removeClass(this.opts.predeleteClass);\n }\n $form.data('alreadyDeleted', false);\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).data('alreadyDeleted')) {\n $(this).data('alreadyDeleted', false);\n } else {\n childFormset.undelete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:undeleted', [$form, this.prefix]);\n }\n add(spliceIndex, ctype) {\n var self = this;\n const $template = (ctype) ? $(`#${this.prefix}-empty-${ctype}`) : this._$template;\n var $form = $template.clone(true);\n\n // For django-grappelli >= 2.14, where the grp.jQuery instance is not\n // the same as django.jQuery, we must copy any prepopulated_field\n // dependency data from grp.jQuery to the cloned nodes.\n grp$($template).find(':data(dependency_ids)').each(function() {\n const id = $(this).attr('id');\n const $el = $form.find(`#${id}`);\n grp$($el).data($.extend({}, $el.data(), grp$(this).data()));\n });\n\n var index = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var isNested = this.$inline.hasClass('djn-group-nested');\n\n $(document).trigger('djnesting:beforeadded', [this.$inline, $form]);\n\n $form.removeClass(this.opts.emptyClass);\n $form.addClass('djn-item');\n $form.attr('id', $form.attr('id').replace(/\\-empty.*?$/, '-' + index));\n\n if (isNested) {\n $form.append(DJNesting.createContainerElement());\n }\n\n DJNesting.updateFormAttributes($form,\n new RegExp('([#_]id_|[\\\\#]|^id_|\\\"|^)' + regexQuote(this.prefix) + '\\\\-(?:__prefix__|empty)\\\\-', 'g'),\n '$1' + this.prefix + '-' + index + '-');\n\n let $firstTemplate = this._$template;\n if (this.opts.childTypes) {\n $firstTemplate = $template.closest('.djn-group')\n .find('> .djn-items > [id*=\"-empty\"], > .djn-fieldset > .djn-items > [id*=\"-empty\"]').eq(0);\n }\n if (this.opts.childTypes) {\n const compatibleParents = this.$inline.djnData('compatibleParents') || {};\n $form.find('> .djn-group').each((i, el) => {\n const fkModel = $(el).djnData('formsetFkModel');\n const compatModels = compatibleParents[ctype] || [];\n const $el = $(el);\n const parentModel = $el.djnData('inlineParentModel');\n const isPolymorphic = !!($el.data('inlineFormset').options.childTypes);\n const formPrefix = $el.data('inlineFormset').options.prefix;\n if (parentModel !== ctype || (isPolymorphic && fkModel !== ctype && compatModels.indexOf(fkModel) === -1)) {\n $el.find('input[id$=\"_FORMS\"]').each((i, input) => {\n input.value = 0\n input.setAttribute('value', '0');\n el.parentNode.appendChild(input);\n });\n el.parentNode.removeChild(el);\n }\n });\n }\n\n $form.insertBefore($firstTemplate);\n\n this.mgmtVal('TOTAL_FORMS', index + 1);\n if ((maxForms - (index + 1)) <= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n\n DJNesting.updatePositions(this.prefix);\n\n if ($.isNumeric(spliceIndex)) {\n this.spliceInto($form, spliceIndex, true);\n } else {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n\n if (grappelli) {\n grappelli.reinitDateTimeFields(grp$($form));\n }\n DJNesting.DjangoInlines.initPrepopulatedFields($form);\n DJNesting.DjangoInlines.reinitDateTimeShortCuts();\n DJNesting.DjangoInlines.updateSelectFilter($form);\n DJNesting.initRelatedFields(this.prefix);\n DJNesting.initAutocompleteFields(this.prefix);\n if (grp && grp.jQuery.fn.grp_collapsible) {\n var addBackMethod = (grp.jQuery.fn.addBack) ? 'addBack' : 'andSelf';\n grp$($form).find(\n '.grp-collapse:not([id$=\"-empty\"]):not([id*=\"-empty-\"])'\n )[addBackMethod]().grp_collapsible({\n toggle_handler_slctr: '.grp-collapse-handler:first',\n closed_css: 'closed grp-closed',\n open_css: 'open grp-open',\n on_toggle: function() {\n $(document).trigger('djnesting:toggle', [self.$inline]);\n }\n });\n }\n if (typeof $.fn.curated_content_type == 'function') {\n $form.find('.curated-content-type-select').each(function() {\n $(this).curated_content_type();\n });\n }\n\n this._initializeForm($form);\n this._bindEvents($form);\n\n if (ctype) {\n const formsetModelClassName = this.$inline.djnData('inlineModel');\n const inlineModelClassName = $form.attr('data-inline-model');\n const $buttons = $form.find(`.djn-model-${formsetModelClassName}`);\n $buttons.addClass(`djn-model-${inlineModelClassName}`);\n $form.addClass(`djn-dynamic-form-${inlineModelClassName}`);\n }\n\n // find any nested formsets\n $form.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n // Fire an event on the document so other javascript applications\n // can be alerted to the newly inserted inline\n $(document).trigger('djnesting:added', [this.$inline, $form]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:added', [$form, this.prefix]);\n\n return $form;\n }\n _fillGap(index, isInitial) {\n var $initialForm, $newForm;\n var formsets = this.$inline.djangoFormsetForms().toArray();\n // Sort formsets in index order, so that we get the last indexed form for the swap.\n formsets.sort(function(a, b) { return $(a).djangoFormIndex() - $(b).djangoFormIndex(); });\n formsets.forEach(function(form) {\n var $form = $(form);\n var i = $form.djangoFormIndex();\n if (i <= index) {\n return;\n }\n if ($form.data('isInitial')) {\n $initialForm = $form;\n } else {\n $newForm = $form;\n }\n });\n var $form = (isInitial) ? $initialForm || $newForm : $newForm;\n if (!$form) {\n return;\n }\n var oldIndex = $form.djangoFormIndex();\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix + '-' + oldIndex) + '(?!\\\\-\\\\d)');\n $form.attr('id', this.prefix + '-' + index);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + this.prefix + '-' + index);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial && $initialForm && $newForm) {\n this._fillGap(oldIndex, false);\n }\n }\n _makeRoomForInsert() {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n gapIndex = initialFormCount,\n $existingForm = $('#' + this.prefix + '-' + gapIndex);\n\n if (!$existingForm.length) {\n return;\n }\n\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix) + '-' + gapIndex + '(?!\\\\-\\\\d)');\n $existingForm.attr('id', this.prefix + '-' + totalFormCount);\n DJNesting.updateFormAttributes($existingForm, oldFormPrefixRegex, '$1' + this.prefix + '-' + totalFormCount);\n\n // Update prefixes on nested DjangoFormset objects\n $existingForm.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $existingForm]);\n }\n /**\n * Splice a form into the current formset at new position `index`.\n */\n spliceInto($form, index, isNewAddition) {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n oldFormsetPrefix = $form.djangoFormsetPrefix(),\n newFormsetPrefix = this.prefix,\n isInitial = $form.data('isInitial'),\n newIndex, $before;\n\n // Make sure the form being spliced is from a different inline\n if ($form.djangoFormsetPrefix() == this.prefix) {\n var currentPosition = $form.prevAll('.djn-item:not(.djn-no-drag,.djn-thead)').length;\n if (currentPosition === index || typeof index == 'undefined') {\n DJNesting.updatePositions(newFormsetPrefix);\n return;\n }\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item:not(#' + $form.attr('id') + ')').eq(index);\n $before.after($form);\n } else {\n var $oldInline = $('#' + oldFormsetPrefix + '-group');\n var $currentFormInline = $form.closest('.djn-group');\n\n if ($currentFormInline.djangoFormsetPrefix() != newFormsetPrefix) {\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item').eq(index);\n $before.after($form);\n }\n\n var oldDjangoFormset = $oldInline.djangoFormset();\n oldDjangoFormset.mgmtVal('TOTAL_FORMS', oldDjangoFormset.mgmtVal('TOTAL_FORMS') - 1);\n oldDjangoFormset._fillGap($form.djangoFormIndex(), isInitial);\n\n if (isInitial) {\n oldDjangoFormset.mgmtVal('INITIAL_FORMS', oldDjangoFormset.mgmtVal('INITIAL_FORMS') - 1);\n\n var $parentInline = this.$inline.parent().closest('.djn-group');\n if ($parentInline.length) {\n var $parentForm = this.$inline.closest('.djn-inline-form');\n var parentPkField = ($parentInline.djnData('fieldNames') || {}).pk;\n var $parentPk = $parentForm.djangoFormField(parentPkField);\n if (!$parentPk.val()) {\n $form.data('isInitial', false);\n $form.attr('data-is-initial', 'false');\n isInitial = false;\n // Set initial form counts to 0 on nested DjangoFormsets\n setTimeout(function() {\n $form.find('[name^=\"' + $form.djangoFormPrefix() + '\"][name$=\"-INITIAL_FORMS\"]')\n .val('0').trigger('change');\n }, 0);\n }\n }\n }\n\n if (isInitial) {\n this._makeRoomForInsert();\n }\n\n // Replace the ids for the splice form\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)' + regexQuote($form.attr('id')) + '(?!\\\\-\\\\d)');\n newIndex = (isInitial) ? initialFormCount : totalFormCount;\n $form.attr('id', newFormsetPrefix + '-' + newIndex);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + newFormsetPrefix + '-' + newIndex);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial) {\n this.mgmtVal('INITIAL_FORMS', initialFormCount + 1);\n }\n this.mgmtVal('TOTAL_FORMS', totalFormCount + 1);\n\n DJNesting.updatePositions(oldFormsetPrefix);\n $(document).trigger('djnesting:mutate', [$oldInline]);\n }\n\n DJNesting.updatePositions(newFormsetPrefix);\n if (!isNewAddition) {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n }\n mgmtVal(name, newValue) {\n var $field = this.$inline.find('#id_' + this.prefix + '-' + name);\n if (typeof newValue == 'undefined') {\n return parseInt($field.val(), 10);\n } else {\n return parseInt($field.val(newValue).trigger('change').val(), 10);\n }\n }\n}\n\n$.fn[pluginName] = function() {\n var options, fn, args;\n var $el = this.eq(0);\n\n if (arguments.length === 0 || (arguments.length === 1 && $.type(arguments[0]) != 'string')) {\n options = arguments[0];\n var djangoFormset = $el.data(pluginName);\n if (!djangoFormset) {\n djangoFormset = new DjangoFormset($el, options);\n $el.data(pluginName, djangoFormset);\n }\n return djangoFormset;\n }\n\n fn = arguments[0];\n args = $.makeArray(arguments).slice(1);\n\n if (fn in DjangoFormset.prototype) {\n return $el.data(pluginName)[fn](args);\n } else {\n throw new Error('Unknown function call ' + fn + ' for $.fn.' + pluginName);\n }\n};\n\nmodule.exports = DjangoFormset;\n","const $ = require('jquery');\n\nvar prefixCache = {};\n\n$.fn.djnData = function(name) {\n var inlineFormsetData = $(this).data('inlineFormset') || {},\n nestedOptions = inlineFormsetData.nestedOptions || {};\n if (!name) {\n return nestedOptions;\n } else {\n return nestedOptions[name];\n }\n};\n\n$.fn.djangoPrefixIndex = function() {\n var $this = (this.length > 1) ? this.first() : this;\n var id = $this.attr('id'),\n name = $this.attr('name'),\n forattr = $this.attr('for'),\n prefix, $form, $group, groupId, cacheKey, match, index;\n\n if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {\n return match;\n }\n\n if (id && !prefix) {\n prefix = (id.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n\n if (id && !prefix && $this.is('.djn-item') && id.match(/\\d+$/)) {\n [cacheKey, prefix, index] = id.match(/(.*?)\\-(\\d+)$/) || [null, null, null];\n }\n\n if (!prefix) {\n $form = $this.closest('.djn-inline-form');\n if ($form.length) {\n [cacheKey, prefix, index] = $form.attr('id').match(/(.*?)\\-(\\d+)$/)\n || [null, null, null];\n } else {\n $group = $this.closest('.djn-group');\n if (!$group.length) {\n return null;\n }\n groupId = $group.attr('id') || '';\n prefix = (groupId.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n } else {\n if (prefix.substr(0, 3) == 'id_') {\n prefix = prefix.substr(3);\n }\n\n if (!document.getElementById(prefix + '-group')) {\n return null;\n }\n }\n if (cacheKey) {\n prefixCache[cacheKey] = [prefix, index];\n }\n\n return [prefix, index];\n};\n\n$.fn.djangoFormPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n if (!prefixIndex || !prefixIndex[1]) {\n return null;\n }\n return prefixIndex[0] + '-' + prefixIndex[1] + '-';\n};\n\n$.fn.djangoFormIndex = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex || !prefixIndex[1]) ? null : parseInt(prefixIndex[1], 10);\n};\n\n$.fn.djangoFormsetPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex) ? null : prefixIndex[0];\n};\n\nvar filterDjangoFormsetForms = function(form, $group, formsetPrefix) {\n var formId = form.getAttribute('id'),\n formIndex = formId.substr(formsetPrefix.length + 1);\n\n // Check if form id matches /{prefix}-\\d+/\n if (formId.indexOf(formsetPrefix) !== 0) { return false; }\n return (!formIndex.match(/\\D/));\n};\n\n// Selects all initial forms within the same formset as the\n// element the method is being called on.\n$.fn.djangoFormsetForms = function() {\n var forms = [];\n this.each(function() {\n var $this = $(this),\n formsetPrefix = $this.djangoFormsetPrefix(),\n $group = (formsetPrefix) ? $('#' + formsetPrefix + '-group') : null,\n $forms;\n\n if (!formsetPrefix || !$group.length) return;\n\n $forms = $group.find('.djn-inline-form').filter(function() {\n return filterDjangoFormsetForms(this, $group, formsetPrefix);\n });\n var sortedForms = $forms.toArray().sort(function(a, b) {\n return $(a).djangoFormIndex() - $(b).djangoFormIndex;\n });\n Array.prototype.push.apply(forms, sortedForms);\n });\n return this.pushStack(forms);\n};\n\nif (typeof($.djangoFormField) != 'function') {\n $.djangoFormField = function(fieldName, prefix, index) {\n var $empty = $([]), matches;\n if (matches = prefix.match(/^(.+)\\-(\\d+)\\-$/)) {\n prefix = matches[1];\n index = matches[2];\n }\n index = parseInt(index, 10);\n if (isNaN(index)) {\n return $empty;\n }\n var namePrefix = prefix + '-' + index + '-';\n if (fieldName == '*') {\n return $('*[name^=\"' + namePrefix + '\"]').filter(function() {\n var fieldPart = $(this).attr('name').substring(namePrefix.length);\n return (fieldPart.indexOf('-') === -1);\n });\n }\n var $field = $('#id_' + namePrefix + fieldName);\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n var $group = $('#' + prefix + '-group'),\n fieldNameData = $group.djnData('fieldNames') || {};\n fieldName = fieldNameData[fieldName];\n if (!fieldName) { return $empty; }\n $field = $('#id_' + namePrefix + fieldName);\n }\n return $field;\n };\n}\n\nif (typeof($.fn.djangoFormField) != 'function') {\n /**\n * Given a django model's field name, and the forms index in the\n * formset, returns the field's input element, or an empty jQuery\n * object on failure.\n *\n * @param String fieldName - 'pk', 'position', or the field's\n * name in django (e.g. 'content_type',\n * 'url', etc.)\n * @return jQuery object containing the field's input element, or\n * an empty jQuery object on failure\n */\n $.fn.djangoFormField = function(fieldName, index) {\n var prefixAndIndex = this.djangoPrefixIndex();\n var $empty = $([]);\n if (!prefixAndIndex) {\n return $empty;\n }\n var prefix = prefixAndIndex[0];\n if (typeof(index) == 'undefined') {\n index = prefixAndIndex[1];\n if (typeof(index) == 'undefined') {\n return $empty;\n }\n }\n return $.djangoFormField(fieldName, prefix, index);\n };\n}\n\nif (typeof($.fn.filterDjangoField) != 'function') {\n var djRegexCache = {};\n $.fn.filterDjangoField = function(prefix, fieldName, index) {\n var $field, fieldNameData;\n if (typeof index != 'undefined') {\n if (typeof index == 'string') {\n index = parseInt(index, 10);\n }\n if (typeof index == 'number' && !isNaN(index)) {\n var fieldId = 'id_' + prefix + '-' + index + '-' + fieldName;\n $field = $('#' + fieldId);\n }\n } else {\n if (typeof(djRegexCache[prefix]) != 'object') {\n djRegexCache[prefix] = {};\n }\n if (typeof(djRegexCache[prefix][fieldName]) == 'undefined') {\n djRegexCache[prefix][fieldName] = new RegExp('^' + prefix + '-\\\\d+-' + fieldName + '$');\n } \n $field = this.find('input[name$=\"' + fieldName + '\"]').filter(function() {\n return this.getAttribute('name').match(djRegexCache[prefix][fieldName]);\n }); \n }\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n fieldNameData = $('#' + prefix + '-group').djnData('fieldNames') || {};\n if (typeof(fieldNameData[fieldName]) && fieldNameData[fieldName] != fieldName) {\n $field = $(this).filterDjangoField(prefix, fieldNameData[fieldName], index);\n }\n }\n return $field;\n };\n}\n","module.exports = window.django.jQuery;\n","'use strict';\n\nconst $ = require('jquery');\n/*!\n * jQuery UI Sortable @VERSION\n * http://jqueryui.com\n *\n * Copyright 2012 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/sortable/\n *\n * Depends:\n *\tjquery.ui.core.js\n *\tjquery.ui.mouse.js\n *\tjquery.ui.widget.js\n */\nif ($.ui === undefined) {\n var jQuery = $;\n (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return\"area\"===o?(s=t.parentNode,n=s.name,t.href&&n&&\"map\"===s.nodeName.toLowerCase()?(r=e(\"img[usemap=#\"+n+\"]\")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:\"a\"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return\"hidden\"===e.css(this,\"visibility\")}).length}var s=0,n=/^ui-id-\\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:\"1.10.3\",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return\"number\"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css(\"position\"))||/absolute/.test(this.css(\"position\"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,\"position\"))&&/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0),/fixed/.test(this.css(\"position\"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css(\"zIndex\",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css(\"position\"),(\"absolute\"===a||\"relative\"===a||\"fixed\"===a)&&(s=parseInt(n.css(\"zIndex\"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id=\"ui-id-\"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr(\"id\")})}}),e.extend(e.expr[\":\"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,\"tabindex\")))},tabbable:function(t){var a=e.attr(t,\"tabindex\"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e(\"\").outerWidth(1).jquery||e.each([\"Width\",\"Height\"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,\"padding\"+this))||0,a&&(i-=parseFloat(e.css(t,\"border\"+this+\"Width\"))||0),s&&(i-=parseFloat(e.css(t,\"margin\"+this))||0)}),i}var n=\"Width\"===a?[\"Left\",\"Right\"]:[\"Top\",\"Bottom\"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn[\"inner\"+a]=function(i){return i===t?o[\"inner\"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+\"px\")})},e.fn[\"outer\"+a]=function(t,i){return\"number\"!=typeof t?o[\"outer\"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+\"px\")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e(\"\").data(\"a-b\",\"a\").removeData(\"a-b\").data(\"a-b\")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart=\"onselectstart\"in document.createElement(\"div\"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?\"selectstart\":\"mousedown\")+\".ui-disableSelection\",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(\".ui-disableSelection\")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if(\"hidden\"===e(t).css(\"overflow\"))return!1;var a=i&&\"left\"===i?\"scrollLeft\":\"scrollTop\",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler(\"remove\")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(\".\")[0];i=i.split(\".\")[1],n=u+\"-\"+i,a||(a=s,s=e.Widget),e.expr[\":\"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+\".\"+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o=\"string\"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&\"_\"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error(\"no such method '\"+r+\"' for \"+i+\" widget instance\"):e.error(\"cannot call methods on \"+i+\" prior to initialization; \"+\"attempted to call method '\"+r+\"'\")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof i)if(o={},a=i.split(\".\"),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled ui-state-disabled\",!!t).attr(\"aria-disabled\",t),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")),this},enable:function(){return this._setOption(\"disabled\",!1)},disable:function(){return this._setOption(\"disabled\",!0)},_on:function(i,s,a){var n,r=this;\"boolean\"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?r[o]:o).apply(r,arguments):t}\"string\"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\\w+)\\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,a,n){\"string\"==typeof a&&(a={effect:a});var r,o=a?a===!0||\"number\"==typeof a?i:a.effect||i:t;a=a||{},\"number\"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget(\"ui.mouse\",{version:\"1.10.3\",options:{cancel:\"input,textarea,button,select,option\",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind(\"mousedown.\"+this.widgetName,function(e){return t._mouseDown(e)}).bind(\"click.\"+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+\".preventClickEvent\")?(e.removeData(i.target,t.widgetName+\".preventClickEvent\"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind(\".\"+this.widgetName),this._mouseMoveDelegate&&e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n=\"string\"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+\".preventClickEvent\")&&e.removeData(i.target,this.widgetName+\".preventClickEvent\"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).bind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+\".preventClickEvent\",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function s(t,i){return parseInt(e.css(t,i),10)||0}function a(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,o=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\\+\\-]\\d+(\\.[\\d]+)?%?/,d=/^\\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var i,s,a=e(\"
\"),r=a.children()[0];return e(\"body\").append(a),i=r.offsetWidth,a.css(\"overflow\",\"scroll\"),s=r.offsetWidth,i===s&&(s=a[0].clientWidth),a.remove(),n=i-s},getScrollInfo:function(t){var i=t.isWindow?\"\":t.element.css(\"overflow-x\"),s=t.isWindow?\"\":t.element.css(\"overflow-y\"),a=\"scroll\"===i||\"auto\"===i&&t.widths?\"left\":i>0?\"right\":\"center\",vertical:0>n?\"top\":a>0?\"bottom\":\"middle\"};c>p&&p>o(i+s)&&(h.horizontal=\"center\"),d>m&&m>o(a+n)&&(h.vertical=\"middle\"),h.important=r(o(i),o(s))>r(o(a),o(n))?\"horizontal\":\"vertical\",t.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,o=e.left-t.collisionPosition.marginLeft,h=a-o,l=o+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=r(e.left-o,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,o=e.top-t.collisionPosition.marginTop,h=a-o,l=o+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,r=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-r-h,d=\"left\"===t.my[0]?-t.elemWidth:\"right\"===t.my[0]?t.elemWidth:0,p=\"left\"===t.at[0]?t.targetWidth:\"right\"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-r-n,(0>i||o(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>o(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,r=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-r-h,d=\"top\"===t.my[1],p=d?-t.elemHeight:\"bottom\"===t.my[1]?t.elemHeight:0,f=\"top\"===t.at[1]?t.targetHeight:\"bottom\"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-r-n,e.top+p+f+m>u&&(0>s||o(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>c&&(i>0||c>o(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,n,r=document.getElementsByTagName(\"body\")[0],o=document.createElement(\"div\");t=document.createElement(r?\"div\":\"body\"),s={visibility:\"hidden\",width:0,height:0,border:0,margin:0,background:\"none\"},r&&e.extend(s,{position:\"absolute\",left:\"-1000px\",top:\"-1000px\"});for(n in s)t.style[n]=s[n];t.appendChild(o),i=r||document.documentElement,i.insertBefore(t,i.firstChild),o.style.cssText=\"position: absolute; left: 10.7432222px;\",a=e(o).offset().left,e.support.offsetFractions=a>10&&11>a,t.innerHTML=\"\",i.removeChild(t)}()})(jQuery);\n}\n\n$.widget(\"ui.djnsortable\", $.ui.mouse, {\n\tversion: \"@VERSION\",\n\twidgetEventPrefix: \"sort\",\n\tready: false,\n\toptions: {\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectWith: false,\n\t\tcontainment: false,\n\t\tcursor: 'auto',\n\t\tcursorAt: false,\n\t\tdropOnEmpty: true,\n\t\tforcePlaceholderSize: false,\n\t\tforceHelperSize: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\titems: '> *',\n\t\topacity: false,\n\t\tplaceholder: false,\n\t\trevert: false,\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tscope: \"default\",\n\t\ttolerance: \"intersect\",\n\t\tzIndex: 1000\n\t},\n\n\t_isOverAxis: function( x, reference, size ) {\n\t\treturn ( x >= reference ) && ( x < ( reference + size ) );\n\t},\n\n\t_create: function() {\n\n\t\tvar o = this.options;\n\t\tthis.containerCache = {};\n\t\tthis.element.addClass(\"ui-sortable\");\n\n\t\t//Get the items\n\t\tthis.refresh();\n\n\t\t//Let's determine if the items are being displayed horizontally\n\t\tthis.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;\n\n\t\t//Let's determine the parent's offset\n\t\tthis.offset = this.element.offset();\n\n\t\t//Initialize mouse events for interaction\n\t\tthis._mouseInit();\n\n\t\t//We're ready to go\n\t\tthis.ready = true\n\n\t},\n\n\t_destroy: function() {\n\t\tthis.element\n\t\t\t.removeClass(\"ui-sortable ui-sortable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\tfor ( var i = this.items.length - 1; i >= 0; i-- )\n\t\t\tthis.items[i].item.removeData(this.widgetName + \"-item\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value){\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.options[ key ] = value;\n\n\t\t\tthis.widget().toggleClass( \"ui-sortable-disabled\", !!value );\n\t\t} else {\n\t\t\t// Don't call widget base _setOption for disable as it adds ui-state-disabled class\n\t\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t\t}\n\t},\n\n\t_mouseCapture: function(event, overrideHandle) {\n\t\tvar that = this;\n\n\t\tif (this.reverting) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(this.options.disabled || this.options.type == 'static') return false;\n\n\t\t//We have to refresh the items data once first\n\t\tthis._refreshItems(event);\n\n\t\t//Find out if the clicked node (or one of its parents) is a actual item in this.items\n\t\tvar currentItem = null, nodes = $(event.target).parents().each(function() {\n\t\t\tif($.data(this, that.widgetName + '-item') == that) {\n\t\t\t\tcurrentItem = $(this);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);\n\n\t\tif(!currentItem) return false;\n\t\tif(this.options.handle && !overrideHandle) {\n\t\t\tvar validHandle = false;\n\t\t\tvar addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n\n\t\t\t$(this.options.handle, currentItem).find(\"*\")[addBackMethod]().each(function() { if(this == event.target) validHandle = true; });\n\t\t\tif(!validHandle) return false;\n\t\t}\n\n\t\tthis.currentItem = currentItem;\n\t\tthis._removeCurrentsFromItems();\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event, overrideHandle, noActivation) {\n\n\t\tvar o = this.options;\n\t\tthis.currentContainer = this;\n\n\t\t//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture\n\t\tthis.refreshPositions();\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Get the next scrolling parent\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.currentItem.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t// Only after we got the offset, we can change the helper's position to absolute\n\t\t// TODO: Still need to figure out a way to make relative sorting possible\n\t\tthis.helper.css(\"position\", \"absolute\");\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\n\t\t//Generate the original position\n\t\tthis.originalPosition = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Cache the former DOM position\n\t\tthis.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };\n\n\t\t//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way\n\t\tif(this.helper[0] != this.currentItem[0]) {\n\t\t\tthis.currentItem.hide();\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthis._createPlaceholder();\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\tif(o.cursor) { // cursor option\n\t\t\tif ($('body').css(\"cursor\")) this._storedCursor = $('body').css(\"cursor\");\n\t\t\t$('body').css(\"cursor\", o.cursor);\n\t\t}\n\n\t\tif(o.opacity) { // opacity option\n\t\t\tif (this.helper.css(\"opacity\")) this._storedOpacity = this.helper.css(\"opacity\");\n\t\t\tthis.helper.css(\"opacity\", o.opacity);\n\t\t}\n\n\t\tif(o.zIndex) { // zIndex option\n\t\t\tif (this.helper.css(\"zIndex\")) this._storedZIndex = this.helper.css(\"zIndex\");\n\t\t\tthis.helper.css(\"zIndex\", o.zIndex);\n\t\t}\n\n\t\t//Prepare scrolling\n\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')\n\t\t\tthis.overflowOffset = this.scrollParent.offset();\n\n\t\t//Call callbacks\n\t\tthis._trigger(\"start\", event, this._uiHash());\n\n\t\t//Recache the helper size\n\t\tif(!this._preserveHelperProportions)\n\t\t\tthis._cacheHelperProportions();\n\n\n\t\t//Post 'activate' events to possible containers\n\t\tif(!noActivation) {\n\t\t\t for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger(\"activate\", event, this._uiHash(this)); }\n\t\t}\n\n\t\t//Prepare possible droppables\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\tthis.dragging = true;\n\n\t\tthis.helper.addClass(\"ui-sortable-helper\");\n\t\tthis._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\treturn true;\n\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\tif (!this.lastPositionAbs) {\n\t\t\tthis.lastPositionAbs = this.positionAbs;\n\t\t}\n\n\t\t//Do scrolling\n\t\tif(this.options.scroll) {\n\t\t\tvar o = this.options, scrolled = false;\n\t\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {\n\n\t\t\t\tif((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n\n\t\t\t\tif((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n\n\t\t\t} else {\n\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\n\t\t\t}\n\n\t\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\t\t}\n\n\t\t//Regenerate the absolute position used for position checks\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Set the helper position\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\n\t\t//Rearrange\n\t\tfor (var i = this.items.length - 1; i >= 0; i--) {\n\n\t\t\t//Cache variables and intersection, continue if no intersection\n\t\t\tvar item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);\n\t\t\tif (!intersection) continue;\n\n\t\t\t// Only put the placeholder inside the current Container, skip all\n\t\t\t// items form other containers. This works because when moving\n\t\t\t// an item from one container to another the\n\t\t\t// currentContainer is switched before the placeholder is moved.\n\t\t\t//\n\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n\t\t\t// beetween the outer and inner container.\n\t\t\tif (item.instance !== this.currentContainer) continue;\n\n\t\t\tif (itemElement != this.currentItem[0] //cannot intersect with itself\n\t\t\t\t&&\tthis.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n\t\t\t\t&&\t!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n\t\t\t\t&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n\t\t\t\t//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container\n\t\t\t) {\n\n\t\t\t\tthis.direction = intersection == 1 ? \"down\" : \"up\";\n\n\t\t\t\tif (this.options.tolerance == \"pointer\" || this._intersectsWithSides(item)) {\n\t\t\t\t\tthis._rearrange(event, item);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Post events to containers\n\t\tthis._contactContainers(event);\n\n\t\t//Interconnect with droppables\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\t//Call callbacks\n\t\tthis._trigger('sort', event, this._uiHash());\n\n\t\tthis.lastPositionAbs = this.positionAbs;\n\t\treturn false;\n\n\t},\n\n\t_mouseStop: function(event, noPropagation) {\n\n\t\tif(!event) return;\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\t$.ui.ddmanager.drop(this, event);\n\n\t\tif(this.options.revert) {\n\t\t\tvar that = this;\n\t\t\tvar cur = this.placeholder.offset();\n\n\t\t\tthis.reverting = true;\n\n\t\t\t$(this.helper).animate({\n\t\t\t\tleft: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),\n\t\t\t\ttop: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)\n\t\t\t}, parseInt(this.options.revert, 10) || 500, function() {\n\t\t\t\tthat._clear(event);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._clear(event, noPropagation);\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tcancel: function() {\n\n\t\tif(this.dragging) {\n\n\t\t\tthis._mouseUp({ target: null });\n\n\t\t\tif(this.options.helper == \"original\")\n\t\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t\telse\n\t\t\t\tthis.currentItem.show();\n\n\t\t\t//Post deactivating events to containers\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tthis.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.placeholder) {\n\t\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\t\tif(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\t\t\tif(this.options.helper != \"original\" && this.helper && this.helper[0].parentNode) this.helper.remove();\n\n\t\t\t$.extend(this, {\n\t\t\t\thelper: null,\n\t\t\t\tdragging: false,\n\t\t\t\treverting: false,\n\t\t\t\t_noFinalSort: null\n\t\t\t});\n\n\t\t\tif(this.domPosition.prev) {\n\t\t\t\t$(this.domPosition.prev).after(this.currentItem);\n\t\t\t} else {\n\t\t\t\t$(this.domPosition.parent).prepend(this.currentItem);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tserialize: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar str = []; o = o || {};\n\n\t\t$(items).each(function() {\n\t\t\tvar res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));\n\t\t\tif(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));\n\t\t});\n\n\t\tif(!str.length && o.key) {\n\t\t\tstr.push(o.key + '=');\n\t\t}\n\n\t\treturn str.join('&');\n\n\t},\n\n\ttoArray: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar ret = []; o = o || {};\n\n\t\titems.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });\n\t\treturn ret;\n\n\t},\n\n\t/* Be careful with the following core functions */\n\t_intersectsWith: function(item) {\n\n\t\tvar x1 = this.positionAbs.left,\n\t\t\tx2 = x1 + this.helperProportions.width,\n\t\t\ty1 = this.positionAbs.top,\n\t\t\ty2 = y1 + this.helperProportions.height;\n\n\t\tvar l = item.left,\n\t\t\tr = l + item.width,\n\t\t\tt = item.top,\n\t\t\tb = t + Math.max(10, item.height);\n\n\t\tvar dyClick = this.offset.click.top,\n\t\t\tdxClick = this.offset.click.left;\n\n\t\tvar isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;\n\n\t\tif(\t this.options.tolerance == \"pointer\"\n\t\t\t|| this.options.forcePointerForContainers\n\t\t\t|| (this.options.tolerance != \"pointer\" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])\n\t\t) {\n\t\t\treturn isOverElement;\n\t\t} else {\n\n\t\t\treturn (l < x1 + (this.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (this.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (this.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (this.helperProportions.height / 2) < b ); // Top Half\n\n\t\t}\n\t},\n\n\t_intersectsWithPointer: function(item) {\n\n\t\tvar isOverElementHeight = (this.options.axis === 'x') || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, Math.max(10, item.height)),\n\t\t\tisOverElementWidth = (this.options.axis === 'y') || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n\t\t\tisOverElement = isOverElementHeight && isOverElementWidth,\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (!isOverElement)\n\t\t\treturn false;\n\n\t\treturn this.floating ?\n\t\t\t( ((horizontalDirection && horizontalDirection == \"right\") || verticalDirection == \"down\") ? 2 : 1 )\n\t\t\t: ( verticalDirection && (verticalDirection == \"down\" ? 2 : 1) );\n\n\t},\n\n\t_intersectsWithSides: function(item) {\n\n\t\tvar isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (Math.max(10, item.height)/2), Math.max(10, item.height)),\n\t\t\tisOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (this.floating && horizontalDirection) {\n\t\t\treturn ((horizontalDirection == \"right\" && isOverRightHalf) || (horizontalDirection == \"left\" && !isOverRightHalf));\n\t\t} else {\n\t\t\treturn verticalDirection && ((verticalDirection == \"down\" && isOverBottomHalf) || (verticalDirection == \"up\" && !isOverBottomHalf));\n\t\t}\n\n\t},\n\n\t_getDragVerticalDirection: function() {\n\t\tvar delta = this.positionAbs.top - this.lastPositionAbs.top;\n\t\treturn delta != 0 && (delta > 0 ? \"down\" : \"up\");\n\t},\n\n\t_getDragHorizontalDirection: function() {\n\t\tvar delta = this.positionAbs.left - this.lastPositionAbs.left;\n\t\treturn delta != 0 && (delta > 0 ? \"right\" : \"left\");\n\t},\n\n\trefresh: function(event) {\n\t\tthis._refreshItems(event);\n\t\tthis.refreshPositions();\n\t\treturn this;\n\t},\n\n\t_connectWith: function() {\n\t\tvar options = this.options;\n\t\treturn options.connectWith.constructor == String\n\t\t\t? [options.connectWith]\n\t\t\t: options.connectWith;\n\t},\n\n\t_getItemsAsjQuery: function(connected) {\n\n\t\tvar items = [];\n\t\tvar queries = [];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && connected) {\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), inst]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tqueries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), this]);\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--){\n\t\t\tqueries[i][0].each(function() {\n\t\t\t\titems.push(this);\n\t\t\t});\n\t\t};\n\n\t\treturn $(items);\n\n\t},\n\n\t_removeCurrentsFromItems: function() {\n\n\t\tvar list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n\n\t\tthis.items = $.grep(this.items, function (item) {\n\t\t\tfor (var j=0; j < list.length; j++) {\n\t\t\t\tif(list[j] == item.item[0])\n\t\t\t\t\treturn false;\n\t\t\t};\n\t\t\treturn true;\n\t\t});\n\n\t},\n\n\t_refreshItems: function(event) {\n\n\t\tthis.items = [];\n\t\tthis.containers = [this];\n\t\tvar items = this.items;\n\t\tvar queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);\n\t\t\t\t\t\tthis.containers.push(inst);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--) {\n\t\t\tvar targetData = queries[i][1];\n\t\t\tvar _queries = queries[i][0];\n\n\t\t\tfor (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {\n\t\t\t\tvar item = $(_queries[j]);\n\n\t\t\t\titem.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)\n\n\t\t\t\titems.push({\n\t\t\t\t\titem: item,\n\t\t\t\t\tinstance: targetData,\n\t\t\t\t\twidth: 0, height: 0,\n\t\t\t\t\tleft: 0, top: 0\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t},\n\n\trefreshPositions: function(fast) {\n\n\t\t//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change\n\t\tif(this.offsetParent && this.helper) {\n\t\t\tthis.offset.parent = this._getParentOffset();\n\t\t}\n\n\t\tfor (var i = this.items.length - 1; i >= 0; i--){\n\t\t\tvar item = this.items[i];\n\n\t\t\t//We ignore calculating positions of all connected containers when we're not over them\n\t\t\tif(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])\n\t\t\t\tcontinue;\n\n\t\t\tvar t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n\t\t\tif (!fast) {\n\t\t\t\titem.width = t.outerWidth();\n\t\t\t\titem.height = t.outerHeight();\n\t\t\t}\n\n\t\t\tvar p = t.offset();\n\t\t\titem.left = p.left;\n\t\t\titem.top = p.top;\n\t\t};\n\n\t\tif(this.options.custom && this.options.custom.refreshContainers) {\n\t\t\tthis.options.custom.refreshContainers.call(this);\n\t\t} else {\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tvar p = this.containers[i].element.offset();\n\t\t\t\tthis.containers[i].containerCache.left = p.left;\n\t\t\t\tthis.containers[i].containerCache.top = p.top;\n\t\t\t\tthis.containers[i].containerCache.width\t= this.containers[i].element.outerWidth();\n\t\t\t\tthis.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_createPlaceholder: function(that) {\n\t\tthat = that || this;\n\t\tvar o = that.options;\n\n\t\tif(!o.placeholder || o.placeholder.constructor == String) {\n\t\t\tvar className = o.placeholder;\n\t\t\to.placeholder = {\n\t\t\t\telement: function() {\n\n\t\t\t\t\tvar el = $(document.createElement(that.currentItem[0].nodeName))\n\t\t\t\t\t\t.addClass(className || that.currentItem[0].className+\" ui-sortable-placeholder\")\n\t\t\t\t\t\t.removeClass(\"ui-sortable-helper\")[0];\n\n\t\t\t\t\tif(!className)\n\t\t\t\t\t\tel.style.visibility = \"hidden\";\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tupdate: function(container, p) {\n\n\t\t\t\t\t// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that\n\t\t\t\t\t// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified\n\t\t\t\t\tif(className && !o.forcePlaceholderSize) return;\n\n\t\t\t\t\t//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item\n\t\t\t\t\tif(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };\n\t\t\t\t\tif(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthat.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));\n\n\t\t//Append it after the actual current item\n\t\tthat.currentItem.after(that.placeholder);\n\n\t\t//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\t\to.placeholder.update(that, that.placeholder);\n\n\t},\n\n\t_contactContainers: function(event) {\n\n\t\t// get innermost container that intersects with item\n\t\tvar innermostContainer = null, innermostIndex = null;\n\n\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\n\t\t\t// never consider a container that's located within the item itself\n\t\t\tif($.contains(this.currentItem[0], this.containers[i].element[0]))\n\t\t\t\tcontinue;\n\n\t\t\tif(this._intersectsWith(this.containers[i].containerCache)) {\n\n\t\t\t\t// if we've already found a container and it's more \"inner\" than this, then continue\n\t\t\t\tif(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tinnermostContainer = this.containers[i];\n\t\t\t\tinnermostIndex = i;\n\n\t\t\t} else {\n\t\t\t\t// container doesn't intersect. trigger \"out\" event if necessary\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// if no intersecting containers found, return\n\t\tif(!innermostContainer) return;\n\n\t\t// move the item into the container if it's not there already\n\t\tif(this.containers.length === 1) {\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} else {\n\n\t\t\t//When entering a new container, we will find the item with the least distance and append our item near it\n\t\t\tvar dist = 10000; var itemWithLeastDistance = null;\n\t\t\tvar posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';\n\t\t\tvar sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';\n\t\t\tvar base = this.positionAbs[posProperty] + this.offset.click[posProperty];\n\t\t\tfor (var j = this.items.length - 1; j >= 0; j--) {\n\t\t\t\tif(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;\n\t\t\t\tif(this.items[j].item[0] == this.currentItem[0]) continue;\n\t\t\t\tvar cur = this.items[j].item.offset()[posProperty];\n\t\t\t\tvar nearBottom = false;\n\t\t\t\tif(Math.abs(cur - base) > Math.abs(cur + Math.max(10, this.items[j][sizeProperty]) - base)){\n\t\t\t\t\tnearBottom = true;\n\t\t\t\t\tcur += this.items[j][sizeProperty];\n\t\t\t\t}\n\n\t\t\t\tif(Math.abs(cur - base) < dist) {\n\t\t\t\t\tdist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];\n\t\t\t\t\tthis.direction = nearBottom ? \"up\": \"down\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\n\t\t\t\treturn;\n\n\t\t\tthis.currentContainer = this.containers[innermostIndex];\n\t\t\titemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\tthis.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n\t\t\t//Update the placeholder\n\t\t\tthis.options.placeholder.update(this.currentContainer, this.placeholder);\n\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t}\n\n\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);\n\n\t\tif(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already\n\t\t\t$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n\n\t\tif(helper[0] == this.currentItem[0])\n\t\t\tthis._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") };\n\n\t\tif(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());\n\t\tif(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.currentItem.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.currentItem.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.currentItem.css(\"marginTop\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\t0 - this.offset.relative.left - this.offset.parent.left,\n\t\t\t0 - this.offset.relative.top - this.offset.parent.top,\n\t\t\t$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment)) {\n\t\t\tvar ce = $(o.containment)[0];\n\t\t\tvar co = $(o.containment).offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\tco.left + (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0) - this.margins.left,\n\t\t\t\tco.top + (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0) - this.margins.top,\n\t\t\t\tco.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left,\n\t\t\t\tco.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top\n\t\t\t];\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\t// This is another very weird special case that only happens for relative elements:\n\t\t// 1. If the css position is relative\n\t\t// 2. and the scroll parent is the document or similar to the offset parent\n\t\t// we have to refresh the relative offset during the scroll so there are no jumps\n\t\tif(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {\n\t\t\tthis.offset.relative = this._getRelativeOffset();\n\t\t}\n\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\n\t\t\tif(this.containment) {\n\t\t\t\tif(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\tvar top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n\t\t\t\tpageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n\t\t\t\tpageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_rearrange: function(event, i, a, hardRefresh) {\n\n\t\ta ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));\n\n\t\t//Various things done here to improve the performance:\n\t\t// 1. we create a setTimeout, that calls refreshPositions\n\t\t// 2. on the instance, we have a counter variable, that get's higher after every append\n\t\t// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n\t\t// 4. this lets only the last addition to the timeout stack through\n\t\tthis.counter = this.counter ? ++this.counter : 1;\n\t\tvar counter = this.counter;\n\n\t\tthis._delay(function() {\n\t\t\tif(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n\t\t});\n\n\t},\n\n\t_clear: function(event, noPropagation) {\n\n\t\tthis.reverting = false;\n\t\t// We delay all events that have to be triggered to after the point where the placeholder has been removed and\n\t\t// everything else normalized again\n\t\tvar delayedTriggers = [];\n\n\t\t// We first have to update the dom position of the actual currentItem\n\t\t// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)\n\t\tif(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);\n\t\tthis._noFinalSort = null;\n\n\t\tif(this.helper[0] == this.currentItem[0]) {\n\t\t\tfor(var i in this._storedCSS) {\n\t\t\t\tif(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';\n\t\t\t}\n\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t} else {\n\t\t\tthis.currentItem.show();\n\t\t}\n\n\t\tif(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"receive\", event, this._uiHash(this.fromOutside)); });\n\t\tif((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"update\", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed\n\n\t\t// Check if the items Container has Changed and trigger appropriate\n\t\t// events.\n\t\tif (this !== this.currentContainer) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tdelayedTriggers.push(function(event) { this._trigger(\"remove\", event, this._uiHash()); });\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"receive\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"update\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t}\n\t\t}\n\n\n\t\t//Post events to containers\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\tif(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger(\"deactivate\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"out\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t}\n\t\t}\n\n\t\t//Do what was originally in plugins\n\t\tif(this._storedCursor) $('body').css(\"cursor\", this._storedCursor); //Reset cursor\n\t\tif(this._storedOpacity) this.helper.css(\"opacity\", this._storedOpacity); //Reset opacity\n\t\tif(this._storedZIndex) this.helper.css(\"zIndex\", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index\n\n\t\tthis.dragging = false;\n\t\tif(this.cancelHelperRemoval) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tthis._trigger(\"beforeStop\", event, this._uiHash());\n\t\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t\t}\n\n\t\t\tthis.fromOutside = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!noPropagation) this._trigger(\"beforeStop\", event, this._uiHash());\n\n\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\tthis.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n\t\tif(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;\n\n\t\tif(!noPropagation) {\n\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t}\n\n\t\tthis.fromOutside = false;\n\t\treturn true;\n\n\t},\n\n\t_trigger: function() {\n\t\tif ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n\t\t\tthis.cancel();\n\t\t}\n\t},\n\n _delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_uiHash: function(_inst) {\n\t\tvar inst = _inst || this;\n\t\treturn {\n\t\t\thelper: inst.helper,\n\t\t\tplaceholder: inst.placeholder || $([]),\n\t\t\tposition: inst.position,\n\t\t\toriginalPosition: inst.originalPosition,\n\t\t\toffset: inst.positionAbs,\n\t\t\titem: inst.currentItem,\n\t\t\tsender: _inst ? _inst.element : null\n\t\t};\n\t}\n\n});\n","'use strict';\n\nconst $ = require('jquery');\nrequire('./jquery.ui.djnsortable');\n\n/*\n * jQuery UI Nested Sortable\n * v 1.3.4 / 28 apr 2011\n * http://mjsarfatti.com/sandbox/nestedSortable\n *\n * Depends:\n * jquery.ui.sortable.js 1.8+\n *\n * License CC BY-SA 3.0\n * Copyright 2010-2011, Manuele J Sarfatti\n */\nif (typeof $.fn.nearest != 'function') {\n /**\n * Returns the descendant(s) matching a given selector which are the\n * shortest distance from the search context element (in otherwords,\n * $.fn.closest(), in reverse).\n */\n $.fn.nearest = function(selector) {\n var nearest = [], node = this, distance = 10000;\n node.find(selector).each(function(){\n var d = $(this).parentsUntil(node).length;\n if (d < distance) {\n distance = d;\n nearest = [this];\n } else if (d == distance) {\n nearest.push(this);\n }\n });\n return this.pushStack(nearest, 'nearest', [selector]);\n };\n}\n\nvar counter = 0;\nvar expando = \"djn\" + (\"\" + Math.random()).replace(/\\D/g, \"\");\n\nvar createChildNestedSortable = function(parent, childContainer) {\n // Don't continue if the new element is the same as the old\n if (parent && parent.element && parent.element[0] == childContainer) {\n return;\n }\n var $childContainer = $(childContainer),\n options = $.extend({}, parent.options);\n options.connectWith = [parent.element];\n\n if ($childContainer.data(parent.widgetName)) {\n return;\n }\n\n var widgetConstructor = $childContainer[parent.widgetName];\n widgetConstructor.call($childContainer, options);\n var newInstance = $childContainer.data(parent.widgetName);\n for (var i = 0; i < parent.options.connectWith.length; i++) {\n var $otherContainer = parent.options.connectWith[i];\n newInstance.addToConnectWith($otherContainer);\n var otherInstance = $otherContainer.data(parent.widgetName);\n if (otherInstance) {\n otherInstance.addToConnectWith($childContainer);\n }\n }\n parent.addToConnectWith($childContainer);\n return newInstance;\n};\n\n$.widget(\"ui.nestedSortable\", $.ui.djnsortable, {\n\n options: {\n tabSize: 20,\n disableNesting: 'ui-nestedSortable-no-nesting',\n errorClass: 'ui-nestedSortable-error',\n nestedContainerSelector: ':not(*)',\n // Whether to clear empty list item and container elements\n doNotClear: false,\n /**\n * Create a list container element if the draggable was dragged\n * to the top or bottom of the elements at its level.\n *\n * @param DOMElement parent - The element relative to which the\n * new element will be inserted.\n * @return DOMElement - The new element.\n */\n createContainerElement: function(parent) {\n return $(document.createElement('ol'));\n },\n // Selector which matches all container elements in the nestedSortable\n containerElementSelector: 'ol',\n // Selector which matches all list items (draggables) in the nestedSortable\n listItemSelector: 'li',\n // Selector which, when applied to a container, returns its child list items\n items: '> li',\n maxLevels: 0,\n revertOnError: 1,\n protectRoot: false,\n rootID: null,\n rtl: false,\n // if true, you can not move nodes to different levels of nesting\n fixedNestingDepth: false,\n // show the error div or just not show a drop area\n showErrorDiv: true,\n // if true only allows you to rearrange within its parent container\n keepInParent: false,\n isAllowed: function(item, parent) { return true; },\n canConnectWith: function(container1, container2, instance) {\n var model1 = container1.data('inlineModel');\n var model2 = container2.data('inlineModel');\n if (model1 !== model2) {\n return false;\n }\n var instance2 = container2.data(instance.widgetName);\n if (!instance.options.fixedNestingDepth) {\n if (!instance2 || !instance2.options.fixedNestingDepth) {\n return true;\n }\n }\n var container1Level = instance._getLevel(container1);\n var container2Level = instance._getLevel(container2);\n return (container1Level === container2Level);\n }\n },\n\n _createWidget: function(options, element) {\n var $element = $( element || this.defaultElement || this ),\n dataOptions = $element.data('djnsortableOptions');\n element = $element[0];\n if (dataOptions) {\n options = $.extend({}, options, dataOptions);\n }\n return $.ui.djnsortable.prototype._createWidget.call(this, options, element);\n },\n\n _create: function() {\n if (this.element.data('uiNestedSortable')) {\n this.element.data('nestedSortable', this.element.data('uiNestedSortable'));\n }\n if (this.element.data('ui-nestedSortable')) {\n this.element.data('nestedSortable', this.element.data('ui-nestedSortable'));\n }\n this.element.data('djnsortable', this.element.data('nestedSortable'));\n if (this.element.data('uiNestedSortable')) {\n this.element.data('uiSortable', this.element.data('nestedSortable'));\n }\n // if (!this.element.is(this.options.containerElementSelector)) {\n // throw new Error('nestedSortable: Please check that the ' +\n // 'containerElementSelector option matches ' +\n // 'the element passed to the constructor.');\n // }\n\n $.ui.djnsortable.prototype._create.apply(this, arguments);\n\n this._connectWithMap = {};\n\n var self = this,\n o = this.options,\n $document = $(document);\n\n var originalConnectWith = o.connectWith;\n if (!originalConnectWith || typeof(originalConnectWith) == 'string') {\n this.options.connectWith = [];\n if (typeof(originalConnectWith) == 'string') {\n var connected = this._connectWith();\n for (var i = 0; i < connected.length; i++) {\n this.addToConnectWith($(connected[i]));\n }\n }\n\n // HACK!! FIX!! (django-specific logic)\n $document.on('djnesting:init.nestedSortable', o.containerElementSelector, function(event) {\n createChildNestedSortable(self, this);\n });\n this.element.find(o.containerElementSelector+':not(.subarticle-wrapper)').each(function(i, el) {\n if ($(el).closest('[data-inline-formset]').attr('id').indexOf('-empty') > -1) {\n return;\n }\n createChildNestedSortable(self, el);\n });\n }\n $document.trigger('nestedSortable:created', [this]);\n $document.on('nestedSortable:created.nestedSortable', function(e, instance) {\n instance.addToConnectWith(self.element);\n self.addToConnectWith(instance.element);\n });\n },\n\n addToConnectWith: function(element) {\n var self = this,\n $element = (typeof(element.selector) != 'undefined') ? element : $(element),\n uniqueId;\n\n if ($element.length > 1) {\n $element.each(function(i, el) {\n self.addToConnectWith($(el));\n });\n return;\n }\n uniqueId = element[0][expando];\n if (typeof uniqueId == 'undefined') {\n uniqueId = element[0][expando] = ++counter;\n }\n if (typeof this.options.connectWith == 'string') {\n return;\n }\n if (this._connectWithMap[uniqueId]) {\n return;\n }\n this.options.connectWith.push(element);\n this._connectWithMap[uniqueId] = 1;\n },\n\n _destroy: function() {\n this.element\n .removeData(\"nestedSortable\")\n .unbind(\".nestedSortable\");\n $(document).unbind('.nestedSortable');\n return $.ui.djnsortable.prototype.destroy.apply(this, arguments);\n },\n\n /**\n * Override this method to add extra conditions on an item before it's\n * rearranged.\n */\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var itemElement = item.item[0], o = this.options,\n intersection = $.ui.djnsortable.prototype._intersectsWithPointer.apply(this, arguments);\n\n this.lastItemElement = null;\n if (!intersection) {\n return intersection;\n }\n\n // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n // between the outer and inner container.\n if (item.instance !== this.currentContainer) {\n return false;\n }\n var $itemElement = $(itemElement);\n\n if (o.fixedNestingDepth && this._getLevel(this.currentItem) === 1+this._getLevel($itemElement)) {\n $itemElement = (function() {\n var containerSel = o.containerElementSelector;\n var $childItems = $itemElement.find('.djn-item');\n if ($childItems.length != 1) {\n return $itemElement;\n }\n if (!$childItems.is('.djn-no-drag,.djn-thead')) {\n return $itemElement;\n }\n var itemElementClosestContainer = $itemElement.closest(containerSel);\n if (!itemElementClosestContainer.length) {\n return $itemElement;\n }\n // Make sure the item is only one level deeper\n if (itemElementClosestContainer[0] != $childItems.closest(containerSel).closest(containerSel)[0]) {\n return $itemElement;\n }\n return $($childItems[0]);\n })();\n itemElement = $itemElement[0];\n }\n\n if (itemElement != this.currentItem[0] //cannot intersect with itself\n && this.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n && (!o.keepInParent || itemElement.parentNode == this.placeholder[0].parentNode) //only rearrange items within the same container\n && (!o.fixedNestingDepth || (this._getLevel(this.currentItem) === this._getLevel($itemElement))) //maintain the nesting level of node\n && (o.showErrorDiv || o.isAllowed.call(this, this.currentItem[0], itemElement.parentNode, this.placeholder))\n ) {\n this.lastItemElement = itemElement;\n return intersection;\n } else {\n return false;\n }\n },\n\n // This method is called after items have been iterated through.\n // Overriding this is cleaner than copying and pasting _mouseDrag()\n // and inserting logic in the middle.\n _contactContainers: function _contactContainers(event) {\n if (this.lastItemElement) {\n this._clearEmpty(this.lastItemElement);\n }\n\n\n var o = this.options,\n _parentItem = this.placeholder.closest(o.listItemSelector),\n parentItem = (_parentItem.length && _parentItem.closest('.ui-sortable').length)\n ? _parentItem\n : null,\n level = this._getLevel(this.placeholder),\n childLevels = this._getChildLevels(this.helper);\n\n var placeholderClassName = this.placeholder.attr('class');\n var phClassSearch = \" \" + placeholderClassName + \" \";\n // If the current level class isn't already set\n if (phClassSearch.indexOf(\" ui-sortable-nested-level-\" + level + \" \") == -1) {\n var phOrigClassName;\n // Check if another level class is set\n var phOrigClassNameEndPos = phClassSearch.indexOf(\" ui-sortable-nested-level-\") - 1;\n if (phOrigClassNameEndPos > -1) {\n phOrigClassName = placeholderClassName.substring(0, phOrigClassNameEndPos);\n } else {\n phOrigClassName = placeholderClassName;\n }\n // Add new level to class\n this.placeholder.attr('class', phOrigClassName + ' ui-sortable-nested-level-' + level);\n }\n\n // To find the previous sibling in the list, keep backtracking until we hit a valid list item.\n var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;\n if (previousItem != null) {\n while (!previousItem.is(this.options.listItemSelector) || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {\n if (previousItem[0].previousSibling) {\n previousItem = $(previousItem[0].previousSibling);\n } else {\n previousItem = null;\n break;\n }\n }\n }\n // To find the next sibling in the list, keep stepping forward until we hit a valid list item.\n var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;\n if (nextItem != null) {\n while (!nextItem.is(this.options.listItemSelector) || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {\n if (nextItem[0].nextSibling) {\n nextItem = $(nextItem[0].nextSibling);\n } else {\n nextItem = null;\n break;\n }\n }\n }\n\n this.beyondMaxLevels = 0;\n\n // We will change this to the instance of the nested container if\n // appropriate, so that the appropriate context is applied to the\n // super _contactContainers prototype method\n var containerInstance = this;\n this.refreshPositions();\n\n // If the item is moved to the left, send it to its parent's level unless there are siblings below it.\n if (!o.fixedNestingDepth && parentItem != null && nextItem == null &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||\n !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {\n parentItem.after(this.placeholder[0]);\n containerInstance = parentItem.closest(o.containerElementSelector).data(this.widgetName) || containerInstance;\n this._clearEmpty(parentItem[0]);\n this.refreshPositions();\n this._trigger(\"change\", event, this._uiHash());\n }\n // If the item is below a sibling and is moved to the right, make it a child of that sibling.\n else if (!o.fixedNestingDepth && previousItem != null && !previousItem.is('.djn-no-drag,.djn-thead') &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||\n !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {\n this._isAllowed(previousItem, level, level+childLevels);\n\n if (this.beyondMaxLevels > 0) {\n return $.ui.djnsortable.prototype._contactContainers.apply(this, arguments);\n }\n var $previousItemChildContainer;\n $previousItemChildContainer = previousItem.nearest(o.containerElementSelector).first();\n\n if (!$previousItemChildContainer.length && !previousItem.closest(o.nestedContainerSelector).length) {\n $previousItemChildContainer = this.options.createContainerElement(previousItem[0]);\n previousItem.append($previousItemChildContainer);\n }\n if ($previousItemChildContainer.length) {\n $previousItemChildContainer.append(this.placeholder);\n containerInstance = $previousItemChildContainer.data(this.widgetName);\n if (!containerInstance) {\n containerInstance = createChildNestedSortable(this, $previousItemChildContainer[0]);\n }\n this.refreshPositions();\n }\n this._trigger(\"change\", event, this._uiHash());\n }\n else {\n this._isAllowed(parentItem, level, level+childLevels);\n }\n\n $.ui.djnsortable.prototype._contactContainers.call(this, event);\n },\n\n _rearrange: function _rearrange(event, item, a, hardRefresh) {\n // Cache the rearranged element for the call to _clear()\n var o = this.options;\n if (item && typeof item == 'object' && item.item) {\n this.lastRearrangedElement = item.item[0];\n }\n if (item && typeof(item) == 'object' && item.item && this.placeholder.closest(o.nestedContainerSelector).length) {\n // This means we have been dropped into a nested container down a level\n // from the parent.\n var placeholderParentItem = this.placeholder.closest(o.listItemSelector);\n var comparisonElement = (this.direction == 'down')\n ? placeholderParentItem.next(o.nestedContainerSelector)\n : placeholderParentItem;\n if (comparisonElement.length && comparisonElement[0] == item.item[0]) {\n //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function() {\n if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n });\n // The super method will pop the container out of its nested container,\n // which we don't want.\n return;\n }\n }\n $.ui.djnsortable.prototype._rearrange.apply(this, arguments);\n },\n\n _convertPositionTo: function(d, pos) {\n // Cache the top offset before rearrangement\n this.previousTopOffset = this.placeholder.offset().top;\n return $.ui.djnsortable.prototype._convertPositionTo.apply(this, arguments);\n },\n\n _clear: function() {\n $.ui.djnsortable.prototype._clear.apply(this, arguments);\n // If lastRearrangedElement exists and is still attached to the document\n // (i.e., hasn't been removed)\n if (typeof this.lastRearrangedElement == 'object' && this.lastRearrangedElement.ownerDocument) {\n this._clearEmpty(this.lastRearrangedElement);\n }\n },\n\n _mouseStop: function _mouseStop(event, noPropagation) {\n // If the item is in a position not allowed, send it back\n if (this.beyondMaxLevels) {\n this.placeholder.removeClass(this.options.errorClass);\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.placeholder);\n } else {\n $(this.domPosition.parent).prepend(this.placeholder);\n }\n this._trigger(\"revert\", event, this._uiHash());\n\n }\n\n // Clean last empty container/list item\n for (var i = this.items.length - 1; i >= 0; i--) {\n var item = this.items[i].item[0];\n this._clearEmpty(item);\n }\n\n $.ui.djnsortable.prototype._mouseStop.apply(this, arguments);\n },\n\n toArray: function(o) {\n\n o = $.extend(true, {}, this.options, o || {});\n\n var sDepth = o.startDepthCount || 0,\n ret = [],\n left = 2;\n\n ret.push({\n \"item_id\": o.rootID,\n \"parent_id\": 'none',\n \"depth\": sDepth,\n \"left\": '1',\n \"right\": ($(o.listItemSelector, this.element).length + 1) * 2\n });\n\n var _recursiveArray = function(item, depth, left) {\n var right = left + 1,\n id,\n pid;\n\n var $childItems = $(item).children(o.containerElementSelector).find(o.items);\n\n if ($childItems.length > 0) {\n depth ++;\n $childItems.each(function () {\n right = _recursiveArray($(this), depth, right);\n });\n depth --;\n }\n\n id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));\n\n if (depth === sDepth + 1) {\n pid = o.rootID;\n } else {\n var parentItem = ($(item).parent(o.containerElementSelector)\n .parent(o.items)\n .attr(o.attribute || 'id'))\n .match(o.expression || (/(.+)[-=_](.+)/));\n pid = parentItem[2];\n }\n\n if (id) {\n ret.push({\"item_id\": id[2], \"parent_id\": pid, \"depth\": depth, \"left\": left, \"right\": right});\n }\n\n left = right + 1;\n return left;\n };\n\n $(this.element).children(o.listItemSelector).each(function () {\n left = _recursiveArray(this, sDepth + 1, left);\n });\n\n ret = ret.sort(function(a,b){ return (a.left - b.left); });\n\n return ret;\n },\n\n _clearEmpty: function(item) {\n if (this.options.doNotClear) {\n return;\n }\n var $item = $(item);\n var childContainers = $item.nearest(this.options.containerElementSelector);\n childContainers.each(function(i, childContainer) {\n var $childContainer = $(childContainer);\n if (!$childContainer.children().length) {\n var instance = $childContainer.data(this.widgetName);\n if (typeof(instance) == 'object' && instance.destroy) {\n instance.destroy();\n }\n $childContainer.remove();\n }\n });\n if (!$item.children().length) {\n $item.remove();\n }\n },\n\n _getLevel: function(item) {\n\n var level = 1,\n o = this.options, list;\n\n if (o.containerElementSelector) {\n list = item.closest(o.containerElementSelector);\n while (list && list.length > 0 && !list.parent().is('.djn-group-root')) {\n // if (!list.is(o.nestedContainerSelector)) {\n level++;\n // }\n list = list.parent().closest(o.containerElementSelector);\n }\n }\n\n return level;\n },\n\n _getChildLevels: function(parent, depth) {\n var self = this,\n o = this.options,\n result = 0;\n depth = depth || 0;\n\n $(parent).nearest(o.containerElementSelector).first().find(o.items).each(function (index, child) {\n if ($(child).is('.djn-no-drag,.djn-thead')) {\n return;\n }\n result = Math.max(self._getChildLevels(child, depth + 1), result);\n });\n\n return depth ? result + 1 : result;\n },\n\n _isAllowed: function _isAllowed(parentItem, level, levels) {\n var o = this.options,\n isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false;\n // this takes into account the maxLevels set to the recipient list\n // var maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels');\n var maxLevels = o.maxLevels;\n\n // Is the root protected?\n // Are we trying to nest under a no-nest?\n // Are we nesting too deep?\n if (parentItem && typeof(parentItem) == 'object' && typeof(parentItem.selector) == 'undefined') {\n parentItem = $(parentItem);\n }\n\n if (!o.isAllowed.call(this, this.currentItem, parentItem, this.placeholder) ||\n parentItem && parentItem.hasClass(o.disableNesting) ||\n o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {\n this.placeholder.addClass(o.errorClass);\n if (maxLevels < levels && maxLevels != 0) {\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.beyondMaxLevels = 1;\n }\n } else {\n if (maxLevels < levels && maxLevels != 0) {\n this.placeholder.addClass(o.errorClass);\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.placeholder.removeClass(o.errorClass);\n this.beyondMaxLevels = 0;\n }\n }\n },\n\n _connectWith: function _connectWith() {\n var origConnectWith = $.ui.djnsortable.prototype._connectWith.apply(this, arguments),\n connectWith = [];\n var self = this;\n for (var i = 0; i < origConnectWith.length; i++) {\n var $elements = $(origConnectWith[i]);\n $elements.each(function(j, el) {\n if (el == self.element[0]) {\n return;\n }\n if (!self.options.canConnectWith(self.element, $(el), self)) {\n return;\n }\n connectWith.push(el);\n });\n }\n return connectWith;\n },\n _removeCurrentsFromItems: function() {\n var list = this.currentItem.find(\":data(sortable-item)\");\n for (var i=0; i < this.items.length; i++) {\n for (var j=0; j < list.length; j++) {\n if (list[j] == this.items[i].item[0]) {\n this.items.splice(i, 1);\n if (i >= this.items.length) {\n break;\n }\n }\n }\n }\n },\n createContainerElement: function(parent) {\n if (!parent.childNodes) {\n throw new Error(\"Invalid element 'parent' passed to \" +\n \"createContainerElement.\");\n }\n var newContainer = this.options.createContainerElement.apply(this, arguments);\n parent.appendChild(newContainer[0]);\n return $(newContainer);\n }\n});\n\n$.ui.nestedSortable.prototype.options = $.extend({}, $.ui.djnsortable.prototype.options, $.ui.nestedSortable.prototype.options);\n","module.exports = function regexQuote(str) {\n return (str+'').replace(/([\\.\\?\\*\\+\\^\\$\\[\\]\\\\\\(\\)\\{\\}\\|\\-])/g, '\\\\$1');\n};\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nrequire('./jquery.ui.nestedsortable');\n\nfunction updatePositions(prefix) {\n var position = 0, // the value of the position formfield\n count = 1, // The count displayed in stacked inline headers\n $group = $('#' + prefix + '-group'),\n groupData = $group.djnData(),\n fieldNames = groupData.fieldNames,\n // The field name on the fieldset which is a ForeignKey to the parent model\n groupFkName = groupData.formsetFkName,\n parentPkVal,\n [, parentPrefix, index] = prefix.match(/^(.*)\\-(\\d+)-[^\\-]+(?:\\-\\d+)?$/) || [],\n sortableOptions = groupData.sortableOptions,\n sortableExcludes = (sortableOptions || {}).sortableExcludes || [];\n\n sortableExcludes.push(groupFkName);\n\n if (parentPrefix) {\n var $parentGroup = $('#' + parentPrefix + '-group');\n var parentFieldNames = $parentGroup.djnData('fieldNames');\n var parentPkFieldName = parentFieldNames.pk;\n var parentPkField = $parentGroup.filterDjangoField(parentPrefix, parentPkFieldName, index);\n parentPkVal = parentPkField.val();\n }\n\n if (groupFkName && typeof(parentPkVal) != 'undefined') {\n $group.filterDjangoField(prefix, groupFkName).val(parentPkVal).trigger('change');\n }\n\n $group.find('.djn-inline-form').each(function() {\n if (!this.id || this.id.substr(-6) == '-empty') {\n return true; // Same as continue\n }\n var regex = new RegExp('^(?:id_)?' + regexQuote(prefix) + '\\\\-\\\\d+$');\n\n if (!this.id.match(regex)) {\n return true;\n }\n // Cache jQuery object\n var $this = $(this),\n [formPrefix, index] = $this.djangoPrefixIndex() || [null, null],\n namePrefix = formPrefix + '-' + index + '-';\n\n if (!formPrefix) {\n return;\n }\n\n // Set header position for stacked inlines in Django 1.9+\n var $inlineLabel = $this.find('> h3 > .inline_label');\n if ($inlineLabel.length) {\n $inlineLabel.html($inlineLabel.html().replace(/(#\\d+)/g, '#' + count));\n }\n count++;\n\n var $fields = $this.djangoFormField('*'),\n $positionField,\n setPosition = false;\n\n // position is being updated if\n // a) the field has a value\n // b) if the field is not exluded with sortable_excludes (e.g. with default values)\n $fields.each(function() {\n var $field = $(this);\n if (!$field.is(':input[type!=radio][type!=checkbox],input:checked')) {\n return;\n }\n var hasValue = $field.val() || ($field.attr('type') == 'file' && $field.siblings('a').length),\n fieldName = $field.attr('name').substring(namePrefix.length);\n if (fieldName == fieldNames.position) {\n $positionField = $field;\n }\n if (hasValue && $.inArray(fieldName, sortableExcludes) === -1) {\n setPosition = true;\n }\n });\n\n if (!setPosition || !$positionField) {\n return;\n }\n\n $positionField.val(position).trigger('change');\n position++;\n });\n}\n\nfunction createSortable($group) {\n const isPolymorphic = $group.is('.djn-is-polymorphic');\n return $group.find('> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items').nestedSortable({\n handle: [\n '> h3.djn-drag-handler',\n '> .djn-tools .drag-handler',\n '> .djn-td > .djn-tools .djn-drag-handler',\n '> .djn-tr > .is-sortable > .djn-drag-handler',\n '> .djn-tr > .grp-tools-container .djn-drag-handler'\n ].join(', '),\n /**\n * items: The selector for ONLY the items underneath a given\n * container at that level. Not to be confused with\n * listItemSelector, which is the selector for all list\n * items in the nestedSortable\n */\n items: '> .djn-item',\n forcePlaceholderSize: true,\n placeholder: {\n element: function($currentItem) {\n var el = $(document.createElement($currentItem[0].nodeName))\n .addClass($currentItem[0].className + ' ui-sortable-placeholder')\n .removeClass('ui-sortable-helper')[0];\n\n if ($currentItem.is('.djn-tbody')) {\n var $originalTr = $currentItem.children('.djn-tr').eq(0);\n var trTagName = $originalTr.prop('tagName').toLowerCase();\n var $tr = $(`<${trTagName}>`);\n $tr.addClass($originalTr.attr('class'));\n var $originalTd = $originalTr.children('.djn-td').eq(0);\n var tdTagName = $originalTd.prop('tagName').toLowerCase();\n var numColumns = 0;\n $originalTr.children('.djn-td').each(function(i, td) {\n numColumns += parseInt($(td).attr('colspan'), 10) || 1;\n });\n $tr.append($(`<${tdTagName} colspan=\"${numColumns}\" class=\"djn-td grp-td\">`));\n el.appendChild($tr[0]);\n }\n\n return el;\n },\n update: function(instance, $placeholder) {\n var $currItem = instance.currentItem;\n if (!$currItem) {\n return;\n }\n var opts = instance.options;\n // 1. If a className is set as 'placeholder option, we\n // don't force sizes - the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to\n // force it even if a class name is specified\n if (opts.className && !opts.forcePlaceholderSize) return;\n\n if ($placeholder.is('.djn-tbody')) {\n // debugger;\n $placeholder = $placeholder.children('.djn-tr').eq(0).children('.djn-td').eq(0);\n }\n\n // If the element doesn't have a actual height by itself\n // (without styles coming from a stylesheet), it receives\n // the inline height from the dragged item\n if (!$placeholder.height()) {\n var innerHeight = $currItem.innerHeight(),\n paddingTop = parseInt($currItem.css('paddingTop') || 0, 10),\n paddingBottom = parseInt($currItem.css('paddingBottom') || 0, 10);\n $placeholder.height(innerHeight - paddingTop - paddingBottom);\n }\n if (!$placeholder.width()) {\n var innerWidth = $currItem.innerWidth(),\n paddingLeft = parseInt($currItem.css('paddingLeft') || 0, 10),\n paddingRight = parseInt($currItem.css('paddingRight') || 0, 10);\n $placeholder.width(innerWidth - paddingLeft - paddingRight);\n }\n }\n },\n helper: 'clone',\n opacity: 0.6,\n maxLevels: 0,\n connectWith: '.djn-items',\n tolerance: 'intersection',\n // Don't allow dragging beneath an inline that is marked for deletion\n isAllowed: function(currentItem, parentItem) {\n if (parentItem && parentItem.hasClass('predelete')) {\n return false;\n }\n const $parentGroup = parentItem.closest('.djn-group');\n const parentModel = $parentGroup.data('inlineModel');\n const childModels = $parentGroup.djnData('childModels');\n const currentModel = currentItem.data('inlineModel');\n const isPolymorphicChild = (childModels && childModels.indexOf(currentModel) !== -1);\n if (currentModel !== parentModel && !isPolymorphicChild) {\n return false;\n }\n return true;\n },\n // fixedNestingDepth: not a standard ui.sortable parameter.\n // Prevents dragging items up or down levels\n fixedNestingDepth: true,\n // The selector for ALL list containers in the nested sortable.\n containerElementSelector: '.djn-items',\n // The selector for ALL list items in the nested sortable.\n listItemSelector: '.djn-item',\n start: function(event, ui) {\n ui.item.addClass('djn-item-dragging');\n ui.item.show();\n },\n stop: function(event, ui) {\n ui.item.removeClass('djn-item-dragging');\n },\n /**\n * Triggered when a sortable is dropped into a container\n */\n receive: function(event, ui) {\n var $inline = $(this).closest('.djn-group');\n $inline.djangoFormset().spliceInto(ui.item);\n updatePositions(ui.item.djangoFormsetPrefix());\n },\n update: function(event, ui) {\n // Ensure that
\n // is the first child of the djn-items. If there\n // is another
before the\n // .do-not-drag element then the drag-and-drop placeholder\n // margins don't work correctly.\n var $nextItem = ui.item.nextAll('.djn-item').first();\n if ($nextItem.is('.djn-no-drag,.djn-thead')) {\n var nextItem = $nextItem[0];\n var parent = nextItem.parentNode;\n parent.insertBefore(nextItem, parent.firstChild);\n }\n var groupId = $(event.target).closest('.djn-group').attr('id'),\n $form = ui.item,\n $parentGroup = $form.closest('#' + groupId);\n if ($form.data('updateOperation') == 'removed') {\n $form.removeAttr('data-update-operation');\n } else if (!$parentGroup.length) {\n $form.attr('data-update-operation', 'removed');\n }\n updatePositions($form.djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$('#' + $form.djangoFormsetPrefix() + '-group')]);\n }\n });\n}\n\nmodule.exports = {updatePositions, createSortable};\n","'use strict';\n\n/* globals SelectFilter, DateTimeShortcuts */\n\nconst $ = require('jquery');\nrequire('./jquery.djnutils.js');\nconst {createSortable, updatePositions} = require('./sortable');\nconst regexQuote = require('./regexquote');\nconst grp$ = require('./grp$');\n\nvar DJNesting = (typeof window.DJNesting != 'undefined')\n ? window.DJNesting : {};\n\nDJNesting.regexQuote = regexQuote;\nDJNesting.createSortable = createSortable;\nDJNesting.updatePositions = updatePositions;\n\n/**\n * Update attributes based on a regular expression\n */\nDJNesting.updateFormAttributes = function($elem, search, replace, selector) {\n if (!selector) {\n selector = [\n ':input', 'span', 'table', 'iframe', 'label', 'a', 'ul', 'p',\n 'img', '.djn-group', '.djn-inline-form', '.cropduster-form',\n '.dal-forward-conf', '[role=tabpanel]'].join(',');\n }\n var addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n $elem.find(selector)[addBackMethod]().each(function() {\n var $node = $(this),\n attrs = ['id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset'];\n\n $.each(attrs, function(i, attrName) {\n var attrVal = $node.attr(attrName);\n if (attrVal) {\n $node.attr(attrName, attrVal.replace(search, replace));\n if (attrName === 'data-inline-formset') {\n $node.data('inlineFormset', JSON.parse($node.attr(attrName)));\n }\n }\n });\n });\n // update prepopulate ids for function initPrepopulatedFields\n $elem.find('.prepopulated_field').each(function() {\n var $node = grp$(this);\n var dependencyIds = $.makeArray($node.data('dependency_ids') || []);\n $node.data('dependency_ids', $.map(dependencyIds, function(id) {\n return id.replace(search, replace);\n }));\n });\n};\n\nDJNesting.createContainerElement = function() {\n return;\n};\n\n// Slight tweaks to the grappelli functions of the same name\n// (initRelatedFields and initAutocompleteFields).\n//\n// The most notable tweak is the call to $.fn.grp_related_generic() (a\n// jQuery method provided by django-curated) and the use of\n// DJNesting.LOOKUP_URLS to determine the ajax lookup urls.\n//\n// We abstract this out using form prefix because the way grappelli does it\n// (adding javascript at the bottom of each formset) doesn't really scale\n// with nested formsets.\n\n// The second parameter (groupData) is optional, and only exists to prevent\n// redundant calls to jQuery() and jQuery.fn.data() in the calling context\nDJNesting.initRelatedFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupRelated;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n grp$(this).grp_related_fk({lookup_url: lookupUrls.related});\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n grp$(this).grp_related_m2m({lookup_url: lookupUrls.m2m});\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n if ($this.hasClass('grp-has-related-lookup')) {\n $this.parent().find('a.related-lookup').remove();\n $this.parent().find('.grp-placeholder-related-generic').remove();\n }\n grp$($this).grp_related_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related\n });\n });\n });\n });\n};\n\nDJNesting.initAutocompleteFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupAutocomplete;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_fk({\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_m2m({\n lookup_url: lookupUrls.m2m,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n // An autocomplete widget has already been initialized, return\n if ($('#' + $this.attr('id') + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.m2m\n });\n });\n });\n });\n};\n\n// I very much regret that these are basically copy-pasted from django's\n// inlines.js, but they're hidden in closure scope so I don't have much choice.\nDJNesting.DjangoInlines = {\n initPrepopulatedFields: function(row) {\n row.find('.prepopulated_field').each(function() {\n var field = $(this),\n input = (field.is(':input') ? field : field.find(':input')),\n $input = grp$(input),\n dependencyList = $input.data('dependency_list') || [],\n formPrefix = input.djangoFormPrefix(),\n dependencies = [];\n if (!formPrefix || formPrefix.match(/__prefix__/)) {\n return;\n }\n $.each(dependencyList, function(i, fieldName) {\n dependencies.push('#id_' + formPrefix + fieldName);\n });\n if (dependencies.length) {\n $input.prepopulate(dependencies, input.attr('maxlength'));\n }\n });\n },\n reinitDateTimeShortCuts: function() {\n // Reinitialize the calendar and clock widgets by force\n if (typeof window.DateTimeShortcuts !== 'undefined') {\n $('.datetimeshortcuts').remove();\n DateTimeShortcuts.init();\n }\n },\n updateSelectFilter: function($form) {\n // If any SelectFilter widgets are a part of the new form,\n // instantiate a new SelectFilter instance for it.\n if (typeof window.SelectFilter !== 'undefined') {\n $form.find('.selectfilter').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], false);\n });\n $form.find('.selectfilterstacked').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], true);\n });\n }\n }\n};\n\nfunction patchSelectFilter() {\n window.SelectFilter.init = (function(oldFn) {\n return function init(field_id, field_name, is_stacked) {\n if (field_id.match(/\\-empty\\-/)) {\n return;\n } else {\n oldFn.apply(this, arguments);\n }\n };\n }(window.SelectFilter.init));\n}\n\nif (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n} else {\n setTimeout(function() {\n if (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n }\n }, 12);\n}\n\nconst djangoFuncs = ['prepopulate', 'djangoAdminSelect2'];\n\ndjangoFuncs.forEach((funcName) => {\n (function patchDjangoFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof $.fn[funcName] === 'undefined') {\n return setTimeout(() => patchDjangoFunction(callCount++), 12);\n }\n $.fn[funcName] = (function(oldFn) {\n return function django_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }($.fn[funcName]));\n }(0));\n});\n\nconst grpFuncs = [\n 'grp_autocomplete_fk', 'grp_autocomplete_generic', 'grp_autocomplete_m2m',\n 'grp_collapsible', 'grp_collapsible_group', 'grp_inline', 'grp_related_fk',\n 'grp_related_generic', 'grp_related_m2m', 'grp_timepicker', 'datepicker',\n 'prepopulate', 'djangoAdminSelect2'];\n\ngrpFuncs.forEach((funcName) => {\n (function patchGrpFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof window.grp === 'undefined' || typeof window.grp.jQuery.fn[funcName] === 'undefined') {\n return setTimeout(() => patchGrpFunction(callCount++), 12);\n }\n window.grp.jQuery.fn[funcName] = (function(oldFn) {\n return function grp_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }(window.grp.jQuery.fn[funcName]));\n }(0));\n});\n\nmodule.exports = DJNesting;\n","// removed by extract-text-webpack-plugin","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","(function() { module.exports = window[\"grappelli\"]; }());","(function() { module.exports = window[\"grp\"]; }());"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["../../../../webpack/bootstrap","../src/nested-admin/grp$.js","../src/nested-admin/index.js","../src/nested-admin/jquery.djangoformset.js","../src/nested-admin/jquery.djnutils.js","../src/nested-admin/jquery.shim.js","../src/nested-admin/jquery.ui.djnsortable.js","../src/nested-admin/jquery.ui.nestedsortable.js","../src/nested-admin/regexquote.js","../src/nested-admin/sortable.js","../src/nested-admin/utils.js","webpack://DJNesting/./nested_admin/static/nested_admin/src/nested_admin.scss?4513","../../../../node_modules/core-js/modules/_a-function.js","../../../../node_modules/core-js/modules/_add-to-unscopables.js","../../../../node_modules/core-js/modules/_an-object.js","../../../../node_modules/core-js/modules/_array-methods.js","../../../../node_modules/core-js/modules/_array-species-constructor.js","../../../../node_modules/core-js/modules/_array-species-create.js","../../../../node_modules/core-js/modules/_cof.js","../../../../node_modules/core-js/modules/_core.js","../../../../node_modules/core-js/modules/_ctx.js","../../../../node_modules/core-js/modules/_defined.js","../../../../node_modules/core-js/modules/_descriptors.js","../../../../node_modules/core-js/modules/_dom-create.js","../../../../node_modules/core-js/modules/_export.js","../../../../node_modules/core-js/modules/_fails.js","../../../../node_modules/core-js/modules/_fix-re-wks.js","../../../../node_modules/core-js/modules/_global.js","../../../../node_modules/core-js/modules/_has.js","../../../../node_modules/core-js/modules/_hide.js","../../../../node_modules/core-js/modules/_ie8-dom-define.js","../../../../node_modules/core-js/modules/_iobject.js","../../../../node_modules/core-js/modules/_is-array.js","../../../../node_modules/core-js/modules/_is-object.js","../../../../node_modules/core-js/modules/_is-regexp.js","../../../../node_modules/core-js/modules/_object-dp.js","../../../../node_modules/core-js/modules/_property-desc.js","../../../../node_modules/core-js/modules/_redefine.js","../../../../node_modules/core-js/modules/_shared.js","../../../../node_modules/core-js/modules/_strict-method.js","../../../../node_modules/core-js/modules/_to-integer.js","../../../../node_modules/core-js/modules/_to-length.js","../../../../node_modules/core-js/modules/_to-object.js","../../../../node_modules/core-js/modules/_to-primitive.js","../../../../node_modules/core-js/modules/_uid.js","../../../../node_modules/core-js/modules/_wks.js","../../../../node_modules/core-js/modules/es6.array.find.js","../../../../node_modules/core-js/modules/es6.array.sort.js","../../../../node_modules/core-js/modules/es6.function.name.js","../../../../node_modules/core-js/modules/es6.regexp.match.js","../../../../node_modules/core-js/modules/es6.regexp.replace.js","../../../../node_modules/core-js/modules/es6.regexp.split.js","../../../../external \"grappelli\"","../../../../external \"grp\""],"names":["$","require","grp$","$sel","window","grp","jQuery","fn","init","$grpSel","prevObject","module","exports","grappelli","DJNesting","DjangoFormset","document","ready","filter","i","element","childNodes","length","css","not","closest","addClass","on","onMutate","e","$inline","$items","find","$rows","children","removeClass","each","row","n","rootGroup","djangoFormset","updatePositions","djangoFormsetPrefix","trigger","regexQuote","pluginName","inline","opts","emptyClass","predeleteClass","prefix","_$totalForms","attr","_$template","inlineModelClassName","djnData","extend","childTypes","data","options","formsetFkModel","addButtonSelector","removeButtonSelector","deleteButtonSelector","formClass","formClassSelector","initRelatedFields","initAutocompleteFields","_setupPolymorphic","_bindEvents","_initializeForms","is","createSortable","Error","menu","forEach","c","type","name","$addButton","$menu","after","totalForms","mgmtVal","maxForms","parents","hide","_initializeForm","form","$form","formPrefix","djangoFormPrefix","hasClass","toggleClass","minForms","self","hideRemoveButton","djangoFormsetForms","showHideMethod","$el","off","preventDefault","stopPropagation","next","add","hideMenu","show","$menuButtons","parent","polymorphicType","target","remove","deleteClickHandler","stopImmediatePropagation","$deleteInput","undelete","$deleteButton","index","djangoFormIndex","isInitial","innerHTML","_fillGap","delete","checked","$childInline","childFormset","removeAttr","spliceIndex","ctype","$template","clone","id","isNested","replace","append","createContainerElement","updateFormAttributes","RegExp","$firstTemplate","eq","compatibleParents","el","fkModel","compatModels","parentModel","isPolymorphic","indexOf","input","value","setAttribute","parentNode","appendChild","removeChild","insertBefore","isNumeric","spliceInto","reinitDateTimeFields","DjangoInlines","initPrepopulatedFields","reinitDateTimeShortCuts","updateSelectFilter","grp_collapsible","addBackMethod","addBack","toggle_handler_slctr","closed_css","open_css","on_toggle","curated_content_type","formsetModelClassName","$buttons","$initialForm","$newForm","formsets","toArray","sort","a","b","oldIndex","oldFormPrefixRegex","_makeRoomForInsert","initialFormCount","totalFormCount","gapIndex","$existingForm","isNewAddition","oldFormsetPrefix","newFormsetPrefix","newIndex","$before","currentPosition","prevAll","$oldInline","$currentFormInline","oldDjangoFormset","$parentInline","$parentForm","parentPkField","pk","$parentPk","djangoFormField","val","setTimeout","newValue","$field","parseInt","args","arguments","makeArray","slice","prototype","prefixCache","inlineFormsetData","nestedOptions","djangoPrefixIndex","$this","first","forattr","$group","groupId","cacheKey","match","substr","getElementById","prefixIndex","filterDjangoFormsetForms","formsetPrefix","formId","getAttribute","formIndex","forms","$forms","sortedForms","Array","push","apply","pushStack","fieldName","$empty","matches","isNaN","namePrefix","fieldPart","substring","fieldNameData","prefixAndIndex","filterDjangoField","djRegexCache","fieldId","django","ui","undefined","t","s","r","o","nodeName","toLowerCase","href","test","disabled","expr","filters","visible","version","keyCode","BACKSPACE","COMMA","DELETE","DOWN","END","ENTER","ESCAPE","HOME","LEFT","NUMPAD_ADD","NUMPAD_DECIMAL","NUMPAD_DIVIDE","NUMPAD_ENTER","NUMPAD_MULTIPLY","NUMPAD_SUBTRACT","PAGE_DOWN","PAGE_UP","PERIOD","RIGHT","SPACE","TAB","UP","focus","call","scrollParent","ie","zIndex","uniqueId","removeUniqueId","createPseudo","focusable","tabbable","outerWidth","jquery","parseFloat","innerWidth","innerHeight","outerHeight","removeData","camelCase","exec","navigator","userAgent","support","selectstart","createElement","disableSelection","bind","enableSelection","unbind","plugin","plugins","nodeType","hasScroll","cleanData","triggerHandler","widget","h","l","u","split","Widget","_createWidget","_proto","_childConstructors","isFunction","_super","_superApply","widgetEventPrefix","constructor","namespace","widgetName","widgetFullName","bridge","hasOwnProperty","isPlainObject","concat","charAt","get","error","option","_init","defaultElement","create","uuid","eventNamespace","_getCreateOptions","bindings","hoverable","_on","destroy","style","ownerDocument","defaultView","parentWindow","_create","_trigger","_getCreateEventData","noop","_destroy","shift","pop","_setOptions","_setOption","enable","disable","guid","delegate","_off","join","undelegate","_delay","_hoverable","mouseenter","currentTarget","mouseleave","_focusable","focusin","focusout","Event","originalEvent","isDefaultPrevented","effect","duration","isEmptyObject","complete","delay","effects","easing","queue","mouseup","cancel","distance","_mouseInit","_mouseDown","started","_mouseDestroy","_mouseMoveDelegate","_mouseUpDelegate","_mouseStarted","_mouseUp","_mouseDownEvent","which","_mouseCapture","mouseDelayMet","_mouseDelayTimer","_mouseDistanceMet","_mouseDelayMet","_mouseStart","_mouseMove","documentMode","button","_mouseDrag","_mouseStop","Math","max","abs","pageX","pageY","p","width","height","offset","top","left","isWindow","scrollTop","scrollLeft","round","d","f","position","scrollbarWidth","offsetWidth","clientWidth","getScrollInfo","scrollWidth","scrollHeight","getWithinInfo","of","m","g","v","y","_","within","x","k","collision","w","at","D","T","M","S","my","offsetFractions","marginLeft","marginTop","targetWidth","targetHeight","elemWidth","elemHeight","collisionPosition","collisionWidth","collisionHeight","elem","using","horizontal","vertical","important","fit","flip","flipfit","getElementsByTagName","visibility","border","margin","background","documentElement","firstChild","cssText","mouse","appendTo","axis","connectWith","containment","cursor","cursorAt","dropOnEmpty","forcePlaceholderSize","forceHelperSize","grid","handle","helper","items","opacity","placeholder","revert","scroll","scrollSensitivity","scrollSpeed","scope","tolerance","_isOverAxis","reference","size","containerCache","refresh","floating","item","key","event","overrideHandle","that","reverting","_refreshItems","currentItem","nodes","validHandle","_removeCurrentsFromItems","noActivation","currentContainer","refreshPositions","_createHelper","_cacheHelperProportions","_cacheMargins","margins","click","_getParentOffset","relative","_getRelativeOffset","cssPosition","originalPosition","_generatePosition","originalPageX","originalPageY","_adjustOffsetFromHelper","domPosition","prev","_createPlaceholder","_setContainment","_storedCursor","_storedOpacity","_storedZIndex","tagName","overflowOffset","_uiHash","_preserveHelperProportions","containers","ddmanager","current","dropBehaviour","prepareOffsets","dragging","positionAbs","_convertPositionTo","lastPositionAbs","scrolled","offsetHeight","itemElement","intersection","_intersectsWithPointer","instance","contains","direction","_intersectsWithSides","_rearrange","_contactContainers","drag","noPropagation","drop","cur","animate","offsetParent","body","_clear","_storedCSS","over","_noFinalSort","prepend","serialize","_getItemsAsjQuery","connected","str","res","attribute","expression","ret","_intersectsWith","x1","x2","helperProportions","y1","y2","dyClick","dxClick","isOverElement","forcePointerForContainers","isOverElementHeight","isOverElementWidth","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","isOverBottomHalf","isOverRightHalf","delta","_connectWith","String","queries","j","inst","list","grep","targetData","_queries","queriesLength","fast","toleranceElement","custom","refreshContainers","className","update","container","innermostContainer","innermostIndex","dist","itemWithLeastDistance","posProperty","sizeProperty","base","nearBottom","obj","isArray","right","bottom","po","ce","co","pos","mod","scrollIsRootNode","hardRefresh","nextSibling","counter","delayedTriggers","before","fromOutside","cancelHelperRemoval","handler","handlerProxy","_inst","sender","nearest","selector","node","parentsUntil","expando","random","createChildNestedSortable","childContainer","$childContainer","widgetConstructor","newInstance","$otherContainer","addToConnectWith","otherInstance","djnsortable","tabSize","disableNesting","errorClass","nestedContainerSelector","doNotClear","containerElementSelector","listItemSelector","maxLevels","revertOnError","protectRoot","rootID","rtl","fixedNestingDepth","showErrorDiv","keepInParent","isAllowed","canConnectWith","container1","container2","model1","model2","instance2","container1Level","_getLevel","container2Level","$element","dataOptions","_connectWithMap","$document","originalConnectWith","lastItemElement","$itemElement","containerSel","$childItems","itemElementClosestContainer","_clearEmpty","_parentItem","parentItem","level","childLevels","_getChildLevels","placeholderClassName","phClassSearch","phOrigClassName","phOrigClassNameEndPos","previousItem","previousSibling","nextItem","beyondMaxLevels","containerInstance","_isAllowed","$previousItemChildContainer","lastRearrangedElement","placeholderParentItem","comparisonElement","previousTopOffset","sDepth","startDepthCount","_recursiveArray","depth","pid","$item","childContainers","result","child","levels","isRoot","origConnectWith","$elements","splice","newContainer","nestedSortable","count","groupData","fieldNames","groupFkName","formsetFkName","parentPkVal","parentPrefix","sortableOptions","sortableExcludes","$parentGroup","parentFieldNames","parentPkFieldName","regex","$inlineLabel","html","$fields","$positionField","setPosition","hasValue","siblings","inArray","$currentItem","$originalTr","trTagName","prop","$tr","$originalTd","tdTagName","numColumns","td","$placeholder","$currItem","paddingTop","paddingBottom","paddingLeft","paddingRight","childModels","currentModel","isPolymorphicChild","start","stop","receive","$nextItem","nextAll","$elem","search","$node","attrs","attrName","attrVal","JSON","parse","dependencyIds","map","LOOKUP_URLS","related","lookupUrls","lookupFields","lookupRelated","fk","grp_related_fk","lookup_url","m2m","grp_related_m2m","generic","contentType","objectId","grp_related_generic","content_type","object_id","lookupAutocomplete","grp_autocomplete_fk","autocomplete_lookup_url","autocomplete","grp_autocomplete_m2m","grp_autocomplete_generic","field","$input","dependencyList","dependencies","prepopulate","DateTimeShortcuts","SelectFilter","namearr","patchSelectFilter","oldFn","field_id","field_name","is_stacked","djangoFuncs","funcName","patchDjangoFunction","callCount","django_fn_patch","grpFuncs","patchGrpFunction","grp_fn_patch"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;ACnEA,IAAMA,IAAI,mBAAAC,CAA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A;AACA,GAAG;AACH;;;;;;;;;;;;ACfA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACLA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;ACJA,6BAA6B;AAC7B,uCAAuC;;;;;;;;;;;;ACDvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA,iCAAiC,QAAQ,mBAAmB,UAAU,EAAE,EAAE;AAC1E,CAAC;;;;;;;;;;;;ACHD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG,iEAAiE;AACjE,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,eAAe;AACf,eAAe;AACf,eAAe;AACf,gBAAgB;AAChB;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,UAAU;AACvC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;;;;;;;;;;;ACLzC,uBAAuB;AACvB;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;;;;;;;;;;;ACPA;AACA,uIAAsE,mBAAmB,UAAU,EAAE,EAAE;AACvG,CAAC;;;;;;;;;;;;ACFD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;;;;;;;;;;;;AC9BD;AACA;AACA,kDAAkD;AAClD;AACA,uCAAuC;AACvC;;;;;;;;;;;;;ACLA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,cAAc;AACvD,GAAG;AACH;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACtBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;ACtED,aAAa,sCAAsC,EAAE,I;;;;;;;;;;;ACArD,aAAa,gCAAgC,EAAE,I","file":"nested_admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const $ = require('jquery');\n\n/**\n * For grappelli 2.14, converts a django.jQuery instance to a grp.jQuery\n * instance. Otherwise (if grappelli is not present, or for grappelli <= 2.13,\n * where the grappelli jQuery instance is the same as django's), returns the\n * object that was passed in, unchanged.\n */\nfunction grp$($sel) {\n if (typeof window.grp === 'undefined') {\n return $($sel);\n }\n if (window.grp.jQuery.fn.init === $.fn.init) {\n return $($sel);\n }\n const $grpSel = window.grp.jQuery($sel);\n if ($sel.prevObject) {\n $grpSel.prevObject = grp$($sel.prevObject);\n }\n return $grpSel;\n}\n\nmodule.exports = grp$;\n","const $ = require('jquery');\nconst grappelli = require('grappelli');\nconst DJNesting = require('./utils');\nDJNesting.DjangoFormset = require('./jquery.djangoformset');\n\n$(document).ready(function() {\n // Remove the border on any empty fieldsets\n $('fieldset.grp-module, fieldset.module').filter(function(i, element) {\n return element.childNodes.length == 0;\n }).css('border-width', '0');\n\n // Set predelete class on any form elements with the DELETE input checked.\n // These can occur on forms rendered after a validation error.\n $('input[name$=\"-DELETE\"]:checked').not('[name*=\"__prefix__\"]').closest('.djn-inline-form').addClass('grp-predelete');\n\n $(document).on('djnesting:initialized djnesting:mutate', function onMutate(e, $inline) {\n var $items = $inline.find('> .djn-items, > .tabular > .module > .djn-items');\n var $rows = $items.children('.djn-tbody');\n $rows.removeClass('row1 row2');\n $rows.each(function(i, row) {\n var n = 1 + (i % 2);\n $(row).addClass('row' + n);\n });\n });\n\n // Register the nested formset on top level djnesting-stacked elements.\n // It will handle recursing down the nested inlines.\n $('.djn-group-root').each(function(i, rootGroup) {\n $(rootGroup).djangoFormset();\n });\n\n $('form').on('submit.djnesting', function(e) {\n $('.djn-group').each(function() {\n DJNesting.updatePositions($(this).djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$(this).djangoFormset().$inline]);\n });\n });\n});\n\nmodule.exports = DJNesting;\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nconst DJNesting = require('./utils');\nconst grappelli = require('grappelli');\nconst grp = require('grp');\nconst grp$ = require('./grp$');\n\nvar pluginName = 'djangoFormset';\n\nclass DjangoFormset {\n constructor(inline) {\n this.opts = {\n emptyClass: 'empty-form grp-empty-form djn-empty-form',\n predeleteClass: 'grp-predelete'\n };\n this.$inline = $(inline);\n this.prefix = this.$inline.djangoFormsetPrefix();\n this._$totalForms = this.$inline.find('#id_' + this.prefix + '-TOTAL_FORMS');\n this._$totalForms.attr('autocomplete', 'off');\n this._$template = $('#' + this.prefix + '-empty');\n\n var inlineModelClassName = this.$inline.djnData('inlineModel');\n\n this.opts = $.extend({}, this.opts, {\n childTypes: this.$inline.data('inlineFormset').options.childTypes,\n formsetFkModel: this.$inline.djnData('formsetFkModel'),\n addButtonSelector: '.djn-add-handler.djn-model-' + inlineModelClassName,\n removeButtonSelector: '.djn-remove-handler.djn-model-' + inlineModelClassName,\n deleteButtonSelector: '.djn-delete-handler.djn-model-' + inlineModelClassName,\n formClass: 'dynamic-form grp-dynamic-form djn-dynamic-form-' + inlineModelClassName,\n formClassSelector: '.djn-dynamic-form-' + inlineModelClassName\n });\n\n DJNesting.initRelatedFields(this.prefix, this.$inline.djnData());\n DJNesting.initAutocompleteFields(this.prefix, this.$inline.djnData());\n\n if (this.opts.childTypes) {\n this._setupPolymorphic();\n }\n this._bindEvents();\n\n this._initializeForms();\n\n this.$inline.find('.djn-items:not([id*=\"-empty\"])').trigger('djnesting:init');\n\n // initialize nested formsets\n this.$inline.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n if (this.$inline.is('.djn-group-root')) {\n DJNesting.createSortable(this.$inline);\n }\n\n $(document).trigger('djnesting:initialized', [this.$inline, this]);\n }\n _setupPolymorphic() {\n if (!this.opts.childTypes) {\n throw Error('The polymorphic fieldset options.childTypes is not defined!');\n }\n let menu = '';\n const $addButton = this.$inline.find(this.opts.addButtonSelector);\n const $menu = $(menu);\n $addButton.after($menu);\n }\n\n _initializeForms() {\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n if (maxForms <= totalForms) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n for (var i = 0; i < totalForms; i++) {\n this._initializeForm('#' + this.prefix + '-' + i);\n }\n }\n _initializeForm(form) {\n var $form = $(form);\n var formPrefix = $form.djangoFormPrefix();\n $form.addClass(this.opts.formClass);\n if ($form.hasClass('has_original')) {\n $('#id_' + formPrefix + 'DELETE:checked').toggleClass(this.opts.predeleteClass);\n }\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n }\n _bindEvents($el) {\n var self = this;\n if (typeof $el == 'undefined') {\n $el = this.$inline;\n }\n const $addButton = $el.find(this.opts.addButtonSelector);\n $addButton.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const $menu = $(this).next('.polymorphic-type-menu');\n if (!$menu.length) {\n self.add();\n } else {\n if (!$menu.is(':visible')) {\n function hideMenu() {\n $menu.hide();\n $(document).off('click', hideMenu);\n }\n $(document).on('click', hideMenu);\n }\n $menu.show();\n }\n });\n const $menuButtons = $addButton.parent().find('> .polymorphic-type-menu a');\n $menuButtons.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const polymorphicType = $(this).attr('data-type');\n self.add(null, polymorphicType);\n const $menu = $(e.target).closest('.polymorphic-type-menu');\n if ($menu.is(':visible')) {\n $menu.hide();\n }\n });\n $el.find(this.opts.removeButtonSelector).filter(function() {\n return !$(this).closest('.djn-empty-form').length;\n }).off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n self.remove($form);\n });\n\n var deleteClickHandler = function(e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n var $deleteInput = $('#id_' + $form.djangoFormPrefix() + 'DELETE');\n if (!$deleteInput.is(':checked')) {\n self['delete']($form);\n } else {\n self.undelete($form);\n }\n };\n\n var $deleteButton = $el.find(this.opts.deleteButtonSelector)\n .filter(function() { return !$(this).closest('.djn-empty-form').length; });\n\n $deleteButton.off('click.djnesting').on('click.djnesting', deleteClickHandler);\n $deleteButton.find('[id$=\"-DELETE\"]').on('mousedown.djnesting', deleteClickHandler);\n }\n remove(form) {\n var $form = $(form);\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var index = $form.djangoFormIndex();\n var isInitial = $form.data('isInitial');\n\n // Clearing out the form HTML itself using DOM APIs is much faster\n // than using jQuery to remove the element. Using jQuery is so\n // slow that it hangs the page.\n $form[0].innerHTML = \"\";\n $form.remove();\n\n totalForms -= 1;\n this.mgmtVal('TOTAL_FORMS', totalForms);\n\n if (maxForms - totalForms >= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').show();\n }\n\n this._fillGap(index, isInitial);\n\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:removed', [$form, this.prefix]);\n }\n delete(form) {\n var self = this,\n $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.hasClass(this.opts.predeleteClass)) {\n return;\n }\n\n if (!$form.data('isInitial')) {\n return;\n }\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n $form.addClass(this.opts.predeleteClass);\n\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).hasClass(self.opts.predeleteClass)) {\n $(this).data('alreadyDeleted', true);\n } else {\n childFormset.delete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:deleted', [$form, this.prefix]);\n }\n undelete(form) {\n var $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.parent().closest('.' + this.opts.predeleteClass).length) {\n return;\n }\n if ($form.hasClass('has_original')) {\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n $form.removeClass(this.opts.predeleteClass);\n }\n $form.data('alreadyDeleted', false);\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).data('alreadyDeleted')) {\n $(this).data('alreadyDeleted', false);\n } else {\n childFormset.undelete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:undeleted', [$form, this.prefix]);\n }\n add(spliceIndex, ctype) {\n var self = this;\n const $template = (ctype) ? $(`#${this.prefix}-empty-${ctype}`) : this._$template;\n var $form = $template.clone(true);\n\n // For django-grappelli >= 2.14, where the grp.jQuery instance is not\n // the same as django.jQuery, we must copy any prepopulated_field\n // dependency data from grp.jQuery to the cloned nodes.\n grp$($template).find(':data(dependency_ids)').each(function() {\n const id = $(this).attr('id');\n const $el = $form.find(`#${id}`);\n grp$($el).data($.extend({}, $el.data(), grp$(this).data()));\n });\n\n var index = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var isNested = this.$inline.hasClass('djn-group-nested');\n\n $(document).trigger('djnesting:beforeadded', [this.$inline, $form]);\n\n $form.removeClass(this.opts.emptyClass);\n $form.addClass('djn-item');\n $form.attr('id', $form.attr('id').replace(/\\-empty.*?$/, '-' + index));\n\n if (isNested) {\n $form.append(DJNesting.createContainerElement());\n }\n\n DJNesting.updateFormAttributes($form,\n new RegExp('([#_]id_|[\\\\#]|^id_|\\\"|^)' + regexQuote(this.prefix) + '\\\\-(?:__prefix__|empty)\\\\-', 'g'),\n '$1' + this.prefix + '-' + index + '-');\n\n let $firstTemplate = this._$template;\n if (this.opts.childTypes) {\n $firstTemplate = $template.closest('.djn-group')\n .find('> .djn-items > [id*=\"-empty\"], > .djn-fieldset > .djn-items > [id*=\"-empty\"]').eq(0);\n }\n if (this.opts.childTypes) {\n const compatibleParents = this.$inline.djnData('compatibleParents') || {};\n $form.find('> .djn-group').each((i, el) => {\n const fkModel = $(el).djnData('formsetFkModel');\n const compatModels = compatibleParents[ctype] || [];\n const $el = $(el);\n const parentModel = $el.djnData('inlineParentModel');\n const isPolymorphic = !!($el.data('inlineFormset').options.childTypes);\n const formPrefix = $el.data('inlineFormset').options.prefix;\n if (parentModel !== ctype || (isPolymorphic && fkModel !== ctype && compatModels.indexOf(fkModel) === -1)) {\n $el.find('input[id$=\"_FORMS\"]').each((i, input) => {\n input.value = 0\n input.setAttribute('value', '0');\n el.parentNode.appendChild(input);\n });\n el.parentNode.removeChild(el);\n }\n });\n }\n\n $form.insertBefore($firstTemplate);\n\n this.mgmtVal('TOTAL_FORMS', index + 1);\n if ((maxForms - (index + 1)) <= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n\n DJNesting.updatePositions(this.prefix);\n\n if ($.isNumeric(spliceIndex)) {\n this.spliceInto($form, spliceIndex, true);\n } else {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n\n if (grappelli) {\n grappelli.reinitDateTimeFields(grp$($form));\n }\n DJNesting.DjangoInlines.initPrepopulatedFields($form);\n DJNesting.DjangoInlines.reinitDateTimeShortCuts();\n DJNesting.DjangoInlines.updateSelectFilter($form);\n DJNesting.initRelatedFields(this.prefix);\n DJNesting.initAutocompleteFields(this.prefix);\n if (grp && grp.jQuery.fn.grp_collapsible) {\n var addBackMethod = (grp.jQuery.fn.addBack) ? 'addBack' : 'andSelf';\n grp$($form).find(\n '.grp-collapse:not([id$=\"-empty\"]):not([id*=\"-empty-\"])'\n )[addBackMethod]().grp_collapsible({\n toggle_handler_slctr: '.grp-collapse-handler:first',\n closed_css: 'closed grp-closed',\n open_css: 'open grp-open',\n on_toggle: function() {\n $(document).trigger('djnesting:toggle', [self.$inline]);\n }\n });\n }\n if (typeof $.fn.curated_content_type == 'function') {\n $form.find('.curated-content-type-select').each(function() {\n $(this).curated_content_type();\n });\n }\n\n this._initializeForm($form);\n this._bindEvents($form);\n\n if (ctype) {\n const formsetModelClassName = this.$inline.djnData('inlineModel');\n const inlineModelClassName = $form.attr('data-inline-model');\n const $buttons = $form.find(`.djn-model-${formsetModelClassName}`);\n $buttons.addClass(`djn-model-${inlineModelClassName}`);\n $form.addClass(`djn-dynamic-form-${inlineModelClassName}`);\n }\n\n // find any nested formsets\n $form.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n // Fire an event on the document so other javascript applications\n // can be alerted to the newly inserted inline\n $(document).trigger('djnesting:added', [this.$inline, $form]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:added', [$form, this.prefix]);\n\n return $form;\n }\n _fillGap(index, isInitial) {\n var $initialForm, $newForm;\n var formsets = this.$inline.djangoFormsetForms().toArray();\n // Sort formsets in index order, so that we get the last indexed form for the swap.\n formsets.sort(function(a, b) { return $(a).djangoFormIndex() - $(b).djangoFormIndex(); });\n formsets.forEach(function(form) {\n var $form = $(form);\n var i = $form.djangoFormIndex();\n if (i <= index) {\n return;\n }\n if ($form.data('isInitial')) {\n $initialForm = $form;\n } else {\n $newForm = $form;\n }\n });\n var $form = (isInitial) ? $initialForm || $newForm : $newForm;\n if (!$form) {\n return;\n }\n var oldIndex = $form.djangoFormIndex();\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix + '-' + oldIndex) + '(?!\\\\-\\\\d)');\n $form.attr('id', this.prefix + '-' + index);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + this.prefix + '-' + index);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial && $initialForm && $newForm) {\n this._fillGap(oldIndex, false);\n }\n }\n _makeRoomForInsert() {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n gapIndex = initialFormCount,\n $existingForm = $('#' + this.prefix + '-' + gapIndex);\n\n if (!$existingForm.length) {\n return;\n }\n\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix) + '-' + gapIndex + '(?!\\\\-\\\\d)');\n $existingForm.attr('id', this.prefix + '-' + totalFormCount);\n DJNesting.updateFormAttributes($existingForm, oldFormPrefixRegex, '$1' + this.prefix + '-' + totalFormCount);\n\n // Update prefixes on nested DjangoFormset objects\n $existingForm.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $existingForm]);\n }\n /**\n * Splice a form into the current formset at new position `index`.\n */\n spliceInto($form, index, isNewAddition) {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n oldFormsetPrefix = $form.djangoFormsetPrefix(),\n newFormsetPrefix = this.prefix,\n isInitial = $form.data('isInitial'),\n newIndex, $before;\n\n // Make sure the form being spliced is from a different inline\n if ($form.djangoFormsetPrefix() == this.prefix) {\n var currentPosition = $form.prevAll('.djn-item:not(.djn-no-drag,.djn-thead)').length;\n if (currentPosition === index || typeof index == 'undefined') {\n DJNesting.updatePositions(newFormsetPrefix);\n return;\n }\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item:not(#' + $form.attr('id') + ')').eq(index);\n $before.after($form);\n } else {\n var $oldInline = $('#' + oldFormsetPrefix + '-group');\n var $currentFormInline = $form.closest('.djn-group');\n\n if ($currentFormInline.djangoFormsetPrefix() != newFormsetPrefix) {\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item').eq(index);\n $before.after($form);\n }\n\n var oldDjangoFormset = $oldInline.djangoFormset();\n oldDjangoFormset.mgmtVal('TOTAL_FORMS', oldDjangoFormset.mgmtVal('TOTAL_FORMS') - 1);\n oldDjangoFormset._fillGap($form.djangoFormIndex(), isInitial);\n\n if (isInitial) {\n oldDjangoFormset.mgmtVal('INITIAL_FORMS', oldDjangoFormset.mgmtVal('INITIAL_FORMS') - 1);\n\n var $parentInline = this.$inline.parent().closest('.djn-group');\n if ($parentInline.length) {\n var $parentForm = this.$inline.closest('.djn-inline-form');\n var parentPkField = ($parentInline.djnData('fieldNames') || {}).pk;\n var $parentPk = $parentForm.djangoFormField(parentPkField);\n if (!$parentPk.val()) {\n $form.data('isInitial', false);\n $form.attr('data-is-initial', 'false');\n isInitial = false;\n // Set initial form counts to 0 on nested DjangoFormsets\n setTimeout(function() {\n $form.find('[name^=\"' + $form.djangoFormPrefix() + '\"][name$=\"-INITIAL_FORMS\"]')\n .val('0').trigger('change');\n }, 0);\n }\n }\n }\n\n if (isInitial) {\n this._makeRoomForInsert();\n }\n\n // Replace the ids for the splice form\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)' + regexQuote($form.attr('id')) + '(?!\\\\-\\\\d)');\n newIndex = (isInitial) ? initialFormCount : totalFormCount;\n $form.attr('id', newFormsetPrefix + '-' + newIndex);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + newFormsetPrefix + '-' + newIndex);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial) {\n this.mgmtVal('INITIAL_FORMS', initialFormCount + 1);\n }\n this.mgmtVal('TOTAL_FORMS', totalFormCount + 1);\n\n DJNesting.updatePositions(oldFormsetPrefix);\n $(document).trigger('djnesting:mutate', [$oldInline]);\n }\n\n DJNesting.updatePositions(newFormsetPrefix);\n if (!isNewAddition) {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n }\n mgmtVal(name, newValue) {\n var $field = this.$inline.find('#id_' + this.prefix + '-' + name);\n if (typeof newValue == 'undefined') {\n return parseInt($field.val(), 10);\n } else {\n return parseInt($field.val(newValue).trigger('change').val(), 10);\n }\n }\n}\n\n$.fn[pluginName] = function() {\n var options, fn, args;\n var $el = this.eq(0);\n\n if (arguments.length === 0 || (arguments.length === 1 && $.type(arguments[0]) != 'string')) {\n options = arguments[0];\n var djangoFormset = $el.data(pluginName);\n if (!djangoFormset) {\n djangoFormset = new DjangoFormset($el, options);\n $el.data(pluginName, djangoFormset);\n }\n return djangoFormset;\n }\n\n fn = arguments[0];\n args = $.makeArray(arguments).slice(1);\n\n if (fn in DjangoFormset.prototype) {\n return $el.data(pluginName)[fn](args);\n } else {\n throw new Error('Unknown function call ' + fn + ' for $.fn.' + pluginName);\n }\n};\n\nmodule.exports = DjangoFormset;\n","const $ = require('jquery');\n\nvar prefixCache = {};\n\n$.fn.djnData = function(name) {\n var inlineFormsetData = $(this).data('inlineFormset') || {},\n nestedOptions = inlineFormsetData.nestedOptions || {};\n if (!name) {\n return nestedOptions;\n } else {\n return nestedOptions[name];\n }\n};\n\n$.fn.djangoPrefixIndex = function() {\n var $this = (this.length > 1) ? this.first() : this;\n var id = $this.attr('id'),\n name = $this.attr('name'),\n forattr = $this.attr('for'),\n prefix, $form, $group, groupId, cacheKey, match, index;\n\n if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {\n return match;\n }\n\n if (id && !prefix) {\n prefix = (id.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n\n if (id && !prefix && $this.is('.djn-item') && id.match(/\\d+$/)) {\n [cacheKey, prefix, index] = id.match(/(.*?)\\-(\\d+)$/) || [null, null, null];\n }\n\n if (!prefix) {\n $form = $this.closest('.djn-inline-form');\n if ($form.length) {\n [cacheKey, prefix, index] = $form.attr('id').match(/(.*?)\\-(\\d+)$/)\n || [null, null, null];\n } else {\n $group = $this.closest('.djn-group');\n if (!$group.length) {\n return null;\n }\n groupId = $group.attr('id') || '';\n prefix = (groupId.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n } else {\n if (prefix.substr(0, 3) == 'id_') {\n prefix = prefix.substr(3);\n }\n\n if (!document.getElementById(prefix + '-group')) {\n return null;\n }\n }\n if (cacheKey) {\n prefixCache[cacheKey] = [prefix, index];\n }\n\n return [prefix, index];\n};\n\n$.fn.djangoFormPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n if (!prefixIndex || !prefixIndex[1]) {\n return null;\n }\n return prefixIndex[0] + '-' + prefixIndex[1] + '-';\n};\n\n$.fn.djangoFormIndex = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex || !prefixIndex[1]) ? null : parseInt(prefixIndex[1], 10);\n};\n\n$.fn.djangoFormsetPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex) ? null : prefixIndex[0];\n};\n\nvar filterDjangoFormsetForms = function(form, $group, formsetPrefix) {\n var formId = form.getAttribute('id'),\n formIndex = formId.substr(formsetPrefix.length + 1);\n\n // Check if form id matches /{prefix}-\\d+/\n if (formId.indexOf(formsetPrefix) !== 0) { return false; }\n return (!formIndex.match(/\\D/));\n};\n\n// Selects all initial forms within the same formset as the\n// element the method is being called on.\n$.fn.djangoFormsetForms = function() {\n var forms = [];\n this.each(function() {\n var $this = $(this),\n formsetPrefix = $this.djangoFormsetPrefix(),\n $group = (formsetPrefix) ? $('#' + formsetPrefix + '-group') : null,\n $forms;\n\n if (!formsetPrefix || !$group.length) return;\n\n $forms = $group.find('.djn-inline-form').filter(function() {\n return filterDjangoFormsetForms(this, $group, formsetPrefix);\n });\n var sortedForms = $forms.toArray().sort(function(a, b) {\n return $(a).djangoFormIndex() - $(b).djangoFormIndex;\n });\n Array.prototype.push.apply(forms, sortedForms);\n });\n return this.pushStack(forms);\n};\n\nif (typeof($.djangoFormField) != 'function') {\n $.djangoFormField = function(fieldName, prefix, index) {\n var $empty = $([]), matches;\n if (matches = prefix.match(/^(.+)\\-(\\d+)\\-$/)) {\n prefix = matches[1];\n index = matches[2];\n }\n index = parseInt(index, 10);\n if (isNaN(index)) {\n return $empty;\n }\n var namePrefix = prefix + '-' + index + '-';\n if (fieldName == '*') {\n return $('*[name^=\"' + namePrefix + '\"]').filter(function() {\n var fieldPart = $(this).attr('name').substring(namePrefix.length);\n return (fieldPart.indexOf('-') === -1);\n });\n }\n var $field = $('#id_' + namePrefix + fieldName);\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n var $group = $('#' + prefix + '-group'),\n fieldNameData = $group.djnData('fieldNames') || {};\n fieldName = fieldNameData[fieldName];\n if (!fieldName) { return $empty; }\n $field = $('#id_' + namePrefix + fieldName);\n }\n return $field;\n };\n}\n\nif (typeof($.fn.djangoFormField) != 'function') {\n /**\n * Given a django model's field name, and the forms index in the\n * formset, returns the field's input element, or an empty jQuery\n * object on failure.\n *\n * @param String fieldName - 'pk', 'position', or the field's\n * name in django (e.g. 'content_type',\n * 'url', etc.)\n * @return jQuery object containing the field's input element, or\n * an empty jQuery object on failure\n */\n $.fn.djangoFormField = function(fieldName, index) {\n var prefixAndIndex = this.djangoPrefixIndex();\n var $empty = $([]);\n if (!prefixAndIndex) {\n return $empty;\n }\n var prefix = prefixAndIndex[0];\n if (typeof(index) == 'undefined') {\n index = prefixAndIndex[1];\n if (typeof(index) == 'undefined') {\n return $empty;\n }\n }\n return $.djangoFormField(fieldName, prefix, index);\n };\n}\n\nif (typeof($.fn.filterDjangoField) != 'function') {\n var djRegexCache = {};\n $.fn.filterDjangoField = function(prefix, fieldName, index) {\n var $field, fieldNameData;\n if (typeof index != 'undefined') {\n if (typeof index == 'string') {\n index = parseInt(index, 10);\n }\n if (typeof index == 'number' && !isNaN(index)) {\n var fieldId = 'id_' + prefix + '-' + index + '-' + fieldName;\n $field = $('#' + fieldId);\n }\n } else {\n if (typeof(djRegexCache[prefix]) != 'object') {\n djRegexCache[prefix] = {};\n }\n if (typeof(djRegexCache[prefix][fieldName]) == 'undefined') {\n djRegexCache[prefix][fieldName] = new RegExp('^' + prefix + '-\\\\d+-' + fieldName + '$');\n } \n $field = this.find('input[name$=\"' + fieldName + '\"]').filter(function() {\n return this.getAttribute('name').match(djRegexCache[prefix][fieldName]);\n }); \n }\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n fieldNameData = $('#' + prefix + '-group').djnData('fieldNames') || {};\n if (typeof(fieldNameData[fieldName]) && fieldNameData[fieldName] != fieldName) {\n $field = $(this).filterDjangoField(prefix, fieldNameData[fieldName], index);\n }\n }\n return $field;\n };\n}\n","module.exports = window.django.jQuery;\n","'use strict';\n\nconst $ = require('jquery');\n/*!\n * jQuery UI Sortable @VERSION\n * http://jqueryui.com\n *\n * Copyright 2012 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/sortable/\n *\n * Depends:\n *\tjquery.ui.core.js\n *\tjquery.ui.mouse.js\n *\tjquery.ui.widget.js\n */\nif ($.ui === undefined) {\n var jQuery = $;\n (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return\"area\"===o?(s=t.parentNode,n=s.name,t.href&&n&&\"map\"===s.nodeName.toLowerCase()?(r=e(\"img[usemap=#\"+n+\"]\")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:\"a\"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return\"hidden\"===e.css(this,\"visibility\")}).length}var s=0,n=/^ui-id-\\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:\"1.10.3\",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return\"number\"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css(\"position\"))||/absolute/.test(this.css(\"position\"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,\"position\"))&&/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0),/fixed/.test(this.css(\"position\"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css(\"zIndex\",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css(\"position\"),(\"absolute\"===a||\"relative\"===a||\"fixed\"===a)&&(s=parseInt(n.css(\"zIndex\"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id=\"ui-id-\"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr(\"id\")})}}),e.extend(e.expr[\":\"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,\"tabindex\")))},tabbable:function(t){var a=e.attr(t,\"tabindex\"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e(\"\").outerWidth(1).jquery||e.each([\"Width\",\"Height\"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,\"padding\"+this))||0,a&&(i-=parseFloat(e.css(t,\"border\"+this+\"Width\"))||0),s&&(i-=parseFloat(e.css(t,\"margin\"+this))||0)}),i}var n=\"Width\"===a?[\"Left\",\"Right\"]:[\"Top\",\"Bottom\"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn[\"inner\"+a]=function(i){return i===t?o[\"inner\"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+\"px\")})},e.fn[\"outer\"+a]=function(t,i){return\"number\"!=typeof t?o[\"outer\"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+\"px\")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e(\"\").data(\"a-b\",\"a\").removeData(\"a-b\").data(\"a-b\")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart=\"onselectstart\"in document.createElement(\"div\"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?\"selectstart\":\"mousedown\")+\".ui-disableSelection\",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(\".ui-disableSelection\")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if(\"hidden\"===e(t).css(\"overflow\"))return!1;var a=i&&\"left\"===i?\"scrollLeft\":\"scrollTop\",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler(\"remove\")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(\".\")[0];i=i.split(\".\")[1],n=u+\"-\"+i,a||(a=s,s=e.Widget),e.expr[\":\"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+\".\"+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o=\"string\"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&\"_\"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error(\"no such method '\"+r+\"' for \"+i+\" widget instance\"):e.error(\"cannot call methods on \"+i+\" prior to initialization; \"+\"attempted to call method '\"+r+\"'\")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof i)if(o={},a=i.split(\".\"),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled ui-state-disabled\",!!t).attr(\"aria-disabled\",t),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")),this},enable:function(){return this._setOption(\"disabled\",!1)},disable:function(){return this._setOption(\"disabled\",!0)},_on:function(i,s,a){var n,r=this;\"boolean\"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?r[o]:o).apply(r,arguments):t}\"string\"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\\w+)\\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,a,n){\"string\"==typeof a&&(a={effect:a});var r,o=a?a===!0||\"number\"==typeof a?i:a.effect||i:t;a=a||{},\"number\"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget(\"ui.mouse\",{version:\"1.10.3\",options:{cancel:\"input,textarea,button,select,option\",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind(\"mousedown.\"+this.widgetName,function(e){return t._mouseDown(e)}).bind(\"click.\"+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+\".preventClickEvent\")?(e.removeData(i.target,t.widgetName+\".preventClickEvent\"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind(\".\"+this.widgetName),this._mouseMoveDelegate&&e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n=\"string\"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+\".preventClickEvent\")&&e.removeData(i.target,this.widgetName+\".preventClickEvent\"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).bind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+\".preventClickEvent\",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function s(t,i){return parseInt(e.css(t,i),10)||0}function a(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,o=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\\+\\-]\\d+(\\.[\\d]+)?%?/,d=/^\\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var i,s,a=e(\"
\"),r=a.children()[0];return e(\"body\").append(a),i=r.offsetWidth,a.css(\"overflow\",\"scroll\"),s=r.offsetWidth,i===s&&(s=a[0].clientWidth),a.remove(),n=i-s},getScrollInfo:function(t){var i=t.isWindow?\"\":t.element.css(\"overflow-x\"),s=t.isWindow?\"\":t.element.css(\"overflow-y\"),a=\"scroll\"===i||\"auto\"===i&&t.widths?\"left\":i>0?\"right\":\"center\",vertical:0>n?\"top\":a>0?\"bottom\":\"middle\"};c>p&&p>o(i+s)&&(h.horizontal=\"center\"),d>m&&m>o(a+n)&&(h.vertical=\"middle\"),h.important=r(o(i),o(s))>r(o(a),o(n))?\"horizontal\":\"vertical\",t.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,o=e.left-t.collisionPosition.marginLeft,h=a-o,l=o+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=r(e.left-o,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,o=e.top-t.collisionPosition.marginTop,h=a-o,l=o+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,r=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-r-h,d=\"left\"===t.my[0]?-t.elemWidth:\"right\"===t.my[0]?t.elemWidth:0,p=\"left\"===t.at[0]?t.targetWidth:\"right\"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-r-n,(0>i||o(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>o(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,r=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-r-h,d=\"top\"===t.my[1],p=d?-t.elemHeight:\"bottom\"===t.my[1]?t.elemHeight:0,f=\"top\"===t.at[1]?t.targetHeight:\"bottom\"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-r-n,e.top+p+f+m>u&&(0>s||o(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>c&&(i>0||c>o(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,n,r=document.getElementsByTagName(\"body\")[0],o=document.createElement(\"div\");t=document.createElement(r?\"div\":\"body\"),s={visibility:\"hidden\",width:0,height:0,border:0,margin:0,background:\"none\"},r&&e.extend(s,{position:\"absolute\",left:\"-1000px\",top:\"-1000px\"});for(n in s)t.style[n]=s[n];t.appendChild(o),i=r||document.documentElement,i.insertBefore(t,i.firstChild),o.style.cssText=\"position: absolute; left: 10.7432222px;\",a=e(o).offset().left,e.support.offsetFractions=a>10&&11>a,t.innerHTML=\"\",i.removeChild(t)}()})(jQuery);\n}\n\n$.widget(\"ui.djnsortable\", $.ui.mouse, {\n\tversion: \"@VERSION\",\n\twidgetEventPrefix: \"sort\",\n\tready: false,\n\toptions: {\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectWith: false,\n\t\tcontainment: false,\n\t\tcursor: 'auto',\n\t\tcursorAt: false,\n\t\tdropOnEmpty: true,\n\t\tforcePlaceholderSize: false,\n\t\tforceHelperSize: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\titems: '> *',\n\t\topacity: false,\n\t\tplaceholder: false,\n\t\trevert: false,\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tscope: \"default\",\n\t\ttolerance: \"intersect\",\n\t\tzIndex: 1000\n\t},\n\n\t_isOverAxis: function( x, reference, size ) {\n\t\treturn ( x >= reference ) && ( x < ( reference + size ) );\n\t},\n\n\t_create: function() {\n\n\t\tvar o = this.options;\n\t\tthis.containerCache = {};\n\t\tthis.element.addClass(\"ui-sortable\");\n\n\t\t//Get the items\n\t\tthis.refresh();\n\n\t\t//Let's determine if the items are being displayed horizontally\n\t\tthis.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;\n\n\t\t//Let's determine the parent's offset\n\t\tthis.offset = this.element.offset();\n\n\t\t//Initialize mouse events for interaction\n\t\tthis._mouseInit();\n\n\t\t//We're ready to go\n\t\tthis.ready = true\n\n\t},\n\n\t_destroy: function() {\n\t\tthis.element\n\t\t\t.removeClass(\"ui-sortable ui-sortable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\tfor ( var i = this.items.length - 1; i >= 0; i-- )\n\t\t\tthis.items[i].item.removeData(this.widgetName + \"-item\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value){\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.options[ key ] = value;\n\n\t\t\tthis.widget().toggleClass( \"ui-sortable-disabled\", !!value );\n\t\t} else {\n\t\t\t// Don't call widget base _setOption for disable as it adds ui-state-disabled class\n\t\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t\t}\n\t},\n\n\t_mouseCapture: function(event, overrideHandle) {\n\t\tvar that = this;\n\n\t\tif (this.reverting) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(this.options.disabled || this.options.type == 'static') return false;\n\n\t\t//We have to refresh the items data once first\n\t\tthis._refreshItems(event);\n\n\t\t//Find out if the clicked node (or one of its parents) is a actual item in this.items\n\t\tvar currentItem = null, nodes = $(event.target).parents().each(function() {\n\t\t\tif($.data(this, that.widgetName + '-item') == that) {\n\t\t\t\tcurrentItem = $(this);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);\n\n\t\tif(!currentItem) return false;\n\t\tif(this.options.handle && !overrideHandle) {\n\t\t\tvar validHandle = false;\n\t\t\tvar addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n\n\t\t\t$(this.options.handle, currentItem).find(\"*\")[addBackMethod]().each(function() { if(this == event.target) validHandle = true; });\n\t\t\tif(!validHandle) return false;\n\t\t}\n\n\t\tthis.currentItem = currentItem;\n\t\tthis._removeCurrentsFromItems();\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event, overrideHandle, noActivation) {\n\n\t\tvar o = this.options;\n\t\tthis.currentContainer = this;\n\n\t\t//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture\n\t\tthis.refreshPositions();\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Get the next scrolling parent\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.currentItem.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t// Only after we got the offset, we can change the helper's position to absolute\n\t\t// TODO: Still need to figure out a way to make relative sorting possible\n\t\tthis.helper.css(\"position\", \"absolute\");\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\n\t\t//Generate the original position\n\t\tthis.originalPosition = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Cache the former DOM position\n\t\tthis.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };\n\n\t\t//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way\n\t\tif(this.helper[0] != this.currentItem[0]) {\n\t\t\tthis.currentItem.hide();\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthis._createPlaceholder();\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\tif(o.cursor) { // cursor option\n\t\t\tif ($('body').css(\"cursor\")) this._storedCursor = $('body').css(\"cursor\");\n\t\t\t$('body').css(\"cursor\", o.cursor);\n\t\t}\n\n\t\tif(o.opacity) { // opacity option\n\t\t\tif (this.helper.css(\"opacity\")) this._storedOpacity = this.helper.css(\"opacity\");\n\t\t\tthis.helper.css(\"opacity\", o.opacity);\n\t\t}\n\n\t\tif(o.zIndex) { // zIndex option\n\t\t\tif (this.helper.css(\"zIndex\")) this._storedZIndex = this.helper.css(\"zIndex\");\n\t\t\tthis.helper.css(\"zIndex\", o.zIndex);\n\t\t}\n\n\t\t//Prepare scrolling\n\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')\n\t\t\tthis.overflowOffset = this.scrollParent.offset();\n\n\t\t//Call callbacks\n\t\tthis._trigger(\"start\", event, this._uiHash());\n\n\t\t//Recache the helper size\n\t\tif(!this._preserveHelperProportions)\n\t\t\tthis._cacheHelperProportions();\n\n\n\t\t//Post 'activate' events to possible containers\n\t\tif(!noActivation) {\n\t\t\t for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger(\"activate\", event, this._uiHash(this)); }\n\t\t}\n\n\t\t//Prepare possible droppables\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\tthis.dragging = true;\n\n\t\tthis.helper.addClass(\"ui-sortable-helper\");\n\t\tthis._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\treturn true;\n\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\tif (!this.lastPositionAbs) {\n\t\t\tthis.lastPositionAbs = this.positionAbs;\n\t\t}\n\n\t\t//Do scrolling\n\t\tif(this.options.scroll) {\n\t\t\tvar o = this.options, scrolled = false;\n\t\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {\n\n\t\t\t\tif((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n\n\t\t\t\tif((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n\n\t\t\t} else {\n\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\n\t\t\t}\n\n\t\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\t\t}\n\n\t\t//Regenerate the absolute position used for position checks\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Set the helper position\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\n\t\t//Rearrange\n\t\tfor (var i = this.items.length - 1; i >= 0; i--) {\n\n\t\t\t//Cache variables and intersection, continue if no intersection\n\t\t\tvar item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);\n\t\t\tif (!intersection) continue;\n\n\t\t\t// Only put the placeholder inside the current Container, skip all\n\t\t\t// items form other containers. This works because when moving\n\t\t\t// an item from one container to another the\n\t\t\t// currentContainer is switched before the placeholder is moved.\n\t\t\t//\n\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n\t\t\t// beetween the outer and inner container.\n\t\t\tif (item.instance !== this.currentContainer) continue;\n\n\t\t\tif (itemElement != this.currentItem[0] //cannot intersect with itself\n\t\t\t\t&&\tthis.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n\t\t\t\t&&\t!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n\t\t\t\t&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n\t\t\t\t//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container\n\t\t\t) {\n\n\t\t\t\tthis.direction = intersection == 1 ? \"down\" : \"up\";\n\n\t\t\t\tif (this.options.tolerance == \"pointer\" || this._intersectsWithSides(item)) {\n\t\t\t\t\tthis._rearrange(event, item);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Post events to containers\n\t\tthis._contactContainers(event);\n\n\t\t//Interconnect with droppables\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\t//Call callbacks\n\t\tthis._trigger('sort', event, this._uiHash());\n\n\t\tthis.lastPositionAbs = this.positionAbs;\n\t\treturn false;\n\n\t},\n\n\t_mouseStop: function(event, noPropagation) {\n\n\t\tif(!event) return;\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\t$.ui.ddmanager.drop(this, event);\n\n\t\tif(this.options.revert) {\n\t\t\tvar that = this;\n\t\t\tvar cur = this.placeholder.offset();\n\n\t\t\tthis.reverting = true;\n\n\t\t\t$(this.helper).animate({\n\t\t\t\tleft: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),\n\t\t\t\ttop: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)\n\t\t\t}, parseInt(this.options.revert, 10) || 500, function() {\n\t\t\t\tthat._clear(event);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._clear(event, noPropagation);\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tcancel: function() {\n\n\t\tif(this.dragging) {\n\n\t\t\tthis._mouseUp({ target: null });\n\n\t\t\tif(this.options.helper == \"original\")\n\t\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t\telse\n\t\t\t\tthis.currentItem.show();\n\n\t\t\t//Post deactivating events to containers\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tthis.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.placeholder) {\n\t\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\t\tif(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\t\t\tif(this.options.helper != \"original\" && this.helper && this.helper[0].parentNode) this.helper.remove();\n\n\t\t\t$.extend(this, {\n\t\t\t\thelper: null,\n\t\t\t\tdragging: false,\n\t\t\t\treverting: false,\n\t\t\t\t_noFinalSort: null\n\t\t\t});\n\n\t\t\tif(this.domPosition.prev) {\n\t\t\t\t$(this.domPosition.prev).after(this.currentItem);\n\t\t\t} else {\n\t\t\t\t$(this.domPosition.parent).prepend(this.currentItem);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tserialize: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar str = []; o = o || {};\n\n\t\t$(items).each(function() {\n\t\t\tvar res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));\n\t\t\tif(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));\n\t\t});\n\n\t\tif(!str.length && o.key) {\n\t\t\tstr.push(o.key + '=');\n\t\t}\n\n\t\treturn str.join('&');\n\n\t},\n\n\ttoArray: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar ret = []; o = o || {};\n\n\t\titems.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });\n\t\treturn ret;\n\n\t},\n\n\t/* Be careful with the following core functions */\n\t_intersectsWith: function(item) {\n\n\t\tvar x1 = this.positionAbs.left,\n\t\t\tx2 = x1 + this.helperProportions.width,\n\t\t\ty1 = this.positionAbs.top,\n\t\t\ty2 = y1 + this.helperProportions.height;\n\n\t\tvar l = item.left,\n\t\t\tr = l + item.width,\n\t\t\tt = item.top,\n\t\t\tb = t + Math.max(10, item.height);\n\n\t\tvar dyClick = this.offset.click.top,\n\t\t\tdxClick = this.offset.click.left;\n\n\t\tvar isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;\n\n\t\tif(\t this.options.tolerance == \"pointer\"\n\t\t\t|| this.options.forcePointerForContainers\n\t\t\t|| (this.options.tolerance != \"pointer\" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])\n\t\t) {\n\t\t\treturn isOverElement;\n\t\t} else {\n\n\t\t\treturn (l < x1 + (this.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (this.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (this.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (this.helperProportions.height / 2) < b ); // Top Half\n\n\t\t}\n\t},\n\n\t_intersectsWithPointer: function(item) {\n\n\t\tvar isOverElementHeight = (this.options.axis === 'x') || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, Math.max(10, item.height)),\n\t\t\tisOverElementWidth = (this.options.axis === 'y') || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n\t\t\tisOverElement = isOverElementHeight && isOverElementWidth,\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (!isOverElement)\n\t\t\treturn false;\n\n\t\treturn this.floating ?\n\t\t\t( ((horizontalDirection && horizontalDirection == \"right\") || verticalDirection == \"down\") ? 2 : 1 )\n\t\t\t: ( verticalDirection && (verticalDirection == \"down\" ? 2 : 1) );\n\n\t},\n\n\t_intersectsWithSides: function(item) {\n\n\t\tvar isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (Math.max(10, item.height)/2), Math.max(10, item.height)),\n\t\t\tisOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (this.floating && horizontalDirection) {\n\t\t\treturn ((horizontalDirection == \"right\" && isOverRightHalf) || (horizontalDirection == \"left\" && !isOverRightHalf));\n\t\t} else {\n\t\t\treturn verticalDirection && ((verticalDirection == \"down\" && isOverBottomHalf) || (verticalDirection == \"up\" && !isOverBottomHalf));\n\t\t}\n\n\t},\n\n\t_getDragVerticalDirection: function() {\n\t\tvar delta = this.positionAbs.top - this.lastPositionAbs.top;\n\t\treturn delta != 0 && (delta > 0 ? \"down\" : \"up\");\n\t},\n\n\t_getDragHorizontalDirection: function() {\n\t\tvar delta = this.positionAbs.left - this.lastPositionAbs.left;\n\t\treturn delta != 0 && (delta > 0 ? \"right\" : \"left\");\n\t},\n\n\trefresh: function(event) {\n\t\tthis._refreshItems(event);\n\t\tthis.refreshPositions();\n\t\treturn this;\n\t},\n\n\t_connectWith: function() {\n\t\tvar options = this.options;\n\t\treturn options.connectWith.constructor == String\n\t\t\t? [options.connectWith]\n\t\t\t: options.connectWith;\n\t},\n\n\t_getItemsAsjQuery: function(connected) {\n\n\t\tvar items = [];\n\t\tvar queries = [];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && connected) {\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), inst]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tqueries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), this]);\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--){\n\t\t\tqueries[i][0].each(function() {\n\t\t\t\titems.push(this);\n\t\t\t});\n\t\t};\n\n\t\treturn $(items);\n\n\t},\n\n\t_removeCurrentsFromItems: function() {\n\n\t\tvar list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n\n\t\tthis.items = $.grep(this.items, function (item) {\n\t\t\tfor (var j=0; j < list.length; j++) {\n\t\t\t\tif(list[j] == item.item[0])\n\t\t\t\t\treturn false;\n\t\t\t};\n\t\t\treturn true;\n\t\t});\n\n\t},\n\n\t_refreshItems: function(event) {\n\n\t\tthis.items = [];\n\t\tthis.containers = [this];\n\t\tvar items = this.items;\n\t\tvar queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);\n\t\t\t\t\t\tthis.containers.push(inst);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--) {\n\t\t\tvar targetData = queries[i][1];\n\t\t\tvar _queries = queries[i][0];\n\n\t\t\tfor (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {\n\t\t\t\tvar item = $(_queries[j]);\n\n\t\t\t\titem.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)\n\n\t\t\t\titems.push({\n\t\t\t\t\titem: item,\n\t\t\t\t\tinstance: targetData,\n\t\t\t\t\twidth: 0, height: 0,\n\t\t\t\t\tleft: 0, top: 0\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t},\n\n\trefreshPositions: function(fast) {\n\n\t\t//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change\n\t\tif(this.offsetParent && this.helper) {\n\t\t\tthis.offset.parent = this._getParentOffset();\n\t\t}\n\n\t\tfor (var i = this.items.length - 1; i >= 0; i--){\n\t\t\tvar item = this.items[i];\n\n\t\t\t//We ignore calculating positions of all connected containers when we're not over them\n\t\t\tif(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])\n\t\t\t\tcontinue;\n\n\t\t\tvar t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n\t\t\tif (!fast) {\n\t\t\t\titem.width = t.outerWidth();\n\t\t\t\titem.height = t.outerHeight();\n\t\t\t}\n\n\t\t\tvar p = t.offset();\n\t\t\titem.left = p.left;\n\t\t\titem.top = p.top;\n\t\t};\n\n\t\tif(this.options.custom && this.options.custom.refreshContainers) {\n\t\t\tthis.options.custom.refreshContainers.call(this);\n\t\t} else {\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tvar p = this.containers[i].element.offset();\n\t\t\t\tthis.containers[i].containerCache.left = p.left;\n\t\t\t\tthis.containers[i].containerCache.top = p.top;\n\t\t\t\tthis.containers[i].containerCache.width\t= this.containers[i].element.outerWidth();\n\t\t\t\tthis.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_createPlaceholder: function(that) {\n\t\tthat = that || this;\n\t\tvar o = that.options;\n\n\t\tif(!o.placeholder || o.placeholder.constructor == String) {\n\t\t\tvar className = o.placeholder;\n\t\t\to.placeholder = {\n\t\t\t\telement: function() {\n\n\t\t\t\t\tvar el = $(document.createElement(that.currentItem[0].nodeName))\n\t\t\t\t\t\t.addClass(className || that.currentItem[0].className+\" ui-sortable-placeholder\")\n\t\t\t\t\t\t.removeClass(\"ui-sortable-helper\")[0];\n\n\t\t\t\t\tif(!className)\n\t\t\t\t\t\tel.style.visibility = \"hidden\";\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tupdate: function(container, p) {\n\n\t\t\t\t\t// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that\n\t\t\t\t\t// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified\n\t\t\t\t\tif(className && !o.forcePlaceholderSize) return;\n\n\t\t\t\t\t//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item\n\t\t\t\t\tif(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };\n\t\t\t\t\tif(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthat.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));\n\n\t\t//Append it after the actual current item\n\t\tthat.currentItem.after(that.placeholder);\n\n\t\t//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\t\to.placeholder.update(that, that.placeholder);\n\n\t},\n\n\t_contactContainers: function(event) {\n\n\t\t// get innermost container that intersects with item\n\t\tvar innermostContainer = null, innermostIndex = null;\n\n\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\n\t\t\t// never consider a container that's located within the item itself\n\t\t\tif($.contains(this.currentItem[0], this.containers[i].element[0]))\n\t\t\t\tcontinue;\n\n\t\t\tif(this._intersectsWith(this.containers[i].containerCache)) {\n\n\t\t\t\t// if we've already found a container and it's more \"inner\" than this, then continue\n\t\t\t\tif(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tinnermostContainer = this.containers[i];\n\t\t\t\tinnermostIndex = i;\n\n\t\t\t} else {\n\t\t\t\t// container doesn't intersect. trigger \"out\" event if necessary\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// if no intersecting containers found, return\n\t\tif(!innermostContainer) return;\n\n\t\t// move the item into the container if it's not there already\n\t\tif(this.containers.length === 1) {\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} else {\n\n\t\t\t//When entering a new container, we will find the item with the least distance and append our item near it\n\t\t\tvar dist = 10000; var itemWithLeastDistance = null;\n\t\t\tvar posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';\n\t\t\tvar sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';\n\t\t\tvar base = this.positionAbs[posProperty] + this.offset.click[posProperty];\n\t\t\tfor (var j = this.items.length - 1; j >= 0; j--) {\n\t\t\t\tif(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;\n\t\t\t\tif(this.items[j].item[0] == this.currentItem[0]) continue;\n\t\t\t\tvar cur = this.items[j].item.offset()[posProperty];\n\t\t\t\tvar nearBottom = false;\n\t\t\t\tif(Math.abs(cur - base) > Math.abs(cur + Math.max(10, this.items[j][sizeProperty]) - base)){\n\t\t\t\t\tnearBottom = true;\n\t\t\t\t\tcur += this.items[j][sizeProperty];\n\t\t\t\t}\n\n\t\t\t\tif(Math.abs(cur - base) < dist) {\n\t\t\t\t\tdist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];\n\t\t\t\t\tthis.direction = nearBottom ? \"up\": \"down\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\n\t\t\t\treturn;\n\n\t\t\tthis.currentContainer = this.containers[innermostIndex];\n\t\t\titemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\tthis.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n\t\t\t//Update the placeholder\n\t\t\tthis.options.placeholder.update(this.currentContainer, this.placeholder);\n\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t}\n\n\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);\n\n\t\tif(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already\n\t\t\t$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n\n\t\tif(helper[0] == this.currentItem[0])\n\t\t\tthis._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") };\n\n\t\tif(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());\n\t\tif(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.currentItem.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.currentItem.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.currentItem.css(\"marginTop\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\t0 - this.offset.relative.left - this.offset.parent.left,\n\t\t\t0 - this.offset.relative.top - this.offset.parent.top,\n\t\t\t$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment)) {\n\t\t\tvar ce = $(o.containment)[0];\n\t\t\tvar co = $(o.containment).offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\tco.left + (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0) - this.margins.left,\n\t\t\t\tco.top + (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0) - this.margins.top,\n\t\t\t\tco.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left,\n\t\t\t\tco.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top\n\t\t\t];\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\t// This is another very weird special case that only happens for relative elements:\n\t\t// 1. If the css position is relative\n\t\t// 2. and the scroll parent is the document or similar to the offset parent\n\t\t// we have to refresh the relative offset during the scroll so there are no jumps\n\t\tif(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {\n\t\t\tthis.offset.relative = this._getRelativeOffset();\n\t\t}\n\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\n\t\t\tif(this.containment) {\n\t\t\t\tif(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\tvar top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n\t\t\t\tpageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n\t\t\t\tpageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_rearrange: function(event, i, a, hardRefresh) {\n\n\t\ta ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));\n\n\t\t//Various things done here to improve the performance:\n\t\t// 1. we create a setTimeout, that calls refreshPositions\n\t\t// 2. on the instance, we have a counter variable, that get's higher after every append\n\t\t// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n\t\t// 4. this lets only the last addition to the timeout stack through\n\t\tthis.counter = this.counter ? ++this.counter : 1;\n\t\tvar counter = this.counter;\n\n\t\tthis._delay(function() {\n\t\t\tif(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n\t\t});\n\n\t},\n\n\t_clear: function(event, noPropagation) {\n\n\t\tthis.reverting = false;\n\t\t// We delay all events that have to be triggered to after the point where the placeholder has been removed and\n\t\t// everything else normalized again\n\t\tvar delayedTriggers = [];\n\n\t\t// We first have to update the dom position of the actual currentItem\n\t\t// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)\n\t\tif(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);\n\t\tthis._noFinalSort = null;\n\n\t\tif(this.helper[0] == this.currentItem[0]) {\n\t\t\tfor(var i in this._storedCSS) {\n\t\t\t\tif(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';\n\t\t\t}\n\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t} else {\n\t\t\tthis.currentItem.show();\n\t\t}\n\n\t\tif(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"receive\", event, this._uiHash(this.fromOutside)); });\n\t\tif((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"update\", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed\n\n\t\t// Check if the items Container has Changed and trigger appropriate\n\t\t// events.\n\t\tif (this !== this.currentContainer) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tdelayedTriggers.push(function(event) { this._trigger(\"remove\", event, this._uiHash()); });\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"receive\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"update\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t}\n\t\t}\n\n\n\t\t//Post events to containers\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\tif(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger(\"deactivate\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"out\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t}\n\t\t}\n\n\t\t//Do what was originally in plugins\n\t\tif(this._storedCursor) $('body').css(\"cursor\", this._storedCursor); //Reset cursor\n\t\tif(this._storedOpacity) this.helper.css(\"opacity\", this._storedOpacity); //Reset opacity\n\t\tif(this._storedZIndex) this.helper.css(\"zIndex\", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index\n\n\t\tthis.dragging = false;\n\t\tif(this.cancelHelperRemoval) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tthis._trigger(\"beforeStop\", event, this._uiHash());\n\t\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t\t}\n\n\t\t\tthis.fromOutside = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!noPropagation) this._trigger(\"beforeStop\", event, this._uiHash());\n\n\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\tthis.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n\t\tif(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;\n\n\t\tif(!noPropagation) {\n\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t}\n\n\t\tthis.fromOutside = false;\n\t\treturn true;\n\n\t},\n\n\t_trigger: function() {\n\t\tif ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n\t\t\tthis.cancel();\n\t\t}\n\t},\n\n _delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_uiHash: function(_inst) {\n\t\tvar inst = _inst || this;\n\t\treturn {\n\t\t\thelper: inst.helper,\n\t\t\tplaceholder: inst.placeholder || $([]),\n\t\t\tposition: inst.position,\n\t\t\toriginalPosition: inst.originalPosition,\n\t\t\toffset: inst.positionAbs,\n\t\t\titem: inst.currentItem,\n\t\t\tsender: _inst ? _inst.element : null\n\t\t};\n\t}\n\n});\n","'use strict';\n\nconst $ = require('jquery');\nrequire('./jquery.ui.djnsortable');\n\n/*\n * jQuery UI Nested Sortable\n * v 1.3.4 / 28 apr 2011\n * http://mjsarfatti.com/sandbox/nestedSortable\n *\n * Depends:\n * jquery.ui.sortable.js 1.8+\n *\n * License CC BY-SA 3.0\n * Copyright 2010-2011, Manuele J Sarfatti\n */\nif (typeof $.fn.nearest != 'function') {\n /**\n * Returns the descendant(s) matching a given selector which are the\n * shortest distance from the search context element (in otherwords,\n * $.fn.closest(), in reverse).\n */\n $.fn.nearest = function(selector) {\n var nearest = [], node = this, distance = 10000;\n node.find(selector).each(function(){\n var d = $(this).parentsUntil(node).length;\n if (d < distance) {\n distance = d;\n nearest = [this];\n } else if (d == distance) {\n nearest.push(this);\n }\n });\n return this.pushStack(nearest, 'nearest', [selector]);\n };\n}\n\nvar counter = 0;\nvar expando = \"djn\" + (\"\" + Math.random()).replace(/\\D/g, \"\");\n\nvar createChildNestedSortable = function(parent, childContainer) {\n // Don't continue if the new element is the same as the old\n if (parent && parent.element && parent.element[0] == childContainer) {\n return;\n }\n var $childContainer = $(childContainer),\n options = $.extend({}, parent.options);\n options.connectWith = [parent.element];\n\n if ($childContainer.data(parent.widgetName)) {\n return;\n }\n\n var widgetConstructor = $childContainer[parent.widgetName];\n widgetConstructor.call($childContainer, options);\n var newInstance = $childContainer.data(parent.widgetName);\n for (var i = 0; i < parent.options.connectWith.length; i++) {\n var $otherContainer = parent.options.connectWith[i];\n newInstance.addToConnectWith($otherContainer);\n var otherInstance = $otherContainer.data(parent.widgetName);\n if (otherInstance) {\n otherInstance.addToConnectWith($childContainer);\n }\n }\n parent.addToConnectWith($childContainer);\n return newInstance;\n};\n\n$.widget(\"ui.nestedSortable\", $.ui.djnsortable, {\n\n options: {\n tabSize: 20,\n disableNesting: 'ui-nestedSortable-no-nesting',\n errorClass: 'ui-nestedSortable-error',\n nestedContainerSelector: ':not(*)',\n // Whether to clear empty list item and container elements\n doNotClear: false,\n /**\n * Create a list container element if the draggable was dragged\n * to the top or bottom of the elements at its level.\n *\n * @param DOMElement parent - The element relative to which the\n * new element will be inserted.\n * @return DOMElement - The new element.\n */\n createContainerElement: function(parent) {\n return $(document.createElement('ol'));\n },\n // Selector which matches all container elements in the nestedSortable\n containerElementSelector: 'ol',\n // Selector which matches all list items (draggables) in the nestedSortable\n listItemSelector: 'li',\n // Selector which, when applied to a container, returns its child list items\n items: '> li',\n maxLevels: 0,\n revertOnError: 1,\n protectRoot: false,\n rootID: null,\n rtl: false,\n // if true, you can not move nodes to different levels of nesting\n fixedNestingDepth: false,\n // show the error div or just not show a drop area\n showErrorDiv: true,\n // if true only allows you to rearrange within its parent container\n keepInParent: false,\n isAllowed: function(item, parent) { return true; },\n canConnectWith: function(container1, container2, instance) {\n var model1 = container1.data('inlineModel');\n var model2 = container2.data('inlineModel');\n if (model1 !== model2) {\n return false;\n }\n var instance2 = container2.data(instance.widgetName);\n if (!instance.options.fixedNestingDepth) {\n if (!instance2 || !instance2.options.fixedNestingDepth) {\n return true;\n }\n }\n var container1Level = instance._getLevel(container1);\n var container2Level = instance._getLevel(container2);\n return (container1Level === container2Level);\n }\n },\n\n _createWidget: function(options, element) {\n var $element = $( element || this.defaultElement || this ),\n dataOptions = $element.data('djnsortableOptions');\n element = $element[0];\n if (dataOptions) {\n options = $.extend({}, options, dataOptions);\n }\n return $.ui.djnsortable.prototype._createWidget.call(this, options, element);\n },\n\n _create: function() {\n if (this.element.data('uiNestedSortable')) {\n this.element.data('nestedSortable', this.element.data('uiNestedSortable'));\n }\n if (this.element.data('ui-nestedSortable')) {\n this.element.data('nestedSortable', this.element.data('ui-nestedSortable'));\n }\n this.element.data('djnsortable', this.element.data('nestedSortable'));\n if (this.element.data('uiNestedSortable')) {\n this.element.data('uiSortable', this.element.data('nestedSortable'));\n }\n // if (!this.element.is(this.options.containerElementSelector)) {\n // throw new Error('nestedSortable: Please check that the ' +\n // 'containerElementSelector option matches ' +\n // 'the element passed to the constructor.');\n // }\n\n $.ui.djnsortable.prototype._create.apply(this, arguments);\n\n this._connectWithMap = {};\n\n var self = this,\n o = this.options,\n $document = $(document);\n\n var originalConnectWith = o.connectWith;\n if (!originalConnectWith || typeof(originalConnectWith) == 'string') {\n this.options.connectWith = [];\n if (typeof(originalConnectWith) == 'string') {\n var connected = this._connectWith();\n for (var i = 0; i < connected.length; i++) {\n this.addToConnectWith($(connected[i]));\n }\n }\n\n // HACK!! FIX!! (django-specific logic)\n $document.on('djnesting:init.nestedSortable', o.containerElementSelector, function(event) {\n createChildNestedSortable(self, this);\n });\n this.element.find(o.containerElementSelector+':not(.subarticle-wrapper)').each(function(i, el) {\n if ($(el).closest('[data-inline-formset]').attr('id').indexOf('-empty') > -1) {\n return;\n }\n createChildNestedSortable(self, el);\n });\n }\n $document.trigger('nestedSortable:created', [this]);\n $document.on('nestedSortable:created.nestedSortable', function(e, instance) {\n instance.addToConnectWith(self.element);\n self.addToConnectWith(instance.element);\n });\n },\n\n addToConnectWith: function(element) {\n var self = this,\n $element = (typeof(element.selector) != 'undefined') ? element : $(element),\n uniqueId;\n\n if ($element.length > 1) {\n $element.each(function(i, el) {\n self.addToConnectWith($(el));\n });\n return;\n }\n uniqueId = element[0][expando];\n if (typeof uniqueId == 'undefined') {\n uniqueId = element[0][expando] = ++counter;\n }\n if (typeof this.options.connectWith == 'string') {\n return;\n }\n if (this._connectWithMap[uniqueId]) {\n return;\n }\n this.options.connectWith.push(element);\n this._connectWithMap[uniqueId] = 1;\n },\n\n _destroy: function() {\n this.element\n .removeData(\"nestedSortable\")\n .unbind(\".nestedSortable\");\n $(document).unbind('.nestedSortable');\n return $.ui.djnsortable.prototype.destroy.apply(this, arguments);\n },\n\n /**\n * Override this method to add extra conditions on an item before it's\n * rearranged.\n */\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var itemElement = item.item[0], o = this.options,\n intersection = $.ui.djnsortable.prototype._intersectsWithPointer.apply(this, arguments);\n\n this.lastItemElement = null;\n if (!intersection) {\n return intersection;\n }\n\n // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n // between the outer and inner container.\n if (item.instance !== this.currentContainer) {\n return false;\n }\n var $itemElement = $(itemElement);\n\n if (o.fixedNestingDepth && this._getLevel(this.currentItem) === 1+this._getLevel($itemElement)) {\n $itemElement = (function() {\n var containerSel = o.containerElementSelector;\n var $childItems = $itemElement.find('.djn-item');\n if ($childItems.length != 1) {\n return $itemElement;\n }\n if (!$childItems.is('.djn-no-drag,.djn-thead')) {\n return $itemElement;\n }\n var itemElementClosestContainer = $itemElement.closest(containerSel);\n if (!itemElementClosestContainer.length) {\n return $itemElement;\n }\n // Make sure the item is only one level deeper\n if (itemElementClosestContainer[0] != $childItems.closest(containerSel).closest(containerSel)[0]) {\n return $itemElement;\n }\n return $($childItems[0]);\n })();\n itemElement = $itemElement[0];\n }\n\n if (itemElement != this.currentItem[0] //cannot intersect with itself\n && this.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n && (!o.keepInParent || itemElement.parentNode == this.placeholder[0].parentNode) //only rearrange items within the same container\n && (!o.fixedNestingDepth || (this._getLevel(this.currentItem) === this._getLevel($itemElement))) //maintain the nesting level of node\n && (o.showErrorDiv || o.isAllowed.call(this, this.currentItem[0], itemElement.parentNode, this.placeholder))\n ) {\n this.lastItemElement = itemElement;\n return intersection;\n } else {\n return false;\n }\n },\n\n // This method is called after items have been iterated through.\n // Overriding this is cleaner than copying and pasting _mouseDrag()\n // and inserting logic in the middle.\n _contactContainers: function _contactContainers(event) {\n if (this.lastItemElement) {\n this._clearEmpty(this.lastItemElement);\n }\n\n\n var o = this.options,\n _parentItem = this.placeholder.closest(o.listItemSelector),\n parentItem = (_parentItem.length && _parentItem.closest('.ui-sortable').length)\n ? _parentItem\n : null,\n level = this._getLevel(this.placeholder),\n childLevels = this._getChildLevels(this.helper);\n\n var placeholderClassName = this.placeholder.attr('class');\n var phClassSearch = \" \" + placeholderClassName + \" \";\n // If the current level class isn't already set\n if (phClassSearch.indexOf(\" ui-sortable-nested-level-\" + level + \" \") == -1) {\n var phOrigClassName;\n // Check if another level class is set\n var phOrigClassNameEndPos = phClassSearch.indexOf(\" ui-sortable-nested-level-\") - 1;\n if (phOrigClassNameEndPos > -1) {\n phOrigClassName = placeholderClassName.substring(0, phOrigClassNameEndPos);\n } else {\n phOrigClassName = placeholderClassName;\n }\n // Add new level to class\n this.placeholder.attr('class', phOrigClassName + ' ui-sortable-nested-level-' + level);\n }\n\n // To find the previous sibling in the list, keep backtracking until we hit a valid list item.\n var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;\n if (previousItem != null) {\n while (!previousItem.is(this.options.listItemSelector) || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {\n if (previousItem[0].previousSibling) {\n previousItem = $(previousItem[0].previousSibling);\n } else {\n previousItem = null;\n break;\n }\n }\n }\n // To find the next sibling in the list, keep stepping forward until we hit a valid list item.\n var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;\n if (nextItem != null) {\n while (!nextItem.is(this.options.listItemSelector) || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {\n if (nextItem[0].nextSibling) {\n nextItem = $(nextItem[0].nextSibling);\n } else {\n nextItem = null;\n break;\n }\n }\n }\n\n this.beyondMaxLevels = 0;\n\n // We will change this to the instance of the nested container if\n // appropriate, so that the appropriate context is applied to the\n // super _contactContainers prototype method\n var containerInstance = this;\n this.refreshPositions();\n\n // If the item is moved to the left, send it to its parent's level unless there are siblings below it.\n if (!o.fixedNestingDepth && parentItem != null && nextItem == null &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||\n !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {\n parentItem.after(this.placeholder[0]);\n containerInstance = parentItem.closest(o.containerElementSelector).data(this.widgetName) || containerInstance;\n this._clearEmpty(parentItem[0]);\n this.refreshPositions();\n this._trigger(\"change\", event, this._uiHash());\n }\n // If the item is below a sibling and is moved to the right, make it a child of that sibling.\n else if (!o.fixedNestingDepth && previousItem != null && !previousItem.is('.djn-no-drag,.djn-thead') &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||\n !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {\n this._isAllowed(previousItem, level, level+childLevels);\n\n if (this.beyondMaxLevels > 0) {\n return $.ui.djnsortable.prototype._contactContainers.apply(this, arguments);\n }\n var $previousItemChildContainer;\n $previousItemChildContainer = previousItem.nearest(o.containerElementSelector).first();\n\n if (!$previousItemChildContainer.length && !previousItem.closest(o.nestedContainerSelector).length) {\n $previousItemChildContainer = this.options.createContainerElement(previousItem[0]);\n previousItem.append($previousItemChildContainer);\n }\n if ($previousItemChildContainer.length) {\n $previousItemChildContainer.append(this.placeholder);\n containerInstance = $previousItemChildContainer.data(this.widgetName);\n if (!containerInstance) {\n containerInstance = createChildNestedSortable(this, $previousItemChildContainer[0]);\n }\n this.refreshPositions();\n }\n this._trigger(\"change\", event, this._uiHash());\n }\n else {\n this._isAllowed(parentItem, level, level+childLevels);\n }\n\n $.ui.djnsortable.prototype._contactContainers.call(this, event);\n },\n\n _rearrange: function _rearrange(event, item, a, hardRefresh) {\n // Cache the rearranged element for the call to _clear()\n var o = this.options;\n if (item && typeof item == 'object' && item.item) {\n this.lastRearrangedElement = item.item[0];\n }\n if (item && typeof(item) == 'object' && item.item && this.placeholder.closest(o.nestedContainerSelector).length) {\n // This means we have been dropped into a nested container down a level\n // from the parent.\n var placeholderParentItem = this.placeholder.closest(o.listItemSelector);\n var comparisonElement = (this.direction == 'down')\n ? placeholderParentItem.next(o.nestedContainerSelector)\n : placeholderParentItem;\n if (comparisonElement.length && comparisonElement[0] == item.item[0]) {\n //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function() {\n if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n });\n // The super method will pop the container out of its nested container,\n // which we don't want.\n return;\n }\n }\n $.ui.djnsortable.prototype._rearrange.apply(this, arguments);\n },\n\n _convertPositionTo: function(d, pos) {\n // Cache the top offset before rearrangement\n this.previousTopOffset = this.placeholder.offset().top;\n return $.ui.djnsortable.prototype._convertPositionTo.apply(this, arguments);\n },\n\n _clear: function() {\n $.ui.djnsortable.prototype._clear.apply(this, arguments);\n // If lastRearrangedElement exists and is still attached to the document\n // (i.e., hasn't been removed)\n if (typeof this.lastRearrangedElement == 'object' && this.lastRearrangedElement.ownerDocument) {\n this._clearEmpty(this.lastRearrangedElement);\n }\n },\n\n _mouseStop: function _mouseStop(event, noPropagation) {\n // If the item is in a position not allowed, send it back\n if (this.beyondMaxLevels) {\n this.placeholder.removeClass(this.options.errorClass);\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.placeholder);\n } else {\n $(this.domPosition.parent).prepend(this.placeholder);\n }\n this._trigger(\"revert\", event, this._uiHash());\n\n }\n\n // Clean last empty container/list item\n for (var i = this.items.length - 1; i >= 0; i--) {\n var item = this.items[i].item[0];\n this._clearEmpty(item);\n }\n\n $.ui.djnsortable.prototype._mouseStop.apply(this, arguments);\n },\n\n toArray: function(o) {\n\n o = $.extend(true, {}, this.options, o || {});\n\n var sDepth = o.startDepthCount || 0,\n ret = [],\n left = 2;\n\n ret.push({\n \"item_id\": o.rootID,\n \"parent_id\": 'none',\n \"depth\": sDepth,\n \"left\": '1',\n \"right\": ($(o.listItemSelector, this.element).length + 1) * 2\n });\n\n var _recursiveArray = function(item, depth, left) {\n var right = left + 1,\n id,\n pid;\n\n var $childItems = $(item).children(o.containerElementSelector).find(o.items);\n\n if ($childItems.length > 0) {\n depth ++;\n $childItems.each(function () {\n right = _recursiveArray($(this), depth, right);\n });\n depth --;\n }\n\n id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));\n\n if (depth === sDepth + 1) {\n pid = o.rootID;\n } else {\n var parentItem = ($(item).parent(o.containerElementSelector)\n .parent(o.items)\n .attr(o.attribute || 'id'))\n .match(o.expression || (/(.+)[-=_](.+)/));\n pid = parentItem[2];\n }\n\n if (id) {\n ret.push({\"item_id\": id[2], \"parent_id\": pid, \"depth\": depth, \"left\": left, \"right\": right});\n }\n\n left = right + 1;\n return left;\n };\n\n $(this.element).children(o.listItemSelector).each(function () {\n left = _recursiveArray(this, sDepth + 1, left);\n });\n\n ret = ret.sort(function(a,b){ return (a.left - b.left); });\n\n return ret;\n },\n\n _clearEmpty: function(item) {\n if (this.options.doNotClear) {\n return;\n }\n var $item = $(item);\n var childContainers = $item.nearest(this.options.containerElementSelector);\n childContainers.each(function(i, childContainer) {\n var $childContainer = $(childContainer);\n if (!$childContainer.children().length) {\n var instance = $childContainer.data(this.widgetName);\n if (typeof(instance) == 'object' && instance.destroy) {\n instance.destroy();\n }\n $childContainer.remove();\n }\n });\n if (!$item.children().length) {\n $item.remove();\n }\n },\n\n _getLevel: function(item) {\n\n var level = 1,\n o = this.options, list;\n\n if (o.containerElementSelector) {\n list = item.closest(o.containerElementSelector);\n while (list && list.length > 0 && !list.parent().is('.djn-group-root')) {\n // if (!list.is(o.nestedContainerSelector)) {\n level++;\n // }\n list = list.parent().closest(o.containerElementSelector);\n }\n }\n\n return level;\n },\n\n _getChildLevels: function(parent, depth) {\n var self = this,\n o = this.options,\n result = 0;\n depth = depth || 0;\n\n $(parent).nearest(o.containerElementSelector).first().find(o.items).each(function (index, child) {\n if ($(child).is('.djn-no-drag,.djn-thead')) {\n return;\n }\n result = Math.max(self._getChildLevels(child, depth + 1), result);\n });\n\n return depth ? result + 1 : result;\n },\n\n _isAllowed: function _isAllowed(parentItem, level, levels) {\n var o = this.options,\n isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false;\n // this takes into account the maxLevels set to the recipient list\n // var maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels');\n var maxLevels = o.maxLevels;\n\n // Is the root protected?\n // Are we trying to nest under a no-nest?\n // Are we nesting too deep?\n if (parentItem && typeof(parentItem) == 'object' && typeof(parentItem.selector) == 'undefined') {\n parentItem = $(parentItem);\n }\n\n if (!o.isAllowed.call(this, this.currentItem, parentItem, this.placeholder) ||\n parentItem && parentItem.hasClass(o.disableNesting) ||\n o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {\n this.placeholder.addClass(o.errorClass);\n if (maxLevels < levels && maxLevels != 0) {\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.beyondMaxLevels = 1;\n }\n } else {\n if (maxLevels < levels && maxLevels != 0) {\n this.placeholder.addClass(o.errorClass);\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.placeholder.removeClass(o.errorClass);\n this.beyondMaxLevels = 0;\n }\n }\n },\n\n _connectWith: function _connectWith() {\n var origConnectWith = $.ui.djnsortable.prototype._connectWith.apply(this, arguments),\n connectWith = [];\n var self = this;\n for (var i = 0; i < origConnectWith.length; i++) {\n var $elements = $(origConnectWith[i]);\n $elements.each(function(j, el) {\n if (el == self.element[0]) {\n return;\n }\n if (!self.options.canConnectWith(self.element, $(el), self)) {\n return;\n }\n connectWith.push(el);\n });\n }\n return connectWith;\n },\n _removeCurrentsFromItems: function() {\n var list = this.currentItem.find(\":data(sortable-item)\");\n for (var i=0; i < this.items.length; i++) {\n for (var j=0; j < list.length; j++) {\n if (list[j] == this.items[i].item[0]) {\n this.items.splice(i, 1);\n if (i >= this.items.length) {\n break;\n }\n }\n }\n }\n },\n createContainerElement: function(parent) {\n if (!parent.childNodes) {\n throw new Error(\"Invalid element 'parent' passed to \" +\n \"createContainerElement.\");\n }\n var newContainer = this.options.createContainerElement.apply(this, arguments);\n parent.appendChild(newContainer[0]);\n return $(newContainer);\n }\n});\n\n$.ui.nestedSortable.prototype.options = $.extend({}, $.ui.djnsortable.prototype.options, $.ui.nestedSortable.prototype.options);\n","module.exports = function regexQuote(str) {\n return (str+'').replace(/([\\.\\?\\*\\+\\^\\$\\[\\]\\\\\\(\\)\\{\\}\\|\\-])/g, '\\\\$1');\n};\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nrequire('./jquery.ui.nestedsortable');\n\nfunction updatePositions(prefix) {\n var position = 0, // the value of the position formfield\n count = 1, // The count displayed in stacked inline headers\n $group = $('#' + prefix + '-group'),\n groupData = $group.djnData(),\n fieldNames = groupData.fieldNames,\n // The field name on the fieldset which is a ForeignKey to the parent model\n groupFkName = groupData.formsetFkName,\n parentPkVal,\n [, parentPrefix, index] = prefix.match(/^(.*)\\-(\\d+)-[^\\-]+(?:\\-\\d+)?$/) || [],\n sortableOptions = groupData.sortableOptions,\n sortableExcludes = (sortableOptions || {}).sortableExcludes || [];\n\n sortableExcludes.push(groupFkName);\n\n if (parentPrefix) {\n var $parentGroup = $('#' + parentPrefix + '-group');\n var parentFieldNames = $parentGroup.djnData('fieldNames');\n var parentPkFieldName = parentFieldNames.pk;\n var parentPkField = $parentGroup.filterDjangoField(parentPrefix, parentPkFieldName, index);\n parentPkVal = parentPkField.val();\n }\n\n if (groupFkName && typeof(parentPkVal) != 'undefined') {\n $group.filterDjangoField(prefix, groupFkName).val(parentPkVal).trigger('change');\n }\n\n $group.find('.djn-inline-form').each(function() {\n if (!this.id || this.id.substr(-6) == '-empty') {\n return true; // Same as continue\n }\n var regex = new RegExp('^(?:id_)?' + regexQuote(prefix) + '\\\\-\\\\d+$');\n\n if (!this.id.match(regex)) {\n return true;\n }\n // Cache jQuery object\n var $this = $(this),\n [formPrefix, index] = $this.djangoPrefixIndex() || [null, null],\n namePrefix = formPrefix + '-' + index + '-';\n\n if (!formPrefix) {\n return;\n }\n\n // Set header position for stacked inlines in Django 1.9+\n var $inlineLabel = $this.find('> h3 > .inline_label');\n if ($inlineLabel.length) {\n $inlineLabel.html($inlineLabel.html().replace(/(#\\d+)/g, '#' + count));\n }\n count++;\n\n var $fields = $this.djangoFormField('*'),\n $positionField,\n setPosition = false;\n\n // position is being updated if\n // a) the field has a value\n // b) if the field is not exluded with sortable_excludes (e.g. with default values)\n $fields.each(function() {\n var $field = $(this);\n if (!$field.is(':input[type!=radio][type!=checkbox],input:checked')) {\n return;\n }\n var hasValue = $field.val() || ($field.attr('type') == 'file' && $field.siblings('a').length),\n fieldName = $field.attr('name').substring(namePrefix.length);\n if (fieldName == fieldNames.position) {\n $positionField = $field;\n }\n if (hasValue && $.inArray(fieldName, sortableExcludes) === -1) {\n setPosition = true;\n }\n });\n\n if (!setPosition || !$positionField) {\n return;\n }\n\n $positionField.val(position).trigger('change');\n position++;\n });\n}\n\nfunction createSortable($group) {\n const isPolymorphic = $group.is('.djn-is-polymorphic');\n return $group.find('> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items').nestedSortable({\n handle: [\n '> h3.djn-drag-handler',\n '> .djn-tools .drag-handler',\n '> .djn-td > .djn-tools .djn-drag-handler',\n '> .djn-tr > .is-sortable > .djn-drag-handler',\n '> .djn-tr > .grp-tools-container .djn-drag-handler'\n ].join(', '),\n /**\n * items: The selector for ONLY the items underneath a given\n * container at that level. Not to be confused with\n * listItemSelector, which is the selector for all list\n * items in the nestedSortable\n */\n items: '> .djn-item',\n forcePlaceholderSize: true,\n placeholder: {\n element: function($currentItem) {\n var el = $(document.createElement($currentItem[0].nodeName))\n .addClass($currentItem[0].className + ' ui-sortable-placeholder')\n .removeClass('ui-sortable-helper')[0];\n\n if ($currentItem.is('.djn-tbody')) {\n var $originalTr = $currentItem.children('.djn-tr').eq(0);\n var trTagName = $originalTr.prop('tagName').toLowerCase();\n var $tr = $(`<${trTagName}>`);\n $tr.addClass($originalTr.attr('class'));\n var $originalTd = $originalTr.children('.djn-td').eq(0);\n var tdTagName = $originalTd.prop('tagName').toLowerCase();\n var numColumns = 0;\n $originalTr.children('.djn-td').each(function(i, td) {\n numColumns += parseInt($(td).attr('colspan'), 10) || 1;\n });\n $tr.append($(`<${tdTagName} colspan=\"${numColumns}\" class=\"djn-td grp-td\">`));\n el.appendChild($tr[0]);\n }\n\n return el;\n },\n update: function(instance, $placeholder) {\n var $currItem = instance.currentItem;\n if (!$currItem) {\n return;\n }\n var opts = instance.options;\n // 1. If a className is set as 'placeholder option, we\n // don't force sizes - the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to\n // force it even if a class name is specified\n if (opts.className && !opts.forcePlaceholderSize) return;\n\n if ($placeholder.is('.djn-tbody')) {\n // debugger;\n $placeholder = $placeholder.children('.djn-tr').eq(0).children('.djn-td').eq(0);\n }\n\n // If the element doesn't have a actual height by itself\n // (without styles coming from a stylesheet), it receives\n // the inline height from the dragged item\n if (!$placeholder.height()) {\n var innerHeight = $currItem.innerHeight(),\n paddingTop = parseInt($currItem.css('paddingTop') || 0, 10),\n paddingBottom = parseInt($currItem.css('paddingBottom') || 0, 10);\n $placeholder.height(innerHeight - paddingTop - paddingBottom);\n }\n if (!$placeholder.width()) {\n var innerWidth = $currItem.innerWidth(),\n paddingLeft = parseInt($currItem.css('paddingLeft') || 0, 10),\n paddingRight = parseInt($currItem.css('paddingRight') || 0, 10);\n $placeholder.width(innerWidth - paddingLeft - paddingRight);\n }\n }\n },\n helper: 'clone',\n opacity: 0.6,\n maxLevels: 0,\n connectWith: '.djn-items',\n tolerance: 'intersection',\n // Don't allow dragging beneath an inline that is marked for deletion\n isAllowed: function(currentItem, parentItem) {\n if (parentItem && parentItem.hasClass('predelete')) {\n return false;\n }\n const $parentGroup = parentItem.closest('.djn-group');\n const parentModel = $parentGroup.data('inlineModel');\n const childModels = $parentGroup.djnData('childModels');\n const currentModel = currentItem.data('inlineModel');\n const isPolymorphicChild = (childModels && childModels.indexOf(currentModel) !== -1);\n if (currentModel !== parentModel && !isPolymorphicChild) {\n return false;\n }\n return true;\n },\n // fixedNestingDepth: not a standard ui.sortable parameter.\n // Prevents dragging items up or down levels\n fixedNestingDepth: true,\n // The selector for ALL list containers in the nested sortable.\n containerElementSelector: '.djn-items',\n // The selector for ALL list items in the nested sortable.\n listItemSelector: '.djn-item',\n start: function(event, ui) {\n ui.item.addClass('djn-item-dragging');\n ui.item.show();\n },\n stop: function(event, ui) {\n ui.item.removeClass('djn-item-dragging');\n },\n /**\n * Triggered when a sortable is dropped into a container\n */\n receive: function(event, ui) {\n var $inline = $(this).closest('.djn-group');\n $inline.djangoFormset().spliceInto(ui.item);\n updatePositions(ui.item.djangoFormsetPrefix());\n },\n update: function(event, ui) {\n // Ensure that
\n // is the first child of the djn-items. If there\n // is another
before the\n // .do-not-drag element then the drag-and-drop placeholder\n // margins don't work correctly.\n var $nextItem = ui.item.nextAll('.djn-item').first();\n if ($nextItem.is('.djn-no-drag,.djn-thead')) {\n var nextItem = $nextItem[0];\n var parent = nextItem.parentNode;\n parent.insertBefore(nextItem, parent.firstChild);\n }\n var groupId = $(event.target).closest('.djn-group').attr('id'),\n $form = ui.item,\n $parentGroup = $form.closest('#' + groupId);\n if ($form.data('updateOperation') == 'removed') {\n $form.removeAttr('data-update-operation');\n } else if (!$parentGroup.length) {\n $form.attr('data-update-operation', 'removed');\n }\n updatePositions($form.djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$('#' + $form.djangoFormsetPrefix() + '-group')]);\n }\n });\n}\n\nmodule.exports = {updatePositions, createSortable};\n","'use strict';\n\n/* globals SelectFilter, DateTimeShortcuts */\n\nconst $ = require('jquery');\nrequire('./jquery.djnutils.js');\nconst {createSortable, updatePositions} = require('./sortable');\nconst regexQuote = require('./regexquote');\nconst grp$ = require('./grp$');\n\nvar DJNesting = (typeof window.DJNesting != 'undefined')\n ? window.DJNesting : {};\n\nDJNesting.regexQuote = regexQuote;\nDJNesting.createSortable = createSortable;\nDJNesting.updatePositions = updatePositions;\n\n/**\n * Update attributes based on a regular expression\n */\nDJNesting.updateFormAttributes = function($elem, search, replace, selector) {\n if (!selector) {\n selector = [\n ':input', 'span', 'table', 'iframe', 'label', 'a', 'ul', 'p',\n 'img', '.djn-group', '.djn-inline-form', '.cropduster-form',\n '.dal-forward-conf', '[role=tabpanel]'].join(',');\n }\n var addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n $elem.find(selector)[addBackMethod]().each(function() {\n var $node = $(this),\n attrs = [\n 'id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset',\n 'django-croppable-image-for',\n 'django-croppable-crop-for',\n ];\n\n $.each(attrs, function(i, attrName) {\n var attrVal = $node.attr(attrName);\n if (attrVal) {\n $node.attr(attrName, attrVal.replace(search, replace));\n if (attrName === 'data-inline-formset') {\n $node.data('inlineFormset', JSON.parse($node.attr(attrName)));\n }\n }\n });\n });\n // update prepopulate ids for function initPrepopulatedFields\n $elem.find('.prepopulated_field').each(function() {\n var $node = grp$(this);\n var dependencyIds = $.makeArray($node.data('dependency_ids') || []);\n $node.data('dependency_ids', $.map(dependencyIds, function(id) {\n return id.replace(search, replace);\n }));\n });\n};\n\nDJNesting.createContainerElement = function() {\n return;\n};\n\n// Slight tweaks to the grappelli functions of the same name\n// (initRelatedFields and initAutocompleteFields).\n//\n// The most notable tweak is the call to $.fn.grp_related_generic() (a\n// jQuery method provided by django-curated) and the use of\n// DJNesting.LOOKUP_URLS to determine the ajax lookup urls.\n//\n// We abstract this out using form prefix because the way grappelli does it\n// (adding javascript at the bottom of each formset) doesn't really scale\n// with nested formsets.\n\n// The second parameter (groupData) is optional, and only exists to prevent\n// redundant calls to jQuery() and jQuery.fn.data() in the calling context\nDJNesting.initRelatedFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupRelated;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n grp$(this).grp_related_fk({lookup_url: lookupUrls.related});\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n grp$(this).grp_related_m2m({lookup_url: lookupUrls.m2m});\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n if ($this.hasClass('grp-has-related-lookup')) {\n $this.parent().find('a.related-lookup').remove();\n $this.parent().find('.grp-placeholder-related-generic').remove();\n }\n grp$($this).grp_related_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related\n });\n });\n });\n });\n};\n\nDJNesting.initAutocompleteFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupAutocomplete;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_fk({\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_m2m({\n lookup_url: lookupUrls.m2m,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n // An autocomplete widget has already been initialized, return\n if ($('#' + $this.attr('id') + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.m2m\n });\n });\n });\n });\n};\n\n// I very much regret that these are basically copy-pasted from django's\n// inlines.js, but they're hidden in closure scope so I don't have much choice.\nDJNesting.DjangoInlines = {\n initPrepopulatedFields: function(row) {\n row.find('.prepopulated_field').each(function() {\n var field = $(this),\n input = (field.is(':input') ? field : field.find(':input')),\n $input = grp$(input),\n dependencyList = $input.data('dependency_list') || [],\n formPrefix = input.djangoFormPrefix(),\n dependencies = [];\n if (!formPrefix || formPrefix.match(/__prefix__/)) {\n return;\n }\n $.each(dependencyList, function(i, fieldName) {\n dependencies.push('#id_' + formPrefix + fieldName);\n });\n if (dependencies.length) {\n $input.prepopulate(dependencies, input.attr('maxlength'));\n }\n });\n },\n reinitDateTimeShortCuts: function() {\n // Reinitialize the calendar and clock widgets by force\n if (typeof window.DateTimeShortcuts !== 'undefined') {\n $('.datetimeshortcuts').remove();\n DateTimeShortcuts.init();\n }\n },\n updateSelectFilter: function($form) {\n // If any SelectFilter widgets are a part of the new form,\n // instantiate a new SelectFilter instance for it.\n if (typeof window.SelectFilter !== 'undefined') {\n $form.find('.selectfilter').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], false);\n });\n $form.find('.selectfilterstacked').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], true);\n });\n }\n }\n};\n\nfunction patchSelectFilter() {\n window.SelectFilter.init = (function(oldFn) {\n return function init(field_id, field_name, is_stacked) {\n if (field_id.match(/\\-empty\\-/)) {\n return;\n } else {\n oldFn.apply(this, arguments);\n }\n };\n }(window.SelectFilter.init));\n}\n\nif (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n} else {\n setTimeout(function() {\n if (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n }\n }, 12);\n}\n\nconst djangoFuncs = ['prepopulate', 'djangoAdminSelect2'];\n\ndjangoFuncs.forEach((funcName) => {\n (function patchDjangoFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof $.fn[funcName] === 'undefined') {\n return setTimeout(() => patchDjangoFunction(callCount++), 12);\n }\n $.fn[funcName] = (function(oldFn) {\n return function django_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }($.fn[funcName]));\n }(0));\n});\n\nconst grpFuncs = [\n 'grp_autocomplete_fk', 'grp_autocomplete_generic', 'grp_autocomplete_m2m',\n 'grp_collapsible', 'grp_collapsible_group', 'grp_inline', 'grp_related_fk',\n 'grp_related_generic', 'grp_related_m2m', 'grp_timepicker', 'datepicker',\n 'prepopulate', 'djangoAdminSelect2'];\n\ngrpFuncs.forEach((funcName) => {\n (function patchGrpFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof window.grp === 'undefined' || typeof window.grp.jQuery.fn[funcName] === 'undefined') {\n return setTimeout(() => patchGrpFunction(callCount++), 12);\n }\n window.grp.jQuery.fn[funcName] = (function(oldFn) {\n return function grp_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }(window.grp.jQuery.fn[funcName]));\n }(0));\n});\n\nmodule.exports = DJNesting;\n","// removed by extract-text-webpack-plugin","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","(function() { module.exports = window[\"grappelli\"]; }());","(function() { module.exports = window[\"grp\"]; }());"],"sourceRoot":""} \ No newline at end of file diff --git a/nested_admin/static/nested_admin/dist/nested_admin.min.js b/nested_admin/static/nested_admin/dist/nested_admin.min.js index 124cca9..876a3e6 100644 --- a/nested_admin/static/nested_admin/dist/nested_admin.min.js +++ b/nested_admin/static/nested_admin/dist/nested_admin.min.js @@ -1,4 +1,4 @@ -window.DJNesting=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=52)}([function(t,e,i){"use strict";t.exports=window.django.jQuery},function(t,e,i){"use strict";var n=i(27),o=i(44)(5),s=!0;"find"in[]&&Array(1).find(function(){s=!1}),n(n.P+n.F*s,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(36)("find")},function(t,e,i){i(13)("replace",2,function(t,e,i){return[function(n,o){"use strict";var s=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,s,o):i.call(String(s),n,o)},i]})},function(t,e,i){i(13)("match",1,function(t,e,i){return[function(i){"use strict";var n=t(this),o=void 0==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},i]})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var n=i(25).f,o=Function.prototype,s=/^\s*function ([^ (]*)/;"name"in o||i(9)&&n(o,"name",{configurable:!0,get:function(){try{return(""+this).match(s)[1]}catch(t){return""}}})},function(t,e,i){var n=i(37)("wks"),o=i(23),s=i(6).Symbol,r="function"==typeof s;(t.exports=function(t){return n[t]||(n[t]=r&&s[t]||(r?s:o)("Symbol."+t))}).store=n},function(t,e,i){t.exports=!i(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){var n=i(25),o=i(46);t.exports=i(9)?function(t,e,i){return n.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){"use strict";i(2),t.exports=function(t){return(t+"").replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g,"\\$1")}},function(t,e,i){"use strict";var n=i(27),o=i(21),s=i(20),r=i(4),a=[].sort,l=[1,2,3];n(n.P+n.F*(r(function(){l.sort(void 0)})||!r(function(){l.sort(null)})||!i(33)(a)),"Array",{sort:function(t){return void 0===t?a.call(s(this)):a.call(s(this),o(t))}})},function(t,e,i){"use strict";var n=i(10),o=i(24),s=i(4),r=i(19),a=i(8);t.exports=function(t,e,i){var l=a(t),h=i(r,l,""[t]),c=h[0],d=h[1];s(function(){var e={};return e[l]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,c),n(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){"use strict";var n=i(0);t.exports=function t(e){if(void 0===window.grp)return n(e);if(window.grp.jQuery.fn.init===n.fn.init)return n(e);var i=window.grp.jQuery(e);return e.prevObject&&(i.prevObject=t(e.prevObject)),i}},function(t,e,i){i(13)("split",2,function(t,e,n){"use strict";var o=i(35),s=n,r=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var a=void 0===/()??/.exec("")[1];n=function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!o(t))return s.call(i,t,e);var n,l,h,c,d,u=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,m=void 0===e?4294967295:e>>>0,g=new RegExp(t.source,f+"g");for(a||(n=new RegExp("^"+g.source+"$(?!\\s)",f));(l=g.exec(i))&&!((h=l.index+l[0].length)>p&&(u.push(i.slice(p,l.index)),!a&&l.length>1&&l[0].replace(n,function(){for(d=1;d1&&l.index=m));)g.lastIndex===l.index&&g.lastIndex++;return p===i.length?!c&&g.test("")||u.push(""):u.push(i.slice(p)),u.length>m?u.slice(0,m):u}}else"0".split(void 0,0).length&&(n=function(t,e){return void 0===t&&0===e?[]:s.call(this,t,e)});return[function(i,o){var s=t(this),r=void 0==i?void 0:i[e];return void 0!==r?r.call(i,s,o):n.call(String(s),i,o)},n]})},function(t,e,i){"use strict";i(7),i(16),i(3),i(2),i(1);var n=i(0);i(34);var o=i(32),s=o.createSortable,r=o.updatePositions,a=i(11),l=i(15),h=void 0!==window.DJNesting?window.DJNesting:{};function c(){var t;window.SelectFilter.init=(t=window.SelectFilter.init,function(e,i,n){e.match(/\-empty\-/)||t.apply(this,arguments)})}h.regexQuote=a,h.createSortable=s,h.updatePositions=r,h.updateFormAttributes=function(t,e,i,o){o||(o=[":input","span","table","iframe","label","a","ul","p","img",".djn-group",".djn-inline-form",".cropduster-form",".dal-forward-conf","[role=tabpanel]"].join(","));var s=n.fn.addBack?"addBack":"andSelf";t.find(o)[s]().each(function(){var t=n(this);n.each(["id","name","for","href","class","onclick","data-inline-formset"],function(n,o){var s=t.attr(o);s&&(t.attr(o,s.replace(e,i)),"data-inline-formset"===o&&t.data("inlineFormset",JSON.parse(t.attr(o))))})}),t.find(".prepopulated_field").each(function(){var t=l(this),o=n.makeArray(t.data("dependency_ids")||[]);t.data("dependency_ids",n.map(o,function(t){return t.replace(e,i)}))})},h.createContainerElement=function(){},h.initRelatedFields=function(t,e){if("object"==typeof h.LOOKUP_URLS&&h.LOOKUP_URLS.related){var i=h.LOOKUP_URLS,o=n("#"+t+"-group");e||(e=o.djnData());var s=e.lookupRelated;o.djangoFormsetForms().each(function(e,o){n.each(s.fk||[],function(t,e){n(o).djangoFormField(e).each(function(){l(this).grp_related_fk({lookup_url:i.related})})}),n.each(s.m2m||[],function(t,e){n(o).djangoFormField(e).each(function(){l(this).grp_related_m2m({lookup_url:i.m2m})})}),n.each(s.generic||[],function(){var e=this[0],s=this[1];n(o).djangoFormField(s).each(function(){var o=n(this),r=o.djangoFormIndex();o.hasClass("grp-has-related-lookup")&&(o.parent().find("a.related-lookup").remove(),o.parent().find(".grp-placeholder-related-generic").remove()),l(o).grp_related_generic({content_type:"#id_"+t+"-"+r+"-"+e,object_id:"#id_"+t+"-"+r+"-"+s,lookup_url:i.related})})})})}},h.initAutocompleteFields=function(t,e){if("object"==typeof h.LOOKUP_URLS&&h.LOOKUP_URLS.related){var i=h.LOOKUP_URLS,o=n("#"+t+"-group");e||(e=o.djnData());var s=e.lookupAutocomplete;o.djangoFormsetForms().each(function(e,o){n.each(s.fk||[],function(t,e){n(o).djangoFormField(e).each(function(){var t=n(this),e=t.attr("id");n("#"+e+"-autocomplete").length||l(t).grp_autocomplete_fk({lookup_url:i.related,autocomplete_lookup_url:i.autocomplete})})}),n.each(s.m2m||[],function(t,e){n(o).djangoFormField(e).each(function(){var t=n(this),e=t.attr("id");n("#"+e+"-autocomplete").length||l(t).grp_autocomplete_m2m({lookup_url:i.m2m,autocomplete_lookup_url:i.autocomplete})})}),n.each(s.generic||[],function(){var e=this[0],s=this[1];n(o).djangoFormField(s).each(function(){var o=n(this),r=o.djangoFormIndex();n("#"+o.attr("id")+"-autocomplete").length||l(o).grp_autocomplete_generic({content_type:"#id_"+t+"-"+r+"-"+e,object_id:"#id_"+t+"-"+r+"-"+s,lookup_url:i.related,autocomplete_lookup_url:i.m2m})})})})}},h.DjangoInlines={initPrepopulatedFields:function(t){t.find(".prepopulated_field").each(function(){var t=n(this),e=t.is(":input")?t:t.find(":input"),i=l(e),o=i.data("dependency_list")||[],s=e.djangoFormPrefix(),r=[];s&&!s.match(/__prefix__/)&&(n.each(o,function(t,e){r.push("#id_"+s+e)}),r.length&&i.prepopulate(r,e.attr("maxlength")))})},reinitDateTimeShortCuts:function(){void 0!==window.DateTimeShortcuts&&(n(".datetimeshortcuts").remove(),DateTimeShortcuts.init())},updateSelectFilter:function(t){void 0!==window.SelectFilter&&(t.find(".selectfilter").each(function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!1)}),t.find(".selectfilterstacked").each(function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!0)}))}},void 0!==window.SelectFilter?c():setTimeout(function(){void 0!==window.SelectFilter&&c()},12);["prepopulate","djangoAdminSelect2"].forEach(function(t){!function e(i){var o;if(!(i>2))return void 0===n.fn[t]?setTimeout(function(){return e(i++)},12):void(n.fn[t]=(o=n.fn[t],function(){return o.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)});["grp_autocomplete_fk","grp_autocomplete_generic","grp_autocomplete_m2m","grp_collapsible","grp_collapsible_group","grp_inline","grp_related_fk","grp_related_generic","grp_related_m2m","grp_timepicker","datepicker","prepopulate","djangoAdminSelect2"].forEach(function(t){!function e(i){var n;if(!(i>2))return void 0===window.grp||void 0===window.grp.jQuery.fn[t]?setTimeout(function(){return e(i++)},12):void(window.grp.jQuery.fn[t]=(n=window.grp.jQuery.fn[t],function(){return n.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)}),t.exports=h},function(t,e){t.exports=window.grappelli},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(19);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var n=i(21);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){var n=i(6),o=i(10),s=i(45),r=i(23)("src"),a=Function.toString,l=(""+a).split("toString");i(26).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,i,a){var h="function"==typeof i;h&&(s(i,"name")||o(i,"name",e)),t[e]!==i&&(h&&(s(i,r)||o(i,r,t[e]?""+t[e]:l.join(String(e)))),t===n?t[e]=i:a?t[e]?t[e]=i:o(t,e,i):(delete t[e],o(t,e,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||a.call(this)})},function(t,e,i){var n=i(50),o=i(49),s=i(47),r=Object.defineProperty;e.f=i(9)?Object.defineProperty:function(t,e,i){if(n(t),e=s(e,!0),n(i),o)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e){var i=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(6),o=i(26),s=i(10),r=i(24),a=i(22),l=function(t,e,i){var h,c,d,u,f=t&l.F,p=t&l.G,m=t&l.S,g=t&l.P,v=t&l.B,_=p?n:m?n[e]||(n[e]={}):(n[e]||{}).prototype,y=p?o:o[e]||(o[e]={}),b=y.prototype||(y.prototype={});for(h in p&&(i=e),i)d=((c=!f&&_&&void 0!==_[h])?_:i)[h],u=v&&c?a(d,n):g&&"function"==typeof d?a(Function.call,d):d,_&&r(_,h,d,t&l.U),y[h]!=d&&s(y,h,u),g&&b[h]!=d&&(b[h]=d)};n.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){t.exports=window.grp},function(t,e,i){"use strict";i(12),i(2),i(7),i(1);var n=i(0),o=i(11),s=i(17),r=i(18),a=i(28),l=i(15),h="djangoFormset",c=function(){function t(t){this.opts={emptyClass:"empty-form grp-empty-form djn-empty-form",predeleteClass:"grp-predelete"},this.$inline=n(t),this.prefix=this.$inline.djangoFormsetPrefix(),this._$totalForms=this.$inline.find("#id_"+this.prefix+"-TOTAL_FORMS"),this._$totalForms.attr("autocomplete","off"),this._$template=n("#"+this.prefix+"-empty");var e=this.$inline.djnData("inlineModel");this.opts=n.extend({},this.opts,{childTypes:this.$inline.data("inlineFormset").options.childTypes,formsetFkModel:this.$inline.djnData("formsetFkModel"),addButtonSelector:".djn-add-handler.djn-model-"+e,removeButtonSelector:".djn-remove-handler.djn-model-"+e,deleteButtonSelector:".djn-delete-handler.djn-model-"+e,formClass:"dynamic-form grp-dynamic-form djn-dynamic-form-"+e,formClassSelector:".djn-dynamic-form-"+e}),s.initRelatedFields(this.prefix,this.$inline.djnData()),s.initAutocompleteFields(this.prefix,this.$inline.djnData()),this.opts.childTypes&&this._setupPolymorphic(),this._bindEvents(),this._initializeForms(),this.$inline.find('.djn-items:not([id*="-empty"])').trigger("djnesting:init"),this.$inline.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){n(this)[h]()}),this.$inline.is(".djn-group-root")&&s.createSortable(this.$inline),n(document).trigger("djnesting:initialized",[this.$inline,this])}var e=t.prototype;return e._setupPolymorphic=function(){if(!this.opts.childTypes)throw Error("The polymorphic fieldset options.childTypes is not defined!");var t='";var e=this.$inline.find(this.opts.addButtonSelector),i=n(t);e.after(i)},e._initializeForms=function(){var t=this.mgmtVal("TOTAL_FORMS");this.mgmtVal("MAX_NUM_FORMS")<=t&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide();for(var e=0;e .polymorphic-type-menu a").off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation();var i=n(this).attr("data-type");e.add(null,i);var o=n(t.target).closest(".polymorphic-type-menu");o.is(":visible")&&o.hide()}),t.find(this.opts.removeButtonSelector).filter(function(){return!n(this).closest(".djn-empty-form").length}).off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation();var i=n(this).closest(e.opts.formClassSelector);e.remove(i)});var o=function(t){t.preventDefault(),t.stopImmediatePropagation();var i=n(this).closest(e.opts.formClassSelector);n("#id_"+i.djangoFormPrefix()+"DELETE").is(":checked")?e.undelete(i):e.delete(i)},s=t.find(this.opts.deleteButtonSelector).filter(function(){return!n(this).closest(".djn-empty-form").length});s.off("click.djnesting").on("click.djnesting",o),s.find('[id$="-DELETE"]').on("mousedown.djnesting",o)},e.remove=function(t){var e=n(t),i=this.mgmtVal("TOTAL_FORMS"),o=this.mgmtVal("MIN_NUM_FORMS"),r=this.mgmtVal("MAX_NUM_FORMS"),a=e.djangoFormIndex(),l=e.data("isInitial");e[0].innerHTML="",e.remove(),i-=1,this.mgmtVal("TOTAL_FORMS",i),r-i>=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").show(),this._fillGap(a,l);var h=this,c=i<=o;this.$inline.djangoFormsetForms().each(function(){var t=c?"hide":"show";n(this).find(h.opts.removeButtonSelector)[t]()}),s.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:removed",[e,this.prefix])},e.delete=function(t){var e=this,i=n(t),o=i.djangoFormPrefix(),r=n("#id_"+o+"DELETE");i.hasClass(this.opts.predeleteClass)||i.data("isInitial")&&(r.attr("checked","checked"),r.length&&(r[0].checked=!0),i.addClass(this.opts.predeleteClass),i.find(".djn-group").each(function(){var t=n(this),i=t.djangoFormset();t.djangoFormsetForms().each(function(){n(this).hasClass(e.opts.predeleteClass)?n(this).data("alreadyDeleted",!0):i.delete(this)})}),i.find(".cropduster-form").each(function(){var t=n(this).djangoFormsetPrefix()+"-0-",e=n("#id_"+t+"DELETE");e.attr("checked","checked"),e.length&&(e[0].checked=!0)}),s.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:deleted",[i,this.prefix]))},e.undelete=function(t){var e=n(t),i=e.djangoFormPrefix(),o=n("#id_"+i+"DELETE");e.parent().closest("."+this.opts.predeleteClass).length||(e.hasClass("has_original")&&(o.removeAttr("checked"),o.length&&(o[0].checked=!1),e.removeClass(this.opts.predeleteClass)),e.data("alreadyDeleted",!1),e.find(".djn-group").each(function(){var t=n(this),e=t.djangoFormset();t.djangoFormsetForms().each(function(){n(this).data("alreadyDeleted")?n(this).data("alreadyDeleted",!1):e.undelete(this)})}),e.find(".cropduster-form").each(function(){var t=n(this).djangoFormsetPrefix()+"-0-",e=n("#id_"+t+"DELETE");e.removeAttr("checked"),e.length&&(e[0].checked=!1)}),s.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:undeleted",[e,this.prefix]))},e.add=function(t,e){var i=this,c=e?n("#"+this.prefix+"-empty-"+e):this._$template,d=c.clone(!0);l(c).find(":data(dependency_ids)").each(function(){var t=n(this).attr("id"),e=d.find("#"+t);l(e).data(n.extend({},e.data(),l(this).data()))});var u=this.mgmtVal("TOTAL_FORMS"),f=this.mgmtVal("MAX_NUM_FORMS"),p=this.$inline.hasClass("djn-group-nested");n(document).trigger("djnesting:beforeadded",[this.$inline,d]),d.removeClass(this.opts.emptyClass),d.addClass("djn-item"),d.attr("id",d.attr("id").replace(/\-empty.*?$/,"-"+u)),p&&d.append(s.createContainerElement()),s.updateFormAttributes(d,new RegExp('([#_]id_|[\\#]|^id_|"|^)'+o(this.prefix)+"\\-(?:__prefix__|empty)\\-","g"),"$1"+this.prefix+"-"+u+"-");var m=this._$template;if(this.opts.childTypes&&(m=c.closest(".djn-group").find('> .djn-items > [id*="-empty"], > .djn-fieldset > .djn-items > [id*="-empty"]').eq(0)),this.opts.childTypes){var g=this.$inline.djnData("compatibleParents")||{};d.find("> .djn-group").each(function(t,i){var o=n(i).djnData("formsetFkModel"),s=g[e]||[],r=n(i),a=r.djnData("inlineParentModel"),l=!!r.data("inlineFormset").options.childTypes;r.data("inlineFormset").options.prefix;(a!==e||l&&o!==e&&-1===s.indexOf(o))&&(r.find('input[id$="_FORMS"]').each(function(t,e){e.value=0,e.setAttribute("value","0"),i.parentNode.appendChild(e)}),i.parentNode.removeChild(i))})}if(d.insertBefore(m),this.mgmtVal("TOTAL_FORMS",u+1),f-(u+1)<=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide(),s.updatePositions(this.prefix),n.isNumeric(t)?this.spliceInto(d,t,!0):n(document).trigger("djnesting:mutate",[this.$inline]),r&&r.reinitDateTimeFields(l(d)),s.DjangoInlines.initPrepopulatedFields(d),s.DjangoInlines.reinitDateTimeShortCuts(),s.DjangoInlines.updateSelectFilter(d),s.initRelatedFields(this.prefix),s.initAutocompleteFields(this.prefix),a&&a.jQuery.fn.grp_collapsible){var v=a.jQuery.fn.addBack?"addBack":"andSelf";l(d).find('.grp-collapse:not([id$="-empty"]):not([id*="-empty-"])')[v]().grp_collapsible({toggle_handler_slctr:".grp-collapse-handler:first",closed_css:"closed grp-closed",open_css:"open grp-open",on_toggle:function(){n(document).trigger("djnesting:toggle",[i.$inline])}})}if("function"==typeof n.fn.curated_content_type&&d.find(".curated-content-type-select").each(function(){n(this).curated_content_type()}),this._initializeForm(d),this._bindEvents(d),e){var _=this.$inline.djnData("inlineModel"),y=d.attr("data-inline-model");d.find(".djn-model-"+_).addClass("djn-model-"+y),d.addClass("djn-dynamic-form-"+y)}return d.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){n(this)[h]()}),n(document).trigger("djnesting:added",[this.$inline,d]),n(document).trigger("formset:added",[d,this.prefix]),d},e._fillGap=function(t,e){var i,r,a=this.$inline.djangoFormsetForms().toArray();a.sort(function(t,e){return n(t).djangoFormIndex()-n(e).djangoFormIndex()}),a.forEach(function(e){var o=n(e);o.djangoFormIndex()<=t||(o.data("isInitial")?i=o:r=o)});var l=e&&i||r;if(l){var h=l.djangoFormIndex(),c=new RegExp("([\\#_]|^)"+o(this.prefix+"-"+h)+"(?!\\-\\d)");l.attr("id",this.prefix+"-"+t),s.updateFormAttributes(l,c,"$1"+this.prefix+"-"+t),l.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,l]),e&&i&&r&&this._fillGap(h,!1)}},e._makeRoomForInsert=function(){var t=this.mgmtVal("INITIAL_FORMS"),e=this.mgmtVal("TOTAL_FORMS"),i=t,r=n("#"+this.prefix+"-"+i);if(r.length){var a=new RegExp("([\\#_]|^)"+o(this.prefix)+"-"+i+"(?!\\-\\d)");r.attr("id",this.prefix+"-"+e),s.updateFormAttributes(r,a,"$1"+this.prefix+"-"+e),r.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,r])}},e.spliceInto=function(t,e,i){var r,a=this.mgmtVal("INITIAL_FORMS"),l=this.mgmtVal("TOTAL_FORMS"),h=t.djangoFormsetPrefix(),c=this.prefix,d=t.data("isInitial");if(t.djangoFormsetPrefix()==this.prefix){if(t.prevAll(".djn-item:not(.djn-no-drag,.djn-thead)").length===e||void 0===e)return void s.updatePositions(c);this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item:not(#"+t.attr("id")+")").eq(e).after(t)}else{var u=n("#"+h+"-group");t.closest(".djn-group").djangoFormsetPrefix()!=c&&this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item").eq(e).after(t);var f=u.djangoFormset();if(f.mgmtVal("TOTAL_FORMS",f.mgmtVal("TOTAL_FORMS")-1),f._fillGap(t.djangoFormIndex(),d),d){f.mgmtVal("INITIAL_FORMS",f.mgmtVal("INITIAL_FORMS")-1);var p=this.$inline.parent().closest(".djn-group");if(p.length){var m=this.$inline.closest(".djn-inline-form"),g=(p.djnData("fieldNames")||{}).pk;m.djangoFormField(g).val()||(t.data("isInitial",!1),t.attr("data-is-initial","false"),d=!1,setTimeout(function(){t.find('[name^="'+t.djangoFormPrefix()+'"][name$="-INITIAL_FORMS"]').val("0").trigger("change")},0))}}d&&this._makeRoomForInsert();var v=new RegExp("([\\#_]|^)"+o(t.attr("id"))+"(?!\\-\\d)");r=d?a:l,t.attr("id",c+"-"+r),s.updateFormAttributes(t,v,"$1"+c+"-"+r),t.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,t]),d&&this.mgmtVal("INITIAL_FORMS",a+1),this.mgmtVal("TOTAL_FORMS",l+1),s.updatePositions(h),n(document).trigger("djnesting:mutate",[u])}s.updatePositions(c),i||n(document).trigger("djnesting:mutate",[this.$inline])},e.mgmtVal=function(t,e){var i=this.$inline.find("#id_"+this.prefix+"-"+t);return void 0===e?parseInt(i.val(),10):parseInt(i.val(e).trigger("change").val(),10)},t}();n.fn[h]=function(){var t,e,i,o=this.eq(0);if(0===arguments.length||1===arguments.length&&"string"!=n.type(arguments[0])){t=arguments[0];var s=o.data(h);return s||(s=new c(o,t),o.data(h,s)),s}if(e=arguments[0],i=n.makeArray(arguments).slice(1),e in c.prototype)return o.data(h)[e](i);throw new Error("Unknown function call "+e+" for $.fn."+h)},t.exports=c},function(t,e,i){"use strict";i(1),i(3),i(16),i(7);var n,o,s,r,a,l=i(0); +window.DJNesting=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=52)}([function(t,e,i){"use strict";t.exports=window.django.jQuery},function(t,e,i){"use strict";var n=i(27),o=i(44)(5),r=!0;"find"in[]&&Array(1).find(function(){r=!1}),n(n.P+n.F*r,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(36)("find")},function(t,e,i){i(13)("replace",2,function(t,e,i){return[function(n,o){"use strict";var r=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,r,o):i.call(String(r),n,o)},i]})},function(t,e,i){i(13)("match",1,function(t,e,i){return[function(i){"use strict";var n=t(this),o=void 0==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},i]})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e,i){var n=i(25).f,o=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in o||i(9)&&n(o,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var n=i(37)("wks"),o=i(23),r=i(6).Symbol,s="function"==typeof r;(t.exports=function(t){return n[t]||(n[t]=s&&r[t]||(s?r:o)("Symbol."+t))}).store=n},function(t,e,i){t.exports=!i(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,i){var n=i(25),o=i(46);t.exports=i(9)?function(t,e,i){return n.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){"use strict";i(2),t.exports=function(t){return(t+"").replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g,"\\$1")}},function(t,e,i){"use strict";var n=i(27),o=i(21),r=i(20),s=i(4),a=[].sort,l=[1,2,3];n(n.P+n.F*(s(function(){l.sort(void 0)})||!s(function(){l.sort(null)})||!i(33)(a)),"Array",{sort:function(t){return void 0===t?a.call(r(this)):a.call(r(this),o(t))}})},function(t,e,i){"use strict";var n=i(10),o=i(24),r=i(4),s=i(19),a=i(8);t.exports=function(t,e,i){var l=a(t),h=i(s,l,""[t]),c=h[0],d=h[1];r(function(){var e={};return e[l]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,c),n(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){"use strict";var n=i(0);t.exports=function t(e){if(void 0===window.grp)return n(e);if(window.grp.jQuery.fn.init===n.fn.init)return n(e);var i=window.grp.jQuery(e);return e.prevObject&&(i.prevObject=t(e.prevObject)),i}},function(t,e,i){i(13)("split",2,function(t,e,n){"use strict";var o=i(35),r=n,s=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var a=void 0===/()??/.exec("")[1];n=function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!o(t))return r.call(i,t,e);var n,l,h,c,d,u=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,m=void 0===e?4294967295:e>>>0,g=new RegExp(t.source,f+"g");for(a||(n=new RegExp("^"+g.source+"$(?!\\s)",f));(l=g.exec(i))&&!((h=l.index+l[0].length)>p&&(u.push(i.slice(p,l.index)),!a&&l.length>1&&l[0].replace(n,function(){for(d=1;d1&&l.index=m));)g.lastIndex===l.index&&g.lastIndex++;return p===i.length?!c&&g.test("")||u.push(""):u.push(i.slice(p)),u.length>m?u.slice(0,m):u}}else"0".split(void 0,0).length&&(n=function(t,e){return void 0===t&&0===e?[]:r.call(this,t,e)});return[function(i,o){var r=t(this),s=void 0==i?void 0:i[e];return void 0!==s?s.call(i,r,o):n.call(String(r),i,o)},n]})},function(t,e,i){"use strict";i(7),i(16),i(3),i(2),i(1);var n=i(0);i(34);var o=i(32),r=o.createSortable,s=o.updatePositions,a=i(11),l=i(15),h=void 0!==window.DJNesting?window.DJNesting:{};function c(){var t;window.SelectFilter.init=(t=window.SelectFilter.init,function(e,i,n){e.match(/\-empty\-/)||t.apply(this,arguments)})}h.regexQuote=a,h.createSortable=r,h.updatePositions=s,h.updateFormAttributes=function(t,e,i,o){o||(o=[":input","span","table","iframe","label","a","ul","p","img",".djn-group",".djn-inline-form",".cropduster-form",".dal-forward-conf","[role=tabpanel]"].join(","));var r=n.fn.addBack?"addBack":"andSelf";t.find(o)[r]().each(function(){var t=n(this);n.each(["id","name","for","href","class","onclick","data-inline-formset","django-croppable-image-for","django-croppable-crop-for"],function(n,o){var r=t.attr(o);r&&(t.attr(o,r.replace(e,i)),"data-inline-formset"===o&&t.data("inlineFormset",JSON.parse(t.attr(o))))})}),t.find(".prepopulated_field").each(function(){var t=l(this),o=n.makeArray(t.data("dependency_ids")||[]);t.data("dependency_ids",n.map(o,function(t){return t.replace(e,i)}))})},h.createContainerElement=function(){},h.initRelatedFields=function(t,e){if("object"==typeof h.LOOKUP_URLS&&h.LOOKUP_URLS.related){var i=h.LOOKUP_URLS,o=n("#"+t+"-group");e||(e=o.djnData());var r=e.lookupRelated;o.djangoFormsetForms().each(function(e,o){n.each(r.fk||[],function(t,e){n(o).djangoFormField(e).each(function(){l(this).grp_related_fk({lookup_url:i.related})})}),n.each(r.m2m||[],function(t,e){n(o).djangoFormField(e).each(function(){l(this).grp_related_m2m({lookup_url:i.m2m})})}),n.each(r.generic||[],function(){var e=this[0],r=this[1];n(o).djangoFormField(r).each(function(){var o=n(this),s=o.djangoFormIndex();o.hasClass("grp-has-related-lookup")&&(o.parent().find("a.related-lookup").remove(),o.parent().find(".grp-placeholder-related-generic").remove()),l(o).grp_related_generic({content_type:"#id_"+t+"-"+s+"-"+e,object_id:"#id_"+t+"-"+s+"-"+r,lookup_url:i.related})})})})}},h.initAutocompleteFields=function(t,e){if("object"==typeof h.LOOKUP_URLS&&h.LOOKUP_URLS.related){var i=h.LOOKUP_URLS,o=n("#"+t+"-group");e||(e=o.djnData());var r=e.lookupAutocomplete;o.djangoFormsetForms().each(function(e,o){n.each(r.fk||[],function(t,e){n(o).djangoFormField(e).each(function(){var t=n(this),e=t.attr("id");n("#"+e+"-autocomplete").length||l(t).grp_autocomplete_fk({lookup_url:i.related,autocomplete_lookup_url:i.autocomplete})})}),n.each(r.m2m||[],function(t,e){n(o).djangoFormField(e).each(function(){var t=n(this),e=t.attr("id");n("#"+e+"-autocomplete").length||l(t).grp_autocomplete_m2m({lookup_url:i.m2m,autocomplete_lookup_url:i.autocomplete})})}),n.each(r.generic||[],function(){var e=this[0],r=this[1];n(o).djangoFormField(r).each(function(){var o=n(this),s=o.djangoFormIndex();n("#"+o.attr("id")+"-autocomplete").length||l(o).grp_autocomplete_generic({content_type:"#id_"+t+"-"+s+"-"+e,object_id:"#id_"+t+"-"+s+"-"+r,lookup_url:i.related,autocomplete_lookup_url:i.m2m})})})})}},h.DjangoInlines={initPrepopulatedFields:function(t){t.find(".prepopulated_field").each(function(){var t=n(this),e=t.is(":input")?t:t.find(":input"),i=l(e),o=i.data("dependency_list")||[],r=e.djangoFormPrefix(),s=[];r&&!r.match(/__prefix__/)&&(n.each(o,function(t,e){s.push("#id_"+r+e)}),s.length&&i.prepopulate(s,e.attr("maxlength")))})},reinitDateTimeShortCuts:function(){void 0!==window.DateTimeShortcuts&&(n(".datetimeshortcuts").remove(),DateTimeShortcuts.init())},updateSelectFilter:function(t){void 0!==window.SelectFilter&&(t.find(".selectfilter").each(function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!1)}),t.find(".selectfilterstacked").each(function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!0)}))}},void 0!==window.SelectFilter?c():setTimeout(function(){void 0!==window.SelectFilter&&c()},12);["prepopulate","djangoAdminSelect2"].forEach(function(t){!function e(i){var o;if(!(i>2))return void 0===n.fn[t]?setTimeout(function(){return e(i++)},12):void(n.fn[t]=(o=n.fn[t],function(){return o.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)});["grp_autocomplete_fk","grp_autocomplete_generic","grp_autocomplete_m2m","grp_collapsible","grp_collapsible_group","grp_inline","grp_related_fk","grp_related_generic","grp_related_m2m","grp_timepicker","datepicker","prepopulate","djangoAdminSelect2"].forEach(function(t){!function e(i){var n;if(!(i>2))return void 0===window.grp||void 0===window.grp.jQuery.fn[t]?setTimeout(function(){return e(i++)},12):void(window.grp.jQuery.fn[t]=(n=window.grp.jQuery.fn[t],function(){return n.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)}),t.exports=h},function(t,e){t.exports=window.grappelli},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(19);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var n=i(21);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){var n=i(6),o=i(10),r=i(45),s=i(23)("src"),a=Function.toString,l=(""+a).split("toString");i(26).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,i,a){var h="function"==typeof i;h&&(r(i,"name")||o(i,"name",e)),t[e]!==i&&(h&&(r(i,s)||o(i,s,t[e]?""+t[e]:l.join(String(e)))),t===n?t[e]=i:a?t[e]?t[e]=i:o(t,e,i):(delete t[e],o(t,e,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,i){var n=i(50),o=i(49),r=i(47),s=Object.defineProperty;e.f=i(9)?Object.defineProperty:function(t,e,i){if(n(t),e=r(e,!0),n(i),o)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e){var i=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(6),o=i(26),r=i(10),s=i(24),a=i(22),l=function(t,e,i){var h,c,d,u,f=t&l.F,p=t&l.G,m=t&l.S,g=t&l.P,v=t&l.B,_=p?n:m?n[e]||(n[e]={}):(n[e]||{}).prototype,y=p?o:o[e]||(o[e]={}),b=y.prototype||(y.prototype={});for(h in p&&(i=e),i)d=((c=!f&&_&&void 0!==_[h])?_:i)[h],u=v&&c?a(d,n):g&&"function"==typeof d?a(Function.call,d):d,_&&s(_,h,d,t&l.U),y[h]!=d&&r(y,h,u),g&&b[h]!=d&&(b[h]=d)};n.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){t.exports=window.grp},function(t,e,i){"use strict";i(12),i(2),i(7),i(1);var n=i(0),o=i(11),r=i(17),s=i(18),a=i(28),l=i(15),h="djangoFormset",c=function(){function t(t){this.opts={emptyClass:"empty-form grp-empty-form djn-empty-form",predeleteClass:"grp-predelete"},this.$inline=n(t),this.prefix=this.$inline.djangoFormsetPrefix(),this._$totalForms=this.$inline.find("#id_"+this.prefix+"-TOTAL_FORMS"),this._$totalForms.attr("autocomplete","off"),this._$template=n("#"+this.prefix+"-empty");var e=this.$inline.djnData("inlineModel");this.opts=n.extend({},this.opts,{childTypes:this.$inline.data("inlineFormset").options.childTypes,formsetFkModel:this.$inline.djnData("formsetFkModel"),addButtonSelector:".djn-add-handler.djn-model-"+e,removeButtonSelector:".djn-remove-handler.djn-model-"+e,deleteButtonSelector:".djn-delete-handler.djn-model-"+e,formClass:"dynamic-form grp-dynamic-form djn-dynamic-form-"+e,formClassSelector:".djn-dynamic-form-"+e}),r.initRelatedFields(this.prefix,this.$inline.djnData()),r.initAutocompleteFields(this.prefix,this.$inline.djnData()),this.opts.childTypes&&this._setupPolymorphic(),this._bindEvents(),this._initializeForms(),this.$inline.find('.djn-items:not([id*="-empty"])').trigger("djnesting:init"),this.$inline.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){n(this)[h]()}),this.$inline.is(".djn-group-root")&&r.createSortable(this.$inline),n(document).trigger("djnesting:initialized",[this.$inline,this])}var e=t.prototype;return e._setupPolymorphic=function(){if(!this.opts.childTypes)throw Error("The polymorphic fieldset options.childTypes is not defined!");var t='";var e=this.$inline.find(this.opts.addButtonSelector),i=n(t);e.after(i)},e._initializeForms=function(){var t=this.mgmtVal("TOTAL_FORMS");this.mgmtVal("MAX_NUM_FORMS")<=t&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide();for(var e=0;e .polymorphic-type-menu a").off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation();var i=n(this).attr("data-type");e.add(null,i);var o=n(t.target).closest(".polymorphic-type-menu");o.is(":visible")&&o.hide()}),t.find(this.opts.removeButtonSelector).filter(function(){return!n(this).closest(".djn-empty-form").length}).off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation();var i=n(this).closest(e.opts.formClassSelector);e.remove(i)});var o=function(t){t.preventDefault(),t.stopImmediatePropagation();var i=n(this).closest(e.opts.formClassSelector);n("#id_"+i.djangoFormPrefix()+"DELETE").is(":checked")?e.undelete(i):e.delete(i)},r=t.find(this.opts.deleteButtonSelector).filter(function(){return!n(this).closest(".djn-empty-form").length});r.off("click.djnesting").on("click.djnesting",o),r.find('[id$="-DELETE"]').on("mousedown.djnesting",o)},e.remove=function(t){var e=n(t),i=this.mgmtVal("TOTAL_FORMS"),o=this.mgmtVal("MIN_NUM_FORMS"),s=this.mgmtVal("MAX_NUM_FORMS"),a=e.djangoFormIndex(),l=e.data("isInitial");e[0].innerHTML="",e.remove(),i-=1,this.mgmtVal("TOTAL_FORMS",i),s-i>=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").show(),this._fillGap(a,l);var h=this,c=i<=o;this.$inline.djangoFormsetForms().each(function(){var t=c?"hide":"show";n(this).find(h.opts.removeButtonSelector)[t]()}),r.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:removed",[e,this.prefix])},e.delete=function(t){var e=this,i=n(t),o=i.djangoFormPrefix(),s=n("#id_"+o+"DELETE");i.hasClass(this.opts.predeleteClass)||i.data("isInitial")&&(s.attr("checked","checked"),s.length&&(s[0].checked=!0),i.addClass(this.opts.predeleteClass),i.find(".djn-group").each(function(){var t=n(this),i=t.djangoFormset();t.djangoFormsetForms().each(function(){n(this).hasClass(e.opts.predeleteClass)?n(this).data("alreadyDeleted",!0):i.delete(this)})}),i.find(".cropduster-form").each(function(){var t=n(this).djangoFormsetPrefix()+"-0-",e=n("#id_"+t+"DELETE");e.attr("checked","checked"),e.length&&(e[0].checked=!0)}),r.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:deleted",[i,this.prefix]))},e.undelete=function(t){var e=n(t),i=e.djangoFormPrefix(),o=n("#id_"+i+"DELETE");e.parent().closest("."+this.opts.predeleteClass).length||(e.hasClass("has_original")&&(o.removeAttr("checked"),o.length&&(o[0].checked=!1),e.removeClass(this.opts.predeleteClass)),e.data("alreadyDeleted",!1),e.find(".djn-group").each(function(){var t=n(this),e=t.djangoFormset();t.djangoFormsetForms().each(function(){n(this).data("alreadyDeleted")?n(this).data("alreadyDeleted",!1):e.undelete(this)})}),e.find(".cropduster-form").each(function(){var t=n(this).djangoFormsetPrefix()+"-0-",e=n("#id_"+t+"DELETE");e.removeAttr("checked"),e.length&&(e[0].checked=!1)}),r.updatePositions(this.prefix),n(document).trigger("djnesting:mutate",[this.$inline]),n(document).trigger("formset:undeleted",[e,this.prefix]))},e.add=function(t,e){var i=this,c=e?n("#"+this.prefix+"-empty-"+e):this._$template,d=c.clone(!0);l(c).find(":data(dependency_ids)").each(function(){var t=n(this).attr("id"),e=d.find("#"+t);l(e).data(n.extend({},e.data(),l(this).data()))});var u=this.mgmtVal("TOTAL_FORMS"),f=this.mgmtVal("MAX_NUM_FORMS"),p=this.$inline.hasClass("djn-group-nested");n(document).trigger("djnesting:beforeadded",[this.$inline,d]),d.removeClass(this.opts.emptyClass),d.addClass("djn-item"),d.attr("id",d.attr("id").replace(/\-empty.*?$/,"-"+u)),p&&d.append(r.createContainerElement()),r.updateFormAttributes(d,new RegExp('([#_]id_|[\\#]|^id_|"|^)'+o(this.prefix)+"\\-(?:__prefix__|empty)\\-","g"),"$1"+this.prefix+"-"+u+"-");var m=this._$template;if(this.opts.childTypes&&(m=c.closest(".djn-group").find('> .djn-items > [id*="-empty"], > .djn-fieldset > .djn-items > [id*="-empty"]').eq(0)),this.opts.childTypes){var g=this.$inline.djnData("compatibleParents")||{};d.find("> .djn-group").each(function(t,i){var o=n(i).djnData("formsetFkModel"),r=g[e]||[],s=n(i),a=s.djnData("inlineParentModel"),l=!!s.data("inlineFormset").options.childTypes;s.data("inlineFormset").options.prefix;(a!==e||l&&o!==e&&-1===r.indexOf(o))&&(s.find('input[id$="_FORMS"]').each(function(t,e){e.value=0,e.setAttribute("value","0"),i.parentNode.appendChild(e)}),i.parentNode.removeChild(i))})}if(d.insertBefore(m),this.mgmtVal("TOTAL_FORMS",u+1),f-(u+1)<=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide(),r.updatePositions(this.prefix),n.isNumeric(t)?this.spliceInto(d,t,!0):n(document).trigger("djnesting:mutate",[this.$inline]),s&&s.reinitDateTimeFields(l(d)),r.DjangoInlines.initPrepopulatedFields(d),r.DjangoInlines.reinitDateTimeShortCuts(),r.DjangoInlines.updateSelectFilter(d),r.initRelatedFields(this.prefix),r.initAutocompleteFields(this.prefix),a&&a.jQuery.fn.grp_collapsible){var v=a.jQuery.fn.addBack?"addBack":"andSelf";l(d).find('.grp-collapse:not([id$="-empty"]):not([id*="-empty-"])')[v]().grp_collapsible({toggle_handler_slctr:".grp-collapse-handler:first",closed_css:"closed grp-closed",open_css:"open grp-open",on_toggle:function(){n(document).trigger("djnesting:toggle",[i.$inline])}})}if("function"==typeof n.fn.curated_content_type&&d.find(".curated-content-type-select").each(function(){n(this).curated_content_type()}),this._initializeForm(d),this._bindEvents(d),e){var _=this.$inline.djnData("inlineModel"),y=d.attr("data-inline-model");d.find(".djn-model-"+_).addClass("djn-model-"+y),d.addClass("djn-dynamic-form-"+y)}return d.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){n(this)[h]()}),n(document).trigger("djnesting:added",[this.$inline,d]),n(document).trigger("formset:added",[d,this.prefix]),d},e._fillGap=function(t,e){var i,s,a=this.$inline.djangoFormsetForms().toArray();a.sort(function(t,e){return n(t).djangoFormIndex()-n(e).djangoFormIndex()}),a.forEach(function(e){var o=n(e);o.djangoFormIndex()<=t||(o.data("isInitial")?i=o:s=o)});var l=e&&i||s;if(l){var h=l.djangoFormIndex(),c=new RegExp("([\\#_]|^)"+o(this.prefix+"-"+h)+"(?!\\-\\d)");l.attr("id",this.prefix+"-"+t),r.updateFormAttributes(l,c,"$1"+this.prefix+"-"+t),l.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,l]),e&&i&&s&&this._fillGap(h,!1)}},e._makeRoomForInsert=function(){var t=this.mgmtVal("INITIAL_FORMS"),e=this.mgmtVal("TOTAL_FORMS"),i=t,s=n("#"+this.prefix+"-"+i);if(s.length){var a=new RegExp("([\\#_]|^)"+o(this.prefix)+"-"+i+"(?!\\-\\d)");s.attr("id",this.prefix+"-"+e),r.updateFormAttributes(s,a,"$1"+this.prefix+"-"+e),s.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,s])}},e.spliceInto=function(t,e,i){var s,a=this.mgmtVal("INITIAL_FORMS"),l=this.mgmtVal("TOTAL_FORMS"),h=t.djangoFormsetPrefix(),c=this.prefix,d=t.data("isInitial");if(t.djangoFormsetPrefix()==this.prefix){if(t.prevAll(".djn-item:not(.djn-no-drag,.djn-thead)").length===e||void 0===e)return void r.updatePositions(c);this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item:not(#"+t.attr("id")+")").eq(e).after(t)}else{var u=n("#"+h+"-group");t.closest(".djn-group").djangoFormsetPrefix()!=c&&this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item").eq(e).after(t);var f=u.djangoFormset();if(f.mgmtVal("TOTAL_FORMS",f.mgmtVal("TOTAL_FORMS")-1),f._fillGap(t.djangoFormIndex(),d),d){f.mgmtVal("INITIAL_FORMS",f.mgmtVal("INITIAL_FORMS")-1);var p=this.$inline.parent().closest(".djn-group");if(p.length){var m=this.$inline.closest(".djn-inline-form"),g=(p.djnData("fieldNames")||{}).pk;m.djangoFormField(g).val()||(t.data("isInitial",!1),t.attr("data-is-initial","false"),d=!1,setTimeout(function(){t.find('[name^="'+t.djangoFormPrefix()+'"][name$="-INITIAL_FORMS"]').val("0").trigger("change")},0))}}d&&this._makeRoomForInsert();var v=new RegExp("([\\#_]|^)"+o(t.attr("id"))+"(?!\\-\\d)");s=d?a:l,t.attr("id",c+"-"+s),r.updateFormAttributes(t,v,"$1"+c+"-"+s),t.find(".djn-group").each(function(){var t=n(this);t.djangoFormset().prefix=t.djangoFormsetPrefix()}),n(document).trigger("djnesting:attrchange",[this.$inline,t]),d&&this.mgmtVal("INITIAL_FORMS",a+1),this.mgmtVal("TOTAL_FORMS",l+1),r.updatePositions(h),n(document).trigger("djnesting:mutate",[u])}r.updatePositions(c),i||n(document).trigger("djnesting:mutate",[this.$inline])},e.mgmtVal=function(t,e){var i=this.$inline.find("#id_"+this.prefix+"-"+t);return void 0===e?parseInt(i.val(),10):parseInt(i.val(e).trigger("change").val(),10)},t}();n.fn[h]=function(){var t,e,i,o=this.eq(0);if(0===arguments.length||1===arguments.length&&"string"!=n.type(arguments[0])){t=arguments[0];var r=o.data(h);return r||(r=new c(o,t),o.data(h,r)),r}if(e=arguments[0],i=n.makeArray(arguments).slice(1),e in c.prototype)return o.data(h)[e](i);throw new Error("Unknown function call "+e+" for $.fn."+h)},t.exports=c},function(t,e,i){"use strict";i(1),i(3),i(16),i(7);var n,o,r,s,a,l=i(0); /*! * jQuery UI Sortable @VERSION * http://jqueryui.com @@ -13,5 +13,5 @@ window.DJNesting=function(t){var e={};function i(n){if(e[n])return e[n].exports; * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js - */if(void 0===l.ui){var h=l;!function(t,e){function i(e,i){var o,s,r,a=e.nodeName.toLowerCase();return"area"===a?(s=(o=e.parentNode).name,!(!e.href||!s||"map"!==o.nodeName.toLowerCase())&&(!!(r=t("img[usemap=#"+s+"]")[0])&&n(r))):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a&&e.href||i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var o=0,s=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,n){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),n&&n.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,o,s=t(this[0]);s.length&&s[0]!==document;){if(("absolute"===(n=s.css("position"))||"relative"===n||"fixed"===n)&&(o=parseInt(s.css("zIndex"),10),!isNaN(o)&&0!==o))return o;s=s.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){s.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),o=isNaN(n);return(o||n>=0)&&i(e,!o)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(i,n){function o(e,i,n,o){return t.each(s,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var s="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each(function(){t(this).css(r,o(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each(function(){t(this).css(r,o(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var o,s=t.ui[e].prototype;for(o in n)s.plugins[o]=s.plugins[o]||[],s.plugins[o].push([i,n[o]])},call:function(t,e,i){var n,o=t.plugins[e];if(o&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",o=!1;return e[n]>0||(e[n]=1,o=e[n]>0,e[n]=0,o)}})}(h),n=h,s=0,r=Array.prototype.slice,a=n.cleanData,n.cleanData=function(t){for(var e,i=0;null!=(e=t[i]);i++)try{n(e).triggerHandler("remove")}catch(t){}a(t)},n.widget=function(t,e,i){var s,r,a,l,h={},c=t.split(".")[0];t=t.split(".")[1],s=c+"-"+t,i||(i=e,e=n.Widget),n.expr[":"][s.toLowerCase()]=function(t){return!!n.data(t,s)},n[c]=n[c]||{},r=n[c][t],a=n[c][t]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),o):new a(t,e)},n.extend(a,r,{version:i.version,_proto:n.extend({},i),_childConstructors:[]}),(l=new e).options=n.widget.extend({},l.options),n.each(i,function(t,i){return n.isFunction(i)?(h[t]=function(){var n=function(){return e.prototype[t].apply(this,arguments)},o=function(i){return e.prototype[t].apply(this,i)};return function(){var t,e=this._super,s=this._superApply;return this._super=n,this._superApply=o,t=i.apply(this,arguments),this._super=e,this._superApply=s,t}}(),o):(h[t]=i,o)}),a.prototype=n.widget.extend(l,{widgetEventPrefix:r?l.widgetEventPrefix:t},h,{constructor:a,namespace:c,widgetName:t,widgetFullName:s}),r?(n.each(r._childConstructors,function(t,e){var i=e.prototype;n.widget(i.namespace+"."+i.widgetName,a,e._proto)}),delete r._childConstructors):e._childConstructors.push(a),n.widget.bridge(t,a)},n.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),a=0,l=s.length;l>a;a++)for(e in s[a])i=s[a][e],s[a].hasOwnProperty(e)&&i!==o&&(t[e]=n.isPlainObject(i)?n.isPlainObject(t[e])?n.widget.extend({},t[e],i):n.widget.extend({},i):i);return t},n.widget.bridge=function(t,e){var i=e.prototype.widgetFullName||t;n.fn[t]=function(s){var a="string"==typeof s,l=r.call(arguments,1),h=this;return s=!a&&l.length?n.widget.extend.apply(null,[s].concat(l)):s,a?this.each(function(){var e,r=n.data(this,i);return r?n.isFunction(r[s])&&"_"!==s.charAt(0)?(e=r[s].apply(r,l))!==r&&e!==o?(h=e&&e.jquery?h.pushStack(e.get()):e,!1):o:n.error("no such method '"+s+"' for "+t+" widget instance"):n.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=n.data(this,i);t?t.option(s||{})._init():n.data(this,i,new e(s,this))}),h}},n.Widget=function(){},n.Widget._childConstructors=[],n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,e){e=n(e||this.defaultElement||this)[0],this.element=n(e),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=n.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=n(),this.hoverable=n(),this.focusable=n(),e!==this&&(n.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=n(e.style?e.ownerDocument:e.document||e),this.window=n(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:n.noop,_getCreateEventData:n.noop,_create:n.noop,_init:n.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(n.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:n.noop,widget:function(){return this.element},option:function(t,e){var i,s,r,a=t;if(0===arguments.length)return n.widget.extend({},this.options);if("string"==typeof t)if(a={},t=(i=t.split(".")).shift(),i.length){for(s=a[t]=n.widget.extend({},this.options[t]),r=0;i.length-1>r;r++)s[i[r]]=s[i[r]]||{},s=s[i[r]];if(t=i.pop(),e===o)return s[t]===o?null:s[t];s[t]=e}else{if(e===o)return this.options[t]===o?null:this.options[t];a[t]=e}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,e,i){var s,r=this;"boolean"!=typeof t&&(i=e,e=t,t=!1),i?(e=s=n(e),this.bindings=this.bindings.add(e)):(i=e,e=this.element,s=this.widget()),n.each(i,function(i,a){function l(){return t||!0!==r.options.disabled&&!n(this).hasClass("ui-state-disabled")?("string"==typeof a?r[a]:a).apply(r,arguments):o}"string"!=typeof a&&(l.guid=a.guid=a.guid||l.guid||n.guid++);var h=i.match(/^(\w+)\s*(.*)$/),c=h[1]+r.eventNamespace,d=h[2];d?s.delegate(d,c,l):e.bind(c,l)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){n(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){n(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){n(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){n(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,e,i){var o,s,r=this.options[t];if(i=i||{},(e=n.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],s=e.originalEvent)for(o in s)o in e||(e[o]=s[o]);return this.element.trigger(e,i),!(n.isFunction(r)&&!1===r.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},n.each({show:"fadeIn",hide:"fadeOut"},function(t,e){n.Widget.prototype["_"+t]=function(i,o,s){"string"==typeof o&&(o={effect:o});var r,a=o?!0===o||"number"==typeof o?e:o.effect||e:t;"number"==typeof(o=o||{})&&(o={duration:o}),r=!n.isEmptyObject(o),o.complete=s,o.delay&&i.delay(o.delay),r&&n.effects&&n.effects.effect[a]?i[t](o):a!==t&&i[a]?i[a](o.duration,o.easing,s):i.queue(function(e){n(this)[t](),s&&s.call(i[0]),e()})}}),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,o=1===i.which,s=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&t(i.target).closest(this.options.cancel).length;return!(o&&!s&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(h),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function n(e,i){return parseInt(t.css(e,i),10)||0}t.ui=t.ui||{};var o,s=Math.max,r=Math.abs,a=Math.round,l=/left|center|right/,h=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,u=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==o)return o;var e,i,n=t("
"),s=n.children()[0];return t("body").append(n),e=s.offsetWidth,n.css("overflow","scroll"),e===(i=s.offsetWidth)&&(i=n[0].clientWidth),n.remove(),o=e-i},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.widthn?"left":i>0?"right":"center",vertical:0>a?"top":o>0?"bottom":"middle"};d>u&&u>r(i+n)&&(l.horizontal="center"),f>p&&p>r(o+a)&&(l.vertical="middle"),l.important=s(r(i),r(n))>s(r(o),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(I,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,a=t.left-e.collisionPosition.marginLeft,l=o-a,h=a+e.collisionWidth-r-o;e.collisionWidth>r?l>0&&0>=h?(i=t.left+l+e.collisionWidth-r-o,t.left+=l-i):t.left=h>0&&0>=l?o:l>h?o+r-e.collisionWidth:o:l>0?t.left+=l:h>0?t.left-=h:t.left=s(t.left-a,t.left)},top:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollTop:n.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=o-a,h=a+e.collisionHeight-r-o;e.collisionHeight>r?l>0&&0>=h?(i=t.top+l+e.collisionHeight-r-o,t.top+=l-i):t.top=h>0&&0>=l?o:l>h?o+r-e.collisionHeight:o:l>0?t.top+=l:h>0?t.top-=h:t.top=s(t.top-a,t.top)}},flip:{left:function(t,e){var i,n,o=e.within,s=o.offset.left+o.scrollLeft,a=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,d=h+e.collisionWidth-a-l,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];0>c?(0>(i=t.left+u+f+p+e.collisionWidth-a-s)||r(c)>i)&&(t.left+=u+f+p):d>0&&(((n=t.left-e.collisionPosition.marginLeft+u+f+p-l)>0||d>r(n))&&(t.left+=u+f+p))},top:function(t,e){var i,n,o=e.within,s=o.offset.top+o.scrollTop,a=o.height,l=o.isWindow?o.scrollTop:o.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,d=h+e.collisionHeight-a-l,u="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];0>c?(n=t.top+u+f+p+e.collisionHeight-a-s,t.top+u+f+p>c&&(0>n||r(c)>n)&&(t.top+=u+f+p)):d>0&&(i=t.top-e.collisionPosition.marginTop+u+f+p-l,t.top+u+f+p>d&&(i>0||d>r(i))&&(t.top+=u+f+p))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,n,o,s,r=document.getElementsByTagName("body")[0],a=document.createElement("div");for(s in e=document.createElement(r?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&t.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"}),n)e.style[s]=n[s];e.appendChild(a),(i=r||document.documentElement).insertBefore(e,i.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",o=t(a).offset().left,t.support.offsetFractions=o>10&&11>o,e.innerHTML="",i.removeChild(e)}()}(h)}l.widget("ui.djnsortable",l.ui.mouse,{version:"@VERSION",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_isOverAxis:function(t,e,i){return t>=e&&t=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,e){"disabled"===t?(this.options[t]=e,this.widget().toggleClass("ui-sortable-disabled",!!e)):l.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,e){var i=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(t);var n=null;l(t.target).parents().each(function(){if(l.data(this,i.widgetName+"-item")==i)return n=l(this),!1});if(l.data(t.target,i.widgetName+"-item")==i&&(n=l(t.target)),!n)return!1;if(this.options.handle&&!e){var o=!1,s=l.fn.addBack?"addBack":"andSelf";if(l(this.options.handle,n).find("*")[s]().each(function(){this==t.target&&(o=!0)}),!o)return!1}return this.currentItem=n,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,e,i){var n=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},l.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),n.containment&&this._setContainment(),n.cursor&&(l("body").css("cursor")&&(this._storedCursor=l("body").css("cursor")),l("body").css("cursor",n.cursor)),n.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",n.opacity)),n.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",n.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",t,this._uiHash(this));return l.ui.ddmanager&&(l.ui.ddmanager.current=this),l.ui.ddmanager&&!n.dropBehaviour&&l.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var e=this.options,i=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;n--){var o=this.items[n],s=o.item[0],r=this._intersectsWithPointer(o);if(r&&(o.instance===this.currentContainer&&!(s==this.currentItem[0]||this.placeholder[1==r?"next":"prev"]()[0]==s||l.contains(this.placeholder[0],s)||"semi-dynamic"==this.options.type&&l.contains(this.element[0],s)))){if(this.direction=1==r?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break;this._rearrange(t,o),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),l.ui.ddmanager&&l.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){if(t){if(l.ui.ddmanager&&!this.options.dropBehaviour&&l.ui.ddmanager.drop(this,t),this.options.revert){var i=this,n=this.placeholder.offset();this.reverting=!0,l(this.helper).animate({left:n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){i._clear(t)})}else this._clear(t,e);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),l.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?l(this.domPosition.prev).after(this.currentItem):l(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},l(e).each(function(){var e=(l(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);e&&i.push((t.key||e[1]+"[]")+"="+(t.key&&t.expression?e[1]:e[2]))}),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(l(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,o=n+this.helperProportions.height,s=t.left,r=s+t.width,a=t.top,l=a+Math.max(10,t.height),h=this.offset.click.top,c=this.offset.click.left,d=n+h>a&&n+hs&&e+ct[this.floating?"width":"height"]?d:s0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e=[],i=[],n=this._connectWith();if(n&&t)for(var o=n.length-1;o>=0;o--)for(var s=l(n[o]),r=s.length-1;r>=0;r--){var a=l.data(s[r],this.widgetName);a&&a!=this&&!a.options.disabled&&i.push([l.isFunction(a.options.items)?a.options.items.call(a.element):l(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}i.push([l.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):l(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(o=i.length-1;o>=0;o--)i[o][0].each(function(){e.push(this)});return l(e)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=l.grep(this.items,function(e){for(var i=0;i=0;o--)for(var s=l(n[o]),r=s.length-1;r>=0;r--){var a=l.data(s[r],this.widgetName);a&&a!=this&&!a.options.disabled&&(i.push([l.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):l(a.options.items,a.element),a]),this.containers.push(a))}for(o=i.length-1;o>=0;o--)for(var h=i[o][1],c=i[o][0],d=(r=0,c.length);r=0;e--){var i=this.items[e];if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var n=this.options.toleranceElement?l(this.options.toleranceElement,i.item):i.item;t||(i.width=n.outerWidth(),i.height=n.outerHeight());var o=n.offset();i.left=o.left,i.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;e>=0;e--){o=this.containers[e].element.offset();this.containers[e].containerCache.left=o.left,this.containers[e].containerCache.top=o.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}return this},_createPlaceholder:function(t){var e=(t=t||this).options;if(!e.placeholder||e.placeholder.constructor==String){var i=e.placeholder;e.placeholder={element:function(){var e=l(document.createElement(t.currentItem[0].nodeName)).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(e.style.visibility="hidden"),e},update:function(n,o){i&&!e.forcePlaceholderSize||(o.height()||o.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}}t.placeholder=l(e.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),e.placeholder.update(t,t.placeholder)},_contactContainers:function(t){for(var e=null,i=null,n=this.containers.length-1;n>=0;n--)if(!l.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(e&&l.contains(this.containers[n].element[0],e.element[0]))continue;e=this.containers[n],i=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(e)if(1===this.containers.length)this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1;else{for(var o=1e4,s=null,r=this.containers[i].floating?"left":"top",a=this.containers[i].floating?"width":"height",h=this.positionAbs[r]+this.offset.click[r],c=this.items.length-1;c>=0;c--)if(l.contains(this.containers[i].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var d=this.items[c].item.offset()[r],u=!1;Math.abs(d-h)>Math.abs(d+Math.max(10,this.items[c][a])-h)&&(u=!0,d+=this.items[c][a]),Math.abs(d-h)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid)){var r=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1];s=this.containment&&(r-this.offset.click.topthis.containment[3])?r-this.offset.click.topthis.containment[2])?a-this.offset.click.left=0;n--)e||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);if(this._storedCursor&&l("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(n=0;n li",maxLevels:0,revertOnError:1,protectRoot:!1,rootID:null,rtl:!1,fixedNestingDepth:!1,showErrorDiv:!0,keepInParent:!1,isAllowed:function(t,e){return!0},canConnectWith:function(t,e,i){if(t.data("inlineModel")!==e.data("inlineModel"))return!1;var n=e.data(i.widgetName);return!(i.options.fixedNestingDepth||n&&n.options.fixedNestingDepth)||i._getLevel(t)===i._getLevel(e)}},_createWidget:function(t,e){var i=n(e||this.defaultElement||this),o=i.data("djnsortableOptions");return e=i[0],o&&(t=n.extend({},t,o)),n.ui.djnsortable.prototype._createWidget.call(this,t,e)},_create:function(){this.element.data("uiNestedSortable")&&this.element.data("nestedSortable",this.element.data("uiNestedSortable")),this.element.data("ui-nestedSortable")&&this.element.data("nestedSortable",this.element.data("ui-nestedSortable")),this.element.data("djnsortable",this.element.data("nestedSortable")),this.element.data("uiNestedSortable")&&this.element.data("uiSortable",this.element.data("nestedSortable")),n.ui.djnsortable.prototype._create.apply(this,arguments),this._connectWithMap={};var t=this,e=this.options,i=n(document),o=e.connectWith;if(!o||"string"==typeof o){if(this.options.connectWith=[],"string"==typeof o)for(var s=this._connectWith(),a=0;a-1||r(t,i)})}i.trigger("nestedSortable:created",[this]),i.on("nestedSortable:created.nestedSortable",function(e,i){i.addToConnectWith(t.element),t.addToConnectWith(i.element)})},addToConnectWith:function(t){var e,i=this,r=void 0!==t.selector?t:n(t);r.length>1?r.each(function(t,e){i.addToConnectWith(n(e))}):(void 0===(e=t[0][s])&&(e=t[0][s]=++o),"string"!=typeof this.options.connectWith&&(this._connectWithMap[e]||(this.options.connectWith.push(t),this._connectWithMap[e]=1)))},_destroy:function(){return this.element.removeData("nestedSortable").unbind(".nestedSortable"),n(document).unbind(".nestedSortable"),n.ui.djnsortable.prototype.destroy.apply(this,arguments)},_intersectsWithPointer:function(t){var e=t.item[0],i=this.options,o=n.ui.djnsortable.prototype._intersectsWithPointer.apply(this,arguments);if(this.lastItemElement=null,!o)return o;if(t.instance!==this.currentContainer)return!1;var s=n(e);return i.fixedNestingDepth&&this._getLevel(this.currentItem)===1+this._getLevel(s)&&(e=(s=function(){var t=i.containerElementSelector,e=s.find(".djn-item");if(1!=e.length)return s;if(!e.is(".djn-no-drag,.djn-thead"))return s;var o=s.closest(t);return o.length?o[0]!=e.closest(t).closest(t)[0]?s:n(e[0]):s}())[0]),!(e==this.currentItem[0]||this.placeholder[1==o?"next":"prev"]()[0]==e||n.contains(this.placeholder[0],e)||"semi-dynamic"==this.options.type&&n.contains(this.element[0],e)||i.keepInParent&&e.parentNode!=this.placeholder[0].parentNode||i.fixedNestingDepth&&this._getLevel(this.currentItem)!==this._getLevel(s)||!i.showErrorDiv&&!i.isAllowed.call(this,this.currentItem[0],e.parentNode,this.placeholder))&&(this.lastItemElement=e,o)},_contactContainers:function(t){this.lastItemElement&&this._clearEmpty(this.lastItemElement);var e=this.options,i=this.placeholder.closest(e.listItemSelector),o=i.length&&i.closest(".ui-sortable").length?i:null,s=this._getLevel(this.placeholder),a=this._getChildLevels(this.helper),l=this.placeholder.attr("class"),h=" "+l+" ";if(-1==h.indexOf(" ui-sortable-nested-level-"+s+" ")){var c,d=h.indexOf(" ui-sortable-nested-level-")-1;c=d>-1?l.substring(0,d):l,this.placeholder.attr("class",c+" ui-sortable-nested-level-"+s)}var u=this.placeholder[0].previousSibling?n(this.placeholder[0].previousSibling):null;if(null!=u)for(;!u.is(this.options.listItemSelector)||u[0]==this.currentItem[0]||u[0]==this.helper[0];){if(!u[0].previousSibling){u=null;break}u=n(u[0].previousSibling)}var f=this.placeholder[0].nextSibling?n(this.placeholder[0].nextSibling):null;if(null!=f)for(;!f.is(this.options.listItemSelector)||f[0]==this.currentItem[0]||f[0]==this.helper[0];){if(!f[0].nextSibling){f=null;break}f=n(f[0].nextSibling)}this.beyondMaxLevels=0;var p=this;if(this.refreshPositions(),!e.fixedNestingDepth&&null!=o&&null==f&&(e.rtl&&this.positionAbs.left+this.helper.outerWidth()>o.offset().left+o.outerWidth()||!e.rtl&&this.positionAbs.leftu.offset().left+e.tabSize))this._isAllowed(o,s,s+a);else{if(this._isAllowed(u,s,s+a),this.beyondMaxLevels>0)return n.ui.djnsortable.prototype._contactContainers.apply(this,arguments);var m;(m=u.nearest(e.containerElementSelector).first()).length||u.closest(e.nestedContainerSelector).length||(m=this.options.createContainerElement(u[0]),u.append(m)),m.length&&(m.append(this.placeholder),(p=m.data(this.widgetName))||(p=r(this,m[0])),this.refreshPositions()),this._trigger("change",t,this._uiHash())}n.ui.djnsortable.prototype._contactContainers.call(this,t)},_rearrange:function(t,e,i,o){var s=this.options;if(e&&"object"==typeof e&&e.item&&(this.lastRearrangedElement=e.item[0]),e&&"object"==typeof e&&e.item&&this.placeholder.closest(s.nestedContainerSelector).length){var r=this.placeholder.closest(s.listItemSelector),a="down"==this.direction?r.next(s.nestedContainerSelector):r;if(a.length&&a[0]==e.item[0]){this.counter=this.counter?++this.counter:1;var l=this.counter;return void this._delay(function(){l==this.counter&&this.refreshPositions(!o)})}}n.ui.djnsortable.prototype._rearrange.apply(this,arguments)},_convertPositionTo:function(t,e){return this.previousTopOffset=this.placeholder.offset().top,n.ui.djnsortable.prototype._convertPositionTo.apply(this,arguments)},_clear:function(){n.ui.djnsortable.prototype._clear.apply(this,arguments),"object"==typeof this.lastRearrangedElement&&this.lastRearrangedElement.ownerDocument&&this._clearEmpty(this.lastRearrangedElement)},_mouseStop:function(t,e){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?n(this.domPosition.prev).after(this.placeholder):n(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash()));for(var i=this.items.length-1;i>=0;i--){var o=this.items[i].item[0];this._clearEmpty(o)}n.ui.djnsortable.prototype._mouseStop.apply(this,arguments)},toArray:function(t){var e=(t=n.extend(!0,{},this.options,t||{})).startDepthCount||0,i=[],o=2;i.push({item_id:t.rootID,parent_id:"none",depth:e,left:"1",right:2*(n(t.listItemSelector,this.element).length+1)});return n(this.element).children(t.listItemSelector).each(function(){o=function o(s,r,a){var l,h,c=a+1,d=n(s).children(t.containerElementSelector).find(t.items);d.length>0&&(r++,d.each(function(){c=o(n(this),r,c)}),r--),l=n(s).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/),h=r===e+1?t.rootID:n(s).parent(t.containerElementSelector).parent(t.items).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/)[2];return l&&i.push({item_id:l[2],parent_id:h,depth:r,left:a,right:c}),a=c+1}(this,e+1,o)}),i=i.sort(function(t,e){return t.left-e.left})},_clearEmpty:function(t){if(!this.options.doNotClear){var e=n(t);e.nearest(this.options.containerElementSelector).each(function(t,e){var i=n(e);if(!i.children().length){var o=i.data(this.widgetName);"object"==typeof o&&o.destroy&&o.destroy(),i.remove()}}),e.children().length||e.remove()}},_getLevel:function(t){var e,i=1,n=this.options;if(n.containerElementSelector)for(e=t.closest(n.containerElementSelector);e&&e.length>0&&!e.parent().is(".djn-group-root");)i++,e=e.parent().closest(n.containerElementSelector);return i},_getChildLevels:function(t,e){var i=this,o=this.options,s=0;return e=e||0,n(t).nearest(o.containerElementSelector).first().find(o.items).each(function(t,o){n(o).is(".djn-no-drag,.djn-thead")||(s=Math.max(i._getChildLevels(o,e+1),s))}),e?s+1:s},_isAllowed:function(t,e,i){var o=this.options,s=!!n(this.domPosition.parent).hasClass("ui-sortable"),r=o.maxLevels;t&&"object"==typeof t&&void 0===t.selector&&(t=n(t)),!o.isAllowed.call(this,this.currentItem,t,this.placeholder)||t&&t.hasClass(o.disableNesting)||o.protectRoot&&(null==t&&!s||s&&e>1)?(this.placeholder.addClass(o.errorClass),this.beyondMaxLevels=r=this.items.length));i++);},createContainerElement:function(t){if(!t.childNodes)throw new Error("Invalid element 'parent' passed to createContainerElement.");var e=this.options.createContainerElement.apply(this,arguments);return t.appendChild(e[0]),n(e)}}),n.ui.nestedSortable.prototype.options=n.extend({},n.ui.djnsortable.prototype.options,n.ui.nestedSortable.prototype.options)},function(t,e,i){"use strict";i(2),i(1),i(3);var n=i(0),o=i(11);function s(t){var e,i=0,s=1,r=n("#"+t+"-group"),a=r.djnData(),l=a.fieldNames,h=a.formsetFkName,c=t.match(/^(.*)\-(\d+)-[^\-]+(?:\-\d+)?$/)||[],d=c[1],u=c[2],f=(a.sortableOptions||{}).sortableExcludes||[];if(f.push(h),d){var p=n("#"+d+"-group"),m=p.djnData("fieldNames").pk;e=p.filterDjangoField(d,m,u).val()}h&&void 0!==e&&r.filterDjangoField(t,h).val(e).trigger("change"),r.find(".djn-inline-form").each(function(){if(!this.id||"-empty"==this.id.substr(-6))return!0;var e=new RegExp("^(?:id_)?"+o(t)+"\\-\\d+$");if(!this.id.match(e))return!0;var r=n(this),a=r.djangoPrefixIndex()||[null,null],h=a[0],c=h+"-"+a[1]+"-";if(h){var d=r.find("> h3 > .inline_label");d.length&&d.html(d.html().replace(/(#\d+)/g,"#"+s)),s++;var u,p=!1;r.djangoFormField("*").each(function(){var t=n(this);if(t.is(":input[type!=radio][type!=checkbox],input:checked")){var e=t.val()||"file"==t.attr("type")&&t.siblings("a").length,i=t.attr("name").substring(c.length);i==l.position&&(u=t),e&&-1===n.inArray(i,f)&&(p=!0)}}),p&&u&&(u.val(i).trigger("change"),i++)}})}i(31),t.exports={updatePositions:s,createSortable:function(t){return t.is(".djn-is-polymorphic"),t.find("> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items").nestedSortable({handle:["> h3.djn-drag-handler","> .djn-tools .drag-handler","> .djn-td > .djn-tools .djn-drag-handler","> .djn-tr > .is-sortable > .djn-drag-handler","> .djn-tr > .grp-tools-container .djn-drag-handler"].join(", "),items:"> .djn-item",forcePlaceholderSize:!0,placeholder:{element:function(t){var e=n(document.createElement(t[0].nodeName)).addClass(t[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(t.is(".djn-tbody")){var i=t.children(".djn-tr").eq(0),o=i.prop("tagName").toLowerCase(),s=n("<"+o+">");s.addClass(i.attr("class"));var r=i.children(".djn-td").eq(0).prop("tagName").toLowerCase(),a=0;i.children(".djn-td").each(function(t,e){a+=parseInt(n(e).attr("colspan"),10)||1}),s.append(n("<"+r+' colspan="'+a+'" class="djn-td grp-td">")),e.appendChild(s[0])}return e},update:function(t,e){var i=t.currentItem;if(i){var n=t.options;if(!n.className||n.forcePlaceholderSize){if(e.is(".djn-tbody")&&(e=e.children(".djn-tr").eq(0).children(".djn-td").eq(0)),!e.height()){var o=i.innerHeight(),s=parseInt(i.css("paddingTop")||0,10),r=parseInt(i.css("paddingBottom")||0,10);e.height(o-s-r)}if(!e.width()){var a=i.innerWidth(),l=parseInt(i.css("paddingLeft")||0,10),h=parseInt(i.css("paddingRight")||0,10);e.width(a-l-h)}}}}},helper:"clone",opacity:.6,maxLevels:0,connectWith:".djn-items",tolerance:"intersection",isAllowed:function(t,e){if(e&&e.hasClass("predelete"))return!1;var i=e.closest(".djn-group"),n=i.data("inlineModel"),o=i.djnData("childModels"),s=t.data("inlineModel"),r=o&&-1!==o.indexOf(s);return!(s!==n&&!r)},fixedNestingDepth:!0,containerElementSelector:".djn-items",listItemSelector:".djn-item",start:function(t,e){e.item.addClass("djn-item-dragging"),e.item.show()},stop:function(t,e){e.item.removeClass("djn-item-dragging")},receive:function(t,e){n(this).closest(".djn-group").djangoFormset().spliceInto(e.item),s(e.item.djangoFormsetPrefix())},update:function(t,e){var i=e.item.nextAll(".djn-item").first();if(i.is(".djn-no-drag,.djn-thead")){var o=i[0],r=o.parentNode;r.insertBefore(o,r.firstChild)}var a=n(t.target).closest(".djn-group").attr("id"),l=e.item,h=l.closest("#"+a);"removed"==l.data("updateOperation")?l.removeAttr("data-update-operation"):h.length||l.attr("data-update-operation","removed"),s(l.djangoFormsetPrefix()),n(document).trigger("djnesting:mutate",[n("#"+l.djangoFormsetPrefix()+"-group")])}})}}},function(t,e,i){"use strict";var n=i(4);t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,i){"use strict";i(12),i(1),i(3),i(7);var n=i(0),o={};n.fn.djnData=function(t){var e=(n(this).data("inlineFormset")||{}).nestedOptions||{};return t?e[t]:e},n.fn.djangoPrefixIndex=function(){var t,e,i,n,s,r,a=this.length>1?this.first():this,l=a.attr("id"),h=a.attr("name"),c=a.attr("for");if((s=o[l])||(s=o[h])||(s=o[c]))return s;if(l&&!t&&(t=(l.match(/^(.*)\-group$/)||[null,null])[1]),l&&!t&&a.is(".djn-item")&&l.match(/\d+$/)){var d=l.match(/(.*?)\-(\d+)$/)||[null,null,null];n=d[0],t=d[1],r=d[2]}if(t){if("id_"==t.substr(0,3)&&(t=t.substr(3)),!document.getElementById(t+"-group"))return null}else if((e=a.closest(".djn-inline-form")).length){var u=e.attr("id").match(/(.*?)\-(\d+)$/)||[null,null,null];n=u[0],t=u[1],r=u[2]}else{if(!(i=a.closest(".djn-group")).length)return null;t=((i.attr("id")||"").match(/^(.*)\-group$/)||[null,null])[1]}return n&&(o[n]=[t,r]),[t,r]},n.fn.djangoFormPrefix=function(){var t=this.djangoPrefixIndex();return t&&t[1]?t[0]+"-"+t[1]+"-":null},n.fn.djangoFormIndex=function(){var t=this.djangoPrefixIndex();return t&&t[1]?parseInt(t[1],10):null},n.fn.djangoFormsetPrefix=function(){var t=this.djangoPrefixIndex();return t?t[0]:null};if(n.fn.djangoFormsetForms=function(){var t=[];return this.each(function(){var e=n(this).djangoFormsetPrefix(),i=e?n("#"+e+"-group"):null;if(e&&i.length){var o=i.find(".djn-inline-form").filter(function(){return function(t,e,i){var n=t.getAttribute("id"),o=n.substr(i.length+1);return 0===n.indexOf(i)&&!o.match(/\D/)}(this,0,e)}).toArray().sort(function(t,e){return n(t).djangoFormIndex()-n(e).djangoFormIndex});Array.prototype.push.apply(t,o)}}),this.pushStack(t)},"function"!=typeof n.djangoFormField&&(n.djangoFormField=function(t,e,i){var o,s=n([]);if((o=e.match(/^(.+)\-(\d+)\-$/))&&(e=o[1],i=o[2]),i=parseInt(i,10),isNaN(i))return s;var r=e+"-"+i+"-";if("*"==t)return n('*[name^="'+r+'"]').filter(function(){return-1===n(this).attr("name").substring(r.length).indexOf("-")});var a=n("#id_"+r+t);if(!a.length&&("pk"==t||"position"==t)){if(!(t=(n("#"+e+"-group").djnData("fieldNames")||{})[t]))return s;a=n("#id_"+r+t)}return a}),"function"!=typeof n.fn.djangoFormField&&(n.fn.djangoFormField=function(t,e){var i=this.djangoPrefixIndex(),o=n([]);if(!i)return o;var s=i[0];return void 0===e&&void 0===(e=i[1])?o:n.djangoFormField(t,s,e)}),"function"!=typeof n.fn.filterDjangoField){var s={};n.fn.filterDjangoField=function(t,e,i){var o,r;void 0!==i?("string"==typeof i&&(i=parseInt(i,10)),"number"!=typeof i||isNaN(i)||(o=n("#"+("id_"+t+"-"+i+"-"+e)))):("object"!=typeof s[t]&&(s[t]={}),void 0===s[t][e]&&(s[t][e]=new RegExp("^"+t+"-\\d+-"+e+"$")),o=this.find('input[name$="'+e+'"]').filter(function(){return this.getAttribute("name").match(s[t][e])}));return o.length||"pk"!=e&&"position"!=e||((r=n("#"+t+"-group").djnData("fieldNames")||{})[e],r[e]!=e&&(o=n(this).filterDjangoField(t,r[e],i))),o}}},function(t,e,i){var n=i(5),o=i(14),s=i(8)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"==o(t))}},function(t,e,i){var n=i(8)("unscopables"),o=Array.prototype;void 0==o[n]&&i(10)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,e,i){var n=i(6),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,i){var n=i(14);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(5),o=i(38),s=i(8)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&null===(e=e[s])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var n=i(39);t.exports=function(t,e){return new(n(t))(e)}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){var n=i(41),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,i){var n=i(14);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,i){var n=i(22),o=i(43),s=i(20),r=i(42),a=i(40);t.exports=function(t,e){var i=1==t,l=2==t,h=3==t,c=4==t,d=6==t,u=5==t||d,f=e||a;return function(e,a,p){for(var m,g,v=s(e),_=o(v),y=n(a,p,3),b=r(_.length),x=0,j=i?f(e,b):l?f(e,0):void 0;b>x;x++)if((u||x in _)&&(g=y(m=_[x],x,v),t))if(i)j[x]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:j.push(m)}else if(c)return!1;return d?-1:h||c?c:j}}},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var n=i(5);t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,i){var n=i(5),o=i(6).document,s=n(o)&&n(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},function(t,e,i){t.exports=!i(9)&&!i(4)(function(){return 7!=Object.defineProperty(i(48)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var n=i(5);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){"use strict";i(1);var n=i(0),o=(i(18),i(17));o.DjangoFormset=i(29),n(document).ready(function(){n("fieldset.grp-module, fieldset.module").filter(function(t,e){return 0==e.childNodes.length}).css("border-width","0"),n('input[name$="-DELETE"]:checked').not('[name*="__prefix__"]').closest(".djn-inline-form").addClass("grp-predelete"),n(document).on("djnesting:initialized djnesting:mutate",function(t,e){var i=e.find("> .djn-items, > .tabular > .module > .djn-items").children(".djn-tbody");i.removeClass("row1 row2"),i.each(function(t,e){var i=1+t%2;n(e).addClass("row"+i)})}),n(".djn-group-root").each(function(t,e){n(e).djangoFormset()}),n("form").on("submit.djnesting",function(t){n(".djn-group").each(function(){o.updatePositions(n(this).djangoFormsetPrefix()),n(document).trigger("djnesting:mutate",[n(this).djangoFormset().$inline])})})}),t.exports=o},function(t,e,i){i(57),t.exports=i(51)},,,,,function(t,e){}]); + */if(void 0===l.ui){var h=l;!function(t,e){function i(e,i){var o,r,s,a=e.nodeName.toLowerCase();return"area"===a?(r=(o=e.parentNode).name,!(!e.href||!r||"map"!==o.nodeName.toLowerCase())&&(!!(s=t("img[usemap=#"+r+"]")[0])&&n(s))):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a&&e.href||i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var o=0,r=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,n){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),n&&n.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,o,r=t(this[0]);r.length&&r[0]!==document;){if(("absolute"===(n=r.css("position"))||"relative"===n||"fixed"===n)&&(o=parseInt(r.css("zIndex"),10),!isNaN(o)&&0!==o))return o;r=r.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),o=isNaN(n);return(o||n>=0)&&i(e,!o)}}),t("
").outerWidth(1).jquery||t.each(["Width","Height"],function(i,n){function o(e,i,n,o){return t.each(r,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var r="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each(function(){t(this).css(s,o(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each(function(){t(this).css(s,o(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var o,r=t.ui[e].prototype;for(o in n)r.plugins[o]=r.plugins[o]||[],r.plugins[o].push([i,n[o]])},call:function(t,e,i){var n,o=t.plugins[e];if(o&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",o=!1;return e[n]>0||(e[n]=1,o=e[n]>0,e[n]=0,o)}})}(h),n=h,r=0,s=Array.prototype.slice,a=n.cleanData,n.cleanData=function(t){for(var e,i=0;null!=(e=t[i]);i++)try{n(e).triggerHandler("remove")}catch(t){}a(t)},n.widget=function(t,e,i){var r,s,a,l,h={},c=t.split(".")[0];t=t.split(".")[1],r=c+"-"+t,i||(i=e,e=n.Widget),n.expr[":"][r.toLowerCase()]=function(t){return!!n.data(t,r)},n[c]=n[c]||{},s=n[c][t],a=n[c][t]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),o):new a(t,e)},n.extend(a,s,{version:i.version,_proto:n.extend({},i),_childConstructors:[]}),(l=new e).options=n.widget.extend({},l.options),n.each(i,function(t,i){return n.isFunction(i)?(h[t]=function(){var n=function(){return e.prototype[t].apply(this,arguments)},o=function(i){return e.prototype[t].apply(this,i)};return function(){var t,e=this._super,r=this._superApply;return this._super=n,this._superApply=o,t=i.apply(this,arguments),this._super=e,this._superApply=r,t}}(),o):(h[t]=i,o)}),a.prototype=n.widget.extend(l,{widgetEventPrefix:s?l.widgetEventPrefix:t},h,{constructor:a,namespace:c,widgetName:t,widgetFullName:r}),s?(n.each(s._childConstructors,function(t,e){var i=e.prototype;n.widget(i.namespace+"."+i.widgetName,a,e._proto)}),delete s._childConstructors):e._childConstructors.push(a),n.widget.bridge(t,a)},n.widget.extend=function(t){for(var e,i,r=s.call(arguments,1),a=0,l=r.length;l>a;a++)for(e in r[a])i=r[a][e],r[a].hasOwnProperty(e)&&i!==o&&(t[e]=n.isPlainObject(i)?n.isPlainObject(t[e])?n.widget.extend({},t[e],i):n.widget.extend({},i):i);return t},n.widget.bridge=function(t,e){var i=e.prototype.widgetFullName||t;n.fn[t]=function(r){var a="string"==typeof r,l=s.call(arguments,1),h=this;return r=!a&&l.length?n.widget.extend.apply(null,[r].concat(l)):r,a?this.each(function(){var e,s=n.data(this,i);return s?n.isFunction(s[r])&&"_"!==r.charAt(0)?(e=s[r].apply(s,l))!==s&&e!==o?(h=e&&e.jquery?h.pushStack(e.get()):e,!1):o:n.error("no such method '"+r+"' for "+t+" widget instance"):n.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")}):this.each(function(){var t=n.data(this,i);t?t.option(r||{})._init():n.data(this,i,new e(r,this))}),h}},n.Widget=function(){},n.Widget._childConstructors=[],n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,e){e=n(e||this.defaultElement||this)[0],this.element=n(e),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=n.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=n(),this.hoverable=n(),this.focusable=n(),e!==this&&(n.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=n(e.style?e.ownerDocument:e.document||e),this.window=n(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:n.noop,_getCreateEventData:n.noop,_create:n.noop,_init:n.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(n.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:n.noop,widget:function(){return this.element},option:function(t,e){var i,r,s,a=t;if(0===arguments.length)return n.widget.extend({},this.options);if("string"==typeof t)if(a={},t=(i=t.split(".")).shift(),i.length){for(r=a[t]=n.widget.extend({},this.options[t]),s=0;i.length-1>s;s++)r[i[s]]=r[i[s]]||{},r=r[i[s]];if(t=i.pop(),e===o)return r[t]===o?null:r[t];r[t]=e}else{if(e===o)return this.options[t]===o?null:this.options[t];a[t]=e}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,e,i){var r,s=this;"boolean"!=typeof t&&(i=e,e=t,t=!1),i?(e=r=n(e),this.bindings=this.bindings.add(e)):(i=e,e=this.element,r=this.widget()),n.each(i,function(i,a){function l(){return t||!0!==s.options.disabled&&!n(this).hasClass("ui-state-disabled")?("string"==typeof a?s[a]:a).apply(s,arguments):o}"string"!=typeof a&&(l.guid=a.guid=a.guid||l.guid||n.guid++);var h=i.match(/^(\w+)\s*(.*)$/),c=h[1]+s.eventNamespace,d=h[2];d?r.delegate(d,c,l):e.bind(c,l)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){n(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){n(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){n(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){n(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,e,i){var o,r,s=this.options[t];if(i=i||{},(e=n.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],r=e.originalEvent)for(o in r)o in e||(e[o]=r[o]);return this.element.trigger(e,i),!(n.isFunction(s)&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},n.each({show:"fadeIn",hide:"fadeOut"},function(t,e){n.Widget.prototype["_"+t]=function(i,o,r){"string"==typeof o&&(o={effect:o});var s,a=o?!0===o||"number"==typeof o?e:o.effect||e:t;"number"==typeof(o=o||{})&&(o={duration:o}),s=!n.isEmptyObject(o),o.complete=r,o.delay&&i.delay(o.delay),s&&n.effects&&n.effects.effect[a]?i[t](o):a!==t&&i[a]?i[a](o.duration,o.easing,r):i.queue(function(e){n(this)[t](),r&&r.call(i[0]),e()})}}),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,o=1===i.which,r=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&t(i.target).closest(this.options.cancel).length;return!(o&&!r&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(h),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function n(e,i){return parseInt(t.css(e,i),10)||0}t.ui=t.ui||{};var o,r=Math.max,s=Math.abs,a=Math.round,l=/left|center|right/,h=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,u=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==o)return o;var e,i,n=t("
"),r=n.children()[0];return t("body").append(n),e=r.offsetWidth,n.css("overflow","scroll"),e===(i=r.offsetWidth)&&(i=n[0].clientWidth),n.remove(),o=e-i},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.widthn?"left":i>0?"right":"center",vertical:0>a?"top":o>0?"bottom":"middle"};d>u&&u>s(i+n)&&(l.horizontal="center"),f>p&&p>s(o+a)&&(l.vertical="middle"),l.important=r(s(i),s(n))>r(s(o),s(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(I,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,a=t.left-e.collisionPosition.marginLeft,l=o-a,h=a+e.collisionWidth-s-o;e.collisionWidth>s?l>0&&0>=h?(i=t.left+l+e.collisionWidth-s-o,t.left+=l-i):t.left=h>0&&0>=l?o:l>h?o+s-e.collisionWidth:o:l>0?t.left+=l:h>0?t.left-=h:t.left=r(t.left-a,t.left)},top:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollTop:n.offset.top,s=e.within.height,a=t.top-e.collisionPosition.marginTop,l=o-a,h=a+e.collisionHeight-s-o;e.collisionHeight>s?l>0&&0>=h?(i=t.top+l+e.collisionHeight-s-o,t.top+=l-i):t.top=h>0&&0>=l?o:l>h?o+s-e.collisionHeight:o:l>0?t.top+=l:h>0?t.top-=h:t.top=r(t.top-a,t.top)}},flip:{left:function(t,e){var i,n,o=e.within,r=o.offset.left+o.scrollLeft,a=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,d=h+e.collisionWidth-a-l,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];0>c?(0>(i=t.left+u+f+p+e.collisionWidth-a-r)||s(c)>i)&&(t.left+=u+f+p):d>0&&(((n=t.left-e.collisionPosition.marginLeft+u+f+p-l)>0||d>s(n))&&(t.left+=u+f+p))},top:function(t,e){var i,n,o=e.within,r=o.offset.top+o.scrollTop,a=o.height,l=o.isWindow?o.scrollTop:o.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,d=h+e.collisionHeight-a-l,u="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];0>c?(n=t.top+u+f+p+e.collisionHeight-a-r,t.top+u+f+p>c&&(0>n||s(c)>n)&&(t.top+=u+f+p)):d>0&&(i=t.top-e.collisionPosition.marginTop+u+f+p-l,t.top+u+f+p>d&&(i>0||d>s(i))&&(t.top+=u+f+p))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,n,o,r,s=document.getElementsByTagName("body")[0],a=document.createElement("div");for(r in e=document.createElement(s?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},s&&t.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"}),n)e.style[r]=n[r];e.appendChild(a),(i=s||document.documentElement).insertBefore(e,i.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",o=t(a).offset().left,t.support.offsetFractions=o>10&&11>o,e.innerHTML="",i.removeChild(e)}()}(h)}l.widget("ui.djnsortable",l.ui.mouse,{version:"@VERSION",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_isOverAxis:function(t,e,i){return t>=e&&t=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,e){"disabled"===t?(this.options[t]=e,this.widget().toggleClass("ui-sortable-disabled",!!e)):l.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,e){var i=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(t);var n=null;l(t.target).parents().each(function(){if(l.data(this,i.widgetName+"-item")==i)return n=l(this),!1});if(l.data(t.target,i.widgetName+"-item")==i&&(n=l(t.target)),!n)return!1;if(this.options.handle&&!e){var o=!1,r=l.fn.addBack?"addBack":"andSelf";if(l(this.options.handle,n).find("*")[r]().each(function(){this==t.target&&(o=!0)}),!o)return!1}return this.currentItem=n,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,e,i){var n=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},l.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),n.containment&&this._setContainment(),n.cursor&&(l("body").css("cursor")&&(this._storedCursor=l("body").css("cursor")),l("body").css("cursor",n.cursor)),n.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",n.opacity)),n.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",n.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",t,this._uiHash(this));return l.ui.ddmanager&&(l.ui.ddmanager.current=this),l.ui.ddmanager&&!n.dropBehaviour&&l.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var e=this.options,i=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;n--){var o=this.items[n],r=o.item[0],s=this._intersectsWithPointer(o);if(s&&(o.instance===this.currentContainer&&!(r==this.currentItem[0]||this.placeholder[1==s?"next":"prev"]()[0]==r||l.contains(this.placeholder[0],r)||"semi-dynamic"==this.options.type&&l.contains(this.element[0],r)))){if(this.direction=1==s?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break;this._rearrange(t,o),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),l.ui.ddmanager&&l.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){if(t){if(l.ui.ddmanager&&!this.options.dropBehaviour&&l.ui.ddmanager.drop(this,t),this.options.revert){var i=this,n=this.placeholder.offset();this.reverting=!0,l(this.helper).animate({left:n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){i._clear(t)})}else this._clear(t,e);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),l.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?l(this.domPosition.prev).after(this.currentItem):l(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},l(e).each(function(){var e=(l(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);e&&i.push((t.key||e[1]+"[]")+"="+(t.key&&t.expression?e[1]:e[2]))}),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(l(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,o=n+this.helperProportions.height,r=t.left,s=r+t.width,a=t.top,l=a+Math.max(10,t.height),h=this.offset.click.top,c=this.offset.click.left,d=n+h>a&&n+hr&&e+ct[this.floating?"width":"height"]?d:r0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e=[],i=[],n=this._connectWith();if(n&&t)for(var o=n.length-1;o>=0;o--)for(var r=l(n[o]),s=r.length-1;s>=0;s--){var a=l.data(r[s],this.widgetName);a&&a!=this&&!a.options.disabled&&i.push([l.isFunction(a.options.items)?a.options.items.call(a.element):l(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}i.push([l.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):l(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(o=i.length-1;o>=0;o--)i[o][0].each(function(){e.push(this)});return l(e)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=l.grep(this.items,function(e){for(var i=0;i=0;o--)for(var r=l(n[o]),s=r.length-1;s>=0;s--){var a=l.data(r[s],this.widgetName);a&&a!=this&&!a.options.disabled&&(i.push([l.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):l(a.options.items,a.element),a]),this.containers.push(a))}for(o=i.length-1;o>=0;o--)for(var h=i[o][1],c=i[o][0],d=(s=0,c.length);s=0;e--){var i=this.items[e];if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var n=this.options.toleranceElement?l(this.options.toleranceElement,i.item):i.item;t||(i.width=n.outerWidth(),i.height=n.outerHeight());var o=n.offset();i.left=o.left,i.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;e>=0;e--){o=this.containers[e].element.offset();this.containers[e].containerCache.left=o.left,this.containers[e].containerCache.top=o.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}return this},_createPlaceholder:function(t){var e=(t=t||this).options;if(!e.placeholder||e.placeholder.constructor==String){var i=e.placeholder;e.placeholder={element:function(){var e=l(document.createElement(t.currentItem[0].nodeName)).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(e.style.visibility="hidden"),e},update:function(n,o){i&&!e.forcePlaceholderSize||(o.height()||o.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}}t.placeholder=l(e.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),e.placeholder.update(t,t.placeholder)},_contactContainers:function(t){for(var e=null,i=null,n=this.containers.length-1;n>=0;n--)if(!l.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(e&&l.contains(this.containers[n].element[0],e.element[0]))continue;e=this.containers[n],i=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(e)if(1===this.containers.length)this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1;else{for(var o=1e4,r=null,s=this.containers[i].floating?"left":"top",a=this.containers[i].floating?"width":"height",h=this.positionAbs[s]+this.offset.click[s],c=this.items.length-1;c>=0;c--)if(l.contains(this.containers[i].element[0],this.items[c].item[0])&&this.items[c].item[0]!=this.currentItem[0]){var d=this.items[c].item.offset()[s],u=!1;Math.abs(d-h)>Math.abs(d+Math.max(10,this.items[c][a])-h)&&(u=!0,d+=this.items[c][a]),Math.abs(d-h)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),e.grid)){var s=this.originalPageY+Math.round((r-this.originalPageY)/e.grid[1])*e.grid[1];r=this.containment&&(s-this.offset.click.topthis.containment[3])?s-this.offset.click.topthis.containment[2])?a-this.offset.click.left=0;n--)e||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);if(this._storedCursor&&l("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(n=0;n li",maxLevels:0,revertOnError:1,protectRoot:!1,rootID:null,rtl:!1,fixedNestingDepth:!1,showErrorDiv:!0,keepInParent:!1,isAllowed:function(t,e){return!0},canConnectWith:function(t,e,i){if(t.data("inlineModel")!==e.data("inlineModel"))return!1;var n=e.data(i.widgetName);return!(i.options.fixedNestingDepth||n&&n.options.fixedNestingDepth)||i._getLevel(t)===i._getLevel(e)}},_createWidget:function(t,e){var i=n(e||this.defaultElement||this),o=i.data("djnsortableOptions");return e=i[0],o&&(t=n.extend({},t,o)),n.ui.djnsortable.prototype._createWidget.call(this,t,e)},_create:function(){this.element.data("uiNestedSortable")&&this.element.data("nestedSortable",this.element.data("uiNestedSortable")),this.element.data("ui-nestedSortable")&&this.element.data("nestedSortable",this.element.data("ui-nestedSortable")),this.element.data("djnsortable",this.element.data("nestedSortable")),this.element.data("uiNestedSortable")&&this.element.data("uiSortable",this.element.data("nestedSortable")),n.ui.djnsortable.prototype._create.apply(this,arguments),this._connectWithMap={};var t=this,e=this.options,i=n(document),o=e.connectWith;if(!o||"string"==typeof o){if(this.options.connectWith=[],"string"==typeof o)for(var r=this._connectWith(),a=0;a-1||s(t,i)})}i.trigger("nestedSortable:created",[this]),i.on("nestedSortable:created.nestedSortable",function(e,i){i.addToConnectWith(t.element),t.addToConnectWith(i.element)})},addToConnectWith:function(t){var e,i=this,s=void 0!==t.selector?t:n(t);s.length>1?s.each(function(t,e){i.addToConnectWith(n(e))}):(void 0===(e=t[0][r])&&(e=t[0][r]=++o),"string"!=typeof this.options.connectWith&&(this._connectWithMap[e]||(this.options.connectWith.push(t),this._connectWithMap[e]=1)))},_destroy:function(){return this.element.removeData("nestedSortable").unbind(".nestedSortable"),n(document).unbind(".nestedSortable"),n.ui.djnsortable.prototype.destroy.apply(this,arguments)},_intersectsWithPointer:function(t){var e=t.item[0],i=this.options,o=n.ui.djnsortable.prototype._intersectsWithPointer.apply(this,arguments);if(this.lastItemElement=null,!o)return o;if(t.instance!==this.currentContainer)return!1;var r=n(e);return i.fixedNestingDepth&&this._getLevel(this.currentItem)===1+this._getLevel(r)&&(e=(r=function(){var t=i.containerElementSelector,e=r.find(".djn-item");if(1!=e.length)return r;if(!e.is(".djn-no-drag,.djn-thead"))return r;var o=r.closest(t);return o.length?o[0]!=e.closest(t).closest(t)[0]?r:n(e[0]):r}())[0]),!(e==this.currentItem[0]||this.placeholder[1==o?"next":"prev"]()[0]==e||n.contains(this.placeholder[0],e)||"semi-dynamic"==this.options.type&&n.contains(this.element[0],e)||i.keepInParent&&e.parentNode!=this.placeholder[0].parentNode||i.fixedNestingDepth&&this._getLevel(this.currentItem)!==this._getLevel(r)||!i.showErrorDiv&&!i.isAllowed.call(this,this.currentItem[0],e.parentNode,this.placeholder))&&(this.lastItemElement=e,o)},_contactContainers:function(t){this.lastItemElement&&this._clearEmpty(this.lastItemElement);var e=this.options,i=this.placeholder.closest(e.listItemSelector),o=i.length&&i.closest(".ui-sortable").length?i:null,r=this._getLevel(this.placeholder),a=this._getChildLevels(this.helper),l=this.placeholder.attr("class"),h=" "+l+" ";if(-1==h.indexOf(" ui-sortable-nested-level-"+r+" ")){var c,d=h.indexOf(" ui-sortable-nested-level-")-1;c=d>-1?l.substring(0,d):l,this.placeholder.attr("class",c+" ui-sortable-nested-level-"+r)}var u=this.placeholder[0].previousSibling?n(this.placeholder[0].previousSibling):null;if(null!=u)for(;!u.is(this.options.listItemSelector)||u[0]==this.currentItem[0]||u[0]==this.helper[0];){if(!u[0].previousSibling){u=null;break}u=n(u[0].previousSibling)}var f=this.placeholder[0].nextSibling?n(this.placeholder[0].nextSibling):null;if(null!=f)for(;!f.is(this.options.listItemSelector)||f[0]==this.currentItem[0]||f[0]==this.helper[0];){if(!f[0].nextSibling){f=null;break}f=n(f[0].nextSibling)}this.beyondMaxLevels=0;var p=this;if(this.refreshPositions(),!e.fixedNestingDepth&&null!=o&&null==f&&(e.rtl&&this.positionAbs.left+this.helper.outerWidth()>o.offset().left+o.outerWidth()||!e.rtl&&this.positionAbs.leftu.offset().left+e.tabSize))this._isAllowed(o,r,r+a);else{if(this._isAllowed(u,r,r+a),this.beyondMaxLevels>0)return n.ui.djnsortable.prototype._contactContainers.apply(this,arguments);var m;(m=u.nearest(e.containerElementSelector).first()).length||u.closest(e.nestedContainerSelector).length||(m=this.options.createContainerElement(u[0]),u.append(m)),m.length&&(m.append(this.placeholder),(p=m.data(this.widgetName))||(p=s(this,m[0])),this.refreshPositions()),this._trigger("change",t,this._uiHash())}n.ui.djnsortable.prototype._contactContainers.call(this,t)},_rearrange:function(t,e,i,o){var r=this.options;if(e&&"object"==typeof e&&e.item&&(this.lastRearrangedElement=e.item[0]),e&&"object"==typeof e&&e.item&&this.placeholder.closest(r.nestedContainerSelector).length){var s=this.placeholder.closest(r.listItemSelector),a="down"==this.direction?s.next(r.nestedContainerSelector):s;if(a.length&&a[0]==e.item[0]){this.counter=this.counter?++this.counter:1;var l=this.counter;return void this._delay(function(){l==this.counter&&this.refreshPositions(!o)})}}n.ui.djnsortable.prototype._rearrange.apply(this,arguments)},_convertPositionTo:function(t,e){return this.previousTopOffset=this.placeholder.offset().top,n.ui.djnsortable.prototype._convertPositionTo.apply(this,arguments)},_clear:function(){n.ui.djnsortable.prototype._clear.apply(this,arguments),"object"==typeof this.lastRearrangedElement&&this.lastRearrangedElement.ownerDocument&&this._clearEmpty(this.lastRearrangedElement)},_mouseStop:function(t,e){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?n(this.domPosition.prev).after(this.placeholder):n(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash()));for(var i=this.items.length-1;i>=0;i--){var o=this.items[i].item[0];this._clearEmpty(o)}n.ui.djnsortable.prototype._mouseStop.apply(this,arguments)},toArray:function(t){var e=(t=n.extend(!0,{},this.options,t||{})).startDepthCount||0,i=[],o=2;i.push({item_id:t.rootID,parent_id:"none",depth:e,left:"1",right:2*(n(t.listItemSelector,this.element).length+1)});return n(this.element).children(t.listItemSelector).each(function(){o=function o(r,s,a){var l,h,c=a+1,d=n(r).children(t.containerElementSelector).find(t.items);d.length>0&&(s++,d.each(function(){c=o(n(this),s,c)}),s--),l=n(r).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/),h=s===e+1?t.rootID:n(r).parent(t.containerElementSelector).parent(t.items).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/)[2];return l&&i.push({item_id:l[2],parent_id:h,depth:s,left:a,right:c}),a=c+1}(this,e+1,o)}),i=i.sort(function(t,e){return t.left-e.left})},_clearEmpty:function(t){if(!this.options.doNotClear){var e=n(t);e.nearest(this.options.containerElementSelector).each(function(t,e){var i=n(e);if(!i.children().length){var o=i.data(this.widgetName);"object"==typeof o&&o.destroy&&o.destroy(),i.remove()}}),e.children().length||e.remove()}},_getLevel:function(t){var e,i=1,n=this.options;if(n.containerElementSelector)for(e=t.closest(n.containerElementSelector);e&&e.length>0&&!e.parent().is(".djn-group-root");)i++,e=e.parent().closest(n.containerElementSelector);return i},_getChildLevels:function(t,e){var i=this,o=this.options,r=0;return e=e||0,n(t).nearest(o.containerElementSelector).first().find(o.items).each(function(t,o){n(o).is(".djn-no-drag,.djn-thead")||(r=Math.max(i._getChildLevels(o,e+1),r))}),e?r+1:r},_isAllowed:function(t,e,i){var o=this.options,r=!!n(this.domPosition.parent).hasClass("ui-sortable"),s=o.maxLevels;t&&"object"==typeof t&&void 0===t.selector&&(t=n(t)),!o.isAllowed.call(this,this.currentItem,t,this.placeholder)||t&&t.hasClass(o.disableNesting)||o.protectRoot&&(null==t&&!r||r&&e>1)?(this.placeholder.addClass(o.errorClass),this.beyondMaxLevels=s=this.items.length));i++);},createContainerElement:function(t){if(!t.childNodes)throw new Error("Invalid element 'parent' passed to createContainerElement.");var e=this.options.createContainerElement.apply(this,arguments);return t.appendChild(e[0]),n(e)}}),n.ui.nestedSortable.prototype.options=n.extend({},n.ui.djnsortable.prototype.options,n.ui.nestedSortable.prototype.options)},function(t,e,i){"use strict";i(2),i(1),i(3);var n=i(0),o=i(11);function r(t){var e,i=0,r=1,s=n("#"+t+"-group"),a=s.djnData(),l=a.fieldNames,h=a.formsetFkName,c=t.match(/^(.*)\-(\d+)-[^\-]+(?:\-\d+)?$/)||[],d=c[1],u=c[2],f=(a.sortableOptions||{}).sortableExcludes||[];if(f.push(h),d){var p=n("#"+d+"-group"),m=p.djnData("fieldNames").pk;e=p.filterDjangoField(d,m,u).val()}h&&void 0!==e&&s.filterDjangoField(t,h).val(e).trigger("change"),s.find(".djn-inline-form").each(function(){if(!this.id||"-empty"==this.id.substr(-6))return!0;var e=new RegExp("^(?:id_)?"+o(t)+"\\-\\d+$");if(!this.id.match(e))return!0;var s=n(this),a=s.djangoPrefixIndex()||[null,null],h=a[0],c=h+"-"+a[1]+"-";if(h){var d=s.find("> h3 > .inline_label");d.length&&d.html(d.html().replace(/(#\d+)/g,"#"+r)),r++;var u,p=!1;s.djangoFormField("*").each(function(){var t=n(this);if(t.is(":input[type!=radio][type!=checkbox],input:checked")){var e=t.val()||"file"==t.attr("type")&&t.siblings("a").length,i=t.attr("name").substring(c.length);i==l.position&&(u=t),e&&-1===n.inArray(i,f)&&(p=!0)}}),p&&u&&(u.val(i).trigger("change"),i++)}})}i(31),t.exports={updatePositions:r,createSortable:function(t){return t.is(".djn-is-polymorphic"),t.find("> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items").nestedSortable({handle:["> h3.djn-drag-handler","> .djn-tools .drag-handler","> .djn-td > .djn-tools .djn-drag-handler","> .djn-tr > .is-sortable > .djn-drag-handler","> .djn-tr > .grp-tools-container .djn-drag-handler"].join(", "),items:"> .djn-item",forcePlaceholderSize:!0,placeholder:{element:function(t){var e=n(document.createElement(t[0].nodeName)).addClass(t[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(t.is(".djn-tbody")){var i=t.children(".djn-tr").eq(0),o=i.prop("tagName").toLowerCase(),r=n("<"+o+">");r.addClass(i.attr("class"));var s=i.children(".djn-td").eq(0).prop("tagName").toLowerCase(),a=0;i.children(".djn-td").each(function(t,e){a+=parseInt(n(e).attr("colspan"),10)||1}),r.append(n("<"+s+' colspan="'+a+'" class="djn-td grp-td">")),e.appendChild(r[0])}return e},update:function(t,e){var i=t.currentItem;if(i){var n=t.options;if(!n.className||n.forcePlaceholderSize){if(e.is(".djn-tbody")&&(e=e.children(".djn-tr").eq(0).children(".djn-td").eq(0)),!e.height()){var o=i.innerHeight(),r=parseInt(i.css("paddingTop")||0,10),s=parseInt(i.css("paddingBottom")||0,10);e.height(o-r-s)}if(!e.width()){var a=i.innerWidth(),l=parseInt(i.css("paddingLeft")||0,10),h=parseInt(i.css("paddingRight")||0,10);e.width(a-l-h)}}}}},helper:"clone",opacity:.6,maxLevels:0,connectWith:".djn-items",tolerance:"intersection",isAllowed:function(t,e){if(e&&e.hasClass("predelete"))return!1;var i=e.closest(".djn-group"),n=i.data("inlineModel"),o=i.djnData("childModels"),r=t.data("inlineModel"),s=o&&-1!==o.indexOf(r);return!(r!==n&&!s)},fixedNestingDepth:!0,containerElementSelector:".djn-items",listItemSelector:".djn-item",start:function(t,e){e.item.addClass("djn-item-dragging"),e.item.show()},stop:function(t,e){e.item.removeClass("djn-item-dragging")},receive:function(t,e){n(this).closest(".djn-group").djangoFormset().spliceInto(e.item),r(e.item.djangoFormsetPrefix())},update:function(t,e){var i=e.item.nextAll(".djn-item").first();if(i.is(".djn-no-drag,.djn-thead")){var o=i[0],s=o.parentNode;s.insertBefore(o,s.firstChild)}var a=n(t.target).closest(".djn-group").attr("id"),l=e.item,h=l.closest("#"+a);"removed"==l.data("updateOperation")?l.removeAttr("data-update-operation"):h.length||l.attr("data-update-operation","removed"),r(l.djangoFormsetPrefix()),n(document).trigger("djnesting:mutate",[n("#"+l.djangoFormsetPrefix()+"-group")])}})}}},function(t,e,i){"use strict";var n=i(4);t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,i){"use strict";i(12),i(1),i(3),i(7);var n=i(0),o={};n.fn.djnData=function(t){var e=(n(this).data("inlineFormset")||{}).nestedOptions||{};return t?e[t]:e},n.fn.djangoPrefixIndex=function(){var t,e,i,n,r,s,a=this.length>1?this.first():this,l=a.attr("id"),h=a.attr("name"),c=a.attr("for");if((r=o[l])||(r=o[h])||(r=o[c]))return r;if(l&&!t&&(t=(l.match(/^(.*)\-group$/)||[null,null])[1]),l&&!t&&a.is(".djn-item")&&l.match(/\d+$/)){var d=l.match(/(.*?)\-(\d+)$/)||[null,null,null];n=d[0],t=d[1],s=d[2]}if(t){if("id_"==t.substr(0,3)&&(t=t.substr(3)),!document.getElementById(t+"-group"))return null}else if((e=a.closest(".djn-inline-form")).length){var u=e.attr("id").match(/(.*?)\-(\d+)$/)||[null,null,null];n=u[0],t=u[1],s=u[2]}else{if(!(i=a.closest(".djn-group")).length)return null;t=((i.attr("id")||"").match(/^(.*)\-group$/)||[null,null])[1]}return n&&(o[n]=[t,s]),[t,s]},n.fn.djangoFormPrefix=function(){var t=this.djangoPrefixIndex();return t&&t[1]?t[0]+"-"+t[1]+"-":null},n.fn.djangoFormIndex=function(){var t=this.djangoPrefixIndex();return t&&t[1]?parseInt(t[1],10):null},n.fn.djangoFormsetPrefix=function(){var t=this.djangoPrefixIndex();return t?t[0]:null};if(n.fn.djangoFormsetForms=function(){var t=[];return this.each(function(){var e=n(this).djangoFormsetPrefix(),i=e?n("#"+e+"-group"):null;if(e&&i.length){var o=i.find(".djn-inline-form").filter(function(){return function(t,e,i){var n=t.getAttribute("id"),o=n.substr(i.length+1);return 0===n.indexOf(i)&&!o.match(/\D/)}(this,0,e)}).toArray().sort(function(t,e){return n(t).djangoFormIndex()-n(e).djangoFormIndex});Array.prototype.push.apply(t,o)}}),this.pushStack(t)},"function"!=typeof n.djangoFormField&&(n.djangoFormField=function(t,e,i){var o,r=n([]);if((o=e.match(/^(.+)\-(\d+)\-$/))&&(e=o[1],i=o[2]),i=parseInt(i,10),isNaN(i))return r;var s=e+"-"+i+"-";if("*"==t)return n('*[name^="'+s+'"]').filter(function(){return-1===n(this).attr("name").substring(s.length).indexOf("-")});var a=n("#id_"+s+t);if(!a.length&&("pk"==t||"position"==t)){if(!(t=(n("#"+e+"-group").djnData("fieldNames")||{})[t]))return r;a=n("#id_"+s+t)}return a}),"function"!=typeof n.fn.djangoFormField&&(n.fn.djangoFormField=function(t,e){var i=this.djangoPrefixIndex(),o=n([]);if(!i)return o;var r=i[0];return void 0===e&&void 0===(e=i[1])?o:n.djangoFormField(t,r,e)}),"function"!=typeof n.fn.filterDjangoField){var r={};n.fn.filterDjangoField=function(t,e,i){var o,s;void 0!==i?("string"==typeof i&&(i=parseInt(i,10)),"number"!=typeof i||isNaN(i)||(o=n("#"+("id_"+t+"-"+i+"-"+e)))):("object"!=typeof r[t]&&(r[t]={}),void 0===r[t][e]&&(r[t][e]=new RegExp("^"+t+"-\\d+-"+e+"$")),o=this.find('input[name$="'+e+'"]').filter(function(){return this.getAttribute("name").match(r[t][e])}));return o.length||"pk"!=e&&"position"!=e||((s=n("#"+t+"-group").djnData("fieldNames")||{})[e],s[e]!=e&&(o=n(this).filterDjangoField(t,s[e],i))),o}}},function(t,e,i){var n=i(5),o=i(14),r=i(8)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==o(t))}},function(t,e,i){var n=i(8)("unscopables"),o=Array.prototype;void 0==o[n]&&i(10)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,e,i){var n=i(6),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,i){var n=i(14);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(5),o=i(38),r=i(8)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var n=i(39);t.exports=function(t,e){return new(n(t))(e)}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){var n=i(41),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,i){var n=i(14);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,i){var n=i(22),o=i(43),r=i(20),s=i(42),a=i(40);t.exports=function(t,e){var i=1==t,l=2==t,h=3==t,c=4==t,d=6==t,u=5==t||d,f=e||a;return function(e,a,p){for(var m,g,v=r(e),_=o(v),y=n(a,p,3),b=s(_.length),x=0,j=i?f(e,b):l?f(e,0):void 0;b>x;x++)if((u||x in _)&&(g=y(m=_[x],x,v),t))if(i)j[x]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:j.push(m)}else if(c)return!1;return d?-1:h||c?c:j}}},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var n=i(5);t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,i){var n=i(5),o=i(6).document,r=n(o)&&n(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},function(t,e,i){t.exports=!i(9)&&!i(4)(function(){return 7!=Object.defineProperty(i(48)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var n=i(5);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){"use strict";i(1);var n=i(0),o=(i(18),i(17));o.DjangoFormset=i(29),n(document).ready(function(){n("fieldset.grp-module, fieldset.module").filter(function(t,e){return 0==e.childNodes.length}).css("border-width","0"),n('input[name$="-DELETE"]:checked').not('[name*="__prefix__"]').closest(".djn-inline-form").addClass("grp-predelete"),n(document).on("djnesting:initialized djnesting:mutate",function(t,e){var i=e.find("> .djn-items, > .tabular > .module > .djn-items").children(".djn-tbody");i.removeClass("row1 row2"),i.each(function(t,e){var i=1+t%2;n(e).addClass("row"+i)})}),n(".djn-group-root").each(function(t,e){n(e).djangoFormset()}),n("form").on("submit.djnesting",function(t){n(".djn-group").each(function(){o.updatePositions(n(this).djangoFormsetPrefix()),n(document).trigger("djnesting:mutate",[n(this).djangoFormset().$inline])})})}),t.exports=o},function(t,e,i){i(57),t.exports=i(51)},,,,,function(t,e){}]); //# sourceMappingURL=nested_admin.min.js.map \ No newline at end of file diff --git a/nested_admin/static/nested_admin/dist/nested_admin.min.js.map b/nested_admin/static/nested_admin/dist/nested_admin.min.js.map index eacf269..d76149e 100644 --- a/nested_admin/static/nested_admin/dist/nested_admin.min.js.map +++ b/nested_admin/static/nested_admin/dist/nested_admin.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../webpack/bootstrap","../src/nested-admin/jquery.shim.js","../../../../node_modules/core-js/modules/es6.array.find.js","../../../../node_modules/core-js/modules/es6.regexp.replace.js","../../../../node_modules/core-js/modules/es6.regexp.match.js","../../../../node_modules/core-js/modules/_fails.js","../../../../node_modules/core-js/modules/_is-object.js","../../../../node_modules/core-js/modules/_global.js","../../../../node_modules/core-js/modules/es6.function.name.js","../../../../node_modules/core-js/modules/_wks.js","../../../../node_modules/core-js/modules/_descriptors.js","../../../../node_modules/core-js/modules/_hide.js","../src/nested-admin/regexquote.js","../../../../node_modules/core-js/modules/es6.array.sort.js","../../../../node_modules/core-js/modules/_fix-re-wks.js","../../../../node_modules/core-js/modules/_cof.js","../src/nested-admin/grp$.js","../../../../node_modules/core-js/modules/es6.regexp.split.js","../src/nested-admin/utils.js","../../../../external \"grappelli\"","../../../../node_modules/core-js/modules/_defined.js","../../../../node_modules/core-js/modules/_to-object.js","../../../../node_modules/core-js/modules/_a-function.js","../../../../node_modules/core-js/modules/_ctx.js","../../../../node_modules/core-js/modules/_uid.js","../../../../node_modules/core-js/modules/_redefine.js","../../../../node_modules/core-js/modules/_object-dp.js","../../../../node_modules/core-js/modules/_core.js","../../../../node_modules/core-js/modules/_export.js","../../../../external \"grp\"","../src/nested-admin/jquery.djangoformset.js","../src/nested-admin/jquery.ui.djnsortable.js","../src/nested-admin/jquery.ui.nestedsortable.js","../src/nested-admin/sortable.js","../../../../node_modules/core-js/modules/_strict-method.js","../src/nested-admin/jquery.djnutils.js","../../../../node_modules/core-js/modules/_is-regexp.js","../../../../node_modules/core-js/modules/_add-to-unscopables.js","../../../../node_modules/core-js/modules/_shared.js","../../../../node_modules/core-js/modules/_is-array.js","../../../../node_modules/core-js/modules/_array-species-constructor.js","../../../../node_modules/core-js/modules/_array-species-create.js","../../../../node_modules/core-js/modules/_to-integer.js","../../../../node_modules/core-js/modules/_to-length.js","../../../../node_modules/core-js/modules/_iobject.js","../../../../node_modules/core-js/modules/_array-methods.js","../../../../node_modules/core-js/modules/_has.js","../../../../node_modules/core-js/modules/_property-desc.js","../../../../node_modules/core-js/modules/_to-primitive.js","../../../../node_modules/core-js/modules/_dom-create.js","../../../../node_modules/core-js/modules/_ie8-dom-define.js","../../../../node_modules/core-js/modules/_an-object.js","../src/nested-admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","window","django","jQuery","$export","$find","forced","Array","P","F","find","callbackfn","this","arguments","length","undefined","defined","REPLACE","$replace","searchValue","replaceValue","O","fn","String","MATCH","$match","regexp","RegExp","exec","e","it","global","Math","self","Function","__g","dP","f","FProto","nameRE","match","store","uid","Symbol","USE_SYMBOL","a","createDesc","key","str","replace","aFunction","toObject","fails","$sort","sort","test","comparefn","hide","redefine","wks","KEY","SYMBOL","fns","strfn","rxfn","string","arg","toString","slice","$","grp$","$sel","grp","init","$grpSel","prevObject","SPLIT","$split","isRegExp","_split","$push","push","NPCG","separator","limit","separator2","lastIndex","lastLength","output","flags","ignoreCase","multiline","unicode","sticky","lastLastIndex","splitLimit","separatorCopy","source","index","apply","createSortable","updatePositions","regexQuote","DJNesting","patchSelectFilter","oldFn","SelectFilter","field_id","field_name","is_stacked","updateFormAttributes","$elem","search","selector","join","addBackMethod","addBack","each","$node","attrName","attrVal","attr","data","JSON","parse","dependencyIds","makeArray","map","id","createContainerElement","initRelatedFields","prefix","groupData","LOOKUP_URLS","related","lookupUrls","$inline","djnData","lookupFields","lookupRelated","djangoFormsetForms","form","fk","djangoFormField","grp_related_fk","lookup_url","m2m","grp_related_m2m","generic","contentType","objectId","$this","djangoFormIndex","hasClass","parent","remove","grp_related_generic","content_type","object_id","initAutocompleteFields","lookupAutocomplete","grp_autocomplete_fk","autocomplete_lookup_url","autocomplete","grp_autocomplete_m2m","grp_autocomplete_generic","DjangoInlines","initPrepopulatedFields","row","field","input","is","$input","dependencyList","formPrefix","djangoFormPrefix","dependencies","fieldName","prepopulate","reinitDateTimeShortCuts","DateTimeShortcuts","updateSelectFilter","$form","namearr","split","setTimeout","forEach","funcName","patchDjangoFunction","callCount","filter","patchGrpFunction","TypeError","that","b","px","random","concat","has","SRC","$toString","TPL","inspectSource","val","safe","isFunction","anObject","IE8_DOM_DEFINE","toPrimitive","Attributes","core","version","__e","ctx","type","own","out","exp","IS_FORCED","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","IS_BIND","B","target","expProto","U","W","R","grappelli","pluginName","DjangoFormset","inline","opts","emptyClass","predeleteClass","djangoFormsetPrefix","_$totalForms","_$template","inlineModelClassName","extend","childTypes","options","formsetFkModel","addButtonSelector","removeButtonSelector","deleteButtonSelector","formClass","formClassSelector","_setupPolymorphic","_bindEvents","_initializeForms","trigger","document","Error","menu","$addButton","$menu","after","totalForms","mgmtVal","parents","_initializeForm","addClass","toggleClass","minForms","hideRemoveButton","showHideMethod","$el","off","on","preventDefault","stopPropagation","next","hideMenu","show","add","polymorphicType","closest","deleteClickHandler","stopImmediatePropagation","undelete","$deleteButton","maxForms","isInitial","innerHTML","_fillGap","delete","$deleteInput","checked","$childInline","childFormset","djangoFormset","removeAttr","removeClass","spliceIndex","ctype","$template","clone","isNested","append","$firstTemplate","eq","compatibleParents","el","fkModel","compatModels","parentModel","isPolymorphic","indexOf","setAttribute","parentNode","appendChild","removeChild","insertBefore","isNumeric","spliceInto","reinitDateTimeFields","grp_collapsible","toggle_handler_slctr","closed_css","open_css","on_toggle","curated_content_type","formsetModelClassName","$initialForm","$newForm","formsets","toArray","oldIndex","oldFormPrefixRegex","_makeRoomForInsert","initialFormCount","totalFormCount","gapIndex","$existingForm","isNewAddition","newIndex","oldFormsetPrefix","newFormsetPrefix","prevAll","$oldInline","oldDjangoFormset","$parentInline","$parentForm","parentPkField","pk","newValue","$field","parseInt","args","t","ui","nodeName","toLowerCase","href","disabled","expr","filters","visible","css","keyCode","BACKSPACE","COMMA","DELETE","DOWN","END","ENTER","ESCAPE","HOME","LEFT","NUMPAD_ADD","NUMPAD_DECIMAL","NUMPAD_DIVIDE","NUMPAD_ENTER","NUMPAD_MULTIPLY","NUMPAD_SUBTRACT","PAGE_DOWN","PAGE_UP","PERIOD","RIGHT","SPACE","TAB","UP","focus","scrollParent","ie","zIndex","isNaN","uniqueId","removeUniqueId","createPseudo","focusable","tabbable","outerWidth","jquery","parseFloat","innerWidth","innerHeight","outerHeight","removeData","camelCase","navigator","userAgent","support","selectstart","createElement","disableSelection","bind","enableSelection","unbind","plugin","plugins","element","nodeType","hasScroll","cleanData","triggerHandler","widget","h","u","Widget","_createWidget","_proto","_childConstructors","_super","_superApply","widgetEventPrefix","constructor","namespace","widgetName","widgetFullName","bridge","isPlainObject","charAt","pushStack","error","option","_init","defaultElement","create","uuid","eventNamespace","_getCreateOptions","bindings","hoverable","_on","destroy","style","ownerDocument","defaultView","parentWindow","_create","_trigger","_getCreateEventData","noop","_destroy","shift","pop","_setOptions","_setOption","enable","disable","guid","delegate","_off","undelegate","_delay","_hoverable","mouseenter","currentTarget","mouseleave","_focusable","focusin","focusout","Event","originalEvent","isDefaultPrevented","effect","duration","isEmptyObject","complete","delay","effects","easing","queue","mouseup","cancel","distance","_mouseInit","_mouseDown","started","_mouseDestroy","_mouseMoveDelegate","_mouseUpDelegate","_mouseStarted","_mouseUp","_mouseDownEvent","which","_mouseCapture","mouseDelayMet","_mouseDelayTimer","_mouseDistanceMet","_mouseDelayMet","_mouseStart","_mouseMove","documentMode","button","_mouseDrag","_mouseStop","max","abs","pageX","pageY","round","position","scrollbarWidth","children","offsetWidth","clientWidth","getScrollInfo","isWindow","width","scrollWidth","height","scrollHeight","getWithinInfo","offset","left","top","scrollLeft","scrollTop","of","g","v","y","_","within","x","k","collision","w","at","D","T","M","my","offsetFractions","marginLeft","marginTop","targetWidth","targetHeight","elemWidth","elemHeight","collisionPosition","collisionWidth","collisionHeight","elem","using","horizontal","vertical","important","fit","flip","flipfit","getElementsByTagName","visibility","border","margin","background","documentElement","firstChild","cssText","mouse","ready","appendTo","axis","connectWith","containment","cursor","cursorAt","dropOnEmpty","forcePlaceholderSize","forceHelperSize","grid","handle","helper","items","opacity","placeholder","revert","scroll","scrollSensitivity","scrollSpeed","scope","tolerance","_isOverAxis","reference","size","containerCache","refresh","floating","item","event","overrideHandle","reverting","_refreshItems","currentItem","validHandle","_removeCurrentsFromItems","noActivation","currentContainer","refreshPositions","_createHelper","_cacheHelperProportions","_cacheMargins","margins","click","_getParentOffset","relative","_getRelativeOffset","cssPosition","originalPosition","_generatePosition","originalPageX","originalPageY","_adjustOffsetFromHelper","domPosition","prev","_createPlaceholder","_setContainment","_storedCursor","_storedOpacity","_storedZIndex","tagName","overflowOffset","_uiHash","_preserveHelperProportions","containers","ddmanager","current","dropBehaviour","prepareOffsets","dragging","positionAbs","_convertPositionTo","lastPositionAbs","scrolled","offsetHeight","itemElement","intersection","_intersectsWithPointer","instance","contains","direction","_intersectsWithSides","_rearrange","_contactContainers","drag","noPropagation","drop","cur","animate","offsetParent","body","_clear","_storedCSS","over","_noFinalSort","prepend","serialize","_getItemsAsjQuery","connected","res","attribute","expression","ret","_intersectsWith","x1","x2","helperProportions","y1","y2","dyClick","dxClick","isOverElement","forcePointerForContainers","isOverElementHeight","isOverElementWidth","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","isOverBottomHalf","isOverRightHalf","delta","_connectWith","queries","j","inst","not","list","grep","targetData","_queries","queriesLength","fast","toleranceElement","custom","refreshContainers","className","update","container","innermostContainer","innermostIndex","dist","itemWithLeastDistance","posProperty","sizeProperty","base","nearBottom","obj","isArray","right","bottom","po","ce","co","pos","mod","scrollIsRootNode","hardRefresh","nextSibling","counter","delayedTriggers","before","fromOutside","cancelHelperRemoval","handler","_inst","sender","nearest","node","parentsUntil","expando","createChildNestedSortable","childContainer","$childContainer","newInstance","$otherContainer","addToConnectWith","otherInstance","djnsortable","tabSize","disableNesting","errorClass","nestedContainerSelector","doNotClear","containerElementSelector","listItemSelector","maxLevels","revertOnError","protectRoot","rootID","rtl","fixedNestingDepth","showErrorDiv","keepInParent","isAllowed","canConnectWith","container1","container2","instance2","_getLevel","$element","dataOptions","_connectWithMap","$document","originalConnectWith","lastItemElement","$itemElement","containerSel","$childItems","itemElementClosestContainer","_clearEmpty","_parentItem","parentItem","level","childLevels","_getChildLevels","placeholderClassName","phClassSearch","phOrigClassName","phOrigClassNameEndPos","substring","previousItem","previousSibling","nextItem","beyondMaxLevels","containerInstance","_isAllowed","$previousItemChildContainer","first","lastRearrangedElement","placeholderParentItem","comparisonElement","previousTopOffset","sDepth","startDepthCount","item_id","parent_id","depth","_recursiveArray","pid","$item","result","child","levels","isRoot","origConnectWith","splice","childNodes","newContainer","nestedSortable","parentPkVal","count","$group","fieldNames","groupFkName","formsetFkName","_ref","parentPrefix","sortableExcludes","sortableOptions","$parentGroup","parentPkFieldName","filterDjangoField","substr","regex","_ref2","djangoPrefixIndex","namePrefix","$inlineLabel","html","$positionField","setPosition","hasValue","siblings","inArray","$currentItem","$originalTr","trTagName","prop","$tr","tdTagName","numColumns","td","$placeholder","$currItem","paddingTop","paddingBottom","paddingLeft","paddingRight","childModels","currentModel","isPolymorphicChild","start","stop","receive","$nextItem","nextAll","groupId","method","prefixCache","nestedOptions","cacheKey","forattr","getElementById","prefixIndex","forms","formsetPrefix","sortedForms","formId","getAttribute","formIndex","filterDjangoFormsetForms","matches","$empty","prefixAndIndex","djRegexCache","fieldNameData","isObject","cof","UNSCOPABLES","ArrayProto","SPECIES","original","C","speciesConstructor","ceil","floor","toInteger","min","propertyIsEnumerable","IObject","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","bitmap","writable","valueOf","$rows","rootGroup"],"mappings":"6BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG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WACjBd,EAAUF,gBAAgBhC,EAAEzD,MAAMkO,uBAClCzK,EAAE0L,UAAUD,QAAQ,oBAAqBzL,EAAEzD,MAAM0R,gBAAgB9J,gBAK7EjK,EAAOD,QAAUiI","file":"nested_admin.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 52);\n","module.exports = window.django.jQuery;\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function regexQuote(str) {\n return (str+'').replace(/([\\.\\?\\*\\+\\^\\$\\[\\]\\\\\\(\\)\\{\\}\\|\\-])/g, '\\\\$1');\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","const $ = require('jquery');\n\n/**\n * For grappelli 2.14, converts a django.jQuery instance to a grp.jQuery\n * instance. Otherwise (if grappelli is not present, or for grappelli <= 2.13,\n * where the grappelli jQuery instance is the same as django's), returns the\n * object that was passed in, unchanged.\n */\nfunction grp$($sel) {\n if (typeof window.grp === 'undefined') {\n return $($sel);\n }\n if (window.grp.jQuery.fn.init === $.fn.init) {\n return $($sel);\n }\n const $grpSel = window.grp.jQuery($sel);\n if ($sel.prevObject) {\n $grpSel.prevObject = grp$($sel.prevObject);\n }\n return $grpSel;\n}\n\nmodule.exports = grp$;\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","'use strict';\n\n/* globals SelectFilter, DateTimeShortcuts */\n\nconst $ = require('jquery');\nrequire('./jquery.djnutils.js');\nconst {createSortable, updatePositions} = require('./sortable');\nconst regexQuote = require('./regexquote');\nconst grp$ = require('./grp$');\n\nvar DJNesting = (typeof window.DJNesting != 'undefined')\n ? window.DJNesting : {};\n\nDJNesting.regexQuote = regexQuote;\nDJNesting.createSortable = createSortable;\nDJNesting.updatePositions = updatePositions;\n\n/**\n * Update attributes based on a regular expression\n */\nDJNesting.updateFormAttributes = function($elem, search, replace, selector) {\n if (!selector) {\n selector = [\n ':input', 'span', 'table', 'iframe', 'label', 'a', 'ul', 'p',\n 'img', '.djn-group', '.djn-inline-form', '.cropduster-form',\n '.dal-forward-conf', '[role=tabpanel]'].join(',');\n }\n var addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n $elem.find(selector)[addBackMethod]().each(function() {\n var $node = $(this),\n attrs = ['id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset'];\n\n $.each(attrs, function(i, attrName) {\n var attrVal = $node.attr(attrName);\n if (attrVal) {\n $node.attr(attrName, attrVal.replace(search, replace));\n if (attrName === 'data-inline-formset') {\n $node.data('inlineFormset', JSON.parse($node.attr(attrName)));\n }\n }\n });\n });\n // update prepopulate ids for function initPrepopulatedFields\n $elem.find('.prepopulated_field').each(function() {\n var $node = grp$(this);\n var dependencyIds = $.makeArray($node.data('dependency_ids') || []);\n $node.data('dependency_ids', $.map(dependencyIds, function(id) {\n return id.replace(search, replace);\n }));\n });\n};\n\nDJNesting.createContainerElement = function() {\n return;\n};\n\n// Slight tweaks to the grappelli functions of the same name\n// (initRelatedFields and initAutocompleteFields).\n//\n// The most notable tweak is the call to $.fn.grp_related_generic() (a\n// jQuery method provided by django-curated) and the use of\n// DJNesting.LOOKUP_URLS to determine the ajax lookup urls.\n//\n// We abstract this out using form prefix because the way grappelli does it\n// (adding javascript at the bottom of each formset) doesn't really scale\n// with nested formsets.\n\n// The second parameter (groupData) is optional, and only exists to prevent\n// redundant calls to jQuery() and jQuery.fn.data() in the calling context\nDJNesting.initRelatedFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupRelated;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n grp$(this).grp_related_fk({lookup_url: lookupUrls.related});\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n grp$(this).grp_related_m2m({lookup_url: lookupUrls.m2m});\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n if ($this.hasClass('grp-has-related-lookup')) {\n $this.parent().find('a.related-lookup').remove();\n $this.parent().find('.grp-placeholder-related-generic').remove();\n }\n grp$($this).grp_related_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related\n });\n });\n });\n });\n};\n\nDJNesting.initAutocompleteFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupAutocomplete;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_fk({\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_m2m({\n lookup_url: lookupUrls.m2m,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n // An autocomplete widget has already been initialized, return\n if ($('#' + $this.attr('id') + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.m2m\n });\n });\n });\n });\n};\n\n// I very much regret that these are basically copy-pasted from django's\n// inlines.js, but they're hidden in closure scope so I don't have much choice.\nDJNesting.DjangoInlines = {\n initPrepopulatedFields: function(row) {\n row.find('.prepopulated_field').each(function() {\n var field = $(this),\n input = (field.is(':input') ? field : field.find(':input')),\n $input = grp$(input),\n dependencyList = $input.data('dependency_list') || [],\n formPrefix = input.djangoFormPrefix(),\n dependencies = [];\n if (!formPrefix || formPrefix.match(/__prefix__/)) {\n return;\n }\n $.each(dependencyList, function(i, fieldName) {\n dependencies.push('#id_' + formPrefix + fieldName);\n });\n if (dependencies.length) {\n $input.prepopulate(dependencies, input.attr('maxlength'));\n }\n });\n },\n reinitDateTimeShortCuts: function() {\n // Reinitialize the calendar and clock widgets by force\n if (typeof window.DateTimeShortcuts !== 'undefined') {\n $('.datetimeshortcuts').remove();\n DateTimeShortcuts.init();\n }\n },\n updateSelectFilter: function($form) {\n // If any SelectFilter widgets are a part of the new form,\n // instantiate a new SelectFilter instance for it.\n if (typeof window.SelectFilter !== 'undefined') {\n $form.find('.selectfilter').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], false);\n });\n $form.find('.selectfilterstacked').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], true);\n });\n }\n }\n};\n\nfunction patchSelectFilter() {\n window.SelectFilter.init = (function(oldFn) {\n return function init(field_id, field_name, is_stacked) {\n if (field_id.match(/\\-empty\\-/)) {\n return;\n } else {\n oldFn.apply(this, arguments);\n }\n };\n }(window.SelectFilter.init));\n}\n\nif (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n} else {\n setTimeout(function() {\n if (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n }\n }, 12);\n}\n\nconst djangoFuncs = ['prepopulate', 'djangoAdminSelect2'];\n\ndjangoFuncs.forEach((funcName) => {\n (function patchDjangoFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof $.fn[funcName] === 'undefined') {\n return setTimeout(() => patchDjangoFunction(callCount++), 12);\n }\n $.fn[funcName] = (function(oldFn) {\n return function django_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }($.fn[funcName]));\n }(0));\n});\n\nconst grpFuncs = [\n 'grp_autocomplete_fk', 'grp_autocomplete_generic', 'grp_autocomplete_m2m',\n 'grp_collapsible', 'grp_collapsible_group', 'grp_inline', 'grp_related_fk',\n 'grp_related_generic', 'grp_related_m2m', 'grp_timepicker', 'datepicker',\n 'prepopulate', 'djangoAdminSelect2'];\n\ngrpFuncs.forEach((funcName) => {\n (function patchGrpFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof window.grp === 'undefined' || typeof window.grp.jQuery.fn[funcName] === 'undefined') {\n return setTimeout(() => patchGrpFunction(callCount++), 12);\n }\n window.grp.jQuery.fn[funcName] = (function(oldFn) {\n return function grp_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }(window.grp.jQuery.fn[funcName]));\n }(0));\n});\n\nmodule.exports = DJNesting;\n","(function() { module.exports = window[\"grappelli\"]; }());","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","(function() { module.exports = window[\"grp\"]; }());","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nconst DJNesting = require('./utils');\nconst grappelli = require('grappelli');\nconst grp = require('grp');\nconst grp$ = require('./grp$');\n\nvar pluginName = 'djangoFormset';\n\nclass DjangoFormset {\n constructor(inline) {\n this.opts = {\n emptyClass: 'empty-form grp-empty-form djn-empty-form',\n predeleteClass: 'grp-predelete'\n };\n this.$inline = $(inline);\n this.prefix = this.$inline.djangoFormsetPrefix();\n this._$totalForms = this.$inline.find('#id_' + this.prefix + '-TOTAL_FORMS');\n this._$totalForms.attr('autocomplete', 'off');\n this._$template = $('#' + this.prefix + '-empty');\n\n var inlineModelClassName = this.$inline.djnData('inlineModel');\n\n this.opts = $.extend({}, this.opts, {\n childTypes: this.$inline.data('inlineFormset').options.childTypes,\n formsetFkModel: this.$inline.djnData('formsetFkModel'),\n addButtonSelector: '.djn-add-handler.djn-model-' + inlineModelClassName,\n removeButtonSelector: '.djn-remove-handler.djn-model-' + inlineModelClassName,\n deleteButtonSelector: '.djn-delete-handler.djn-model-' + inlineModelClassName,\n formClass: 'dynamic-form grp-dynamic-form djn-dynamic-form-' + inlineModelClassName,\n formClassSelector: '.djn-dynamic-form-' + inlineModelClassName\n });\n\n DJNesting.initRelatedFields(this.prefix, this.$inline.djnData());\n DJNesting.initAutocompleteFields(this.prefix, this.$inline.djnData());\n\n if (this.opts.childTypes) {\n this._setupPolymorphic();\n }\n this._bindEvents();\n\n this._initializeForms();\n\n this.$inline.find('.djn-items:not([id*=\"-empty\"])').trigger('djnesting:init');\n\n // initialize nested formsets\n this.$inline.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n if (this.$inline.is('.djn-group-root')) {\n DJNesting.createSortable(this.$inline);\n }\n\n $(document).trigger('djnesting:initialized', [this.$inline, this]);\n }\n _setupPolymorphic() {\n if (!this.opts.childTypes) {\n throw Error('The polymorphic fieldset options.childTypes is not defined!');\n }\n let menu = '
';\n const $addButton = this.$inline.find(this.opts.addButtonSelector);\n const $menu = $(menu);\n $addButton.after($menu);\n }\n\n _initializeForms() {\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n if (maxForms <= totalForms) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n for (var i = 0; i < totalForms; i++) {\n this._initializeForm('#' + this.prefix + '-' + i);\n }\n }\n _initializeForm(form) {\n var $form = $(form);\n var formPrefix = $form.djangoFormPrefix();\n $form.addClass(this.opts.formClass);\n if ($form.hasClass('has_original')) {\n $('#id_' + formPrefix + 'DELETE:checked').toggleClass(this.opts.predeleteClass);\n }\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n }\n _bindEvents($el) {\n var self = this;\n if (typeof $el == 'undefined') {\n $el = this.$inline;\n }\n const $addButton = $el.find(this.opts.addButtonSelector);\n $addButton.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const $menu = $(this).next('.polymorphic-type-menu');\n if (!$menu.length) {\n self.add();\n } else {\n if (!$menu.is(':visible')) {\n function hideMenu() {\n $menu.hide();\n $(document).off('click', hideMenu);\n }\n $(document).on('click', hideMenu);\n }\n $menu.show();\n }\n });\n const $menuButtons = $addButton.parent().find('> .polymorphic-type-menu a');\n $menuButtons.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const polymorphicType = $(this).attr('data-type');\n self.add(null, polymorphicType);\n const $menu = $(e.target).closest('.polymorphic-type-menu');\n if ($menu.is(':visible')) {\n $menu.hide();\n }\n });\n $el.find(this.opts.removeButtonSelector).filter(function() {\n return !$(this).closest('.djn-empty-form').length;\n }).off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n self.remove($form);\n });\n\n var deleteClickHandler = function(e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n var $deleteInput = $('#id_' + $form.djangoFormPrefix() + 'DELETE');\n if (!$deleteInput.is(':checked')) {\n self['delete']($form);\n } else {\n self.undelete($form);\n }\n };\n\n var $deleteButton = $el.find(this.opts.deleteButtonSelector)\n .filter(function() { return !$(this).closest('.djn-empty-form').length; });\n\n $deleteButton.off('click.djnesting').on('click.djnesting', deleteClickHandler);\n $deleteButton.find('[id$=\"-DELETE\"]').on('mousedown.djnesting', deleteClickHandler);\n }\n remove(form) {\n var $form = $(form);\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var index = $form.djangoFormIndex();\n var isInitial = $form.data('isInitial');\n\n // Clearing out the form HTML itself using DOM APIs is much faster\n // than using jQuery to remove the element. Using jQuery is so\n // slow that it hangs the page.\n $form[0].innerHTML = \"\";\n $form.remove();\n\n totalForms -= 1;\n this.mgmtVal('TOTAL_FORMS', totalForms);\n\n if (maxForms - totalForms >= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').show();\n }\n\n this._fillGap(index, isInitial);\n\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:removed', [$form, this.prefix]);\n }\n delete(form) {\n var self = this,\n $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.hasClass(this.opts.predeleteClass)) {\n return;\n }\n\n if (!$form.data('isInitial')) {\n return;\n }\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n $form.addClass(this.opts.predeleteClass);\n\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).hasClass(self.opts.predeleteClass)) {\n $(this).data('alreadyDeleted', true);\n } else {\n childFormset.delete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:deleted', [$form, this.prefix]);\n }\n undelete(form) {\n var $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.parent().closest('.' + this.opts.predeleteClass).length) {\n return;\n }\n if ($form.hasClass('has_original')) {\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n $form.removeClass(this.opts.predeleteClass);\n }\n $form.data('alreadyDeleted', false);\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).data('alreadyDeleted')) {\n $(this).data('alreadyDeleted', false);\n } else {\n childFormset.undelete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:undeleted', [$form, this.prefix]);\n }\n add(spliceIndex, ctype) {\n var self = this;\n const $template = (ctype) ? $(`#${this.prefix}-empty-${ctype}`) : this._$template;\n var $form = $template.clone(true);\n\n // For django-grappelli >= 2.14, where the grp.jQuery instance is not\n // the same as django.jQuery, we must copy any prepopulated_field\n // dependency data from grp.jQuery to the cloned nodes.\n grp$($template).find(':data(dependency_ids)').each(function() {\n const id = $(this).attr('id');\n const $el = $form.find(`#${id}`);\n grp$($el).data($.extend({}, $el.data(), grp$(this).data()));\n });\n\n var index = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var isNested = this.$inline.hasClass('djn-group-nested');\n\n $(document).trigger('djnesting:beforeadded', [this.$inline, $form]);\n\n $form.removeClass(this.opts.emptyClass);\n $form.addClass('djn-item');\n $form.attr('id', $form.attr('id').replace(/\\-empty.*?$/, '-' + index));\n\n if (isNested) {\n $form.append(DJNesting.createContainerElement());\n }\n\n DJNesting.updateFormAttributes($form,\n new RegExp('([#_]id_|[\\\\#]|^id_|\\\"|^)' + regexQuote(this.prefix) + '\\\\-(?:__prefix__|empty)\\\\-', 'g'),\n '$1' + this.prefix + '-' + index + '-');\n\n let $firstTemplate = this._$template;\n if (this.opts.childTypes) {\n $firstTemplate = $template.closest('.djn-group')\n .find('> .djn-items > [id*=\"-empty\"], > .djn-fieldset > .djn-items > [id*=\"-empty\"]').eq(0);\n }\n if (this.opts.childTypes) {\n const compatibleParents = this.$inline.djnData('compatibleParents') || {};\n $form.find('> .djn-group').each((i, el) => {\n const fkModel = $(el).djnData('formsetFkModel');\n const compatModels = compatibleParents[ctype] || [];\n const $el = $(el);\n const parentModel = $el.djnData('inlineParentModel');\n const isPolymorphic = !!($el.data('inlineFormset').options.childTypes);\n const formPrefix = $el.data('inlineFormset').options.prefix;\n if (parentModel !== ctype || (isPolymorphic && fkModel !== ctype && compatModels.indexOf(fkModel) === -1)) {\n $el.find('input[id$=\"_FORMS\"]').each((i, input) => {\n input.value = 0\n input.setAttribute('value', '0');\n el.parentNode.appendChild(input);\n });\n el.parentNode.removeChild(el);\n }\n });\n }\n\n $form.insertBefore($firstTemplate);\n\n this.mgmtVal('TOTAL_FORMS', index + 1);\n if ((maxForms - (index + 1)) <= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n\n DJNesting.updatePositions(this.prefix);\n\n if ($.isNumeric(spliceIndex)) {\n this.spliceInto($form, spliceIndex, true);\n } else {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n\n if (grappelli) {\n grappelli.reinitDateTimeFields(grp$($form));\n }\n DJNesting.DjangoInlines.initPrepopulatedFields($form);\n DJNesting.DjangoInlines.reinitDateTimeShortCuts();\n DJNesting.DjangoInlines.updateSelectFilter($form);\n DJNesting.initRelatedFields(this.prefix);\n DJNesting.initAutocompleteFields(this.prefix);\n if (grp && grp.jQuery.fn.grp_collapsible) {\n var addBackMethod = (grp.jQuery.fn.addBack) ? 'addBack' : 'andSelf';\n grp$($form).find(\n '.grp-collapse:not([id$=\"-empty\"]):not([id*=\"-empty-\"])'\n )[addBackMethod]().grp_collapsible({\n toggle_handler_slctr: '.grp-collapse-handler:first',\n closed_css: 'closed grp-closed',\n open_css: 'open grp-open',\n on_toggle: function() {\n $(document).trigger('djnesting:toggle', [self.$inline]);\n }\n });\n }\n if (typeof $.fn.curated_content_type == 'function') {\n $form.find('.curated-content-type-select').each(function() {\n $(this).curated_content_type();\n });\n }\n\n this._initializeForm($form);\n this._bindEvents($form);\n\n if (ctype) {\n const formsetModelClassName = this.$inline.djnData('inlineModel');\n const inlineModelClassName = $form.attr('data-inline-model');\n const $buttons = $form.find(`.djn-model-${formsetModelClassName}`);\n $buttons.addClass(`djn-model-${inlineModelClassName}`);\n $form.addClass(`djn-dynamic-form-${inlineModelClassName}`);\n }\n\n // find any nested formsets\n $form.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n // Fire an event on the document so other javascript applications\n // can be alerted to the newly inserted inline\n $(document).trigger('djnesting:added', [this.$inline, $form]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:added', [$form, this.prefix]);\n\n return $form;\n }\n _fillGap(index, isInitial) {\n var $initialForm, $newForm;\n var formsets = this.$inline.djangoFormsetForms().toArray();\n // Sort formsets in index order, so that we get the last indexed form for the swap.\n formsets.sort(function(a, b) { return $(a).djangoFormIndex() - $(b).djangoFormIndex(); });\n formsets.forEach(function(form) {\n var $form = $(form);\n var i = $form.djangoFormIndex();\n if (i <= index) {\n return;\n }\n if ($form.data('isInitial')) {\n $initialForm = $form;\n } else {\n $newForm = $form;\n }\n });\n var $form = (isInitial) ? $initialForm || $newForm : $newForm;\n if (!$form) {\n return;\n }\n var oldIndex = $form.djangoFormIndex();\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix + '-' + oldIndex) + '(?!\\\\-\\\\d)');\n $form.attr('id', this.prefix + '-' + index);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + this.prefix + '-' + index);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial && $initialForm && $newForm) {\n this._fillGap(oldIndex, false);\n }\n }\n _makeRoomForInsert() {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n gapIndex = initialFormCount,\n $existingForm = $('#' + this.prefix + '-' + gapIndex);\n\n if (!$existingForm.length) {\n return;\n }\n\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix) + '-' + gapIndex + '(?!\\\\-\\\\d)');\n $existingForm.attr('id', this.prefix + '-' + totalFormCount);\n DJNesting.updateFormAttributes($existingForm, oldFormPrefixRegex, '$1' + this.prefix + '-' + totalFormCount);\n\n // Update prefixes on nested DjangoFormset objects\n $existingForm.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $existingForm]);\n }\n /**\n * Splice a form into the current formset at new position `index`.\n */\n spliceInto($form, index, isNewAddition) {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n oldFormsetPrefix = $form.djangoFormsetPrefix(),\n newFormsetPrefix = this.prefix,\n isInitial = $form.data('isInitial'),\n newIndex, $before;\n\n // Make sure the form being spliced is from a different inline\n if ($form.djangoFormsetPrefix() == this.prefix) {\n var currentPosition = $form.prevAll('.djn-item:not(.djn-no-drag,.djn-thead)').length;\n if (currentPosition === index || typeof index == 'undefined') {\n DJNesting.updatePositions(newFormsetPrefix);\n return;\n }\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item:not(#' + $form.attr('id') + ')').eq(index);\n $before.after($form);\n } else {\n var $oldInline = $('#' + oldFormsetPrefix + '-group');\n var $currentFormInline = $form.closest('.djn-group');\n\n if ($currentFormInline.djangoFormsetPrefix() != newFormsetPrefix) {\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item').eq(index);\n $before.after($form);\n }\n\n var oldDjangoFormset = $oldInline.djangoFormset();\n oldDjangoFormset.mgmtVal('TOTAL_FORMS', oldDjangoFormset.mgmtVal('TOTAL_FORMS') - 1);\n oldDjangoFormset._fillGap($form.djangoFormIndex(), isInitial);\n\n if (isInitial) {\n oldDjangoFormset.mgmtVal('INITIAL_FORMS', oldDjangoFormset.mgmtVal('INITIAL_FORMS') - 1);\n\n var $parentInline = this.$inline.parent().closest('.djn-group');\n if ($parentInline.length) {\n var $parentForm = this.$inline.closest('.djn-inline-form');\n var parentPkField = ($parentInline.djnData('fieldNames') || {}).pk;\n var $parentPk = $parentForm.djangoFormField(parentPkField);\n if (!$parentPk.val()) {\n $form.data('isInitial', false);\n $form.attr('data-is-initial', 'false');\n isInitial = false;\n // Set initial form counts to 0 on nested DjangoFormsets\n setTimeout(function() {\n $form.find('[name^=\"' + $form.djangoFormPrefix() + '\"][name$=\"-INITIAL_FORMS\"]')\n .val('0').trigger('change');\n }, 0);\n }\n }\n }\n\n if (isInitial) {\n this._makeRoomForInsert();\n }\n\n // Replace the ids for the splice form\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)' + regexQuote($form.attr('id')) + '(?!\\\\-\\\\d)');\n newIndex = (isInitial) ? initialFormCount : totalFormCount;\n $form.attr('id', newFormsetPrefix + '-' + newIndex);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + newFormsetPrefix + '-' + newIndex);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial) {\n this.mgmtVal('INITIAL_FORMS', initialFormCount + 1);\n }\n this.mgmtVal('TOTAL_FORMS', totalFormCount + 1);\n\n DJNesting.updatePositions(oldFormsetPrefix);\n $(document).trigger('djnesting:mutate', [$oldInline]);\n }\n\n DJNesting.updatePositions(newFormsetPrefix);\n if (!isNewAddition) {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n }\n mgmtVal(name, newValue) {\n var $field = this.$inline.find('#id_' + this.prefix + '-' + name);\n if (typeof newValue == 'undefined') {\n return parseInt($field.val(), 10);\n } else {\n return parseInt($field.val(newValue).trigger('change').val(), 10);\n }\n }\n}\n\n$.fn[pluginName] = function() {\n var options, fn, args;\n var $el = this.eq(0);\n\n if (arguments.length === 0 || (arguments.length === 1 && $.type(arguments[0]) != 'string')) {\n options = arguments[0];\n var djangoFormset = $el.data(pluginName);\n if (!djangoFormset) {\n djangoFormset = new DjangoFormset($el, options);\n $el.data(pluginName, djangoFormset);\n }\n return djangoFormset;\n }\n\n fn = arguments[0];\n args = $.makeArray(arguments).slice(1);\n\n if (fn in DjangoFormset.prototype) {\n return $el.data(pluginName)[fn](args);\n } else {\n throw new Error('Unknown function call ' + fn + ' for $.fn.' + pluginName);\n }\n};\n\nmodule.exports = DjangoFormset;\n","'use strict';\n\nconst $ = require('jquery');\n/*!\n * jQuery UI Sortable @VERSION\n * http://jqueryui.com\n *\n * Copyright 2012 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/sortable/\n *\n * Depends:\n *\tjquery.ui.core.js\n *\tjquery.ui.mouse.js\n *\tjquery.ui.widget.js\n */\nif ($.ui === undefined) {\n var jQuery = $;\n (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return\"area\"===o?(s=t.parentNode,n=s.name,t.href&&n&&\"map\"===s.nodeName.toLowerCase()?(r=e(\"img[usemap=#\"+n+\"]\")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:\"a\"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return\"hidden\"===e.css(this,\"visibility\")}).length}var s=0,n=/^ui-id-\\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:\"1.10.3\",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return\"number\"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css(\"position\"))||/absolute/.test(this.css(\"position\"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,\"position\"))&&/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0),/fixed/.test(this.css(\"position\"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css(\"zIndex\",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css(\"position\"),(\"absolute\"===a||\"relative\"===a||\"fixed\"===a)&&(s=parseInt(n.css(\"zIndex\"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id=\"ui-id-\"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr(\"id\")})}}),e.extend(e.expr[\":\"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,\"tabindex\")))},tabbable:function(t){var a=e.attr(t,\"tabindex\"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e(\"\").outerWidth(1).jquery||e.each([\"Width\",\"Height\"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,\"padding\"+this))||0,a&&(i-=parseFloat(e.css(t,\"border\"+this+\"Width\"))||0),s&&(i-=parseFloat(e.css(t,\"margin\"+this))||0)}),i}var n=\"Width\"===a?[\"Left\",\"Right\"]:[\"Top\",\"Bottom\"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn[\"inner\"+a]=function(i){return i===t?o[\"inner\"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+\"px\")})},e.fn[\"outer\"+a]=function(t,i){return\"number\"!=typeof t?o[\"outer\"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+\"px\")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e(\"\").data(\"a-b\",\"a\").removeData(\"a-b\").data(\"a-b\")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart=\"onselectstart\"in document.createElement(\"div\"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?\"selectstart\":\"mousedown\")+\".ui-disableSelection\",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(\".ui-disableSelection\")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if(\"hidden\"===e(t).css(\"overflow\"))return!1;var a=i&&\"left\"===i?\"scrollLeft\":\"scrollTop\",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler(\"remove\")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(\".\")[0];i=i.split(\".\")[1],n=u+\"-\"+i,a||(a=s,s=e.Widget),e.expr[\":\"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+\".\"+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o=\"string\"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&\"_\"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error(\"no such method '\"+r+\"' for \"+i+\" widget instance\"):e.error(\"cannot call methods on \"+i+\" prior to initialization; \"+\"attempted to call method '\"+r+\"'\")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof i)if(o={},a=i.split(\".\"),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled ui-state-disabled\",!!t).attr(\"aria-disabled\",t),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")),this},enable:function(){return this._setOption(\"disabled\",!1)},disable:function(){return this._setOption(\"disabled\",!0)},_on:function(i,s,a){var n,r=this;\"boolean\"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?r[o]:o).apply(r,arguments):t}\"string\"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\\w+)\\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,a,n){\"string\"==typeof a&&(a={effect:a});var r,o=a?a===!0||\"number\"==typeof a?i:a.effect||i:t;a=a||{},\"number\"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget(\"ui.mouse\",{version:\"1.10.3\",options:{cancel:\"input,textarea,button,select,option\",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind(\"mousedown.\"+this.widgetName,function(e){return t._mouseDown(e)}).bind(\"click.\"+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+\".preventClickEvent\")?(e.removeData(i.target,t.widgetName+\".preventClickEvent\"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind(\".\"+this.widgetName),this._mouseMoveDelegate&&e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n=\"string\"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+\".preventClickEvent\")&&e.removeData(i.target,this.widgetName+\".preventClickEvent\"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).bind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+\".preventClickEvent\",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function s(t,i){return parseInt(e.css(t,i),10)||0}function a(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,o=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\\+\\-]\\d+(\\.[\\d]+)?%?/,d=/^\\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var i,s,a=e(\"
\"),r=a.children()[0];return e(\"body\").append(a),i=r.offsetWidth,a.css(\"overflow\",\"scroll\"),s=r.offsetWidth,i===s&&(s=a[0].clientWidth),a.remove(),n=i-s},getScrollInfo:function(t){var i=t.isWindow?\"\":t.element.css(\"overflow-x\"),s=t.isWindow?\"\":t.element.css(\"overflow-y\"),a=\"scroll\"===i||\"auto\"===i&&t.widths?\"left\":i>0?\"right\":\"center\",vertical:0>n?\"top\":a>0?\"bottom\":\"middle\"};c>p&&p>o(i+s)&&(h.horizontal=\"center\"),d>m&&m>o(a+n)&&(h.vertical=\"middle\"),h.important=r(o(i),o(s))>r(o(a),o(n))?\"horizontal\":\"vertical\",t.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,o=e.left-t.collisionPosition.marginLeft,h=a-o,l=o+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=r(e.left-o,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,o=e.top-t.collisionPosition.marginTop,h=a-o,l=o+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,r=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-r-h,d=\"left\"===t.my[0]?-t.elemWidth:\"right\"===t.my[0]?t.elemWidth:0,p=\"left\"===t.at[0]?t.targetWidth:\"right\"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-r-n,(0>i||o(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>o(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,r=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-r-h,d=\"top\"===t.my[1],p=d?-t.elemHeight:\"bottom\"===t.my[1]?t.elemHeight:0,f=\"top\"===t.at[1]?t.targetHeight:\"bottom\"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-r-n,e.top+p+f+m>u&&(0>s||o(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>c&&(i>0||c>o(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,n,r=document.getElementsByTagName(\"body\")[0],o=document.createElement(\"div\");t=document.createElement(r?\"div\":\"body\"),s={visibility:\"hidden\",width:0,height:0,border:0,margin:0,background:\"none\"},r&&e.extend(s,{position:\"absolute\",left:\"-1000px\",top:\"-1000px\"});for(n in s)t.style[n]=s[n];t.appendChild(o),i=r||document.documentElement,i.insertBefore(t,i.firstChild),o.style.cssText=\"position: absolute; left: 10.7432222px;\",a=e(o).offset().left,e.support.offsetFractions=a>10&&11>a,t.innerHTML=\"\",i.removeChild(t)}()})(jQuery);\n}\n\n$.widget(\"ui.djnsortable\", $.ui.mouse, {\n\tversion: \"@VERSION\",\n\twidgetEventPrefix: \"sort\",\n\tready: false,\n\toptions: {\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectWith: false,\n\t\tcontainment: false,\n\t\tcursor: 'auto',\n\t\tcursorAt: false,\n\t\tdropOnEmpty: true,\n\t\tforcePlaceholderSize: false,\n\t\tforceHelperSize: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\titems: '> *',\n\t\topacity: false,\n\t\tplaceholder: false,\n\t\trevert: false,\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tscope: \"default\",\n\t\ttolerance: \"intersect\",\n\t\tzIndex: 1000\n\t},\n\n\t_isOverAxis: function( x, reference, size ) {\n\t\treturn ( x >= reference ) && ( x < ( reference + size ) );\n\t},\n\n\t_create: function() {\n\n\t\tvar o = this.options;\n\t\tthis.containerCache = {};\n\t\tthis.element.addClass(\"ui-sortable\");\n\n\t\t//Get the items\n\t\tthis.refresh();\n\n\t\t//Let's determine if the items are being displayed horizontally\n\t\tthis.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;\n\n\t\t//Let's determine the parent's offset\n\t\tthis.offset = this.element.offset();\n\n\t\t//Initialize mouse events for interaction\n\t\tthis._mouseInit();\n\n\t\t//We're ready to go\n\t\tthis.ready = true\n\n\t},\n\n\t_destroy: function() {\n\t\tthis.element\n\t\t\t.removeClass(\"ui-sortable ui-sortable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\tfor ( var i = this.items.length - 1; i >= 0; i-- )\n\t\t\tthis.items[i].item.removeData(this.widgetName + \"-item\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value){\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.options[ key ] = value;\n\n\t\t\tthis.widget().toggleClass( \"ui-sortable-disabled\", !!value );\n\t\t} else {\n\t\t\t// Don't call widget base _setOption for disable as it adds ui-state-disabled class\n\t\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t\t}\n\t},\n\n\t_mouseCapture: function(event, overrideHandle) {\n\t\tvar that = this;\n\n\t\tif (this.reverting) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(this.options.disabled || this.options.type == 'static') return false;\n\n\t\t//We have to refresh the items data once first\n\t\tthis._refreshItems(event);\n\n\t\t//Find out if the clicked node (or one of its parents) is a actual item in this.items\n\t\tvar currentItem = null, nodes = $(event.target).parents().each(function() {\n\t\t\tif($.data(this, that.widgetName + '-item') == that) {\n\t\t\t\tcurrentItem = $(this);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);\n\n\t\tif(!currentItem) return false;\n\t\tif(this.options.handle && !overrideHandle) {\n\t\t\tvar validHandle = false;\n\t\t\tvar addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n\n\t\t\t$(this.options.handle, currentItem).find(\"*\")[addBackMethod]().each(function() { if(this == event.target) validHandle = true; });\n\t\t\tif(!validHandle) return false;\n\t\t}\n\n\t\tthis.currentItem = currentItem;\n\t\tthis._removeCurrentsFromItems();\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event, overrideHandle, noActivation) {\n\n\t\tvar o = this.options;\n\t\tthis.currentContainer = this;\n\n\t\t//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture\n\t\tthis.refreshPositions();\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Get the next scrolling parent\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.currentItem.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t// Only after we got the offset, we can change the helper's position to absolute\n\t\t// TODO: Still need to figure out a way to make relative sorting possible\n\t\tthis.helper.css(\"position\", \"absolute\");\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\n\t\t//Generate the original position\n\t\tthis.originalPosition = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Cache the former DOM position\n\t\tthis.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };\n\n\t\t//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way\n\t\tif(this.helper[0] != this.currentItem[0]) {\n\t\t\tthis.currentItem.hide();\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthis._createPlaceholder();\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\tif(o.cursor) { // cursor option\n\t\t\tif ($('body').css(\"cursor\")) this._storedCursor = $('body').css(\"cursor\");\n\t\t\t$('body').css(\"cursor\", o.cursor);\n\t\t}\n\n\t\tif(o.opacity) { // opacity option\n\t\t\tif (this.helper.css(\"opacity\")) this._storedOpacity = this.helper.css(\"opacity\");\n\t\t\tthis.helper.css(\"opacity\", o.opacity);\n\t\t}\n\n\t\tif(o.zIndex) { // zIndex option\n\t\t\tif (this.helper.css(\"zIndex\")) this._storedZIndex = this.helper.css(\"zIndex\");\n\t\t\tthis.helper.css(\"zIndex\", o.zIndex);\n\t\t}\n\n\t\t//Prepare scrolling\n\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')\n\t\t\tthis.overflowOffset = this.scrollParent.offset();\n\n\t\t//Call callbacks\n\t\tthis._trigger(\"start\", event, this._uiHash());\n\n\t\t//Recache the helper size\n\t\tif(!this._preserveHelperProportions)\n\t\t\tthis._cacheHelperProportions();\n\n\n\t\t//Post 'activate' events to possible containers\n\t\tif(!noActivation) {\n\t\t\t for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger(\"activate\", event, this._uiHash(this)); }\n\t\t}\n\n\t\t//Prepare possible droppables\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\tthis.dragging = true;\n\n\t\tthis.helper.addClass(\"ui-sortable-helper\");\n\t\tthis._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\treturn true;\n\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\tif (!this.lastPositionAbs) {\n\t\t\tthis.lastPositionAbs = this.positionAbs;\n\t\t}\n\n\t\t//Do scrolling\n\t\tif(this.options.scroll) {\n\t\t\tvar o = this.options, scrolled = false;\n\t\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {\n\n\t\t\t\tif((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n\n\t\t\t\tif((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n\n\t\t\t} else {\n\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\n\t\t\t}\n\n\t\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\t\t}\n\n\t\t//Regenerate the absolute position used for position checks\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Set the helper position\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\n\t\t//Rearrange\n\t\tfor (var i = this.items.length - 1; i >= 0; i--) {\n\n\t\t\t//Cache variables and intersection, continue if no intersection\n\t\t\tvar item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);\n\t\t\tif (!intersection) continue;\n\n\t\t\t// Only put the placeholder inside the current Container, skip all\n\t\t\t// items form other containers. This works because when moving\n\t\t\t// an item from one container to another the\n\t\t\t// currentContainer is switched before the placeholder is moved.\n\t\t\t//\n\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n\t\t\t// beetween the outer and inner container.\n\t\t\tif (item.instance !== this.currentContainer) continue;\n\n\t\t\tif (itemElement != this.currentItem[0] //cannot intersect with itself\n\t\t\t\t&&\tthis.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n\t\t\t\t&&\t!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n\t\t\t\t&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n\t\t\t\t//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container\n\t\t\t) {\n\n\t\t\t\tthis.direction = intersection == 1 ? \"down\" : \"up\";\n\n\t\t\t\tif (this.options.tolerance == \"pointer\" || this._intersectsWithSides(item)) {\n\t\t\t\t\tthis._rearrange(event, item);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Post events to containers\n\t\tthis._contactContainers(event);\n\n\t\t//Interconnect with droppables\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\t//Call callbacks\n\t\tthis._trigger('sort', event, this._uiHash());\n\n\t\tthis.lastPositionAbs = this.positionAbs;\n\t\treturn false;\n\n\t},\n\n\t_mouseStop: function(event, noPropagation) {\n\n\t\tif(!event) return;\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\t$.ui.ddmanager.drop(this, event);\n\n\t\tif(this.options.revert) {\n\t\t\tvar that = this;\n\t\t\tvar cur = this.placeholder.offset();\n\n\t\t\tthis.reverting = true;\n\n\t\t\t$(this.helper).animate({\n\t\t\t\tleft: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),\n\t\t\t\ttop: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)\n\t\t\t}, parseInt(this.options.revert, 10) || 500, function() {\n\t\t\t\tthat._clear(event);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._clear(event, noPropagation);\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tcancel: function() {\n\n\t\tif(this.dragging) {\n\n\t\t\tthis._mouseUp({ target: null });\n\n\t\t\tif(this.options.helper == \"original\")\n\t\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t\telse\n\t\t\t\tthis.currentItem.show();\n\n\t\t\t//Post deactivating events to containers\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tthis.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.placeholder) {\n\t\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\t\tif(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\t\t\tif(this.options.helper != \"original\" && this.helper && this.helper[0].parentNode) this.helper.remove();\n\n\t\t\t$.extend(this, {\n\t\t\t\thelper: null,\n\t\t\t\tdragging: false,\n\t\t\t\treverting: false,\n\t\t\t\t_noFinalSort: null\n\t\t\t});\n\n\t\t\tif(this.domPosition.prev) {\n\t\t\t\t$(this.domPosition.prev).after(this.currentItem);\n\t\t\t} else {\n\t\t\t\t$(this.domPosition.parent).prepend(this.currentItem);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tserialize: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar str = []; o = o || {};\n\n\t\t$(items).each(function() {\n\t\t\tvar res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));\n\t\t\tif(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));\n\t\t});\n\n\t\tif(!str.length && o.key) {\n\t\t\tstr.push(o.key + '=');\n\t\t}\n\n\t\treturn str.join('&');\n\n\t},\n\n\ttoArray: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar ret = []; o = o || {};\n\n\t\titems.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });\n\t\treturn ret;\n\n\t},\n\n\t/* Be careful with the following core functions */\n\t_intersectsWith: function(item) {\n\n\t\tvar x1 = this.positionAbs.left,\n\t\t\tx2 = x1 + this.helperProportions.width,\n\t\t\ty1 = this.positionAbs.top,\n\t\t\ty2 = y1 + this.helperProportions.height;\n\n\t\tvar l = item.left,\n\t\t\tr = l + item.width,\n\t\t\tt = item.top,\n\t\t\tb = t + Math.max(10, item.height);\n\n\t\tvar dyClick = this.offset.click.top,\n\t\t\tdxClick = this.offset.click.left;\n\n\t\tvar isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;\n\n\t\tif(\t this.options.tolerance == \"pointer\"\n\t\t\t|| this.options.forcePointerForContainers\n\t\t\t|| (this.options.tolerance != \"pointer\" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])\n\t\t) {\n\t\t\treturn isOverElement;\n\t\t} else {\n\n\t\t\treturn (l < x1 + (this.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (this.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (this.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (this.helperProportions.height / 2) < b ); // Top Half\n\n\t\t}\n\t},\n\n\t_intersectsWithPointer: function(item) {\n\n\t\tvar isOverElementHeight = (this.options.axis === 'x') || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, Math.max(10, item.height)),\n\t\t\tisOverElementWidth = (this.options.axis === 'y') || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n\t\t\tisOverElement = isOverElementHeight && isOverElementWidth,\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (!isOverElement)\n\t\t\treturn false;\n\n\t\treturn this.floating ?\n\t\t\t( ((horizontalDirection && horizontalDirection == \"right\") || verticalDirection == \"down\") ? 2 : 1 )\n\t\t\t: ( verticalDirection && (verticalDirection == \"down\" ? 2 : 1) );\n\n\t},\n\n\t_intersectsWithSides: function(item) {\n\n\t\tvar isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (Math.max(10, item.height)/2), Math.max(10, item.height)),\n\t\t\tisOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (this.floating && horizontalDirection) {\n\t\t\treturn ((horizontalDirection == \"right\" && isOverRightHalf) || (horizontalDirection == \"left\" && !isOverRightHalf));\n\t\t} else {\n\t\t\treturn verticalDirection && ((verticalDirection == \"down\" && isOverBottomHalf) || (verticalDirection == \"up\" && !isOverBottomHalf));\n\t\t}\n\n\t},\n\n\t_getDragVerticalDirection: function() {\n\t\tvar delta = this.positionAbs.top - this.lastPositionAbs.top;\n\t\treturn delta != 0 && (delta > 0 ? \"down\" : \"up\");\n\t},\n\n\t_getDragHorizontalDirection: function() {\n\t\tvar delta = this.positionAbs.left - this.lastPositionAbs.left;\n\t\treturn delta != 0 && (delta > 0 ? \"right\" : \"left\");\n\t},\n\n\trefresh: function(event) {\n\t\tthis._refreshItems(event);\n\t\tthis.refreshPositions();\n\t\treturn this;\n\t},\n\n\t_connectWith: function() {\n\t\tvar options = this.options;\n\t\treturn options.connectWith.constructor == String\n\t\t\t? [options.connectWith]\n\t\t\t: options.connectWith;\n\t},\n\n\t_getItemsAsjQuery: function(connected) {\n\n\t\tvar items = [];\n\t\tvar queries = [];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && connected) {\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), inst]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tqueries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), this]);\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--){\n\t\t\tqueries[i][0].each(function() {\n\t\t\t\titems.push(this);\n\t\t\t});\n\t\t};\n\n\t\treturn $(items);\n\n\t},\n\n\t_removeCurrentsFromItems: function() {\n\n\t\tvar list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n\n\t\tthis.items = $.grep(this.items, function (item) {\n\t\t\tfor (var j=0; j < list.length; j++) {\n\t\t\t\tif(list[j] == item.item[0])\n\t\t\t\t\treturn false;\n\t\t\t};\n\t\t\treturn true;\n\t\t});\n\n\t},\n\n\t_refreshItems: function(event) {\n\n\t\tthis.items = [];\n\t\tthis.containers = [this];\n\t\tvar items = this.items;\n\t\tvar queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);\n\t\t\t\t\t\tthis.containers.push(inst);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--) {\n\t\t\tvar targetData = queries[i][1];\n\t\t\tvar _queries = queries[i][0];\n\n\t\t\tfor (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {\n\t\t\t\tvar item = $(_queries[j]);\n\n\t\t\t\titem.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)\n\n\t\t\t\titems.push({\n\t\t\t\t\titem: item,\n\t\t\t\t\tinstance: targetData,\n\t\t\t\t\twidth: 0, height: 0,\n\t\t\t\t\tleft: 0, top: 0\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t},\n\n\trefreshPositions: function(fast) {\n\n\t\t//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change\n\t\tif(this.offsetParent && this.helper) {\n\t\t\tthis.offset.parent = this._getParentOffset();\n\t\t}\n\n\t\tfor (var i = this.items.length - 1; i >= 0; i--){\n\t\t\tvar item = this.items[i];\n\n\t\t\t//We ignore calculating positions of all connected containers when we're not over them\n\t\t\tif(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])\n\t\t\t\tcontinue;\n\n\t\t\tvar t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n\t\t\tif (!fast) {\n\t\t\t\titem.width = t.outerWidth();\n\t\t\t\titem.height = t.outerHeight();\n\t\t\t}\n\n\t\t\tvar p = t.offset();\n\t\t\titem.left = p.left;\n\t\t\titem.top = p.top;\n\t\t};\n\n\t\tif(this.options.custom && this.options.custom.refreshContainers) {\n\t\t\tthis.options.custom.refreshContainers.call(this);\n\t\t} else {\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tvar p = this.containers[i].element.offset();\n\t\t\t\tthis.containers[i].containerCache.left = p.left;\n\t\t\t\tthis.containers[i].containerCache.top = p.top;\n\t\t\t\tthis.containers[i].containerCache.width\t= this.containers[i].element.outerWidth();\n\t\t\t\tthis.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_createPlaceholder: function(that) {\n\t\tthat = that || this;\n\t\tvar o = that.options;\n\n\t\tif(!o.placeholder || o.placeholder.constructor == String) {\n\t\t\tvar className = o.placeholder;\n\t\t\to.placeholder = {\n\t\t\t\telement: function() {\n\n\t\t\t\t\tvar el = $(document.createElement(that.currentItem[0].nodeName))\n\t\t\t\t\t\t.addClass(className || that.currentItem[0].className+\" ui-sortable-placeholder\")\n\t\t\t\t\t\t.removeClass(\"ui-sortable-helper\")[0];\n\n\t\t\t\t\tif(!className)\n\t\t\t\t\t\tel.style.visibility = \"hidden\";\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tupdate: function(container, p) {\n\n\t\t\t\t\t// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that\n\t\t\t\t\t// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified\n\t\t\t\t\tif(className && !o.forcePlaceholderSize) return;\n\n\t\t\t\t\t//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item\n\t\t\t\t\tif(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };\n\t\t\t\t\tif(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthat.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));\n\n\t\t//Append it after the actual current item\n\t\tthat.currentItem.after(that.placeholder);\n\n\t\t//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\t\to.placeholder.update(that, that.placeholder);\n\n\t},\n\n\t_contactContainers: function(event) {\n\n\t\t// get innermost container that intersects with item\n\t\tvar innermostContainer = null, innermostIndex = null;\n\n\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\n\t\t\t// never consider a container that's located within the item itself\n\t\t\tif($.contains(this.currentItem[0], this.containers[i].element[0]))\n\t\t\t\tcontinue;\n\n\t\t\tif(this._intersectsWith(this.containers[i].containerCache)) {\n\n\t\t\t\t// if we've already found a container and it's more \"inner\" than this, then continue\n\t\t\t\tif(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tinnermostContainer = this.containers[i];\n\t\t\t\tinnermostIndex = i;\n\n\t\t\t} else {\n\t\t\t\t// container doesn't intersect. trigger \"out\" event if necessary\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// if no intersecting containers found, return\n\t\tif(!innermostContainer) return;\n\n\t\t// move the item into the container if it's not there already\n\t\tif(this.containers.length === 1) {\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} else {\n\n\t\t\t//When entering a new container, we will find the item with the least distance and append our item near it\n\t\t\tvar dist = 10000; var itemWithLeastDistance = null;\n\t\t\tvar posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';\n\t\t\tvar sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';\n\t\t\tvar base = this.positionAbs[posProperty] + this.offset.click[posProperty];\n\t\t\tfor (var j = this.items.length - 1; j >= 0; j--) {\n\t\t\t\tif(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;\n\t\t\t\tif(this.items[j].item[0] == this.currentItem[0]) continue;\n\t\t\t\tvar cur = this.items[j].item.offset()[posProperty];\n\t\t\t\tvar nearBottom = false;\n\t\t\t\tif(Math.abs(cur - base) > Math.abs(cur + Math.max(10, this.items[j][sizeProperty]) - base)){\n\t\t\t\t\tnearBottom = true;\n\t\t\t\t\tcur += this.items[j][sizeProperty];\n\t\t\t\t}\n\n\t\t\t\tif(Math.abs(cur - base) < dist) {\n\t\t\t\t\tdist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];\n\t\t\t\t\tthis.direction = nearBottom ? \"up\": \"down\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\n\t\t\t\treturn;\n\n\t\t\tthis.currentContainer = this.containers[innermostIndex];\n\t\t\titemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\tthis.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n\t\t\t//Update the placeholder\n\t\t\tthis.options.placeholder.update(this.currentContainer, this.placeholder);\n\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t}\n\n\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);\n\n\t\tif(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already\n\t\t\t$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n\n\t\tif(helper[0] == this.currentItem[0])\n\t\t\tthis._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") };\n\n\t\tif(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());\n\t\tif(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.currentItem.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.currentItem.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.currentItem.css(\"marginTop\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\t0 - this.offset.relative.left - this.offset.parent.left,\n\t\t\t0 - this.offset.relative.top - this.offset.parent.top,\n\t\t\t$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment)) {\n\t\t\tvar ce = $(o.containment)[0];\n\t\t\tvar co = $(o.containment).offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\tco.left + (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0) - this.margins.left,\n\t\t\t\tco.top + (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0) - this.margins.top,\n\t\t\t\tco.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left,\n\t\t\t\tco.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top\n\t\t\t];\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\t// This is another very weird special case that only happens for relative elements:\n\t\t// 1. If the css position is relative\n\t\t// 2. and the scroll parent is the document or similar to the offset parent\n\t\t// we have to refresh the relative offset during the scroll so there are no jumps\n\t\tif(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {\n\t\t\tthis.offset.relative = this._getRelativeOffset();\n\t\t}\n\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\n\t\t\tif(this.containment) {\n\t\t\t\tif(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\tvar top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n\t\t\t\tpageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n\t\t\t\tpageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_rearrange: function(event, i, a, hardRefresh) {\n\n\t\ta ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));\n\n\t\t//Various things done here to improve the performance:\n\t\t// 1. we create a setTimeout, that calls refreshPositions\n\t\t// 2. on the instance, we have a counter variable, that get's higher after every append\n\t\t// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n\t\t// 4. this lets only the last addition to the timeout stack through\n\t\tthis.counter = this.counter ? ++this.counter : 1;\n\t\tvar counter = this.counter;\n\n\t\tthis._delay(function() {\n\t\t\tif(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n\t\t});\n\n\t},\n\n\t_clear: function(event, noPropagation) {\n\n\t\tthis.reverting = false;\n\t\t// We delay all events that have to be triggered to after the point where the placeholder has been removed and\n\t\t// everything else normalized again\n\t\tvar delayedTriggers = [];\n\n\t\t// We first have to update the dom position of the actual currentItem\n\t\t// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)\n\t\tif(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);\n\t\tthis._noFinalSort = null;\n\n\t\tif(this.helper[0] == this.currentItem[0]) {\n\t\t\tfor(var i in this._storedCSS) {\n\t\t\t\tif(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';\n\t\t\t}\n\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t} else {\n\t\t\tthis.currentItem.show();\n\t\t}\n\n\t\tif(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"receive\", event, this._uiHash(this.fromOutside)); });\n\t\tif((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"update\", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed\n\n\t\t// Check if the items Container has Changed and trigger appropriate\n\t\t// events.\n\t\tif (this !== this.currentContainer) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tdelayedTriggers.push(function(event) { this._trigger(\"remove\", event, this._uiHash()); });\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"receive\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"update\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t}\n\t\t}\n\n\n\t\t//Post events to containers\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\tif(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger(\"deactivate\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"out\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t}\n\t\t}\n\n\t\t//Do what was originally in plugins\n\t\tif(this._storedCursor) $('body').css(\"cursor\", this._storedCursor); //Reset cursor\n\t\tif(this._storedOpacity) this.helper.css(\"opacity\", this._storedOpacity); //Reset opacity\n\t\tif(this._storedZIndex) this.helper.css(\"zIndex\", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index\n\n\t\tthis.dragging = false;\n\t\tif(this.cancelHelperRemoval) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tthis._trigger(\"beforeStop\", event, this._uiHash());\n\t\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t\t}\n\n\t\t\tthis.fromOutside = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!noPropagation) this._trigger(\"beforeStop\", event, this._uiHash());\n\n\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\tthis.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n\t\tif(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;\n\n\t\tif(!noPropagation) {\n\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t}\n\n\t\tthis.fromOutside = false;\n\t\treturn true;\n\n\t},\n\n\t_trigger: function() {\n\t\tif ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n\t\t\tthis.cancel();\n\t\t}\n\t},\n\n _delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_uiHash: function(_inst) {\n\t\tvar inst = _inst || this;\n\t\treturn {\n\t\t\thelper: inst.helper,\n\t\t\tplaceholder: inst.placeholder || $([]),\n\t\t\tposition: inst.position,\n\t\t\toriginalPosition: inst.originalPosition,\n\t\t\toffset: inst.positionAbs,\n\t\t\titem: inst.currentItem,\n\t\t\tsender: _inst ? _inst.element : null\n\t\t};\n\t}\n\n});\n","'use strict';\n\nconst $ = require('jquery');\nrequire('./jquery.ui.djnsortable');\n\n/*\n * jQuery UI Nested Sortable\n * v 1.3.4 / 28 apr 2011\n * http://mjsarfatti.com/sandbox/nestedSortable\n *\n * Depends:\n * jquery.ui.sortable.js 1.8+\n *\n * License CC BY-SA 3.0\n * Copyright 2010-2011, Manuele J Sarfatti\n */\nif (typeof $.fn.nearest != 'function') {\n /**\n * Returns the descendant(s) matching a given selector which are the\n * shortest distance from the search context element (in otherwords,\n * $.fn.closest(), in reverse).\n */\n $.fn.nearest = function(selector) {\n var nearest = [], node = this, distance = 10000;\n node.find(selector).each(function(){\n var d = $(this).parentsUntil(node).length;\n if (d < distance) {\n distance = d;\n nearest = [this];\n } else if (d == distance) {\n nearest.push(this);\n }\n });\n return this.pushStack(nearest, 'nearest', [selector]);\n };\n}\n\nvar counter = 0;\nvar expando = \"djn\" + (\"\" + Math.random()).replace(/\\D/g, \"\");\n\nvar createChildNestedSortable = function(parent, childContainer) {\n // Don't continue if the new element is the same as the old\n if (parent && parent.element && parent.element[0] == childContainer) {\n return;\n }\n var $childContainer = $(childContainer),\n options = $.extend({}, parent.options);\n options.connectWith = [parent.element];\n\n if ($childContainer.data(parent.widgetName)) {\n return;\n }\n\n var widgetConstructor = $childContainer[parent.widgetName];\n widgetConstructor.call($childContainer, options);\n var newInstance = $childContainer.data(parent.widgetName);\n for (var i = 0; i < parent.options.connectWith.length; i++) {\n var $otherContainer = parent.options.connectWith[i];\n newInstance.addToConnectWith($otherContainer);\n var otherInstance = $otherContainer.data(parent.widgetName);\n if (otherInstance) {\n otherInstance.addToConnectWith($childContainer);\n }\n }\n parent.addToConnectWith($childContainer);\n return newInstance;\n};\n\n$.widget(\"ui.nestedSortable\", $.ui.djnsortable, {\n\n options: {\n tabSize: 20,\n disableNesting: 'ui-nestedSortable-no-nesting',\n errorClass: 'ui-nestedSortable-error',\n nestedContainerSelector: ':not(*)',\n // Whether to clear empty list item and container elements\n doNotClear: false,\n /**\n * Create a list container element if the draggable was dragged\n * to the top or bottom of the elements at its level.\n *\n * @param DOMElement parent - The element relative to which the\n * new element will be inserted.\n * @return DOMElement - The new element.\n */\n createContainerElement: function(parent) {\n return $(document.createElement('ol'));\n },\n // Selector which matches all container elements in the nestedSortable\n containerElementSelector: 'ol',\n // Selector which matches all list items (draggables) in the nestedSortable\n listItemSelector: 'li',\n // Selector which, when applied to a container, returns its child list items\n items: '> li',\n maxLevels: 0,\n revertOnError: 1,\n protectRoot: false,\n rootID: null,\n rtl: false,\n // if true, you can not move nodes to different levels of nesting\n fixedNestingDepth: false,\n // show the error div or just not show a drop area\n showErrorDiv: true,\n // if true only allows you to rearrange within its parent container\n keepInParent: false,\n isAllowed: function(item, parent) { return true; },\n canConnectWith: function(container1, container2, instance) {\n var model1 = container1.data('inlineModel');\n var model2 = container2.data('inlineModel');\n if (model1 !== model2) {\n return false;\n }\n var instance2 = container2.data(instance.widgetName);\n if (!instance.options.fixedNestingDepth) {\n if (!instance2 || !instance2.options.fixedNestingDepth) {\n return true;\n }\n }\n var container1Level = instance._getLevel(container1);\n var container2Level = instance._getLevel(container2);\n return (container1Level === container2Level);\n }\n },\n\n _createWidget: function(options, element) {\n var $element = $( element || this.defaultElement || this ),\n dataOptions = $element.data('djnsortableOptions');\n element = $element[0];\n if (dataOptions) {\n options = $.extend({}, options, dataOptions);\n }\n return $.ui.djnsortable.prototype._createWidget.call(this, options, element);\n },\n\n _create: function() {\n if (this.element.data('uiNestedSortable')) {\n this.element.data('nestedSortable', this.element.data('uiNestedSortable'));\n }\n if (this.element.data('ui-nestedSortable')) {\n this.element.data('nestedSortable', this.element.data('ui-nestedSortable'));\n }\n this.element.data('djnsortable', this.element.data('nestedSortable'));\n if (this.element.data('uiNestedSortable')) {\n this.element.data('uiSortable', this.element.data('nestedSortable'));\n }\n // if (!this.element.is(this.options.containerElementSelector)) {\n // throw new Error('nestedSortable: Please check that the ' +\n // 'containerElementSelector option matches ' +\n // 'the element passed to the constructor.');\n // }\n\n $.ui.djnsortable.prototype._create.apply(this, arguments);\n\n this._connectWithMap = {};\n\n var self = this,\n o = this.options,\n $document = $(document);\n\n var originalConnectWith = o.connectWith;\n if (!originalConnectWith || typeof(originalConnectWith) == 'string') {\n this.options.connectWith = [];\n if (typeof(originalConnectWith) == 'string') {\n var connected = this._connectWith();\n for (var i = 0; i < connected.length; i++) {\n this.addToConnectWith($(connected[i]));\n }\n }\n\n // HACK!! FIX!! (django-specific logic)\n $document.on('djnesting:init.nestedSortable', o.containerElementSelector, function(event) {\n createChildNestedSortable(self, this);\n });\n this.element.find(o.containerElementSelector+':not(.subarticle-wrapper)').each(function(i, el) {\n if ($(el).closest('[data-inline-formset]').attr('id').indexOf('-empty') > -1) {\n return;\n }\n createChildNestedSortable(self, el);\n });\n }\n $document.trigger('nestedSortable:created', [this]);\n $document.on('nestedSortable:created.nestedSortable', function(e, instance) {\n instance.addToConnectWith(self.element);\n self.addToConnectWith(instance.element);\n });\n },\n\n addToConnectWith: function(element) {\n var self = this,\n $element = (typeof(element.selector) != 'undefined') ? element : $(element),\n uniqueId;\n\n if ($element.length > 1) {\n $element.each(function(i, el) {\n self.addToConnectWith($(el));\n });\n return;\n }\n uniqueId = element[0][expando];\n if (typeof uniqueId == 'undefined') {\n uniqueId = element[0][expando] = ++counter;\n }\n if (typeof this.options.connectWith == 'string') {\n return;\n }\n if (this._connectWithMap[uniqueId]) {\n return;\n }\n this.options.connectWith.push(element);\n this._connectWithMap[uniqueId] = 1;\n },\n\n _destroy: function() {\n this.element\n .removeData(\"nestedSortable\")\n .unbind(\".nestedSortable\");\n $(document).unbind('.nestedSortable');\n return $.ui.djnsortable.prototype.destroy.apply(this, arguments);\n },\n\n /**\n * Override this method to add extra conditions on an item before it's\n * rearranged.\n */\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var itemElement = item.item[0], o = this.options,\n intersection = $.ui.djnsortable.prototype._intersectsWithPointer.apply(this, arguments);\n\n this.lastItemElement = null;\n if (!intersection) {\n return intersection;\n }\n\n // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n // between the outer and inner container.\n if (item.instance !== this.currentContainer) {\n return false;\n }\n var $itemElement = $(itemElement);\n\n if (o.fixedNestingDepth && this._getLevel(this.currentItem) === 1+this._getLevel($itemElement)) {\n $itemElement = (function() {\n var containerSel = o.containerElementSelector;\n var $childItems = $itemElement.find('.djn-item');\n if ($childItems.length != 1) {\n return $itemElement;\n }\n if (!$childItems.is('.djn-no-drag,.djn-thead')) {\n return $itemElement;\n }\n var itemElementClosestContainer = $itemElement.closest(containerSel);\n if (!itemElementClosestContainer.length) {\n return $itemElement;\n }\n // Make sure the item is only one level deeper\n if (itemElementClosestContainer[0] != $childItems.closest(containerSel).closest(containerSel)[0]) {\n return $itemElement;\n }\n return $($childItems[0]);\n })();\n itemElement = $itemElement[0];\n }\n\n if (itemElement != this.currentItem[0] //cannot intersect with itself\n && this.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n && (!o.keepInParent || itemElement.parentNode == this.placeholder[0].parentNode) //only rearrange items within the same container\n && (!o.fixedNestingDepth || (this._getLevel(this.currentItem) === this._getLevel($itemElement))) //maintain the nesting level of node\n && (o.showErrorDiv || o.isAllowed.call(this, this.currentItem[0], itemElement.parentNode, this.placeholder))\n ) {\n this.lastItemElement = itemElement;\n return intersection;\n } else {\n return false;\n }\n },\n\n // This method is called after items have been iterated through.\n // Overriding this is cleaner than copying and pasting _mouseDrag()\n // and inserting logic in the middle.\n _contactContainers: function _contactContainers(event) {\n if (this.lastItemElement) {\n this._clearEmpty(this.lastItemElement);\n }\n\n\n var o = this.options,\n _parentItem = this.placeholder.closest(o.listItemSelector),\n parentItem = (_parentItem.length && _parentItem.closest('.ui-sortable').length)\n ? _parentItem\n : null,\n level = this._getLevel(this.placeholder),\n childLevels = this._getChildLevels(this.helper);\n\n var placeholderClassName = this.placeholder.attr('class');\n var phClassSearch = \" \" + placeholderClassName + \" \";\n // If the current level class isn't already set\n if (phClassSearch.indexOf(\" ui-sortable-nested-level-\" + level + \" \") == -1) {\n var phOrigClassName;\n // Check if another level class is set\n var phOrigClassNameEndPos = phClassSearch.indexOf(\" ui-sortable-nested-level-\") - 1;\n if (phOrigClassNameEndPos > -1) {\n phOrigClassName = placeholderClassName.substring(0, phOrigClassNameEndPos);\n } else {\n phOrigClassName = placeholderClassName;\n }\n // Add new level to class\n this.placeholder.attr('class', phOrigClassName + ' ui-sortable-nested-level-' + level);\n }\n\n // To find the previous sibling in the list, keep backtracking until we hit a valid list item.\n var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;\n if (previousItem != null) {\n while (!previousItem.is(this.options.listItemSelector) || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {\n if (previousItem[0].previousSibling) {\n previousItem = $(previousItem[0].previousSibling);\n } else {\n previousItem = null;\n break;\n }\n }\n }\n // To find the next sibling in the list, keep stepping forward until we hit a valid list item.\n var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;\n if (nextItem != null) {\n while (!nextItem.is(this.options.listItemSelector) || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {\n if (nextItem[0].nextSibling) {\n nextItem = $(nextItem[0].nextSibling);\n } else {\n nextItem = null;\n break;\n }\n }\n }\n\n this.beyondMaxLevels = 0;\n\n // We will change this to the instance of the nested container if\n // appropriate, so that the appropriate context is applied to the\n // super _contactContainers prototype method\n var containerInstance = this;\n this.refreshPositions();\n\n // If the item is moved to the left, send it to its parent's level unless there are siblings below it.\n if (!o.fixedNestingDepth && parentItem != null && nextItem == null &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||\n !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {\n parentItem.after(this.placeholder[0]);\n containerInstance = parentItem.closest(o.containerElementSelector).data(this.widgetName) || containerInstance;\n this._clearEmpty(parentItem[0]);\n this.refreshPositions();\n this._trigger(\"change\", event, this._uiHash());\n }\n // If the item is below a sibling and is moved to the right, make it a child of that sibling.\n else if (!o.fixedNestingDepth && previousItem != null && !previousItem.is('.djn-no-drag,.djn-thead') &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||\n !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {\n this._isAllowed(previousItem, level, level+childLevels);\n\n if (this.beyondMaxLevels > 0) {\n return $.ui.djnsortable.prototype._contactContainers.apply(this, arguments);\n }\n var $previousItemChildContainer;\n $previousItemChildContainer = previousItem.nearest(o.containerElementSelector).first();\n\n if (!$previousItemChildContainer.length && !previousItem.closest(o.nestedContainerSelector).length) {\n $previousItemChildContainer = this.options.createContainerElement(previousItem[0]);\n previousItem.append($previousItemChildContainer);\n }\n if ($previousItemChildContainer.length) {\n $previousItemChildContainer.append(this.placeholder);\n containerInstance = $previousItemChildContainer.data(this.widgetName);\n if (!containerInstance) {\n containerInstance = createChildNestedSortable(this, $previousItemChildContainer[0]);\n }\n this.refreshPositions();\n }\n this._trigger(\"change\", event, this._uiHash());\n }\n else {\n this._isAllowed(parentItem, level, level+childLevels);\n }\n\n $.ui.djnsortable.prototype._contactContainers.call(this, event);\n },\n\n _rearrange: function _rearrange(event, item, a, hardRefresh) {\n // Cache the rearranged element for the call to _clear()\n var o = this.options;\n if (item && typeof item == 'object' && item.item) {\n this.lastRearrangedElement = item.item[0];\n }\n if (item && typeof(item) == 'object' && item.item && this.placeholder.closest(o.nestedContainerSelector).length) {\n // This means we have been dropped into a nested container down a level\n // from the parent.\n var placeholderParentItem = this.placeholder.closest(o.listItemSelector);\n var comparisonElement = (this.direction == 'down')\n ? placeholderParentItem.next(o.nestedContainerSelector)\n : placeholderParentItem;\n if (comparisonElement.length && comparisonElement[0] == item.item[0]) {\n //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function() {\n if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n });\n // The super method will pop the container out of its nested container,\n // which we don't want.\n return;\n }\n }\n $.ui.djnsortable.prototype._rearrange.apply(this, arguments);\n },\n\n _convertPositionTo: function(d, pos) {\n // Cache the top offset before rearrangement\n this.previousTopOffset = this.placeholder.offset().top;\n return $.ui.djnsortable.prototype._convertPositionTo.apply(this, arguments);\n },\n\n _clear: function() {\n $.ui.djnsortable.prototype._clear.apply(this, arguments);\n // If lastRearrangedElement exists and is still attached to the document\n // (i.e., hasn't been removed)\n if (typeof this.lastRearrangedElement == 'object' && this.lastRearrangedElement.ownerDocument) {\n this._clearEmpty(this.lastRearrangedElement);\n }\n },\n\n _mouseStop: function _mouseStop(event, noPropagation) {\n // If the item is in a position not allowed, send it back\n if (this.beyondMaxLevels) {\n this.placeholder.removeClass(this.options.errorClass);\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.placeholder);\n } else {\n $(this.domPosition.parent).prepend(this.placeholder);\n }\n this._trigger(\"revert\", event, this._uiHash());\n\n }\n\n // Clean last empty container/list item\n for (var i = this.items.length - 1; i >= 0; i--) {\n var item = this.items[i].item[0];\n this._clearEmpty(item);\n }\n\n $.ui.djnsortable.prototype._mouseStop.apply(this, arguments);\n },\n\n toArray: function(o) {\n\n o = $.extend(true, {}, this.options, o || {});\n\n var sDepth = o.startDepthCount || 0,\n ret = [],\n left = 2;\n\n ret.push({\n \"item_id\": o.rootID,\n \"parent_id\": 'none',\n \"depth\": sDepth,\n \"left\": '1',\n \"right\": ($(o.listItemSelector, this.element).length + 1) * 2\n });\n\n var _recursiveArray = function(item, depth, left) {\n var right = left + 1,\n id,\n pid;\n\n var $childItems = $(item).children(o.containerElementSelector).find(o.items);\n\n if ($childItems.length > 0) {\n depth ++;\n $childItems.each(function () {\n right = _recursiveArray($(this), depth, right);\n });\n depth --;\n }\n\n id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));\n\n if (depth === sDepth + 1) {\n pid = o.rootID;\n } else {\n var parentItem = ($(item).parent(o.containerElementSelector)\n .parent(o.items)\n .attr(o.attribute || 'id'))\n .match(o.expression || (/(.+)[-=_](.+)/));\n pid = parentItem[2];\n }\n\n if (id) {\n ret.push({\"item_id\": id[2], \"parent_id\": pid, \"depth\": depth, \"left\": left, \"right\": right});\n }\n\n left = right + 1;\n return left;\n };\n\n $(this.element).children(o.listItemSelector).each(function () {\n left = _recursiveArray(this, sDepth + 1, left);\n });\n\n ret = ret.sort(function(a,b){ return (a.left - b.left); });\n\n return ret;\n },\n\n _clearEmpty: function(item) {\n if (this.options.doNotClear) {\n return;\n }\n var $item = $(item);\n var childContainers = $item.nearest(this.options.containerElementSelector);\n childContainers.each(function(i, childContainer) {\n var $childContainer = $(childContainer);\n if (!$childContainer.children().length) {\n var instance = $childContainer.data(this.widgetName);\n if (typeof(instance) == 'object' && instance.destroy) {\n instance.destroy();\n }\n $childContainer.remove();\n }\n });\n if (!$item.children().length) {\n $item.remove();\n }\n },\n\n _getLevel: function(item) {\n\n var level = 1,\n o = this.options, list;\n\n if (o.containerElementSelector) {\n list = item.closest(o.containerElementSelector);\n while (list && list.length > 0 && !list.parent().is('.djn-group-root')) {\n // if (!list.is(o.nestedContainerSelector)) {\n level++;\n // }\n list = list.parent().closest(o.containerElementSelector);\n }\n }\n\n return level;\n },\n\n _getChildLevels: function(parent, depth) {\n var self = this,\n o = this.options,\n result = 0;\n depth = depth || 0;\n\n $(parent).nearest(o.containerElementSelector).first().find(o.items).each(function (index, child) {\n if ($(child).is('.djn-no-drag,.djn-thead')) {\n return;\n }\n result = Math.max(self._getChildLevels(child, depth + 1), result);\n });\n\n return depth ? result + 1 : result;\n },\n\n _isAllowed: function _isAllowed(parentItem, level, levels) {\n var o = this.options,\n isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false;\n // this takes into account the maxLevels set to the recipient list\n // var maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels');\n var maxLevels = o.maxLevels;\n\n // Is the root protected?\n // Are we trying to nest under a no-nest?\n // Are we nesting too deep?\n if (parentItem && typeof(parentItem) == 'object' && typeof(parentItem.selector) == 'undefined') {\n parentItem = $(parentItem);\n }\n\n if (!o.isAllowed.call(this, this.currentItem, parentItem, this.placeholder) ||\n parentItem && parentItem.hasClass(o.disableNesting) ||\n o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {\n this.placeholder.addClass(o.errorClass);\n if (maxLevels < levels && maxLevels != 0) {\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.beyondMaxLevels = 1;\n }\n } else {\n if (maxLevels < levels && maxLevels != 0) {\n this.placeholder.addClass(o.errorClass);\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.placeholder.removeClass(o.errorClass);\n this.beyondMaxLevels = 0;\n }\n }\n },\n\n _connectWith: function _connectWith() {\n var origConnectWith = $.ui.djnsortable.prototype._connectWith.apply(this, arguments),\n connectWith = [];\n var self = this;\n for (var i = 0; i < origConnectWith.length; i++) {\n var $elements = $(origConnectWith[i]);\n $elements.each(function(j, el) {\n if (el == self.element[0]) {\n return;\n }\n if (!self.options.canConnectWith(self.element, $(el), self)) {\n return;\n }\n connectWith.push(el);\n });\n }\n return connectWith;\n },\n _removeCurrentsFromItems: function() {\n var list = this.currentItem.find(\":data(sortable-item)\");\n for (var i=0; i < this.items.length; i++) {\n for (var j=0; j < list.length; j++) {\n if (list[j] == this.items[i].item[0]) {\n this.items.splice(i, 1);\n if (i >= this.items.length) {\n break;\n }\n }\n }\n }\n },\n createContainerElement: function(parent) {\n if (!parent.childNodes) {\n throw new Error(\"Invalid element 'parent' passed to \" +\n \"createContainerElement.\");\n }\n var newContainer = this.options.createContainerElement.apply(this, arguments);\n parent.appendChild(newContainer[0]);\n return $(newContainer);\n }\n});\n\n$.ui.nestedSortable.prototype.options = $.extend({}, $.ui.djnsortable.prototype.options, $.ui.nestedSortable.prototype.options);\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nrequire('./jquery.ui.nestedsortable');\n\nfunction updatePositions(prefix) {\n var position = 0, // the value of the position formfield\n count = 1, // The count displayed in stacked inline headers\n $group = $('#' + prefix + '-group'),\n groupData = $group.djnData(),\n fieldNames = groupData.fieldNames,\n // The field name on the fieldset which is a ForeignKey to the parent model\n groupFkName = groupData.formsetFkName,\n parentPkVal,\n [, parentPrefix, index] = prefix.match(/^(.*)\\-(\\d+)-[^\\-]+(?:\\-\\d+)?$/) || [],\n sortableOptions = groupData.sortableOptions,\n sortableExcludes = (sortableOptions || {}).sortableExcludes || [];\n\n sortableExcludes.push(groupFkName);\n\n if (parentPrefix) {\n var $parentGroup = $('#' + parentPrefix + '-group');\n var parentFieldNames = $parentGroup.djnData('fieldNames');\n var parentPkFieldName = parentFieldNames.pk;\n var parentPkField = $parentGroup.filterDjangoField(parentPrefix, parentPkFieldName, index);\n parentPkVal = parentPkField.val();\n }\n\n if (groupFkName && typeof(parentPkVal) != 'undefined') {\n $group.filterDjangoField(prefix, groupFkName).val(parentPkVal).trigger('change');\n }\n\n $group.find('.djn-inline-form').each(function() {\n if (!this.id || this.id.substr(-6) == '-empty') {\n return true; // Same as continue\n }\n var regex = new RegExp('^(?:id_)?' + regexQuote(prefix) + '\\\\-\\\\d+$');\n\n if (!this.id.match(regex)) {\n return true;\n }\n // Cache jQuery object\n var $this = $(this),\n [formPrefix, index] = $this.djangoPrefixIndex() || [null, null],\n namePrefix = formPrefix + '-' + index + '-';\n\n if (!formPrefix) {\n return;\n }\n\n // Set header position for stacked inlines in Django 1.9+\n var $inlineLabel = $this.find('> h3 > .inline_label');\n if ($inlineLabel.length) {\n $inlineLabel.html($inlineLabel.html().replace(/(#\\d+)/g, '#' + count));\n }\n count++;\n\n var $fields = $this.djangoFormField('*'),\n $positionField,\n setPosition = false;\n\n // position is being updated if\n // a) the field has a value\n // b) if the field is not exluded with sortable_excludes (e.g. with default values)\n $fields.each(function() {\n var $field = $(this);\n if (!$field.is(':input[type!=radio][type!=checkbox],input:checked')) {\n return;\n }\n var hasValue = $field.val() || ($field.attr('type') == 'file' && $field.siblings('a').length),\n fieldName = $field.attr('name').substring(namePrefix.length);\n if (fieldName == fieldNames.position) {\n $positionField = $field;\n }\n if (hasValue && $.inArray(fieldName, sortableExcludes) === -1) {\n setPosition = true;\n }\n });\n\n if (!setPosition || !$positionField) {\n return;\n }\n\n $positionField.val(position).trigger('change');\n position++;\n });\n}\n\nfunction createSortable($group) {\n const isPolymorphic = $group.is('.djn-is-polymorphic');\n return $group.find('> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items').nestedSortable({\n handle: [\n '> h3.djn-drag-handler',\n '> .djn-tools .drag-handler',\n '> .djn-td > .djn-tools .djn-drag-handler',\n '> .djn-tr > .is-sortable > .djn-drag-handler',\n '> .djn-tr > .grp-tools-container .djn-drag-handler'\n ].join(', '),\n /**\n * items: The selector for ONLY the items underneath a given\n * container at that level. Not to be confused with\n * listItemSelector, which is the selector for all list\n * items in the nestedSortable\n */\n items: '> .djn-item',\n forcePlaceholderSize: true,\n placeholder: {\n element: function($currentItem) {\n var el = $(document.createElement($currentItem[0].nodeName))\n .addClass($currentItem[0].className + ' ui-sortable-placeholder')\n .removeClass('ui-sortable-helper')[0];\n\n if ($currentItem.is('.djn-tbody')) {\n var $originalTr = $currentItem.children('.djn-tr').eq(0);\n var trTagName = $originalTr.prop('tagName').toLowerCase();\n var $tr = $(`<${trTagName}>`);\n $tr.addClass($originalTr.attr('class'));\n var $originalTd = $originalTr.children('.djn-td').eq(0);\n var tdTagName = $originalTd.prop('tagName').toLowerCase();\n var numColumns = 0;\n $originalTr.children('.djn-td').each(function(i, td) {\n numColumns += parseInt($(td).attr('colspan'), 10) || 1;\n });\n $tr.append($(`<${tdTagName} colspan=\"${numColumns}\" class=\"djn-td grp-td\">`));\n el.appendChild($tr[0]);\n }\n\n return el;\n },\n update: function(instance, $placeholder) {\n var $currItem = instance.currentItem;\n if (!$currItem) {\n return;\n }\n var opts = instance.options;\n // 1. If a className is set as 'placeholder option, we\n // don't force sizes - the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to\n // force it even if a class name is specified\n if (opts.className && !opts.forcePlaceholderSize) return;\n\n if ($placeholder.is('.djn-tbody')) {\n // debugger;\n $placeholder = $placeholder.children('.djn-tr').eq(0).children('.djn-td').eq(0);\n }\n\n // If the element doesn't have a actual height by itself\n // (without styles coming from a stylesheet), it receives\n // the inline height from the dragged item\n if (!$placeholder.height()) {\n var innerHeight = $currItem.innerHeight(),\n paddingTop = parseInt($currItem.css('paddingTop') || 0, 10),\n paddingBottom = parseInt($currItem.css('paddingBottom') || 0, 10);\n $placeholder.height(innerHeight - paddingTop - paddingBottom);\n }\n if (!$placeholder.width()) {\n var innerWidth = $currItem.innerWidth(),\n paddingLeft = parseInt($currItem.css('paddingLeft') || 0, 10),\n paddingRight = parseInt($currItem.css('paddingRight') || 0, 10);\n $placeholder.width(innerWidth - paddingLeft - paddingRight);\n }\n }\n },\n helper: 'clone',\n opacity: 0.6,\n maxLevels: 0,\n connectWith: '.djn-items',\n tolerance: 'intersection',\n // Don't allow dragging beneath an inline that is marked for deletion\n isAllowed: function(currentItem, parentItem) {\n if (parentItem && parentItem.hasClass('predelete')) {\n return false;\n }\n const $parentGroup = parentItem.closest('.djn-group');\n const parentModel = $parentGroup.data('inlineModel');\n const childModels = $parentGroup.djnData('childModels');\n const currentModel = currentItem.data('inlineModel');\n const isPolymorphicChild = (childModels && childModels.indexOf(currentModel) !== -1);\n if (currentModel !== parentModel && !isPolymorphicChild) {\n return false;\n }\n return true;\n },\n // fixedNestingDepth: not a standard ui.sortable parameter.\n // Prevents dragging items up or down levels\n fixedNestingDepth: true,\n // The selector for ALL list containers in the nested sortable.\n containerElementSelector: '.djn-items',\n // The selector for ALL list items in the nested sortable.\n listItemSelector: '.djn-item',\n start: function(event, ui) {\n ui.item.addClass('djn-item-dragging');\n ui.item.show();\n },\n stop: function(event, ui) {\n ui.item.removeClass('djn-item-dragging');\n },\n /**\n * Triggered when a sortable is dropped into a container\n */\n receive: function(event, ui) {\n var $inline = $(this).closest('.djn-group');\n $inline.djangoFormset().spliceInto(ui.item);\n updatePositions(ui.item.djangoFormsetPrefix());\n },\n update: function(event, ui) {\n // Ensure that
\n // is the first child of the djn-items. If there\n // is another
before the\n // .do-not-drag element then the drag-and-drop placeholder\n // margins don't work correctly.\n var $nextItem = ui.item.nextAll('.djn-item').first();\n if ($nextItem.is('.djn-no-drag,.djn-thead')) {\n var nextItem = $nextItem[0];\n var parent = nextItem.parentNode;\n parent.insertBefore(nextItem, parent.firstChild);\n }\n var groupId = $(event.target).closest('.djn-group').attr('id'),\n $form = ui.item,\n $parentGroup = $form.closest('#' + groupId);\n if ($form.data('updateOperation') == 'removed') {\n $form.removeAttr('data-update-operation');\n } else if (!$parentGroup.length) {\n $form.attr('data-update-operation', 'removed');\n }\n updatePositions($form.djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$('#' + $form.djangoFormsetPrefix() + '-group')]);\n }\n });\n}\n\nmodule.exports = {updatePositions, createSortable};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","const $ = require('jquery');\n\nvar prefixCache = {};\n\n$.fn.djnData = function(name) {\n var inlineFormsetData = $(this).data('inlineFormset') || {},\n nestedOptions = inlineFormsetData.nestedOptions || {};\n if (!name) {\n return nestedOptions;\n } else {\n return nestedOptions[name];\n }\n};\n\n$.fn.djangoPrefixIndex = function() {\n var $this = (this.length > 1) ? this.first() : this;\n var id = $this.attr('id'),\n name = $this.attr('name'),\n forattr = $this.attr('for'),\n prefix, $form, $group, groupId, cacheKey, match, index;\n\n if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {\n return match;\n }\n\n if (id && !prefix) {\n prefix = (id.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n\n if (id && !prefix && $this.is('.djn-item') && id.match(/\\d+$/)) {\n [cacheKey, prefix, index] = id.match(/(.*?)\\-(\\d+)$/) || [null, null, null];\n }\n\n if (!prefix) {\n $form = $this.closest('.djn-inline-form');\n if ($form.length) {\n [cacheKey, prefix, index] = $form.attr('id').match(/(.*?)\\-(\\d+)$/)\n || [null, null, null];\n } else {\n $group = $this.closest('.djn-group');\n if (!$group.length) {\n return null;\n }\n groupId = $group.attr('id') || '';\n prefix = (groupId.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n } else {\n if (prefix.substr(0, 3) == 'id_') {\n prefix = prefix.substr(3);\n }\n\n if (!document.getElementById(prefix + '-group')) {\n return null;\n }\n }\n if (cacheKey) {\n prefixCache[cacheKey] = [prefix, index];\n }\n\n return [prefix, index];\n};\n\n$.fn.djangoFormPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n if (!prefixIndex || !prefixIndex[1]) {\n return null;\n }\n return prefixIndex[0] + '-' + prefixIndex[1] + '-';\n};\n\n$.fn.djangoFormIndex = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex || !prefixIndex[1]) ? null : parseInt(prefixIndex[1], 10);\n};\n\n$.fn.djangoFormsetPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex) ? null : prefixIndex[0];\n};\n\nvar filterDjangoFormsetForms = function(form, $group, formsetPrefix) {\n var formId = form.getAttribute('id'),\n formIndex = formId.substr(formsetPrefix.length + 1);\n\n // Check if form id matches /{prefix}-\\d+/\n if (formId.indexOf(formsetPrefix) !== 0) { return false; }\n return (!formIndex.match(/\\D/));\n};\n\n// Selects all initial forms within the same formset as the\n// element the method is being called on.\n$.fn.djangoFormsetForms = function() {\n var forms = [];\n this.each(function() {\n var $this = $(this),\n formsetPrefix = $this.djangoFormsetPrefix(),\n $group = (formsetPrefix) ? $('#' + formsetPrefix + '-group') : null,\n $forms;\n\n if (!formsetPrefix || !$group.length) return;\n\n $forms = $group.find('.djn-inline-form').filter(function() {\n return filterDjangoFormsetForms(this, $group, formsetPrefix);\n });\n var sortedForms = $forms.toArray().sort(function(a, b) {\n return $(a).djangoFormIndex() - $(b).djangoFormIndex;\n });\n Array.prototype.push.apply(forms, sortedForms);\n });\n return this.pushStack(forms);\n};\n\nif (typeof($.djangoFormField) != 'function') {\n $.djangoFormField = function(fieldName, prefix, index) {\n var $empty = $([]), matches;\n if (matches = prefix.match(/^(.+)\\-(\\d+)\\-$/)) {\n prefix = matches[1];\n index = matches[2];\n }\n index = parseInt(index, 10);\n if (isNaN(index)) {\n return $empty;\n }\n var namePrefix = prefix + '-' + index + '-';\n if (fieldName == '*') {\n return $('*[name^=\"' + namePrefix + '\"]').filter(function() {\n var fieldPart = $(this).attr('name').substring(namePrefix.length);\n return (fieldPart.indexOf('-') === -1);\n });\n }\n var $field = $('#id_' + namePrefix + fieldName);\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n var $group = $('#' + prefix + '-group'),\n fieldNameData = $group.djnData('fieldNames') || {};\n fieldName = fieldNameData[fieldName];\n if (!fieldName) { return $empty; }\n $field = $('#id_' + namePrefix + fieldName);\n }\n return $field;\n };\n}\n\nif (typeof($.fn.djangoFormField) != 'function') {\n /**\n * Given a django model's field name, and the forms index in the\n * formset, returns the field's input element, or an empty jQuery\n * object on failure.\n *\n * @param String fieldName - 'pk', 'position', or the field's\n * name in django (e.g. 'content_type',\n * 'url', etc.)\n * @return jQuery object containing the field's input element, or\n * an empty jQuery object on failure\n */\n $.fn.djangoFormField = function(fieldName, index) {\n var prefixAndIndex = this.djangoPrefixIndex();\n var $empty = $([]);\n if (!prefixAndIndex) {\n return $empty;\n }\n var prefix = prefixAndIndex[0];\n if (typeof(index) == 'undefined') {\n index = prefixAndIndex[1];\n if (typeof(index) == 'undefined') {\n return $empty;\n }\n }\n return $.djangoFormField(fieldName, prefix, index);\n };\n}\n\nif (typeof($.fn.filterDjangoField) != 'function') {\n var djRegexCache = {};\n $.fn.filterDjangoField = function(prefix, fieldName, index) {\n var $field, fieldNameData;\n if (typeof index != 'undefined') {\n if (typeof index == 'string') {\n index = parseInt(index, 10);\n }\n if (typeof index == 'number' && !isNaN(index)) {\n var fieldId = 'id_' + prefix + '-' + index + '-' + fieldName;\n $field = $('#' + fieldId);\n }\n } else {\n if (typeof(djRegexCache[prefix]) != 'object') {\n djRegexCache[prefix] = {};\n }\n if (typeof(djRegexCache[prefix][fieldName]) == 'undefined') {\n djRegexCache[prefix][fieldName] = new RegExp('^' + prefix + '-\\\\d+-' + fieldName + '$');\n } \n $field = this.find('input[name$=\"' + fieldName + '\"]').filter(function() {\n return this.getAttribute('name').match(djRegexCache[prefix][fieldName]);\n }); \n }\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n fieldNameData = $('#' + prefix + '-group').djnData('fieldNames') || {};\n if (typeof(fieldNameData[fieldName]) && fieldNameData[fieldName] != fieldName) {\n $field = $(this).filterDjangoField(prefix, fieldNameData[fieldName], index);\n }\n }\n return $field;\n };\n}\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","const $ = require('jquery');\nconst grappelli = require('grappelli');\nconst DJNesting = require('./utils');\nDJNesting.DjangoFormset = require('./jquery.djangoformset');\n\n$(document).ready(function() {\n // Remove the border on any empty fieldsets\n $('fieldset.grp-module, fieldset.module').filter(function(i, element) {\n return element.childNodes.length == 0;\n }).css('border-width', '0');\n\n // Set predelete class on any form elements with the DELETE input checked.\n // These can occur on forms rendered after a validation error.\n $('input[name$=\"-DELETE\"]:checked').not('[name*=\"__prefix__\"]').closest('.djn-inline-form').addClass('grp-predelete');\n\n $(document).on('djnesting:initialized djnesting:mutate', function onMutate(e, $inline) {\n var $items = $inline.find('> .djn-items, > .tabular > .module > .djn-items');\n var $rows = $items.children('.djn-tbody');\n $rows.removeClass('row1 row2');\n $rows.each(function(i, row) {\n var n = 1 + (i % 2);\n $(row).addClass('row' + n);\n });\n });\n\n // Register the nested formset on top level djnesting-stacked elements.\n // It will handle recursing down the nested inlines.\n $('.djn-group-root').each(function(i, rootGroup) {\n $(rootGroup).djangoFormset();\n });\n\n $('form').on('submit.djnesting', function(e) {\n $('.djn-group').each(function() {\n DJNesting.updatePositions($(this).djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$(this).djangoFormset().$inline]);\n });\n });\n});\n\nmodule.exports = DJNesting;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["../../../../webpack/bootstrap","../src/nested-admin/jquery.shim.js","../../../../node_modules/core-js/modules/es6.array.find.js","../../../../node_modules/core-js/modules/es6.regexp.replace.js","../../../../node_modules/core-js/modules/es6.regexp.match.js","../../../../node_modules/core-js/modules/_fails.js","../../../../node_modules/core-js/modules/_is-object.js","../../../../node_modules/core-js/modules/_global.js","../../../../node_modules/core-js/modules/es6.function.name.js","../../../../node_modules/core-js/modules/_wks.js","../../../../node_modules/core-js/modules/_descriptors.js","../../../../node_modules/core-js/modules/_hide.js","../src/nested-admin/regexquote.js","../../../../node_modules/core-js/modules/es6.array.sort.js","../../../../node_modules/core-js/modules/_fix-re-wks.js","../../../../node_modules/core-js/modules/_cof.js","../src/nested-admin/grp$.js","../../../../node_modules/core-js/modules/es6.regexp.split.js","../src/nested-admin/utils.js","../../../../external \"grappelli\"","../../../../node_modules/core-js/modules/_defined.js","../../../../node_modules/core-js/modules/_to-object.js","../../../../node_modules/core-js/modules/_a-function.js","../../../../node_modules/core-js/modules/_ctx.js","../../../../node_modules/core-js/modules/_uid.js","../../../../node_modules/core-js/modules/_redefine.js","../../../../node_modules/core-js/modules/_object-dp.js","../../../../node_modules/core-js/modules/_core.js","../../../../node_modules/core-js/modules/_export.js","../../../../external \"grp\"","../src/nested-admin/jquery.djangoformset.js","../src/nested-admin/jquery.ui.djnsortable.js","../src/nested-admin/jquery.ui.nestedsortable.js","../src/nested-admin/sortable.js","../../../../node_modules/core-js/modules/_strict-method.js","../src/nested-admin/jquery.djnutils.js","../../../../node_modules/core-js/modules/_is-regexp.js","../../../../node_modules/core-js/modules/_add-to-unscopables.js","../../../../node_modules/core-js/modules/_shared.js","../../../../node_modules/core-js/modules/_is-array.js","../../../../node_modules/core-js/modules/_array-species-constructor.js","../../../../node_modules/core-js/modules/_array-species-create.js","../../../../node_modules/core-js/modules/_to-integer.js","../../../../node_modules/core-js/modules/_to-length.js","../../../../node_modules/core-js/modules/_iobject.js","../../../../node_modules/core-js/modules/_array-methods.js","../../../../node_modules/core-js/modules/_has.js","../../../../node_modules/core-js/modules/_property-desc.js","../../../../node_modules/core-js/modules/_to-primitive.js","../../../../node_modules/core-js/modules/_dom-create.js","../../../../node_modules/core-js/modules/_ie8-dom-define.js","../../../../node_modules/core-js/modules/_an-object.js","../src/nested-admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","window","django","jQuery","$export","$find","forced","Array","P","F","find","callbackfn","this","arguments","length","undefined","defined","REPLACE","$replace","searchValue","replaceValue","O","fn","String","MATCH","$match","regexp","RegExp","exec","e","it","global","Math","self","Function","__g","dP","f","FProto","nameRE","match","store","uid","Symbol","USE_SYMBOL","a","createDesc","key","str","replace","aFunction","toObject","fails","$sort","sort","test","comparefn","hide","redefine","wks","KEY","SYMBOL","fns","strfn","rxfn","string","arg","toString","slice","$","grp$","$sel","grp","init","$grpSel","prevObject","SPLIT","$split","isRegExp","_split","$push","push","NPCG","separator","limit","separator2","lastIndex","lastLength","output","flags","ignoreCase","multiline","unicode","sticky","lastLastIndex","splitLimit","separatorCopy","source","index","apply","createSortable","updatePositions","regexQuote","DJNesting","patchSelectFilter","oldFn","SelectFilter","field_id","field_name","is_stacked","updateFormAttributes","$elem","search","selector","join","addBackMethod","addBack","each","$node","attrName","attrVal","attr","data","JSON","parse","dependencyIds","makeArray","map","id","createContainerElement","initRelatedFields","prefix","groupData","LOOKUP_URLS","related","lookupUrls","$inline","djnData","lookupFields","lookupRelated","djangoFormsetForms","form","fk","djangoFormField","grp_related_fk","lookup_url","m2m","grp_related_m2m","generic","contentType","objectId","$this","djangoFormIndex","hasClass","parent","remove","grp_related_generic","content_type","object_id","initAutocompleteFields","lookupAutocomplete","grp_autocomplete_fk","autocomplete_lookup_url","autocomplete","grp_autocomplete_m2m","grp_autocomplete_generic","DjangoInlines","initPrepopulatedFields","row","field","input","is","$input","dependencyList","formPrefix","djangoFormPrefix","dependencies","fieldName","prepopulate","reinitDateTimeShortCuts","DateTimeShortcuts","updateSelectFilter","$form","namearr","split","setTimeout","forEach","funcName","patchDjangoFunction","callCount","filter","patchGrpFunction","TypeError","that","b","px","random","concat","has","SRC","$toString","TPL","inspectSource","val","safe","isFunction","anObject","IE8_DOM_DEFINE","toPrimitive","Attributes","core","version","__e","ctx","type","own","out","exp","IS_FORCED","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","IS_BIND","B","target","expProto","U","W","R","grappelli","pluginName","DjangoFormset","inline","opts","emptyClass","predeleteClass","djangoFormsetPrefix","_$totalForms","_$template","inlineModelClassName","extend","childTypes","options","formsetFkModel","addButtonSelector","removeButtonSelector","deleteButtonSelector","formClass","formClassSelector","_setupPolymorphic","_bindEvents","_initializeForms","trigger","document","Error","menu","$addButton","$menu","after","totalForms","mgmtVal","parents","_initializeForm","addClass","toggleClass","minForms","hideRemoveButton","showHideMethod","$el","off","on","preventDefault","stopPropagation","next","hideMenu","show","add","polymorphicType","closest","deleteClickHandler","stopImmediatePropagation","undelete","$deleteButton","maxForms","isInitial","innerHTML","_fillGap","delete","$deleteInput","checked","$childInline","childFormset","djangoFormset","removeAttr","removeClass","spliceIndex","ctype","$template","clone","isNested","append","$firstTemplate","eq","compatibleParents","el","fkModel","compatModels","parentModel","isPolymorphic","indexOf","setAttribute","parentNode","appendChild","removeChild","insertBefore","isNumeric","spliceInto","reinitDateTimeFields","grp_collapsible","toggle_handler_slctr","closed_css","open_css","on_toggle","curated_content_type","formsetModelClassName","$initialForm","$newForm","formsets","toArray","oldIndex","oldFormPrefixRegex","_makeRoomForInsert","initialFormCount","totalFormCount","gapIndex","$existingForm","isNewAddition","newIndex","oldFormsetPrefix","newFormsetPrefix","prevAll","$oldInline","oldDjangoFormset","$parentInline","$parentForm","parentPkField","pk","newValue","$field","parseInt","args","t","ui","nodeName","toLowerCase","href","disabled","expr","filters","visible","css","keyCode","BACKSPACE","COMMA","DELETE","DOWN","END","ENTER","ESCAPE","HOME","LEFT","NUMPAD_ADD","NUMPAD_DECIMAL","NUMPAD_DIVIDE","NUMPAD_ENTER","NUMPAD_MULTIPLY","NUMPAD_SUBTRACT","PAGE_DOWN","PAGE_UP","PERIOD","RIGHT","SPACE","TAB","UP","focus","scrollParent","ie","zIndex","isNaN","uniqueId","removeUniqueId","createPseudo","focusable","tabbable","outerWidth","jquery","parseFloat","innerWidth","innerHeight","outerHeight","removeData","camelCase","navigator","userAgent","support","selectstart","createElement","disableSelection","bind","enableSelection","unbind","plugin","plugins","element","nodeType","hasScroll","cleanData","triggerHandler","widget","h","u","Widget","_createWidget","_proto","_childConstructors","_super","_superApply","widgetEventPrefix","constructor","namespace","widgetName","widgetFullName","bridge","isPlainObject","charAt","pushStack","error","option","_init","defaultElement","create","uuid","eventNamespace","_getCreateOptions","bindings","hoverable","_on","destroy","style","ownerDocument","defaultView","parentWindow","_create","_trigger","_getCreateEventData","noop","_destroy","shift","pop","_setOptions","_setOption","enable","disable","guid","delegate","_off","undelegate","_delay","_hoverable","mouseenter","currentTarget","mouseleave","_focusable","focusin","focusout","Event","originalEvent","isDefaultPrevented","effect","duration","isEmptyObject","complete","delay","effects","easing","queue","mouseup","cancel","distance","_mouseInit","_mouseDown","started","_mouseDestroy","_mouseMoveDelegate","_mouseUpDelegate","_mouseStarted","_mouseUp","_mouseDownEvent","which","_mouseCapture","mouseDelayMet","_mouseDelayTimer","_mouseDistanceMet","_mouseDelayMet","_mouseStart","_mouseMove","documentMode","button","_mouseDrag","_mouseStop","max","abs","pageX","pageY","round","position","scrollbarWidth","children","offsetWidth","clientWidth","getScrollInfo","isWindow","width","scrollWidth","height","scrollHeight","getWithinInfo","offset","left","top","scrollLeft","scrollTop","of","g","v","y","_","within","x","k","collision","w","at","D","T","M","my","offsetFractions","marginLeft","marginTop","targetWidth","targetHeight","elemWidth","elemHeight","collisionPosition","collisionWidth","collisionHeight","elem","using","horizontal","vertical","important","fit","flip","flipfit","getElementsByTagName","visibility","border","margin","background","documentElement","firstChild","cssText","mouse","ready","appendTo","axis","connectWith","containment","cursor","cursorAt","dropOnEmpty","forcePlaceholderSize","forceHelperSize","grid","handle","helper","items","opacity","placeholder","revert","scroll","scrollSensitivity","scrollSpeed","scope","tolerance","_isOverAxis","reference","size","containerCache","refresh","floating","item","event","overrideHandle","reverting","_refreshItems","currentItem","validHandle","_removeCurrentsFromItems","noActivation","currentContainer","refreshPositions","_createHelper","_cacheHelperProportions","_cacheMargins","margins","click","_getParentOffset","relative","_getRelativeOffset","cssPosition","originalPosition","_generatePosition","originalPageX","originalPageY","_adjustOffsetFromHelper","domPosition","prev","_createPlaceholder","_setContainment","_storedCursor","_storedOpacity","_storedZIndex","tagName","overflowOffset","_uiHash","_preserveHelperProportions","containers","ddmanager","current","dropBehaviour","prepareOffsets","dragging","positionAbs","_convertPositionTo","lastPositionAbs","scrolled","offsetHeight","itemElement","intersection","_intersectsWithPointer","instance","contains","direction","_intersectsWithSides","_rearrange","_contactContainers","drag","noPropagation","drop","cur","animate","offsetParent","body","_clear","_storedCSS","over","_noFinalSort","prepend","serialize","_getItemsAsjQuery","connected","res","attribute","expression","ret","_intersectsWith","x1","x2","helperProportions","y1","y2","dyClick","dxClick","isOverElement","forcePointerForContainers","isOverElementHeight","isOverElementWidth","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","isOverBottomHalf","isOverRightHalf","delta","_connectWith","queries","j","inst","not","list","grep","targetData","_queries","queriesLength","fast","toleranceElement","custom","refreshContainers","className","update","container","innermostContainer","innermostIndex","dist","itemWithLeastDistance","posProperty","sizeProperty","base","nearBottom","obj","isArray","right","bottom","po","ce","co","pos","mod","scrollIsRootNode","hardRefresh","nextSibling","counter","delayedTriggers","before","fromOutside","cancelHelperRemoval","handler","_inst","sender","nearest","node","parentsUntil","expando","createChildNestedSortable","childContainer","$childContainer","newInstance","$otherContainer","addToConnectWith","otherInstance","djnsortable","tabSize","disableNesting","errorClass","nestedContainerSelector","doNotClear","containerElementSelector","listItemSelector","maxLevels","revertOnError","protectRoot","rootID","rtl","fixedNestingDepth","showErrorDiv","keepInParent","isAllowed","canConnectWith","container1","container2","instance2","_getLevel","$element","dataOptions","_connectWithMap","$document","originalConnectWith","lastItemElement","$itemElement","containerSel","$childItems","itemElementClosestContainer","_clearEmpty","_parentItem","parentItem","level","childLevels","_getChildLevels","placeholderClassName","phClassSearch","phOrigClassName","phOrigClassNameEndPos","substring","previousItem","previousSibling","nextItem","beyondMaxLevels","containerInstance","_isAllowed","$previousItemChildContainer","first","lastRearrangedElement","placeholderParentItem","comparisonElement","previousTopOffset","sDepth","startDepthCount","item_id","parent_id","depth","_recursiveArray","pid","$item","result","child","levels","isRoot","origConnectWith","splice","childNodes","newContainer","nestedSortable","parentPkVal","count","$group","fieldNames","groupFkName","formsetFkName","_ref","parentPrefix","sortableExcludes","sortableOptions","$parentGroup","parentPkFieldName","filterDjangoField","substr","regex","_ref2","djangoPrefixIndex","namePrefix","$inlineLabel","html","$positionField","setPosition","hasValue","siblings","inArray","$currentItem","$originalTr","trTagName","prop","$tr","tdTagName","numColumns","td","$placeholder","$currItem","paddingTop","paddingBottom","paddingLeft","paddingRight","childModels","currentModel","isPolymorphicChild","start","stop","receive","$nextItem","nextAll","groupId","method","prefixCache","nestedOptions","cacheKey","forattr","getElementById","prefixIndex","forms","formsetPrefix","sortedForms","formId","getAttribute","formIndex","filterDjangoFormsetForms","matches","$empty","prefixAndIndex","djRegexCache","fieldNameData","isObject","cof","UNSCOPABLES","ArrayProto","SPECIES","original","C","speciesConstructor","ceil","floor","toInteger","min","propertyIsEnumerable","IObject","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","bitmap","writable","valueOf","$rows","rootGroup"],"mappings":"6BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAA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MAAMkO,uBAClCzK,EAAE0L,UAAUD,QAAQ,oBAAqBzL,EAAEzD,MAAM0R,gBAAgB9J,gBAK7EjK,EAAOD,QAAUiI","file":"nested_admin.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 52);\n","module.exports = window.django.jQuery;\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function regexQuote(str) {\n return (str+'').replace(/([\\.\\?\\*\\+\\^\\$\\[\\]\\\\\\(\\)\\{\\}\\|\\-])/g, '\\\\$1');\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","const $ = require('jquery');\n\n/**\n * For grappelli 2.14, converts a django.jQuery instance to a grp.jQuery\n * instance. Otherwise (if grappelli is not present, or for grappelli <= 2.13,\n * where the grappelli jQuery instance is the same as django's), returns the\n * object that was passed in, unchanged.\n */\nfunction grp$($sel) {\n if (typeof window.grp === 'undefined') {\n return $($sel);\n }\n if (window.grp.jQuery.fn.init === $.fn.init) {\n return $($sel);\n }\n const $grpSel = window.grp.jQuery($sel);\n if ($sel.prevObject) {\n $grpSel.prevObject = grp$($sel.prevObject);\n }\n return $grpSel;\n}\n\nmodule.exports = grp$;\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","'use strict';\n\n/* globals SelectFilter, DateTimeShortcuts */\n\nconst $ = require('jquery');\nrequire('./jquery.djnutils.js');\nconst {createSortable, updatePositions} = require('./sortable');\nconst regexQuote = require('./regexquote');\nconst grp$ = require('./grp$');\n\nvar DJNesting = (typeof window.DJNesting != 'undefined')\n ? window.DJNesting : {};\n\nDJNesting.regexQuote = regexQuote;\nDJNesting.createSortable = createSortable;\nDJNesting.updatePositions = updatePositions;\n\n/**\n * Update attributes based on a regular expression\n */\nDJNesting.updateFormAttributes = function($elem, search, replace, selector) {\n if (!selector) {\n selector = [\n ':input', 'span', 'table', 'iframe', 'label', 'a', 'ul', 'p',\n 'img', '.djn-group', '.djn-inline-form', '.cropduster-form',\n '.dal-forward-conf', '[role=tabpanel]'].join(',');\n }\n var addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n $elem.find(selector)[addBackMethod]().each(function() {\n var $node = $(this),\n attrs = [\n 'id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset',\n 'django-croppable-image-for',\n 'django-croppable-crop-for',\n ];\n\n $.each(attrs, function(i, attrName) {\n var attrVal = $node.attr(attrName);\n if (attrVal) {\n $node.attr(attrName, attrVal.replace(search, replace));\n if (attrName === 'data-inline-formset') {\n $node.data('inlineFormset', JSON.parse($node.attr(attrName)));\n }\n }\n });\n });\n // update prepopulate ids for function initPrepopulatedFields\n $elem.find('.prepopulated_field').each(function() {\n var $node = grp$(this);\n var dependencyIds = $.makeArray($node.data('dependency_ids') || []);\n $node.data('dependency_ids', $.map(dependencyIds, function(id) {\n return id.replace(search, replace);\n }));\n });\n};\n\nDJNesting.createContainerElement = function() {\n return;\n};\n\n// Slight tweaks to the grappelli functions of the same name\n// (initRelatedFields and initAutocompleteFields).\n//\n// The most notable tweak is the call to $.fn.grp_related_generic() (a\n// jQuery method provided by django-curated) and the use of\n// DJNesting.LOOKUP_URLS to determine the ajax lookup urls.\n//\n// We abstract this out using form prefix because the way grappelli does it\n// (adding javascript at the bottom of each formset) doesn't really scale\n// with nested formsets.\n\n// The second parameter (groupData) is optional, and only exists to prevent\n// redundant calls to jQuery() and jQuery.fn.data() in the calling context\nDJNesting.initRelatedFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupRelated;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n grp$(this).grp_related_fk({lookup_url: lookupUrls.related});\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n grp$(this).grp_related_m2m({lookup_url: lookupUrls.m2m});\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n if ($this.hasClass('grp-has-related-lookup')) {\n $this.parent().find('a.related-lookup').remove();\n $this.parent().find('.grp-placeholder-related-generic').remove();\n }\n grp$($this).grp_related_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related\n });\n });\n });\n });\n};\n\nDJNesting.initAutocompleteFields = function(prefix, groupData) {\n if (typeof DJNesting.LOOKUP_URLS != 'object' || !DJNesting.LOOKUP_URLS.related) {\n return;\n }\n var lookupUrls = DJNesting.LOOKUP_URLS;\n\n var $inline = $('#' + prefix + '-group');\n\n if (!groupData) {\n groupData = $inline.djnData();\n }\n var lookupFields = groupData.lookupAutocomplete;\n\n $inline.djangoFormsetForms().each(function(i, form) {\n $.each(lookupFields.fk || [], function(i, fk) {\n $(form).djangoFormField(fk).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_fk({\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.m2m || [], function(i, m2m) {\n $(form).djangoFormField(m2m).each(function() {\n var $this = $(this), id = $this.attr('id');\n // An autocomplete widget has already been initialized, return\n if ($('#' + id + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_m2m({\n lookup_url: lookupUrls.m2m,\n autocomplete_lookup_url: lookupUrls.autocomplete\n });\n });\n });\n $.each(lookupFields.generic || [], function() {\n var [contentType, objectId] = this;\n $(form).djangoFormField(objectId).each(function() {\n var $this = $(this);\n var index = $this.djangoFormIndex();\n // An autocomplete widget has already been initialized, return\n if ($('#' + $this.attr('id') + '-autocomplete').length) {\n return;\n }\n grp$($this).grp_autocomplete_generic({\n content_type: `#id_${prefix}-${index}-${contentType}`,\n object_id: `#id_${prefix}-${index}-${objectId}`,\n lookup_url: lookupUrls.related,\n autocomplete_lookup_url: lookupUrls.m2m\n });\n });\n });\n });\n};\n\n// I very much regret that these are basically copy-pasted from django's\n// inlines.js, but they're hidden in closure scope so I don't have much choice.\nDJNesting.DjangoInlines = {\n initPrepopulatedFields: function(row) {\n row.find('.prepopulated_field').each(function() {\n var field = $(this),\n input = (field.is(':input') ? field : field.find(':input')),\n $input = grp$(input),\n dependencyList = $input.data('dependency_list') || [],\n formPrefix = input.djangoFormPrefix(),\n dependencies = [];\n if (!formPrefix || formPrefix.match(/__prefix__/)) {\n return;\n }\n $.each(dependencyList, function(i, fieldName) {\n dependencies.push('#id_' + formPrefix + fieldName);\n });\n if (dependencies.length) {\n $input.prepopulate(dependencies, input.attr('maxlength'));\n }\n });\n },\n reinitDateTimeShortCuts: function() {\n // Reinitialize the calendar and clock widgets by force\n if (typeof window.DateTimeShortcuts !== 'undefined') {\n $('.datetimeshortcuts').remove();\n DateTimeShortcuts.init();\n }\n },\n updateSelectFilter: function($form) {\n // If any SelectFilter widgets are a part of the new form,\n // instantiate a new SelectFilter instance for it.\n if (typeof window.SelectFilter !== 'undefined') {\n $form.find('.selectfilter').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], false);\n });\n $form.find('.selectfilterstacked').each(function(index, value) {\n var namearr = value.name.split('-');\n SelectFilter.init(value.id, namearr[namearr.length - 1], true);\n });\n }\n }\n};\n\nfunction patchSelectFilter() {\n window.SelectFilter.init = (function(oldFn) {\n return function init(field_id, field_name, is_stacked) {\n if (field_id.match(/\\-empty\\-/)) {\n return;\n } else {\n oldFn.apply(this, arguments);\n }\n };\n }(window.SelectFilter.init));\n}\n\nif (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n} else {\n setTimeout(function() {\n if (typeof window.SelectFilter !== 'undefined') {\n patchSelectFilter();\n }\n }, 12);\n}\n\nconst djangoFuncs = ['prepopulate', 'djangoAdminSelect2'];\n\ndjangoFuncs.forEach((funcName) => {\n (function patchDjangoFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof $.fn[funcName] === 'undefined') {\n return setTimeout(() => patchDjangoFunction(callCount++), 12);\n }\n $.fn[funcName] = (function(oldFn) {\n return function django_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }($.fn[funcName]));\n }(0));\n});\n\nconst grpFuncs = [\n 'grp_autocomplete_fk', 'grp_autocomplete_generic', 'grp_autocomplete_m2m',\n 'grp_collapsible', 'grp_collapsible_group', 'grp_inline', 'grp_related_fk',\n 'grp_related_generic', 'grp_related_m2m', 'grp_timepicker', 'datepicker',\n 'prepopulate', 'djangoAdminSelect2'];\n\ngrpFuncs.forEach((funcName) => {\n (function patchGrpFunction(callCount) {\n if (callCount > 2) {\n return;\n }\n if (typeof window.grp === 'undefined' || typeof window.grp.jQuery.fn[funcName] === 'undefined') {\n return setTimeout(() => patchGrpFunction(callCount++), 12);\n }\n window.grp.jQuery.fn[funcName] = (function(oldFn) {\n return function grp_fn_patch() {\n return oldFn.apply(\n this.filter(\n ':not([id*=\"-empty-\"]):not([id$=\"-empty\"]):not([id*=\"__prefix__\"])'),\n arguments);\n }\n }(window.grp.jQuery.fn[funcName]));\n }(0));\n});\n\nmodule.exports = DJNesting;\n","(function() { module.exports = window[\"grappelli\"]; }());","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","(function() { module.exports = window[\"grp\"]; }());","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nconst DJNesting = require('./utils');\nconst grappelli = require('grappelli');\nconst grp = require('grp');\nconst grp$ = require('./grp$');\n\nvar pluginName = 'djangoFormset';\n\nclass DjangoFormset {\n constructor(inline) {\n this.opts = {\n emptyClass: 'empty-form grp-empty-form djn-empty-form',\n predeleteClass: 'grp-predelete'\n };\n this.$inline = $(inline);\n this.prefix = this.$inline.djangoFormsetPrefix();\n this._$totalForms = this.$inline.find('#id_' + this.prefix + '-TOTAL_FORMS');\n this._$totalForms.attr('autocomplete', 'off');\n this._$template = $('#' + this.prefix + '-empty');\n\n var inlineModelClassName = this.$inline.djnData('inlineModel');\n\n this.opts = $.extend({}, this.opts, {\n childTypes: this.$inline.data('inlineFormset').options.childTypes,\n formsetFkModel: this.$inline.djnData('formsetFkModel'),\n addButtonSelector: '.djn-add-handler.djn-model-' + inlineModelClassName,\n removeButtonSelector: '.djn-remove-handler.djn-model-' + inlineModelClassName,\n deleteButtonSelector: '.djn-delete-handler.djn-model-' + inlineModelClassName,\n formClass: 'dynamic-form grp-dynamic-form djn-dynamic-form-' + inlineModelClassName,\n formClassSelector: '.djn-dynamic-form-' + inlineModelClassName\n });\n\n DJNesting.initRelatedFields(this.prefix, this.$inline.djnData());\n DJNesting.initAutocompleteFields(this.prefix, this.$inline.djnData());\n\n if (this.opts.childTypes) {\n this._setupPolymorphic();\n }\n this._bindEvents();\n\n this._initializeForms();\n\n this.$inline.find('.djn-items:not([id*=\"-empty\"])').trigger('djnesting:init');\n\n // initialize nested formsets\n this.$inline.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n if (this.$inline.is('.djn-group-root')) {\n DJNesting.createSortable(this.$inline);\n }\n\n $(document).trigger('djnesting:initialized', [this.$inline, this]);\n }\n _setupPolymorphic() {\n if (!this.opts.childTypes) {\n throw Error('The polymorphic fieldset options.childTypes is not defined!');\n }\n let menu = '';\n const $addButton = this.$inline.find(this.opts.addButtonSelector);\n const $menu = $(menu);\n $addButton.after($menu);\n }\n\n _initializeForms() {\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n if (maxForms <= totalForms) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n for (var i = 0; i < totalForms; i++) {\n this._initializeForm('#' + this.prefix + '-' + i);\n }\n }\n _initializeForm(form) {\n var $form = $(form);\n var formPrefix = $form.djangoFormPrefix();\n $form.addClass(this.opts.formClass);\n if ($form.hasClass('has_original')) {\n $('#id_' + formPrefix + 'DELETE:checked').toggleClass(this.opts.predeleteClass);\n }\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n }\n _bindEvents($el) {\n var self = this;\n if (typeof $el == 'undefined') {\n $el = this.$inline;\n }\n const $addButton = $el.find(this.opts.addButtonSelector);\n $addButton.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const $menu = $(this).next('.polymorphic-type-menu');\n if (!$menu.length) {\n self.add();\n } else {\n if (!$menu.is(':visible')) {\n function hideMenu() {\n $menu.hide();\n $(document).off('click', hideMenu);\n }\n $(document).on('click', hideMenu);\n }\n $menu.show();\n }\n });\n const $menuButtons = $addButton.parent().find('> .polymorphic-type-menu a');\n $menuButtons.off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n const polymorphicType = $(this).attr('data-type');\n self.add(null, polymorphicType);\n const $menu = $(e.target).closest('.polymorphic-type-menu');\n if ($menu.is(':visible')) {\n $menu.hide();\n }\n });\n $el.find(this.opts.removeButtonSelector).filter(function() {\n return !$(this).closest('.djn-empty-form').length;\n }).off('click.djnesting').on('click.djnesting', function(e) {\n e.preventDefault();\n e.stopPropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n self.remove($form);\n });\n\n var deleteClickHandler = function(e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n var $form = $(this).closest(self.opts.formClassSelector);\n var $deleteInput = $('#id_' + $form.djangoFormPrefix() + 'DELETE');\n if (!$deleteInput.is(':checked')) {\n self['delete']($form);\n } else {\n self.undelete($form);\n }\n };\n\n var $deleteButton = $el.find(this.opts.deleteButtonSelector)\n .filter(function() { return !$(this).closest('.djn-empty-form').length; });\n\n $deleteButton.off('click.djnesting').on('click.djnesting', deleteClickHandler);\n $deleteButton.find('[id$=\"-DELETE\"]').on('mousedown.djnesting', deleteClickHandler);\n }\n remove(form) {\n var $form = $(form);\n var totalForms = this.mgmtVal('TOTAL_FORMS');\n var minForms = this.mgmtVal('MIN_NUM_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var index = $form.djangoFormIndex();\n var isInitial = $form.data('isInitial');\n\n // Clearing out the form HTML itself using DOM APIs is much faster\n // than using jQuery to remove the element. Using jQuery is so\n // slow that it hangs the page.\n $form[0].innerHTML = \"\";\n $form.remove();\n\n totalForms -= 1;\n this.mgmtVal('TOTAL_FORMS', totalForms);\n\n if (maxForms - totalForms >= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').show();\n }\n\n this._fillGap(index, isInitial);\n\n var self = this;\n var hideRemoveButton = (totalForms <= minForms);\n this.$inline.djangoFormsetForms().each(function() {\n var showHideMethod = (hideRemoveButton) ? 'hide' : 'show';\n $(this).find(self.opts.removeButtonSelector)[showHideMethod]();\n });\n\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:removed', [$form, this.prefix]);\n }\n delete(form) {\n var self = this,\n $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.hasClass(this.opts.predeleteClass)) {\n return;\n }\n\n if (!$form.data('isInitial')) {\n return;\n }\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n $form.addClass(this.opts.predeleteClass);\n\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).hasClass(self.opts.predeleteClass)) {\n $(this).data('alreadyDeleted', true);\n } else {\n childFormset.delete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.attr('checked', 'checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = true;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:deleted', [$form, this.prefix]);\n }\n undelete(form) {\n var $form = $(form),\n formPrefix = $form.djangoFormPrefix(),\n $deleteInput = $('#id_' + formPrefix + 'DELETE');\n\n if ($form.parent().closest('.' + this.opts.predeleteClass).length) {\n return;\n }\n if ($form.hasClass('has_original')) {\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n $form.removeClass(this.opts.predeleteClass);\n }\n $form.data('alreadyDeleted', false);\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n $childInline.djangoFormsetForms().each(function() {\n if ($(this).data('alreadyDeleted')) {\n $(this).data('alreadyDeleted', false);\n } else {\n childFormset.undelete(this);\n }\n });\n });\n $form.find('.cropduster-form').each(function() {\n var formPrefix = $(this).djangoFormsetPrefix() + '-0-';\n var $deleteInput = $('#id_' + formPrefix + 'DELETE');\n $deleteInput.removeAttr('checked');\n if ($deleteInput.length) {\n $deleteInput[0].checked = false;\n }\n });\n DJNesting.updatePositions(this.prefix);\n $(document).trigger('djnesting:mutate', [this.$inline]);\n $(document).trigger('formset:undeleted', [$form, this.prefix]);\n }\n add(spliceIndex, ctype) {\n var self = this;\n const $template = (ctype) ? $(`#${this.prefix}-empty-${ctype}`) : this._$template;\n var $form = $template.clone(true);\n\n // For django-grappelli >= 2.14, where the grp.jQuery instance is not\n // the same as django.jQuery, we must copy any prepopulated_field\n // dependency data from grp.jQuery to the cloned nodes.\n grp$($template).find(':data(dependency_ids)').each(function() {\n const id = $(this).attr('id');\n const $el = $form.find(`#${id}`);\n grp$($el).data($.extend({}, $el.data(), grp$(this).data()));\n });\n\n var index = this.mgmtVal('TOTAL_FORMS');\n var maxForms = this.mgmtVal('MAX_NUM_FORMS');\n var isNested = this.$inline.hasClass('djn-group-nested');\n\n $(document).trigger('djnesting:beforeadded', [this.$inline, $form]);\n\n $form.removeClass(this.opts.emptyClass);\n $form.addClass('djn-item');\n $form.attr('id', $form.attr('id').replace(/\\-empty.*?$/, '-' + index));\n\n if (isNested) {\n $form.append(DJNesting.createContainerElement());\n }\n\n DJNesting.updateFormAttributes($form,\n new RegExp('([#_]id_|[\\\\#]|^id_|\\\"|^)' + regexQuote(this.prefix) + '\\\\-(?:__prefix__|empty)\\\\-', 'g'),\n '$1' + this.prefix + '-' + index + '-');\n\n let $firstTemplate = this._$template;\n if (this.opts.childTypes) {\n $firstTemplate = $template.closest('.djn-group')\n .find('> .djn-items > [id*=\"-empty\"], > .djn-fieldset > .djn-items > [id*=\"-empty\"]').eq(0);\n }\n if (this.opts.childTypes) {\n const compatibleParents = this.$inline.djnData('compatibleParents') || {};\n $form.find('> .djn-group').each((i, el) => {\n const fkModel = $(el).djnData('formsetFkModel');\n const compatModels = compatibleParents[ctype] || [];\n const $el = $(el);\n const parentModel = $el.djnData('inlineParentModel');\n const isPolymorphic = !!($el.data('inlineFormset').options.childTypes);\n const formPrefix = $el.data('inlineFormset').options.prefix;\n if (parentModel !== ctype || (isPolymorphic && fkModel !== ctype && compatModels.indexOf(fkModel) === -1)) {\n $el.find('input[id$=\"_FORMS\"]').each((i, input) => {\n input.value = 0\n input.setAttribute('value', '0');\n el.parentNode.appendChild(input);\n });\n el.parentNode.removeChild(el);\n }\n });\n }\n\n $form.insertBefore($firstTemplate);\n\n this.mgmtVal('TOTAL_FORMS', index + 1);\n if ((maxForms - (index + 1)) <= 0) {\n this.$inline.find(this.opts.addButtonSelector).parents('.djn-add-item').hide();\n }\n\n DJNesting.updatePositions(this.prefix);\n\n if ($.isNumeric(spliceIndex)) {\n this.spliceInto($form, spliceIndex, true);\n } else {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n\n if (grappelli) {\n grappelli.reinitDateTimeFields(grp$($form));\n }\n DJNesting.DjangoInlines.initPrepopulatedFields($form);\n DJNesting.DjangoInlines.reinitDateTimeShortCuts();\n DJNesting.DjangoInlines.updateSelectFilter($form);\n DJNesting.initRelatedFields(this.prefix);\n DJNesting.initAutocompleteFields(this.prefix);\n if (grp && grp.jQuery.fn.grp_collapsible) {\n var addBackMethod = (grp.jQuery.fn.addBack) ? 'addBack' : 'andSelf';\n grp$($form).find(\n '.grp-collapse:not([id$=\"-empty\"]):not([id*=\"-empty-\"])'\n )[addBackMethod]().grp_collapsible({\n toggle_handler_slctr: '.grp-collapse-handler:first',\n closed_css: 'closed grp-closed',\n open_css: 'open grp-open',\n on_toggle: function() {\n $(document).trigger('djnesting:toggle', [self.$inline]);\n }\n });\n }\n if (typeof $.fn.curated_content_type == 'function') {\n $form.find('.curated-content-type-select').each(function() {\n $(this).curated_content_type();\n });\n }\n\n this._initializeForm($form);\n this._bindEvents($form);\n\n if (ctype) {\n const formsetModelClassName = this.$inline.djnData('inlineModel');\n const inlineModelClassName = $form.attr('data-inline-model');\n const $buttons = $form.find(`.djn-model-${formsetModelClassName}`);\n $buttons.addClass(`djn-model-${inlineModelClassName}`);\n $form.addClass(`djn-dynamic-form-${inlineModelClassName}`);\n }\n\n // find any nested formsets\n $form.find('.djn-group[id$=\"-group\"][id^=\"' + this.prefix + '\"][data-inline-formset]:not([id*=\"-empty\"])').each(function() {\n $(this)[pluginName]();\n });\n\n // Fire an event on the document so other javascript applications\n // can be alerted to the newly inserted inline\n $(document).trigger('djnesting:added', [this.$inline, $form]);\n\n // Also fire using the events that were added in Django 1.9\n $(document).trigger('formset:added', [$form, this.prefix]);\n\n return $form;\n }\n _fillGap(index, isInitial) {\n var $initialForm, $newForm;\n var formsets = this.$inline.djangoFormsetForms().toArray();\n // Sort formsets in index order, so that we get the last indexed form for the swap.\n formsets.sort(function(a, b) { return $(a).djangoFormIndex() - $(b).djangoFormIndex(); });\n formsets.forEach(function(form) {\n var $form = $(form);\n var i = $form.djangoFormIndex();\n if (i <= index) {\n return;\n }\n if ($form.data('isInitial')) {\n $initialForm = $form;\n } else {\n $newForm = $form;\n }\n });\n var $form = (isInitial) ? $initialForm || $newForm : $newForm;\n if (!$form) {\n return;\n }\n var oldIndex = $form.djangoFormIndex();\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix + '-' + oldIndex) + '(?!\\\\-\\\\d)');\n $form.attr('id', this.prefix + '-' + index);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + this.prefix + '-' + index);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial && $initialForm && $newForm) {\n this._fillGap(oldIndex, false);\n }\n }\n _makeRoomForInsert() {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n gapIndex = initialFormCount,\n $existingForm = $('#' + this.prefix + '-' + gapIndex);\n\n if (!$existingForm.length) {\n return;\n }\n\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)'\n + regexQuote(this.prefix) + '-' + gapIndex + '(?!\\\\-\\\\d)');\n $existingForm.attr('id', this.prefix + '-' + totalFormCount);\n DJNesting.updateFormAttributes($existingForm, oldFormPrefixRegex, '$1' + this.prefix + '-' + totalFormCount);\n\n // Update prefixes on nested DjangoFormset objects\n $existingForm.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $existingForm]);\n }\n /**\n * Splice a form into the current formset at new position `index`.\n */\n spliceInto($form, index, isNewAddition) {\n var initialFormCount = this.mgmtVal('INITIAL_FORMS'),\n totalFormCount = this.mgmtVal('TOTAL_FORMS'),\n oldFormsetPrefix = $form.djangoFormsetPrefix(),\n newFormsetPrefix = this.prefix,\n isInitial = $form.data('isInitial'),\n newIndex, $before;\n\n // Make sure the form being spliced is from a different inline\n if ($form.djangoFormsetPrefix() == this.prefix) {\n var currentPosition = $form.prevAll('.djn-item:not(.djn-no-drag,.djn-thead)').length;\n if (currentPosition === index || typeof index == 'undefined') {\n DJNesting.updatePositions(newFormsetPrefix);\n return;\n }\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item:not(#' + $form.attr('id') + ')').eq(index);\n $before.after($form);\n } else {\n var $oldInline = $('#' + oldFormsetPrefix + '-group');\n var $currentFormInline = $form.closest('.djn-group');\n\n if ($currentFormInline.djangoFormsetPrefix() != newFormsetPrefix) {\n $before = this.$inline.find('> .djn-items, > .tabular > .module > .djn-items').find('> .djn-item').eq(index);\n $before.after($form);\n }\n\n var oldDjangoFormset = $oldInline.djangoFormset();\n oldDjangoFormset.mgmtVal('TOTAL_FORMS', oldDjangoFormset.mgmtVal('TOTAL_FORMS') - 1);\n oldDjangoFormset._fillGap($form.djangoFormIndex(), isInitial);\n\n if (isInitial) {\n oldDjangoFormset.mgmtVal('INITIAL_FORMS', oldDjangoFormset.mgmtVal('INITIAL_FORMS') - 1);\n\n var $parentInline = this.$inline.parent().closest('.djn-group');\n if ($parentInline.length) {\n var $parentForm = this.$inline.closest('.djn-inline-form');\n var parentPkField = ($parentInline.djnData('fieldNames') || {}).pk;\n var $parentPk = $parentForm.djangoFormField(parentPkField);\n if (!$parentPk.val()) {\n $form.data('isInitial', false);\n $form.attr('data-is-initial', 'false');\n isInitial = false;\n // Set initial form counts to 0 on nested DjangoFormsets\n setTimeout(function() {\n $form.find('[name^=\"' + $form.djangoFormPrefix() + '\"][name$=\"-INITIAL_FORMS\"]')\n .val('0').trigger('change');\n }, 0);\n }\n }\n }\n\n if (isInitial) {\n this._makeRoomForInsert();\n }\n\n // Replace the ids for the splice form\n var oldFormPrefixRegex = new RegExp('([\\\\#_]|^)' + regexQuote($form.attr('id')) + '(?!\\\\-\\\\d)');\n newIndex = (isInitial) ? initialFormCount : totalFormCount;\n $form.attr('id', newFormsetPrefix + '-' + newIndex);\n DJNesting.updateFormAttributes($form, oldFormPrefixRegex, '$1' + newFormsetPrefix + '-' + newIndex);\n\n // Update prefixes on nested DjangoFormset objects\n $form.find('.djn-group').each(function() {\n var $childInline = $(this);\n var childFormset = $childInline.djangoFormset();\n childFormset.prefix = $childInline.djangoFormsetPrefix();\n });\n\n $(document).trigger('djnesting:attrchange', [this.$inline, $form]);\n\n if (isInitial) {\n this.mgmtVal('INITIAL_FORMS', initialFormCount + 1);\n }\n this.mgmtVal('TOTAL_FORMS', totalFormCount + 1);\n\n DJNesting.updatePositions(oldFormsetPrefix);\n $(document).trigger('djnesting:mutate', [$oldInline]);\n }\n\n DJNesting.updatePositions(newFormsetPrefix);\n if (!isNewAddition) {\n $(document).trigger('djnesting:mutate', [this.$inline]);\n }\n }\n mgmtVal(name, newValue) {\n var $field = this.$inline.find('#id_' + this.prefix + '-' + name);\n if (typeof newValue == 'undefined') {\n return parseInt($field.val(), 10);\n } else {\n return parseInt($field.val(newValue).trigger('change').val(), 10);\n }\n }\n}\n\n$.fn[pluginName] = function() {\n var options, fn, args;\n var $el = this.eq(0);\n\n if (arguments.length === 0 || (arguments.length === 1 && $.type(arguments[0]) != 'string')) {\n options = arguments[0];\n var djangoFormset = $el.data(pluginName);\n if (!djangoFormset) {\n djangoFormset = new DjangoFormset($el, options);\n $el.data(pluginName, djangoFormset);\n }\n return djangoFormset;\n }\n\n fn = arguments[0];\n args = $.makeArray(arguments).slice(1);\n\n if (fn in DjangoFormset.prototype) {\n return $el.data(pluginName)[fn](args);\n } else {\n throw new Error('Unknown function call ' + fn + ' for $.fn.' + pluginName);\n }\n};\n\nmodule.exports = DjangoFormset;\n","'use strict';\n\nconst $ = require('jquery');\n/*!\n * jQuery UI Sortable @VERSION\n * http://jqueryui.com\n *\n * Copyright 2012 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/sortable/\n *\n * Depends:\n *\tjquery.ui.core.js\n *\tjquery.ui.mouse.js\n *\tjquery.ui.widget.js\n */\nif ($.ui === undefined) {\n var jQuery = $;\n (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return\"area\"===o?(s=t.parentNode,n=s.name,t.href&&n&&\"map\"===s.nodeName.toLowerCase()?(r=e(\"img[usemap=#\"+n+\"]\")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:\"a\"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return\"hidden\"===e.css(this,\"visibility\")}).length}var s=0,n=/^ui-id-\\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:\"1.10.3\",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return\"number\"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css(\"position\"))||/absolute/.test(this.css(\"position\"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,\"position\"))&&/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,\"overflow\")+e.css(this,\"overflow-y\")+e.css(this,\"overflow-x\"))}).eq(0),/fixed/.test(this.css(\"position\"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css(\"zIndex\",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css(\"position\"),(\"absolute\"===a||\"relative\"===a||\"fixed\"===a)&&(s=parseInt(n.css(\"zIndex\"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id=\"ui-id-\"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr(\"id\")})}}),e.extend(e.expr[\":\"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,\"tabindex\")))},tabbable:function(t){var a=e.attr(t,\"tabindex\"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e(\"\").outerWidth(1).jquery||e.each([\"Width\",\"Height\"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,\"padding\"+this))||0,a&&(i-=parseFloat(e.css(t,\"border\"+this+\"Width\"))||0),s&&(i-=parseFloat(e.css(t,\"margin\"+this))||0)}),i}var n=\"Width\"===a?[\"Left\",\"Right\"]:[\"Top\",\"Bottom\"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn[\"inner\"+a]=function(i){return i===t?o[\"inner\"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+\"px\")})},e.fn[\"outer\"+a]=function(t,i){return\"number\"!=typeof t?o[\"outer\"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+\"px\")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e(\"\").data(\"a-b\",\"a\").removeData(\"a-b\").data(\"a-b\")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart=\"onselectstart\"in document.createElement(\"div\"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?\"selectstart\":\"mousedown\")+\".ui-disableSelection\",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(\".ui-disableSelection\")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if(\"hidden\"===e(t).css(\"overflow\"))return!1;var a=i&&\"left\"===i?\"scrollLeft\":\"scrollTop\",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler(\"remove\")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(\".\")[0];i=i.split(\".\")[1],n=u+\"-\"+i,a||(a=s,s=e.Widget),e.expr[\":\"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+\".\"+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o=\"string\"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&\"_\"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error(\"no such method '\"+r+\"' for \"+i+\" widget instance\"):e.error(\"cannot call methods on \"+i+\" prior to initialization; \"+\"attempted to call method '\"+r+\"'\")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
\",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(\"create\",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(\"aria-disabled\").removeClass(this.widgetFullName+\"-disabled \"+\"ui-state-disabled\"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof i)if(o={},a=i.split(\".\"),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,\"disabled\"===e&&(this.widget().toggleClass(this.widgetFullName+\"-disabled ui-state-disabled\",!!t).attr(\"aria-disabled\",t),this.hoverable.removeClass(\"ui-state-hover\"),this.focusable.removeClass(\"ui-state-focus\")),this},enable:function(){return this._setOption(\"disabled\",!1)},disable:function(){return this._setOption(\"disabled\",!0)},_on:function(i,s,a){var n,r=this;\"boolean\"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof o?r[o]:o).apply(r,arguments):t}\"string\"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\\w+)\\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||\"\").split(\" \").join(this.eventNamespace+\" \")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return(\"string\"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass(\"ui-state-hover\")},mouseleave:function(t){e(t.currentTarget).removeClass(\"ui-state-hover\")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass(\"ui-state-focus\")},focusout:function(t){e(t.currentTarget).removeClass(\"ui-state-focus\")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:\"fadeIn\",hide:\"fadeOut\"},function(t,i){e.Widget.prototype[\"_\"+t]=function(s,a,n){\"string\"==typeof a&&(a={effect:a});var r,o=a?a===!0||\"number\"==typeof a?i:a.effect||i:t;a=a||{},\"number\"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget(\"ui.mouse\",{version:\"1.10.3\",options:{cancel:\"input,textarea,button,select,option\",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind(\"mousedown.\"+this.widgetName,function(e){return t._mouseDown(e)}).bind(\"click.\"+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+\".preventClickEvent\")?(e.removeData(i.target,t.widgetName+\".preventClickEvent\"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind(\".\"+this.widgetName),this._mouseMoveDelegate&&e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n=\"string\"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+\".preventClickEvent\")&&e.removeData(i.target,this.widgetName+\".preventClickEvent\"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).bind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind(\"mousemove.\"+this.widgetName,this._mouseMoveDelegate).unbind(\"mouseup.\"+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+\".preventClickEvent\",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function s(t,i){return parseInt(e.css(t,i),10)||0}function a(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,o=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\\+\\-]\\d+(\\.[\\d]+)?%?/,d=/^\\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var i,s,a=e(\"
\"),r=a.children()[0];return e(\"body\").append(a),i=r.offsetWidth,a.css(\"overflow\",\"scroll\"),s=r.offsetWidth,i===s&&(s=a[0].clientWidth),a.remove(),n=i-s},getScrollInfo:function(t){var i=t.isWindow?\"\":t.element.css(\"overflow-x\"),s=t.isWindow?\"\":t.element.css(\"overflow-y\"),a=\"scroll\"===i||\"auto\"===i&&t.widths?\"left\":i>0?\"right\":\"center\",vertical:0>n?\"top\":a>0?\"bottom\":\"middle\"};c>p&&p>o(i+s)&&(h.horizontal=\"center\"),d>m&&m>o(a+n)&&(h.vertical=\"middle\"),h.important=r(o(i),o(s))>r(o(a),o(n))?\"horizontal\":\"vertical\",t.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,o=e.left-t.collisionPosition.marginLeft,h=a-o,l=o+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=r(e.left-o,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,o=e.top-t.collisionPosition.marginTop,h=a-o,l=o+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,r=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-r-h,d=\"left\"===t.my[0]?-t.elemWidth:\"right\"===t.my[0]?t.elemWidth:0,p=\"left\"===t.at[0]?t.targetWidth:\"right\"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-r-n,(0>i||o(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>o(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,r=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-r-h,d=\"top\"===t.my[1],p=d?-t.elemHeight:\"bottom\"===t.my[1]?t.elemHeight:0,f=\"top\"===t.at[1]?t.targetHeight:\"bottom\"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-r-n,e.top+p+f+m>u&&(0>s||o(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>c&&(i>0||c>o(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,n,r=document.getElementsByTagName(\"body\")[0],o=document.createElement(\"div\");t=document.createElement(r?\"div\":\"body\"),s={visibility:\"hidden\",width:0,height:0,border:0,margin:0,background:\"none\"},r&&e.extend(s,{position:\"absolute\",left:\"-1000px\",top:\"-1000px\"});for(n in s)t.style[n]=s[n];t.appendChild(o),i=r||document.documentElement,i.insertBefore(t,i.firstChild),o.style.cssText=\"position: absolute; left: 10.7432222px;\",a=e(o).offset().left,e.support.offsetFractions=a>10&&11>a,t.innerHTML=\"\",i.removeChild(t)}()})(jQuery);\n}\n\n$.widget(\"ui.djnsortable\", $.ui.mouse, {\n\tversion: \"@VERSION\",\n\twidgetEventPrefix: \"sort\",\n\tready: false,\n\toptions: {\n\t\tappendTo: \"parent\",\n\t\taxis: false,\n\t\tconnectWith: false,\n\t\tcontainment: false,\n\t\tcursor: 'auto',\n\t\tcursorAt: false,\n\t\tdropOnEmpty: true,\n\t\tforcePlaceholderSize: false,\n\t\tforceHelperSize: false,\n\t\tgrid: false,\n\t\thandle: false,\n\t\thelper: \"original\",\n\t\titems: '> *',\n\t\topacity: false,\n\t\tplaceholder: false,\n\t\trevert: false,\n\t\tscroll: true,\n\t\tscrollSensitivity: 20,\n\t\tscrollSpeed: 20,\n\t\tscope: \"default\",\n\t\ttolerance: \"intersect\",\n\t\tzIndex: 1000\n\t},\n\n\t_isOverAxis: function( x, reference, size ) {\n\t\treturn ( x >= reference ) && ( x < ( reference + size ) );\n\t},\n\n\t_create: function() {\n\n\t\tvar o = this.options;\n\t\tthis.containerCache = {};\n\t\tthis.element.addClass(\"ui-sortable\");\n\n\t\t//Get the items\n\t\tthis.refresh();\n\n\t\t//Let's determine if the items are being displayed horizontally\n\t\tthis.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;\n\n\t\t//Let's determine the parent's offset\n\t\tthis.offset = this.element.offset();\n\n\t\t//Initialize mouse events for interaction\n\t\tthis._mouseInit();\n\n\t\t//We're ready to go\n\t\tthis.ready = true\n\n\t},\n\n\t_destroy: function() {\n\t\tthis.element\n\t\t\t.removeClass(\"ui-sortable ui-sortable-disabled\");\n\t\tthis._mouseDestroy();\n\n\t\tfor ( var i = this.items.length - 1; i >= 0; i-- )\n\t\t\tthis.items[i].item.removeData(this.widgetName + \"-item\");\n\n\t\treturn this;\n\t},\n\n\t_setOption: function(key, value){\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis.options[ key ] = value;\n\n\t\t\tthis.widget().toggleClass( \"ui-sortable-disabled\", !!value );\n\t\t} else {\n\t\t\t// Don't call widget base _setOption for disable as it adds ui-state-disabled class\n\t\t\t$.Widget.prototype._setOption.apply(this, arguments);\n\t\t}\n\t},\n\n\t_mouseCapture: function(event, overrideHandle) {\n\t\tvar that = this;\n\n\t\tif (this.reverting) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(this.options.disabled || this.options.type == 'static') return false;\n\n\t\t//We have to refresh the items data once first\n\t\tthis._refreshItems(event);\n\n\t\t//Find out if the clicked node (or one of its parents) is a actual item in this.items\n\t\tvar currentItem = null, nodes = $(event.target).parents().each(function() {\n\t\t\tif($.data(this, that.widgetName + '-item') == that) {\n\t\t\t\tcurrentItem = $(this);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);\n\n\t\tif(!currentItem) return false;\n\t\tif(this.options.handle && !overrideHandle) {\n\t\t\tvar validHandle = false;\n\t\t\tvar addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf';\n\n\t\t\t$(this.options.handle, currentItem).find(\"*\")[addBackMethod]().each(function() { if(this == event.target) validHandle = true; });\n\t\t\tif(!validHandle) return false;\n\t\t}\n\n\t\tthis.currentItem = currentItem;\n\t\tthis._removeCurrentsFromItems();\n\t\treturn true;\n\n\t},\n\n\t_mouseStart: function(event, overrideHandle, noActivation) {\n\n\t\tvar o = this.options;\n\t\tthis.currentContainer = this;\n\n\t\t//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture\n\t\tthis.refreshPositions();\n\n\t\t//Create and append the visible helper\n\t\tthis.helper = this._createHelper(event);\n\n\t\t//Cache the helper size\n\t\tthis._cacheHelperProportions();\n\n\t\t/*\n\t\t * - Position generation -\n\t\t * This block generates everything position related - it's the core of draggables.\n\t\t */\n\n\t\t//Cache the margins of the original element\n\t\tthis._cacheMargins();\n\n\t\t//Get the next scrolling parent\n\t\tthis.scrollParent = this.helper.scrollParent();\n\n\t\t//The element's absolute position on the page minus margins\n\t\tthis.offset = this.currentItem.offset();\n\t\tthis.offset = {\n\t\t\ttop: this.offset.top - this.margins.top,\n\t\t\tleft: this.offset.left - this.margins.left\n\t\t};\n\n\t\t$.extend(this.offset, {\n\t\t\tclick: { //Where the click happened, relative to the element\n\t\t\t\tleft: event.pageX - this.offset.left,\n\t\t\t\ttop: event.pageY - this.offset.top\n\t\t\t},\n\t\t\tparent: this._getParentOffset(),\n\t\t\trelative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper\n\t\t});\n\n\t\t// Only after we got the offset, we can change the helper's position to absolute\n\t\t// TODO: Still need to figure out a way to make relative sorting possible\n\t\tthis.helper.css(\"position\", \"absolute\");\n\t\tthis.cssPosition = this.helper.css(\"position\");\n\n\t\t//Generate the original position\n\t\tthis.originalPosition = this._generatePosition(event);\n\t\tthis.originalPageX = event.pageX;\n\t\tthis.originalPageY = event.pageY;\n\n\t\t//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied\n\t\t(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));\n\n\t\t//Cache the former DOM position\n\t\tthis.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };\n\n\t\t//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way\n\t\tif(this.helper[0] != this.currentItem[0]) {\n\t\t\tthis.currentItem.hide();\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthis._createPlaceholder();\n\n\t\t//Set a containment if given in the options\n\t\tif(o.containment)\n\t\t\tthis._setContainment();\n\n\t\tif(o.cursor) { // cursor option\n\t\t\tif ($('body').css(\"cursor\")) this._storedCursor = $('body').css(\"cursor\");\n\t\t\t$('body').css(\"cursor\", o.cursor);\n\t\t}\n\n\t\tif(o.opacity) { // opacity option\n\t\t\tif (this.helper.css(\"opacity\")) this._storedOpacity = this.helper.css(\"opacity\");\n\t\t\tthis.helper.css(\"opacity\", o.opacity);\n\t\t}\n\n\t\tif(o.zIndex) { // zIndex option\n\t\t\tif (this.helper.css(\"zIndex\")) this._storedZIndex = this.helper.css(\"zIndex\");\n\t\t\tthis.helper.css(\"zIndex\", o.zIndex);\n\t\t}\n\n\t\t//Prepare scrolling\n\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')\n\t\t\tthis.overflowOffset = this.scrollParent.offset();\n\n\t\t//Call callbacks\n\t\tthis._trigger(\"start\", event, this._uiHash());\n\n\t\t//Recache the helper size\n\t\tif(!this._preserveHelperProportions)\n\t\t\tthis._cacheHelperProportions();\n\n\n\t\t//Post 'activate' events to possible containers\n\t\tif(!noActivation) {\n\t\t\t for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger(\"activate\", event, this._uiHash(this)); }\n\t\t}\n\n\t\t//Prepare possible droppables\n\t\tif($.ui.ddmanager)\n\t\t\t$.ui.ddmanager.current = this;\n\n\t\tif ($.ui.ddmanager && !o.dropBehaviour)\n\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\n\t\tthis.dragging = true;\n\n\t\tthis.helper.addClass(\"ui-sortable-helper\");\n\t\tthis._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position\n\t\treturn true;\n\n\t},\n\n\t_mouseDrag: function(event) {\n\n\t\t//Compute the helpers position\n\t\tthis.position = this._generatePosition(event);\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\tif (!this.lastPositionAbs) {\n\t\t\tthis.lastPositionAbs = this.positionAbs;\n\t\t}\n\n\t\t//Do scrolling\n\t\tif(this.options.scroll) {\n\t\t\tvar o = this.options, scrolled = false;\n\t\t\tif(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {\n\n\t\t\t\tif((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n\t\t\t\telse if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n\n\t\t\t\tif((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n\t\t\t\telse if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)\n\t\t\t\t\tthis.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n\n\t\t\t} else {\n\n\t\t\t\tif(event.pageY - $(document).scrollTop() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);\n\t\t\t\telse if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);\n\n\t\t\t\tif(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);\n\t\t\t\telse if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)\n\t\t\t\t\tscrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);\n\n\t\t\t}\n\n\t\t\tif(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)\n\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\n\t\t}\n\n\t\t//Regenerate the absolute position used for position checks\n\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\n\n\t\t//Set the helper position\n\t\tif(!this.options.axis || this.options.axis != \"y\") this.helper[0].style.left = this.position.left+'px';\n\t\tif(!this.options.axis || this.options.axis != \"x\") this.helper[0].style.top = this.position.top+'px';\n\n\t\t//Rearrange\n\t\tfor (var i = this.items.length - 1; i >= 0; i--) {\n\n\t\t\t//Cache variables and intersection, continue if no intersection\n\t\t\tvar item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);\n\t\t\tif (!intersection) continue;\n\n\t\t\t// Only put the placeholder inside the current Container, skip all\n\t\t\t// items form other containers. This works because when moving\n\t\t\t// an item from one container to another the\n\t\t\t// currentContainer is switched before the placeholder is moved.\n\t\t\t//\n\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n\t\t\t// beetween the outer and inner container.\n\t\t\tif (item.instance !== this.currentContainer) continue;\n\n\t\t\tif (itemElement != this.currentItem[0] //cannot intersect with itself\n\t\t\t\t&&\tthis.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n\t\t\t\t&&\t!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n\t\t\t\t&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n\t\t\t\t//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container\n\t\t\t) {\n\n\t\t\t\tthis.direction = intersection == 1 ? \"down\" : \"up\";\n\n\t\t\t\tif (this.options.tolerance == \"pointer\" || this._intersectsWithSides(item)) {\n\t\t\t\t\tthis._rearrange(event, item);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Post events to containers\n\t\tthis._contactContainers(event);\n\n\t\t//Interconnect with droppables\n\t\tif($.ui.ddmanager) $.ui.ddmanager.drag(this, event);\n\n\t\t//Call callbacks\n\t\tthis._trigger('sort', event, this._uiHash());\n\n\t\tthis.lastPositionAbs = this.positionAbs;\n\t\treturn false;\n\n\t},\n\n\t_mouseStop: function(event, noPropagation) {\n\n\t\tif(!event) return;\n\n\t\t//If we are using droppables, inform the manager about the drop\n\t\tif ($.ui.ddmanager && !this.options.dropBehaviour)\n\t\t\t$.ui.ddmanager.drop(this, event);\n\n\t\tif(this.options.revert) {\n\t\t\tvar that = this;\n\t\t\tvar cur = this.placeholder.offset();\n\n\t\t\tthis.reverting = true;\n\n\t\t\t$(this.helper).animate({\n\t\t\t\tleft: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),\n\t\t\t\ttop: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)\n\t\t\t}, parseInt(this.options.revert, 10) || 500, function() {\n\t\t\t\tthat._clear(event);\n\t\t\t});\n\t\t} else {\n\t\t\tthis._clear(event, noPropagation);\n\t\t}\n\n\t\treturn false;\n\n\t},\n\n\tcancel: function() {\n\n\t\tif(this.dragging) {\n\n\t\t\tthis._mouseUp({ target: null });\n\n\t\t\tif(this.options.helper == \"original\")\n\t\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t\telse\n\t\t\t\tthis.currentItem.show();\n\n\t\t\t//Post deactivating events to containers\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tthis.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.placeholder) {\n\t\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\t\tif(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\t\t\tif(this.options.helper != \"original\" && this.helper && this.helper[0].parentNode) this.helper.remove();\n\n\t\t\t$.extend(this, {\n\t\t\t\thelper: null,\n\t\t\t\tdragging: false,\n\t\t\t\treverting: false,\n\t\t\t\t_noFinalSort: null\n\t\t\t});\n\n\t\t\tif(this.domPosition.prev) {\n\t\t\t\t$(this.domPosition.prev).after(this.currentItem);\n\t\t\t} else {\n\t\t\t\t$(this.domPosition.parent).prepend(this.currentItem);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tserialize: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar str = []; o = o || {};\n\n\t\t$(items).each(function() {\n\t\t\tvar res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));\n\t\t\tif(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));\n\t\t});\n\n\t\tif(!str.length && o.key) {\n\t\t\tstr.push(o.key + '=');\n\t\t}\n\n\t\treturn str.join('&');\n\n\t},\n\n\ttoArray: function(o) {\n\n\t\tvar items = this._getItemsAsjQuery(o && o.connected);\n\t\tvar ret = []; o = o || {};\n\n\t\titems.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });\n\t\treturn ret;\n\n\t},\n\n\t/* Be careful with the following core functions */\n\t_intersectsWith: function(item) {\n\n\t\tvar x1 = this.positionAbs.left,\n\t\t\tx2 = x1 + this.helperProportions.width,\n\t\t\ty1 = this.positionAbs.top,\n\t\t\ty2 = y1 + this.helperProportions.height;\n\n\t\tvar l = item.left,\n\t\t\tr = l + item.width,\n\t\t\tt = item.top,\n\t\t\tb = t + Math.max(10, item.height);\n\n\t\tvar dyClick = this.offset.click.top,\n\t\t\tdxClick = this.offset.click.left;\n\n\t\tvar isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;\n\n\t\tif(\t this.options.tolerance == \"pointer\"\n\t\t\t|| this.options.forcePointerForContainers\n\t\t\t|| (this.options.tolerance != \"pointer\" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])\n\t\t) {\n\t\t\treturn isOverElement;\n\t\t} else {\n\n\t\t\treturn (l < x1 + (this.helperProportions.width / 2) // Right Half\n\t\t\t\t&& x2 - (this.helperProportions.width / 2) < r // Left Half\n\t\t\t\t&& t < y1 + (this.helperProportions.height / 2) // Bottom Half\n\t\t\t\t&& y2 - (this.helperProportions.height / 2) < b ); // Top Half\n\n\t\t}\n\t},\n\n\t_intersectsWithPointer: function(item) {\n\n\t\tvar isOverElementHeight = (this.options.axis === 'x') || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, Math.max(10, item.height)),\n\t\t\tisOverElementWidth = (this.options.axis === 'y') || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n\t\t\tisOverElement = isOverElementHeight && isOverElementWidth,\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (!isOverElement)\n\t\t\treturn false;\n\n\t\treturn this.floating ?\n\t\t\t( ((horizontalDirection && horizontalDirection == \"right\") || verticalDirection == \"down\") ? 2 : 1 )\n\t\t\t: ( verticalDirection && (verticalDirection == \"down\" ? 2 : 1) );\n\n\t},\n\n\t_intersectsWithSides: function(item) {\n\n\t\tvar isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (Math.max(10, item.height)/2), Math.max(10, item.height)),\n\t\t\tisOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),\n\t\t\tverticalDirection = this._getDragVerticalDirection(),\n\t\t\thorizontalDirection = this._getDragHorizontalDirection();\n\n\t\tif (this.floating && horizontalDirection) {\n\t\t\treturn ((horizontalDirection == \"right\" && isOverRightHalf) || (horizontalDirection == \"left\" && !isOverRightHalf));\n\t\t} else {\n\t\t\treturn verticalDirection && ((verticalDirection == \"down\" && isOverBottomHalf) || (verticalDirection == \"up\" && !isOverBottomHalf));\n\t\t}\n\n\t},\n\n\t_getDragVerticalDirection: function() {\n\t\tvar delta = this.positionAbs.top - this.lastPositionAbs.top;\n\t\treturn delta != 0 && (delta > 0 ? \"down\" : \"up\");\n\t},\n\n\t_getDragHorizontalDirection: function() {\n\t\tvar delta = this.positionAbs.left - this.lastPositionAbs.left;\n\t\treturn delta != 0 && (delta > 0 ? \"right\" : \"left\");\n\t},\n\n\trefresh: function(event) {\n\t\tthis._refreshItems(event);\n\t\tthis.refreshPositions();\n\t\treturn this;\n\t},\n\n\t_connectWith: function() {\n\t\tvar options = this.options;\n\t\treturn options.connectWith.constructor == String\n\t\t\t? [options.connectWith]\n\t\t\t: options.connectWith;\n\t},\n\n\t_getItemsAsjQuery: function(connected) {\n\n\t\tvar items = [];\n\t\tvar queries = [];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && connected) {\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), inst]);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tqueries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not('.ui-sortable-placeholder'), this]);\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--){\n\t\t\tqueries[i][0].each(function() {\n\t\t\t\titems.push(this);\n\t\t\t});\n\t\t};\n\n\t\treturn $(items);\n\n\t},\n\n\t_removeCurrentsFromItems: function() {\n\n\t\tvar list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n\n\t\tthis.items = $.grep(this.items, function (item) {\n\t\t\tfor (var j=0; j < list.length; j++) {\n\t\t\t\tif(list[j] == item.item[0])\n\t\t\t\t\treturn false;\n\t\t\t};\n\t\t\treturn true;\n\t\t});\n\n\t},\n\n\t_refreshItems: function(event) {\n\n\t\tthis.items = [];\n\t\tthis.containers = [this];\n\t\tvar items = this.items;\n\t\tvar queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];\n\t\tvar connectWith = this._connectWith();\n\n\t\tif(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down\n\t\t\tfor (var i = connectWith.length - 1; i >= 0; i--){\n\t\t\t\tvar cur = $(connectWith[i]);\n\t\t\t\tfor (var j = cur.length - 1; j >= 0; j--){\n\t\t\t\t\tvar inst = $.data(cur[j], this.widgetName);\n\t\t\t\t\tif(inst && inst != this && !inst.options.disabled) {\n\t\t\t\t\t\tqueries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);\n\t\t\t\t\t\tthis.containers.push(inst);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\tfor (var i = queries.length - 1; i >= 0; i--) {\n\t\t\tvar targetData = queries[i][1];\n\t\t\tvar _queries = queries[i][0];\n\n\t\t\tfor (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {\n\t\t\t\tvar item = $(_queries[j]);\n\n\t\t\t\titem.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)\n\n\t\t\t\titems.push({\n\t\t\t\t\titem: item,\n\t\t\t\t\tinstance: targetData,\n\t\t\t\t\twidth: 0, height: 0,\n\t\t\t\t\tleft: 0, top: 0\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t},\n\n\trefreshPositions: function(fast) {\n\n\t\t//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change\n\t\tif(this.offsetParent && this.helper) {\n\t\t\tthis.offset.parent = this._getParentOffset();\n\t\t}\n\n\t\tfor (var i = this.items.length - 1; i >= 0; i--){\n\t\t\tvar item = this.items[i];\n\n\t\t\t//We ignore calculating positions of all connected containers when we're not over them\n\t\t\tif(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])\n\t\t\t\tcontinue;\n\n\t\t\tvar t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n\t\t\tif (!fast) {\n\t\t\t\titem.width = t.outerWidth();\n\t\t\t\titem.height = t.outerHeight();\n\t\t\t}\n\n\t\t\tvar p = t.offset();\n\t\t\titem.left = p.left;\n\t\t\titem.top = p.top;\n\t\t};\n\n\t\tif(this.options.custom && this.options.custom.refreshContainers) {\n\t\t\tthis.options.custom.refreshContainers.call(this);\n\t\t} else {\n\t\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\t\tvar p = this.containers[i].element.offset();\n\t\t\t\tthis.containers[i].containerCache.left = p.left;\n\t\t\t\tthis.containers[i].containerCache.top = p.top;\n\t\t\t\tthis.containers[i].containerCache.width\t= this.containers[i].element.outerWidth();\n\t\t\t\tthis.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n\t\t\t};\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_createPlaceholder: function(that) {\n\t\tthat = that || this;\n\t\tvar o = that.options;\n\n\t\tif(!o.placeholder || o.placeholder.constructor == String) {\n\t\t\tvar className = o.placeholder;\n\t\t\to.placeholder = {\n\t\t\t\telement: function() {\n\n\t\t\t\t\tvar el = $(document.createElement(that.currentItem[0].nodeName))\n\t\t\t\t\t\t.addClass(className || that.currentItem[0].className+\" ui-sortable-placeholder\")\n\t\t\t\t\t\t.removeClass(\"ui-sortable-helper\")[0];\n\n\t\t\t\t\tif(!className)\n\t\t\t\t\t\tel.style.visibility = \"hidden\";\n\n\t\t\t\t\treturn el;\n\t\t\t\t},\n\t\t\t\tupdate: function(container, p) {\n\n\t\t\t\t\t// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that\n\t\t\t\t\t// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified\n\t\t\t\t\tif(className && !o.forcePlaceholderSize) return;\n\n\t\t\t\t\t//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item\n\t\t\t\t\tif(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };\n\t\t\t\t\tif(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t//Create the placeholder\n\t\tthat.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));\n\n\t\t//Append it after the actual current item\n\t\tthat.currentItem.after(that.placeholder);\n\n\t\t//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\t\to.placeholder.update(that, that.placeholder);\n\n\t},\n\n\t_contactContainers: function(event) {\n\n\t\t// get innermost container that intersects with item\n\t\tvar innermostContainer = null, innermostIndex = null;\n\n\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\n\t\t\t// never consider a container that's located within the item itself\n\t\t\tif($.contains(this.currentItem[0], this.containers[i].element[0]))\n\t\t\t\tcontinue;\n\n\t\t\tif(this._intersectsWith(this.containers[i].containerCache)) {\n\n\t\t\t\t// if we've already found a container and it's more \"inner\" than this, then continue\n\t\t\t\tif(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tinnermostContainer = this.containers[i];\n\t\t\t\tinnermostIndex = i;\n\n\t\t\t} else {\n\t\t\t\t// container doesn't intersect. trigger \"out\" event if necessary\n\t\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\t\tthis.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\t\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// if no intersecting containers found, return\n\t\tif(!innermostContainer) return;\n\n\t\t// move the item into the container if it's not there already\n\t\tif(this.containers.length === 1) {\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t} else {\n\n\t\t\t//When entering a new container, we will find the item with the least distance and append our item near it\n\t\t\tvar dist = 10000; var itemWithLeastDistance = null;\n\t\t\tvar posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';\n\t\t\tvar sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';\n\t\t\tvar base = this.positionAbs[posProperty] + this.offset.click[posProperty];\n\t\t\tfor (var j = this.items.length - 1; j >= 0; j--) {\n\t\t\t\tif(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;\n\t\t\t\tif(this.items[j].item[0] == this.currentItem[0]) continue;\n\t\t\t\tvar cur = this.items[j].item.offset()[posProperty];\n\t\t\t\tvar nearBottom = false;\n\t\t\t\tif(Math.abs(cur - base) > Math.abs(cur + Math.max(10, this.items[j][sizeProperty]) - base)){\n\t\t\t\t\tnearBottom = true;\n\t\t\t\t\tcur += this.items[j][sizeProperty];\n\t\t\t\t}\n\n\t\t\t\tif(Math.abs(cur - base) < dist) {\n\t\t\t\t\tdist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];\n\t\t\t\t\tthis.direction = nearBottom ? \"up\": \"down\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled\n\t\t\t\treturn;\n\n\t\t\tthis.currentContainer = this.containers[innermostIndex];\n\t\t\titemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\t\t\tthis._trigger(\"change\", event, this._uiHash());\n\t\t\tthis.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n\t\t\t//Update the placeholder\n\t\t\tthis.options.placeholder.update(this.currentContainer, this.placeholder);\n\n\t\t\tthis.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\t\t\tthis.containers[innermostIndex].containerCache.over = 1;\n\t\t}\n\n\n\t},\n\n\t_createHelper: function(event) {\n\n\t\tvar o = this.options;\n\t\tvar helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);\n\n\t\tif(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already\n\t\t\t$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n\n\t\tif(helper[0] == this.currentItem[0])\n\t\t\tthis._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") };\n\n\t\tif(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());\n\t\tif(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());\n\n\t\treturn helper;\n\n\t},\n\n\t_adjustOffsetFromHelper: function(obj) {\n\t\tif (typeof obj == 'string') {\n\t\t\tobj = obj.split(' ');\n\t\t}\n\t\tif ($.isArray(obj)) {\n\t\t\tobj = {left: +obj[0], top: +obj[1] || 0};\n\t\t}\n\t\tif ('left' in obj) {\n\t\t\tthis.offset.click.left = obj.left + this.margins.left;\n\t\t}\n\t\tif ('right' in obj) {\n\t\t\tthis.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n\t\t}\n\t\tif ('top' in obj) {\n\t\t\tthis.offset.click.top = obj.top + this.margins.top;\n\t\t}\n\t\tif ('bottom' in obj) {\n\t\t\tthis.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n\t\t}\n\t},\n\n\t_getParentOffset: function() {\n\n\n\t\t//Get the offsetParent and cache its position\n\t\tthis.offsetParent = this.helper.offsetParent();\n\t\tvar po = this.offsetParent.offset();\n\n\t\t// This is a special case where we need to modify a offset calculated on start, since the following happened:\n\t\t// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent\n\t\t// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that\n\t\t// the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag\n\t\tif(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n\t\t\tpo.left += this.scrollParent.scrollLeft();\n\t\t\tpo.top += this.scrollParent.scrollTop();\n\t\t}\n\n\t\tif((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information\n\t\t|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix\n\t\t\tpo = { top: 0, left: 0 };\n\n\t\treturn {\n\t\t\ttop: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"),10) || 0),\n\t\t\tleft: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"),10) || 0)\n\t\t};\n\n\t},\n\n\t_getRelativeOffset: function() {\n\n\t\tif(this.cssPosition == \"relative\") {\n\t\t\tvar p = this.currentItem.position();\n\t\t\treturn {\n\t\t\t\ttop: p.top - (parseInt(this.helper.css(\"top\"),10) || 0) + this.scrollParent.scrollTop(),\n\t\t\t\tleft: p.left - (parseInt(this.helper.css(\"left\"),10) || 0) + this.scrollParent.scrollLeft()\n\t\t\t};\n\t\t} else {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t},\n\n\t_cacheMargins: function() {\n\t\tthis.margins = {\n\t\t\tleft: (parseInt(this.currentItem.css(\"marginLeft\"),10) || 0),\n\t\t\ttop: (parseInt(this.currentItem.css(\"marginTop\"),10) || 0)\n\t\t};\n\t},\n\n\t_cacheHelperProportions: function() {\n\t\tthis.helperProportions = {\n\t\t\twidth: this.helper.outerWidth(),\n\t\t\theight: this.helper.outerHeight()\n\t\t};\n\t},\n\n\t_setContainment: function() {\n\n\t\tvar o = this.options;\n\t\tif(o.containment == 'parent') o.containment = this.helper[0].parentNode;\n\t\tif(o.containment == 'document' || o.containment == 'window') this.containment = [\n\t\t\t0 - this.offset.relative.left - this.offset.parent.left,\n\t\t\t0 - this.offset.relative.top - this.offset.parent.top,\n\t\t\t$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,\n\t\t\t($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top\n\t\t];\n\n\t\tif(!(/^(document|window|parent)$/).test(o.containment)) {\n\t\t\tvar ce = $(o.containment)[0];\n\t\t\tvar co = $(o.containment).offset();\n\t\t\tvar over = ($(ce).css(\"overflow\") != 'hidden');\n\n\t\t\tthis.containment = [\n\t\t\t\tco.left + (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingLeft\"),10) || 0) - this.margins.left,\n\t\t\t\tco.top + (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) + (parseInt($(ce).css(\"paddingTop\"),10) || 0) - this.margins.top,\n\t\t\t\tco.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingRight\"),10) || 0) - this.helperProportions.width - this.margins.left,\n\t\t\t\tco.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"),10) || 0) - (parseInt($(ce).css(\"paddingBottom\"),10) || 0) - this.helperProportions.height - this.margins.top\n\t\t\t];\n\t\t}\n\n\t},\n\n\t_convertPositionTo: function(d, pos) {\n\n\t\tif(!pos) pos = this.position;\n\t\tvar mod = d == \"absolute\" ? 1 : -1;\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpos.top\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.top * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.top * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpos.left\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t+ this.offset.relative.left * mod\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t+ this.offset.parent.left * mod\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_generatePosition: function(event) {\n\n\t\tvar o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);\n\n\t\t// This is another very weird special case that only happens for relative elements:\n\t\t// 1. If the css position is relative\n\t\t// 2. and the scroll parent is the document or similar to the offset parent\n\t\t// we have to refresh the relative offset during the scroll so there are no jumps\n\t\tif(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {\n\t\t\tthis.offset.relative = this._getRelativeOffset();\n\t\t}\n\n\t\tvar pageX = event.pageX;\n\t\tvar pageY = event.pageY;\n\n\t\t/*\n\t\t * - Position constraining -\n\t\t * Constrain the position to a mix of grid, containment.\n\t\t */\n\n\t\tif(this.originalPosition) { //If we are not dragging yet, we won't check for options\n\n\t\t\tif(this.containment) {\n\t\t\t\tif(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;\n\t\t\t\tif(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;\n\t\t\t\tif(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;\n\t\t\t}\n\n\t\t\tif(o.grid) {\n\t\t\t\tvar top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n\t\t\t\tpageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;\n\n\t\t\t\tvar left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n\t\t\t\tpageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttop: (\n\t\t\t\tpageY\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.top\t\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.top\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.top\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))\n\t\t\t),\n\t\t\tleft: (\n\t\t\t\tpageX\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// The absolute mouse position\n\t\t\t\t- this.offset.click.left\t\t\t\t\t\t\t\t\t\t\t\t// Click offset (relative to the element)\n\t\t\t\t- this.offset.relative.left\t\t\t\t\t\t\t\t\t\t\t\t// Only for relative positioned nodes: Relative offset from element to offset parent\n\t\t\t\t- this.offset.parent.left\t\t\t\t\t\t\t\t\t\t\t\t// The offsetParent's offset without borders (offset + border)\n\t\t\t\t+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))\n\t\t\t)\n\t\t};\n\n\t},\n\n\t_rearrange: function(event, i, a, hardRefresh) {\n\n\t\ta ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));\n\n\t\t//Various things done here to improve the performance:\n\t\t// 1. we create a setTimeout, that calls refreshPositions\n\t\t// 2. on the instance, we have a counter variable, that get's higher after every append\n\t\t// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n\t\t// 4. this lets only the last addition to the timeout stack through\n\t\tthis.counter = this.counter ? ++this.counter : 1;\n\t\tvar counter = this.counter;\n\n\t\tthis._delay(function() {\n\t\t\tif(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n\t\t});\n\n\t},\n\n\t_clear: function(event, noPropagation) {\n\n\t\tthis.reverting = false;\n\t\t// We delay all events that have to be triggered to after the point where the placeholder has been removed and\n\t\t// everything else normalized again\n\t\tvar delayedTriggers = [];\n\n\t\t// We first have to update the dom position of the actual currentItem\n\t\t// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)\n\t\tif(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);\n\t\tthis._noFinalSort = null;\n\n\t\tif(this.helper[0] == this.currentItem[0]) {\n\t\t\tfor(var i in this._storedCSS) {\n\t\t\t\tif(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';\n\t\t\t}\n\t\t\tthis.currentItem.css(this._storedCSS).removeClass(\"ui-sortable-helper\");\n\t\t} else {\n\t\t\tthis.currentItem.show();\n\t\t}\n\n\t\tif(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"receive\", event, this._uiHash(this.fromOutside)); });\n\t\tif((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger(\"update\", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed\n\n\t\t// Check if the items Container has Changed and trigger appropriate\n\t\t// events.\n\t\tif (this !== this.currentContainer) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tdelayedTriggers.push(function(event) { this._trigger(\"remove\", event, this._uiHash()); });\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"receive\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"update\", event, this._uiHash(this)); }; }).call(this, this.currentContainer));\n\t\t\t}\n\t\t}\n\n\n\t\t//Post events to containers\n\t\tfor (var i = this.containers.length - 1; i >= 0; i--){\n\t\t\tif(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger(\"deactivate\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\tif(this.containers[i].containerCache.over) {\n\t\t\t\tdelayedTriggers.push((function(c) { return function(event) { c._trigger(\"out\", event, this._uiHash(this)); }; }).call(this, this.containers[i]));\n\t\t\t\tthis.containers[i].containerCache.over = 0;\n\t\t\t}\n\t\t}\n\n\t\t//Do what was originally in plugins\n\t\tif(this._storedCursor) $('body').css(\"cursor\", this._storedCursor); //Reset cursor\n\t\tif(this._storedOpacity) this.helper.css(\"opacity\", this._storedOpacity); //Reset opacity\n\t\tif(this._storedZIndex) this.helper.css(\"zIndex\", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index\n\n\t\tthis.dragging = false;\n\t\tif(this.cancelHelperRemoval) {\n\t\t\tif(!noPropagation) {\n\t\t\t\tthis._trigger(\"beforeStop\", event, this._uiHash());\n\t\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t\t}\n\n\t\t\tthis.fromOutside = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!noPropagation) this._trigger(\"beforeStop\", event, this._uiHash());\n\n\t\t//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!\n\t\tthis.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n\t\tif(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;\n\n\t\tif(!noPropagation) {\n\t\t\tfor (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events\n\t\t\tthis._trigger(\"stop\", event, this._uiHash());\n\t\t}\n\n\t\tthis.fromOutside = false;\n\t\treturn true;\n\n\t},\n\n\t_trigger: function() {\n\t\tif ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n\t\t\tthis.cancel();\n\t\t}\n\t},\n\n _delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_uiHash: function(_inst) {\n\t\tvar inst = _inst || this;\n\t\treturn {\n\t\t\thelper: inst.helper,\n\t\t\tplaceholder: inst.placeholder || $([]),\n\t\t\tposition: inst.position,\n\t\t\toriginalPosition: inst.originalPosition,\n\t\t\toffset: inst.positionAbs,\n\t\t\titem: inst.currentItem,\n\t\t\tsender: _inst ? _inst.element : null\n\t\t};\n\t}\n\n});\n","'use strict';\n\nconst $ = require('jquery');\nrequire('./jquery.ui.djnsortable');\n\n/*\n * jQuery UI Nested Sortable\n * v 1.3.4 / 28 apr 2011\n * http://mjsarfatti.com/sandbox/nestedSortable\n *\n * Depends:\n * jquery.ui.sortable.js 1.8+\n *\n * License CC BY-SA 3.0\n * Copyright 2010-2011, Manuele J Sarfatti\n */\nif (typeof $.fn.nearest != 'function') {\n /**\n * Returns the descendant(s) matching a given selector which are the\n * shortest distance from the search context element (in otherwords,\n * $.fn.closest(), in reverse).\n */\n $.fn.nearest = function(selector) {\n var nearest = [], node = this, distance = 10000;\n node.find(selector).each(function(){\n var d = $(this).parentsUntil(node).length;\n if (d < distance) {\n distance = d;\n nearest = [this];\n } else if (d == distance) {\n nearest.push(this);\n }\n });\n return this.pushStack(nearest, 'nearest', [selector]);\n };\n}\n\nvar counter = 0;\nvar expando = \"djn\" + (\"\" + Math.random()).replace(/\\D/g, \"\");\n\nvar createChildNestedSortable = function(parent, childContainer) {\n // Don't continue if the new element is the same as the old\n if (parent && parent.element && parent.element[0] == childContainer) {\n return;\n }\n var $childContainer = $(childContainer),\n options = $.extend({}, parent.options);\n options.connectWith = [parent.element];\n\n if ($childContainer.data(parent.widgetName)) {\n return;\n }\n\n var widgetConstructor = $childContainer[parent.widgetName];\n widgetConstructor.call($childContainer, options);\n var newInstance = $childContainer.data(parent.widgetName);\n for (var i = 0; i < parent.options.connectWith.length; i++) {\n var $otherContainer = parent.options.connectWith[i];\n newInstance.addToConnectWith($otherContainer);\n var otherInstance = $otherContainer.data(parent.widgetName);\n if (otherInstance) {\n otherInstance.addToConnectWith($childContainer);\n }\n }\n parent.addToConnectWith($childContainer);\n return newInstance;\n};\n\n$.widget(\"ui.nestedSortable\", $.ui.djnsortable, {\n\n options: {\n tabSize: 20,\n disableNesting: 'ui-nestedSortable-no-nesting',\n errorClass: 'ui-nestedSortable-error',\n nestedContainerSelector: ':not(*)',\n // Whether to clear empty list item and container elements\n doNotClear: false,\n /**\n * Create a list container element if the draggable was dragged\n * to the top or bottom of the elements at its level.\n *\n * @param DOMElement parent - The element relative to which the\n * new element will be inserted.\n * @return DOMElement - The new element.\n */\n createContainerElement: function(parent) {\n return $(document.createElement('ol'));\n },\n // Selector which matches all container elements in the nestedSortable\n containerElementSelector: 'ol',\n // Selector which matches all list items (draggables) in the nestedSortable\n listItemSelector: 'li',\n // Selector which, when applied to a container, returns its child list items\n items: '> li',\n maxLevels: 0,\n revertOnError: 1,\n protectRoot: false,\n rootID: null,\n rtl: false,\n // if true, you can not move nodes to different levels of nesting\n fixedNestingDepth: false,\n // show the error div or just not show a drop area\n showErrorDiv: true,\n // if true only allows you to rearrange within its parent container\n keepInParent: false,\n isAllowed: function(item, parent) { return true; },\n canConnectWith: function(container1, container2, instance) {\n var model1 = container1.data('inlineModel');\n var model2 = container2.data('inlineModel');\n if (model1 !== model2) {\n return false;\n }\n var instance2 = container2.data(instance.widgetName);\n if (!instance.options.fixedNestingDepth) {\n if (!instance2 || !instance2.options.fixedNestingDepth) {\n return true;\n }\n }\n var container1Level = instance._getLevel(container1);\n var container2Level = instance._getLevel(container2);\n return (container1Level === container2Level);\n }\n },\n\n _createWidget: function(options, element) {\n var $element = $( element || this.defaultElement || this ),\n dataOptions = $element.data('djnsortableOptions');\n element = $element[0];\n if (dataOptions) {\n options = $.extend({}, options, dataOptions);\n }\n return $.ui.djnsortable.prototype._createWidget.call(this, options, element);\n },\n\n _create: function() {\n if (this.element.data('uiNestedSortable')) {\n this.element.data('nestedSortable', this.element.data('uiNestedSortable'));\n }\n if (this.element.data('ui-nestedSortable')) {\n this.element.data('nestedSortable', this.element.data('ui-nestedSortable'));\n }\n this.element.data('djnsortable', this.element.data('nestedSortable'));\n if (this.element.data('uiNestedSortable')) {\n this.element.data('uiSortable', this.element.data('nestedSortable'));\n }\n // if (!this.element.is(this.options.containerElementSelector)) {\n // throw new Error('nestedSortable: Please check that the ' +\n // 'containerElementSelector option matches ' +\n // 'the element passed to the constructor.');\n // }\n\n $.ui.djnsortable.prototype._create.apply(this, arguments);\n\n this._connectWithMap = {};\n\n var self = this,\n o = this.options,\n $document = $(document);\n\n var originalConnectWith = o.connectWith;\n if (!originalConnectWith || typeof(originalConnectWith) == 'string') {\n this.options.connectWith = [];\n if (typeof(originalConnectWith) == 'string') {\n var connected = this._connectWith();\n for (var i = 0; i < connected.length; i++) {\n this.addToConnectWith($(connected[i]));\n }\n }\n\n // HACK!! FIX!! (django-specific logic)\n $document.on('djnesting:init.nestedSortable', o.containerElementSelector, function(event) {\n createChildNestedSortable(self, this);\n });\n this.element.find(o.containerElementSelector+':not(.subarticle-wrapper)').each(function(i, el) {\n if ($(el).closest('[data-inline-formset]').attr('id').indexOf('-empty') > -1) {\n return;\n }\n createChildNestedSortable(self, el);\n });\n }\n $document.trigger('nestedSortable:created', [this]);\n $document.on('nestedSortable:created.nestedSortable', function(e, instance) {\n instance.addToConnectWith(self.element);\n self.addToConnectWith(instance.element);\n });\n },\n\n addToConnectWith: function(element) {\n var self = this,\n $element = (typeof(element.selector) != 'undefined') ? element : $(element),\n uniqueId;\n\n if ($element.length > 1) {\n $element.each(function(i, el) {\n self.addToConnectWith($(el));\n });\n return;\n }\n uniqueId = element[0][expando];\n if (typeof uniqueId == 'undefined') {\n uniqueId = element[0][expando] = ++counter;\n }\n if (typeof this.options.connectWith == 'string') {\n return;\n }\n if (this._connectWithMap[uniqueId]) {\n return;\n }\n this.options.connectWith.push(element);\n this._connectWithMap[uniqueId] = 1;\n },\n\n _destroy: function() {\n this.element\n .removeData(\"nestedSortable\")\n .unbind(\".nestedSortable\");\n $(document).unbind('.nestedSortable');\n return $.ui.djnsortable.prototype.destroy.apply(this, arguments);\n },\n\n /**\n * Override this method to add extra conditions on an item before it's\n * rearranged.\n */\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var itemElement = item.item[0], o = this.options,\n intersection = $.ui.djnsortable.prototype._intersectsWithPointer.apply(this, arguments);\n\n this.lastItemElement = null;\n if (!intersection) {\n return intersection;\n }\n\n // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\n // between the outer and inner container.\n if (item.instance !== this.currentContainer) {\n return false;\n }\n var $itemElement = $(itemElement);\n\n if (o.fixedNestingDepth && this._getLevel(this.currentItem) === 1+this._getLevel($itemElement)) {\n $itemElement = (function() {\n var containerSel = o.containerElementSelector;\n var $childItems = $itemElement.find('.djn-item');\n if ($childItems.length != 1) {\n return $itemElement;\n }\n if (!$childItems.is('.djn-no-drag,.djn-thead')) {\n return $itemElement;\n }\n var itemElementClosestContainer = $itemElement.closest(containerSel);\n if (!itemElementClosestContainer.length) {\n return $itemElement;\n }\n // Make sure the item is only one level deeper\n if (itemElementClosestContainer[0] != $childItems.closest(containerSel).closest(containerSel)[0]) {\n return $itemElement;\n }\n return $($childItems[0]);\n })();\n itemElement = $itemElement[0];\n }\n\n if (itemElement != this.currentItem[0] //cannot intersect with itself\n && this.placeholder[intersection == 1 ? \"next\" : \"prev\"]()[0] != itemElement //no useless actions that have been done before\n && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked\n && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)\n && (!o.keepInParent || itemElement.parentNode == this.placeholder[0].parentNode) //only rearrange items within the same container\n && (!o.fixedNestingDepth || (this._getLevel(this.currentItem) === this._getLevel($itemElement))) //maintain the nesting level of node\n && (o.showErrorDiv || o.isAllowed.call(this, this.currentItem[0], itemElement.parentNode, this.placeholder))\n ) {\n this.lastItemElement = itemElement;\n return intersection;\n } else {\n return false;\n }\n },\n\n // This method is called after items have been iterated through.\n // Overriding this is cleaner than copying and pasting _mouseDrag()\n // and inserting logic in the middle.\n _contactContainers: function _contactContainers(event) {\n if (this.lastItemElement) {\n this._clearEmpty(this.lastItemElement);\n }\n\n\n var o = this.options,\n _parentItem = this.placeholder.closest(o.listItemSelector),\n parentItem = (_parentItem.length && _parentItem.closest('.ui-sortable').length)\n ? _parentItem\n : null,\n level = this._getLevel(this.placeholder),\n childLevels = this._getChildLevels(this.helper);\n\n var placeholderClassName = this.placeholder.attr('class');\n var phClassSearch = \" \" + placeholderClassName + \" \";\n // If the current level class isn't already set\n if (phClassSearch.indexOf(\" ui-sortable-nested-level-\" + level + \" \") == -1) {\n var phOrigClassName;\n // Check if another level class is set\n var phOrigClassNameEndPos = phClassSearch.indexOf(\" ui-sortable-nested-level-\") - 1;\n if (phOrigClassNameEndPos > -1) {\n phOrigClassName = placeholderClassName.substring(0, phOrigClassNameEndPos);\n } else {\n phOrigClassName = placeholderClassName;\n }\n // Add new level to class\n this.placeholder.attr('class', phOrigClassName + ' ui-sortable-nested-level-' + level);\n }\n\n // To find the previous sibling in the list, keep backtracking until we hit a valid list item.\n var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;\n if (previousItem != null) {\n while (!previousItem.is(this.options.listItemSelector) || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {\n if (previousItem[0].previousSibling) {\n previousItem = $(previousItem[0].previousSibling);\n } else {\n previousItem = null;\n break;\n }\n }\n }\n // To find the next sibling in the list, keep stepping forward until we hit a valid list item.\n var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;\n if (nextItem != null) {\n while (!nextItem.is(this.options.listItemSelector) || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {\n if (nextItem[0].nextSibling) {\n nextItem = $(nextItem[0].nextSibling);\n } else {\n nextItem = null;\n break;\n }\n }\n }\n\n this.beyondMaxLevels = 0;\n\n // We will change this to the instance of the nested container if\n // appropriate, so that the appropriate context is applied to the\n // super _contactContainers prototype method\n var containerInstance = this;\n this.refreshPositions();\n\n // If the item is moved to the left, send it to its parent's level unless there are siblings below it.\n if (!o.fixedNestingDepth && parentItem != null && nextItem == null &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||\n !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {\n parentItem.after(this.placeholder[0]);\n containerInstance = parentItem.closest(o.containerElementSelector).data(this.widgetName) || containerInstance;\n this._clearEmpty(parentItem[0]);\n this.refreshPositions();\n this._trigger(\"change\", event, this._uiHash());\n }\n // If the item is below a sibling and is moved to the right, make it a child of that sibling.\n else if (!o.fixedNestingDepth && previousItem != null && !previousItem.is('.djn-no-drag,.djn-thead') &&\n (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||\n !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {\n this._isAllowed(previousItem, level, level+childLevels);\n\n if (this.beyondMaxLevels > 0) {\n return $.ui.djnsortable.prototype._contactContainers.apply(this, arguments);\n }\n var $previousItemChildContainer;\n $previousItemChildContainer = previousItem.nearest(o.containerElementSelector).first();\n\n if (!$previousItemChildContainer.length && !previousItem.closest(o.nestedContainerSelector).length) {\n $previousItemChildContainer = this.options.createContainerElement(previousItem[0]);\n previousItem.append($previousItemChildContainer);\n }\n if ($previousItemChildContainer.length) {\n $previousItemChildContainer.append(this.placeholder);\n containerInstance = $previousItemChildContainer.data(this.widgetName);\n if (!containerInstance) {\n containerInstance = createChildNestedSortable(this, $previousItemChildContainer[0]);\n }\n this.refreshPositions();\n }\n this._trigger(\"change\", event, this._uiHash());\n }\n else {\n this._isAllowed(parentItem, level, level+childLevels);\n }\n\n $.ui.djnsortable.prototype._contactContainers.call(this, event);\n },\n\n _rearrange: function _rearrange(event, item, a, hardRefresh) {\n // Cache the rearranged element for the call to _clear()\n var o = this.options;\n if (item && typeof item == 'object' && item.item) {\n this.lastRearrangedElement = item.item[0];\n }\n if (item && typeof(item) == 'object' && item.item && this.placeholder.closest(o.nestedContainerSelector).length) {\n // This means we have been dropped into a nested container down a level\n // from the parent.\n var placeholderParentItem = this.placeholder.closest(o.listItemSelector);\n var comparisonElement = (this.direction == 'down')\n ? placeholderParentItem.next(o.nestedContainerSelector)\n : placeholderParentItem;\n if (comparisonElement.length && comparisonElement[0] == item.item[0]) {\n //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function() {\n if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove\n });\n // The super method will pop the container out of its nested container,\n // which we don't want.\n return;\n }\n }\n $.ui.djnsortable.prototype._rearrange.apply(this, arguments);\n },\n\n _convertPositionTo: function(d, pos) {\n // Cache the top offset before rearrangement\n this.previousTopOffset = this.placeholder.offset().top;\n return $.ui.djnsortable.prototype._convertPositionTo.apply(this, arguments);\n },\n\n _clear: function() {\n $.ui.djnsortable.prototype._clear.apply(this, arguments);\n // If lastRearrangedElement exists and is still attached to the document\n // (i.e., hasn't been removed)\n if (typeof this.lastRearrangedElement == 'object' && this.lastRearrangedElement.ownerDocument) {\n this._clearEmpty(this.lastRearrangedElement);\n }\n },\n\n _mouseStop: function _mouseStop(event, noPropagation) {\n // If the item is in a position not allowed, send it back\n if (this.beyondMaxLevels) {\n this.placeholder.removeClass(this.options.errorClass);\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.placeholder);\n } else {\n $(this.domPosition.parent).prepend(this.placeholder);\n }\n this._trigger(\"revert\", event, this._uiHash());\n\n }\n\n // Clean last empty container/list item\n for (var i = this.items.length - 1; i >= 0; i--) {\n var item = this.items[i].item[0];\n this._clearEmpty(item);\n }\n\n $.ui.djnsortable.prototype._mouseStop.apply(this, arguments);\n },\n\n toArray: function(o) {\n\n o = $.extend(true, {}, this.options, o || {});\n\n var sDepth = o.startDepthCount || 0,\n ret = [],\n left = 2;\n\n ret.push({\n \"item_id\": o.rootID,\n \"parent_id\": 'none',\n \"depth\": sDepth,\n \"left\": '1',\n \"right\": ($(o.listItemSelector, this.element).length + 1) * 2\n });\n\n var _recursiveArray = function(item, depth, left) {\n var right = left + 1,\n id,\n pid;\n\n var $childItems = $(item).children(o.containerElementSelector).find(o.items);\n\n if ($childItems.length > 0) {\n depth ++;\n $childItems.each(function () {\n right = _recursiveArray($(this), depth, right);\n });\n depth --;\n }\n\n id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));\n\n if (depth === sDepth + 1) {\n pid = o.rootID;\n } else {\n var parentItem = ($(item).parent(o.containerElementSelector)\n .parent(o.items)\n .attr(o.attribute || 'id'))\n .match(o.expression || (/(.+)[-=_](.+)/));\n pid = parentItem[2];\n }\n\n if (id) {\n ret.push({\"item_id\": id[2], \"parent_id\": pid, \"depth\": depth, \"left\": left, \"right\": right});\n }\n\n left = right + 1;\n return left;\n };\n\n $(this.element).children(o.listItemSelector).each(function () {\n left = _recursiveArray(this, sDepth + 1, left);\n });\n\n ret = ret.sort(function(a,b){ return (a.left - b.left); });\n\n return ret;\n },\n\n _clearEmpty: function(item) {\n if (this.options.doNotClear) {\n return;\n }\n var $item = $(item);\n var childContainers = $item.nearest(this.options.containerElementSelector);\n childContainers.each(function(i, childContainer) {\n var $childContainer = $(childContainer);\n if (!$childContainer.children().length) {\n var instance = $childContainer.data(this.widgetName);\n if (typeof(instance) == 'object' && instance.destroy) {\n instance.destroy();\n }\n $childContainer.remove();\n }\n });\n if (!$item.children().length) {\n $item.remove();\n }\n },\n\n _getLevel: function(item) {\n\n var level = 1,\n o = this.options, list;\n\n if (o.containerElementSelector) {\n list = item.closest(o.containerElementSelector);\n while (list && list.length > 0 && !list.parent().is('.djn-group-root')) {\n // if (!list.is(o.nestedContainerSelector)) {\n level++;\n // }\n list = list.parent().closest(o.containerElementSelector);\n }\n }\n\n return level;\n },\n\n _getChildLevels: function(parent, depth) {\n var self = this,\n o = this.options,\n result = 0;\n depth = depth || 0;\n\n $(parent).nearest(o.containerElementSelector).first().find(o.items).each(function (index, child) {\n if ($(child).is('.djn-no-drag,.djn-thead')) {\n return;\n }\n result = Math.max(self._getChildLevels(child, depth + 1), result);\n });\n\n return depth ? result + 1 : result;\n },\n\n _isAllowed: function _isAllowed(parentItem, level, levels) {\n var o = this.options,\n isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false;\n // this takes into account the maxLevels set to the recipient list\n // var maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels');\n var maxLevels = o.maxLevels;\n\n // Is the root protected?\n // Are we trying to nest under a no-nest?\n // Are we nesting too deep?\n if (parentItem && typeof(parentItem) == 'object' && typeof(parentItem.selector) == 'undefined') {\n parentItem = $(parentItem);\n }\n\n if (!o.isAllowed.call(this, this.currentItem, parentItem, this.placeholder) ||\n parentItem && parentItem.hasClass(o.disableNesting) ||\n o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {\n this.placeholder.addClass(o.errorClass);\n if (maxLevels < levels && maxLevels != 0) {\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.beyondMaxLevels = 1;\n }\n } else {\n if (maxLevels < levels && maxLevels != 0) {\n this.placeholder.addClass(o.errorClass);\n this.beyondMaxLevels = levels - maxLevels;\n } else {\n this.placeholder.removeClass(o.errorClass);\n this.beyondMaxLevels = 0;\n }\n }\n },\n\n _connectWith: function _connectWith() {\n var origConnectWith = $.ui.djnsortable.prototype._connectWith.apply(this, arguments),\n connectWith = [];\n var self = this;\n for (var i = 0; i < origConnectWith.length; i++) {\n var $elements = $(origConnectWith[i]);\n $elements.each(function(j, el) {\n if (el == self.element[0]) {\n return;\n }\n if (!self.options.canConnectWith(self.element, $(el), self)) {\n return;\n }\n connectWith.push(el);\n });\n }\n return connectWith;\n },\n _removeCurrentsFromItems: function() {\n var list = this.currentItem.find(\":data(sortable-item)\");\n for (var i=0; i < this.items.length; i++) {\n for (var j=0; j < list.length; j++) {\n if (list[j] == this.items[i].item[0]) {\n this.items.splice(i, 1);\n if (i >= this.items.length) {\n break;\n }\n }\n }\n }\n },\n createContainerElement: function(parent) {\n if (!parent.childNodes) {\n throw new Error(\"Invalid element 'parent' passed to \" +\n \"createContainerElement.\");\n }\n var newContainer = this.options.createContainerElement.apply(this, arguments);\n parent.appendChild(newContainer[0]);\n return $(newContainer);\n }\n});\n\n$.ui.nestedSortable.prototype.options = $.extend({}, $.ui.djnsortable.prototype.options, $.ui.nestedSortable.prototype.options);\n","'use strict';\n\nconst $ = require('jquery');\nconst regexQuote = require('./regexquote');\nrequire('./jquery.ui.nestedsortable');\n\nfunction updatePositions(prefix) {\n var position = 0, // the value of the position formfield\n count = 1, // The count displayed in stacked inline headers\n $group = $('#' + prefix + '-group'),\n groupData = $group.djnData(),\n fieldNames = groupData.fieldNames,\n // The field name on the fieldset which is a ForeignKey to the parent model\n groupFkName = groupData.formsetFkName,\n parentPkVal,\n [, parentPrefix, index] = prefix.match(/^(.*)\\-(\\d+)-[^\\-]+(?:\\-\\d+)?$/) || [],\n sortableOptions = groupData.sortableOptions,\n sortableExcludes = (sortableOptions || {}).sortableExcludes || [];\n\n sortableExcludes.push(groupFkName);\n\n if (parentPrefix) {\n var $parentGroup = $('#' + parentPrefix + '-group');\n var parentFieldNames = $parentGroup.djnData('fieldNames');\n var parentPkFieldName = parentFieldNames.pk;\n var parentPkField = $parentGroup.filterDjangoField(parentPrefix, parentPkFieldName, index);\n parentPkVal = parentPkField.val();\n }\n\n if (groupFkName && typeof(parentPkVal) != 'undefined') {\n $group.filterDjangoField(prefix, groupFkName).val(parentPkVal).trigger('change');\n }\n\n $group.find('.djn-inline-form').each(function() {\n if (!this.id || this.id.substr(-6) == '-empty') {\n return true; // Same as continue\n }\n var regex = new RegExp('^(?:id_)?' + regexQuote(prefix) + '\\\\-\\\\d+$');\n\n if (!this.id.match(regex)) {\n return true;\n }\n // Cache jQuery object\n var $this = $(this),\n [formPrefix, index] = $this.djangoPrefixIndex() || [null, null],\n namePrefix = formPrefix + '-' + index + '-';\n\n if (!formPrefix) {\n return;\n }\n\n // Set header position for stacked inlines in Django 1.9+\n var $inlineLabel = $this.find('> h3 > .inline_label');\n if ($inlineLabel.length) {\n $inlineLabel.html($inlineLabel.html().replace(/(#\\d+)/g, '#' + count));\n }\n count++;\n\n var $fields = $this.djangoFormField('*'),\n $positionField,\n setPosition = false;\n\n // position is being updated if\n // a) the field has a value\n // b) if the field is not exluded with sortable_excludes (e.g. with default values)\n $fields.each(function() {\n var $field = $(this);\n if (!$field.is(':input[type!=radio][type!=checkbox],input:checked')) {\n return;\n }\n var hasValue = $field.val() || ($field.attr('type') == 'file' && $field.siblings('a').length),\n fieldName = $field.attr('name').substring(namePrefix.length);\n if (fieldName == fieldNames.position) {\n $positionField = $field;\n }\n if (hasValue && $.inArray(fieldName, sortableExcludes) === -1) {\n setPosition = true;\n }\n });\n\n if (!setPosition || !$positionField) {\n return;\n }\n\n $positionField.val(position).trigger('change');\n position++;\n });\n}\n\nfunction createSortable($group) {\n const isPolymorphic = $group.is('.djn-is-polymorphic');\n return $group.find('> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items').nestedSortable({\n handle: [\n '> h3.djn-drag-handler',\n '> .djn-tools .drag-handler',\n '> .djn-td > .djn-tools .djn-drag-handler',\n '> .djn-tr > .is-sortable > .djn-drag-handler',\n '> .djn-tr > .grp-tools-container .djn-drag-handler'\n ].join(', '),\n /**\n * items: The selector for ONLY the items underneath a given\n * container at that level. Not to be confused with\n * listItemSelector, which is the selector for all list\n * items in the nestedSortable\n */\n items: '> .djn-item',\n forcePlaceholderSize: true,\n placeholder: {\n element: function($currentItem) {\n var el = $(document.createElement($currentItem[0].nodeName))\n .addClass($currentItem[0].className + ' ui-sortable-placeholder')\n .removeClass('ui-sortable-helper')[0];\n\n if ($currentItem.is('.djn-tbody')) {\n var $originalTr = $currentItem.children('.djn-tr').eq(0);\n var trTagName = $originalTr.prop('tagName').toLowerCase();\n var $tr = $(`<${trTagName}>`);\n $tr.addClass($originalTr.attr('class'));\n var $originalTd = $originalTr.children('.djn-td').eq(0);\n var tdTagName = $originalTd.prop('tagName').toLowerCase();\n var numColumns = 0;\n $originalTr.children('.djn-td').each(function(i, td) {\n numColumns += parseInt($(td).attr('colspan'), 10) || 1;\n });\n $tr.append($(`<${tdTagName} colspan=\"${numColumns}\" class=\"djn-td grp-td\">`));\n el.appendChild($tr[0]);\n }\n\n return el;\n },\n update: function(instance, $placeholder) {\n var $currItem = instance.currentItem;\n if (!$currItem) {\n return;\n }\n var opts = instance.options;\n // 1. If a className is set as 'placeholder option, we\n // don't force sizes - the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to\n // force it even if a class name is specified\n if (opts.className && !opts.forcePlaceholderSize) return;\n\n if ($placeholder.is('.djn-tbody')) {\n // debugger;\n $placeholder = $placeholder.children('.djn-tr').eq(0).children('.djn-td').eq(0);\n }\n\n // If the element doesn't have a actual height by itself\n // (without styles coming from a stylesheet), it receives\n // the inline height from the dragged item\n if (!$placeholder.height()) {\n var innerHeight = $currItem.innerHeight(),\n paddingTop = parseInt($currItem.css('paddingTop') || 0, 10),\n paddingBottom = parseInt($currItem.css('paddingBottom') || 0, 10);\n $placeholder.height(innerHeight - paddingTop - paddingBottom);\n }\n if (!$placeholder.width()) {\n var innerWidth = $currItem.innerWidth(),\n paddingLeft = parseInt($currItem.css('paddingLeft') || 0, 10),\n paddingRight = parseInt($currItem.css('paddingRight') || 0, 10);\n $placeholder.width(innerWidth - paddingLeft - paddingRight);\n }\n }\n },\n helper: 'clone',\n opacity: 0.6,\n maxLevels: 0,\n connectWith: '.djn-items',\n tolerance: 'intersection',\n // Don't allow dragging beneath an inline that is marked for deletion\n isAllowed: function(currentItem, parentItem) {\n if (parentItem && parentItem.hasClass('predelete')) {\n return false;\n }\n const $parentGroup = parentItem.closest('.djn-group');\n const parentModel = $parentGroup.data('inlineModel');\n const childModels = $parentGroup.djnData('childModels');\n const currentModel = currentItem.data('inlineModel');\n const isPolymorphicChild = (childModels && childModels.indexOf(currentModel) !== -1);\n if (currentModel !== parentModel && !isPolymorphicChild) {\n return false;\n }\n return true;\n },\n // fixedNestingDepth: not a standard ui.sortable parameter.\n // Prevents dragging items up or down levels\n fixedNestingDepth: true,\n // The selector for ALL list containers in the nested sortable.\n containerElementSelector: '.djn-items',\n // The selector for ALL list items in the nested sortable.\n listItemSelector: '.djn-item',\n start: function(event, ui) {\n ui.item.addClass('djn-item-dragging');\n ui.item.show();\n },\n stop: function(event, ui) {\n ui.item.removeClass('djn-item-dragging');\n },\n /**\n * Triggered when a sortable is dropped into a container\n */\n receive: function(event, ui) {\n var $inline = $(this).closest('.djn-group');\n $inline.djangoFormset().spliceInto(ui.item);\n updatePositions(ui.item.djangoFormsetPrefix());\n },\n update: function(event, ui) {\n // Ensure that
\n // is the first child of the djn-items. If there\n // is another
before the\n // .do-not-drag element then the drag-and-drop placeholder\n // margins don't work correctly.\n var $nextItem = ui.item.nextAll('.djn-item').first();\n if ($nextItem.is('.djn-no-drag,.djn-thead')) {\n var nextItem = $nextItem[0];\n var parent = nextItem.parentNode;\n parent.insertBefore(nextItem, parent.firstChild);\n }\n var groupId = $(event.target).closest('.djn-group').attr('id'),\n $form = ui.item,\n $parentGroup = $form.closest('#' + groupId);\n if ($form.data('updateOperation') == 'removed') {\n $form.removeAttr('data-update-operation');\n } else if (!$parentGroup.length) {\n $form.attr('data-update-operation', 'removed');\n }\n updatePositions($form.djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$('#' + $form.djangoFormsetPrefix() + '-group')]);\n }\n });\n}\n\nmodule.exports = {updatePositions, createSortable};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","const $ = require('jquery');\n\nvar prefixCache = {};\n\n$.fn.djnData = function(name) {\n var inlineFormsetData = $(this).data('inlineFormset') || {},\n nestedOptions = inlineFormsetData.nestedOptions || {};\n if (!name) {\n return nestedOptions;\n } else {\n return nestedOptions[name];\n }\n};\n\n$.fn.djangoPrefixIndex = function() {\n var $this = (this.length > 1) ? this.first() : this;\n var id = $this.attr('id'),\n name = $this.attr('name'),\n forattr = $this.attr('for'),\n prefix, $form, $group, groupId, cacheKey, match, index;\n\n if ((match = prefixCache[id]) || (match = prefixCache[name]) || (match = prefixCache[forattr])) {\n return match;\n }\n\n if (id && !prefix) {\n prefix = (id.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n\n if (id && !prefix && $this.is('.djn-item') && id.match(/\\d+$/)) {\n [cacheKey, prefix, index] = id.match(/(.*?)\\-(\\d+)$/) || [null, null, null];\n }\n\n if (!prefix) {\n $form = $this.closest('.djn-inline-form');\n if ($form.length) {\n [cacheKey, prefix, index] = $form.attr('id').match(/(.*?)\\-(\\d+)$/)\n || [null, null, null];\n } else {\n $group = $this.closest('.djn-group');\n if (!$group.length) {\n return null;\n }\n groupId = $group.attr('id') || '';\n prefix = (groupId.match(/^(.*)\\-group$/) || [null, null])[1];\n }\n } else {\n if (prefix.substr(0, 3) == 'id_') {\n prefix = prefix.substr(3);\n }\n\n if (!document.getElementById(prefix + '-group')) {\n return null;\n }\n }\n if (cacheKey) {\n prefixCache[cacheKey] = [prefix, index];\n }\n\n return [prefix, index];\n};\n\n$.fn.djangoFormPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n if (!prefixIndex || !prefixIndex[1]) {\n return null;\n }\n return prefixIndex[0] + '-' + prefixIndex[1] + '-';\n};\n\n$.fn.djangoFormIndex = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex || !prefixIndex[1]) ? null : parseInt(prefixIndex[1], 10);\n};\n\n$.fn.djangoFormsetPrefix = function() {\n var prefixIndex = this.djangoPrefixIndex();\n return (!prefixIndex) ? null : prefixIndex[0];\n};\n\nvar filterDjangoFormsetForms = function(form, $group, formsetPrefix) {\n var formId = form.getAttribute('id'),\n formIndex = formId.substr(formsetPrefix.length + 1);\n\n // Check if form id matches /{prefix}-\\d+/\n if (formId.indexOf(formsetPrefix) !== 0) { return false; }\n return (!formIndex.match(/\\D/));\n};\n\n// Selects all initial forms within the same formset as the\n// element the method is being called on.\n$.fn.djangoFormsetForms = function() {\n var forms = [];\n this.each(function() {\n var $this = $(this),\n formsetPrefix = $this.djangoFormsetPrefix(),\n $group = (formsetPrefix) ? $('#' + formsetPrefix + '-group') : null,\n $forms;\n\n if (!formsetPrefix || !$group.length) return;\n\n $forms = $group.find('.djn-inline-form').filter(function() {\n return filterDjangoFormsetForms(this, $group, formsetPrefix);\n });\n var sortedForms = $forms.toArray().sort(function(a, b) {\n return $(a).djangoFormIndex() - $(b).djangoFormIndex;\n });\n Array.prototype.push.apply(forms, sortedForms);\n });\n return this.pushStack(forms);\n};\n\nif (typeof($.djangoFormField) != 'function') {\n $.djangoFormField = function(fieldName, prefix, index) {\n var $empty = $([]), matches;\n if (matches = prefix.match(/^(.+)\\-(\\d+)\\-$/)) {\n prefix = matches[1];\n index = matches[2];\n }\n index = parseInt(index, 10);\n if (isNaN(index)) {\n return $empty;\n }\n var namePrefix = prefix + '-' + index + '-';\n if (fieldName == '*') {\n return $('*[name^=\"' + namePrefix + '\"]').filter(function() {\n var fieldPart = $(this).attr('name').substring(namePrefix.length);\n return (fieldPart.indexOf('-') === -1);\n });\n }\n var $field = $('#id_' + namePrefix + fieldName);\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n var $group = $('#' + prefix + '-group'),\n fieldNameData = $group.djnData('fieldNames') || {};\n fieldName = fieldNameData[fieldName];\n if (!fieldName) { return $empty; }\n $field = $('#id_' + namePrefix + fieldName);\n }\n return $field;\n };\n}\n\nif (typeof($.fn.djangoFormField) != 'function') {\n /**\n * Given a django model's field name, and the forms index in the\n * formset, returns the field's input element, or an empty jQuery\n * object on failure.\n *\n * @param String fieldName - 'pk', 'position', or the field's\n * name in django (e.g. 'content_type',\n * 'url', etc.)\n * @return jQuery object containing the field's input element, or\n * an empty jQuery object on failure\n */\n $.fn.djangoFormField = function(fieldName, index) {\n var prefixAndIndex = this.djangoPrefixIndex();\n var $empty = $([]);\n if (!prefixAndIndex) {\n return $empty;\n }\n var prefix = prefixAndIndex[0];\n if (typeof(index) == 'undefined') {\n index = prefixAndIndex[1];\n if (typeof(index) == 'undefined') {\n return $empty;\n }\n }\n return $.djangoFormField(fieldName, prefix, index);\n };\n}\n\nif (typeof($.fn.filterDjangoField) != 'function') {\n var djRegexCache = {};\n $.fn.filterDjangoField = function(prefix, fieldName, index) {\n var $field, fieldNameData;\n if (typeof index != 'undefined') {\n if (typeof index == 'string') {\n index = parseInt(index, 10);\n }\n if (typeof index == 'number' && !isNaN(index)) {\n var fieldId = 'id_' + prefix + '-' + index + '-' + fieldName;\n $field = $('#' + fieldId);\n }\n } else {\n if (typeof(djRegexCache[prefix]) != 'object') {\n djRegexCache[prefix] = {};\n }\n if (typeof(djRegexCache[prefix][fieldName]) == 'undefined') {\n djRegexCache[prefix][fieldName] = new RegExp('^' + prefix + '-\\\\d+-' + fieldName + '$');\n } \n $field = this.find('input[name$=\"' + fieldName + '\"]').filter(function() {\n return this.getAttribute('name').match(djRegexCache[prefix][fieldName]);\n }); \n }\n if (!$field.length && (fieldName == 'pk' || fieldName == 'position')) {\n fieldNameData = $('#' + prefix + '-group').djnData('fieldNames') || {};\n if (typeof(fieldNameData[fieldName]) && fieldNameData[fieldName] != fieldName) {\n $field = $(this).filterDjangoField(prefix, fieldNameData[fieldName], index);\n }\n }\n return $field;\n };\n}\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","const $ = require('jquery');\nconst grappelli = require('grappelli');\nconst DJNesting = require('./utils');\nDJNesting.DjangoFormset = require('./jquery.djangoformset');\n\n$(document).ready(function() {\n // Remove the border on any empty fieldsets\n $('fieldset.grp-module, fieldset.module').filter(function(i, element) {\n return element.childNodes.length == 0;\n }).css('border-width', '0');\n\n // Set predelete class on any form elements with the DELETE input checked.\n // These can occur on forms rendered after a validation error.\n $('input[name$=\"-DELETE\"]:checked').not('[name*=\"__prefix__\"]').closest('.djn-inline-form').addClass('grp-predelete');\n\n $(document).on('djnesting:initialized djnesting:mutate', function onMutate(e, $inline) {\n var $items = $inline.find('> .djn-items, > .tabular > .module > .djn-items');\n var $rows = $items.children('.djn-tbody');\n $rows.removeClass('row1 row2');\n $rows.each(function(i, row) {\n var n = 1 + (i % 2);\n $(row).addClass('row' + n);\n });\n });\n\n // Register the nested formset on top level djnesting-stacked elements.\n // It will handle recursing down the nested inlines.\n $('.djn-group-root').each(function(i, rootGroup) {\n $(rootGroup).djangoFormset();\n });\n\n $('form').on('submit.djnesting', function(e) {\n $('.djn-group').each(function() {\n DJNesting.updatePositions($(this).djangoFormsetPrefix());\n $(document).trigger('djnesting:mutate', [$(this).djangoFormset().$inline]);\n });\n });\n});\n\nmodule.exports = DJNesting;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/nested_admin/static/nested_admin/src/nested-admin/utils.js b/nested_admin/static/nested_admin/src/nested-admin/utils.js index cc5c6d0..a8edc59 100644 --- a/nested_admin/static/nested_admin/src/nested-admin/utils.js +++ b/nested_admin/static/nested_admin/src/nested-admin/utils.js @@ -28,7 +28,11 @@ DJNesting.updateFormAttributes = function($elem, search, replace, selector) { var addBackMethod = ($.fn.addBack) ? 'addBack' : 'andSelf'; $elem.find(selector)[addBackMethod]().each(function() { var $node = $(this), - attrs = ['id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset']; + attrs = [ + 'id', 'name', 'for', 'href', 'class', 'onclick', 'data-inline-formset', + 'django-croppable-image-for', + 'django-croppable-crop-for', + ]; $.each(attrs, function(i, attrName) { var attrVal = $node.attr(attrName);