var sortableDecorator=function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("Ractive"));else if("function"==typeof define&&define.amd)define(["Ractive"],b);else{if(!a.Ractive)throw new Error("Could not find Ractive! It must be loaded before the Ractive-decorators-sortable plugin");b(a.Ractive)}}("undefined"!=typeof window?window:this,function(a){"use strict";var b,c,d,e,f,g,h,i,j;return b=function(a){return a.draggable=!0,a.addEventListener("dragstart",f,!1),a.addEventListener("dragenter",g,!1),a.addEventListener("dragleave",h,!1),a.addEventListener("drop",h,!1),a.addEventListener("dragover",i,!1),{teardown:function(){a.removeEventListener("dragstart",f,!1),a.removeEventListener("dragenter",g,!1),a.removeEventListener("dragleave",h,!1),a.removeEventListener("drop",h,!1),a.removeEventListener("dragover",i,!1)}}},b.targetClass="droptarget",j="The sortable decorator only works with elements that correspond to array members",f=function(b){var f=a.getContext(this);if(d=f.resolve(),e=f.resolve("../"),!Array.isArray(f.get("../")))throw new Error(j);b.dataTransfer.setData("foo",!0),c=f.ractive},g=function(){var f,g,h,i,j;if(j=a.getContext(this),j.ractive===c&&(f=j.resolve(),g=j.resolve("../"),g===e)){if(f===d)return void this.classList.add(b.targetClass);i=c.get(d),h=a.splitKeypath(d),c.splice(g,h[h.length-1],1),d=f,h=a.splitKeypath(d),c.splice(g,h[h.length-1],0,i)}},h=function(){this.classList.remove(b.targetClass)},i=function(a){a.preventDefault()},a.decorators.sortable=b,b});"undefined"!=typeof module&&module.exports&&(module.exports=sortableDecorator);