/
bundle.forms.apphookselect.min.js
1 lines (1 loc) · 6.89 KB
/
bundle.forms.apphookselect.min.js
1
!function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}(function(){var e=this,t=void 0;Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,o=function(){},r=function(){return n.apply(this instanceof o?this:e,t.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(o.prototype=this.prototype),r.prototype=new o,r}),Object.keys||(Object.keys=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=n.length;return function(r){if("object"!=typeof r&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var i,a,c=[];for(i in r)e.call(r,i)&&c.push(i);if(t)for(a=0;a<o;a++)e.call(r,n[a])&&c.push(n[a]);return c}}()),e.Promise||function(e){function n(){}function o(e,t){return function(){e.apply(t,arguments)}}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function i(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e._deferreds.push(t);e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?a:c)(t.promise,e._value);var o;try{o=n(e._value)}catch(e){return void c(t.promise,e)}a(t.promise,o)})}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof n)return void l(o(n,t),e)}e._state=1,e._value=t,u(e)}catch(t){c(e,t)}}function c(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}var s=setTimeout;r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new f(e,t,o)),o},r.all=function(e){var t=Array.prototype.slice.call(e);return new r(function(e,n){function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(e){o(i,e)},n)}t[i]=a,0==--r&&e(t)}catch(e){n(e)}}if(0===t.length)return e([]);for(var r=t.length,i=0;i<t.length;i++)o(i,t[i])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,n){n(e)})},r.race=function(e){return new r(function(t,n){for(var o=0,r=e.length;o<r;o++)e[o].then(t,n)})},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){s(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console},r._setImmediateFn=function(e){r._immediateFn=e},r._setUnhandledRejectionFn=function(e){r._unhandledRejectionFn=e},void 0!==t&&t.exports?t.exports=r:e.Promise||(e.Promise=r)}(this),function(){Object.defineProperty||"__defineGetter__"in{}&&(Object.defineProperty=function(e,t,n){n.get&&e.__defineGetter__(t,function(){return n.get.call(e)}),n.set&&e.__defineSetter__(t,function(t){return n.set.call(e,t)})})}()}).call(function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0}());var n=window.cmsWebpackJsonp;window.cmsWebpackJsonp=function(t,o,i){for(var a,c,u=0,f=[];u<t.length;u++)c=t[u],r[c]&&f.push(r[c][0]),r[c]=0;for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e[a]=o[a]);for(n&&n(t,o,i);f.length;)f.shift()()};var o={},r={8:0};t.e=function(e){function n(){c.onerror=c.onload=null,clearTimeout(u);var t=r[e];0!==t&&(t&&t[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}var o=r[e];if(0===o)return new Promise(function(e){e()});if(o)return o[2];var i=new Promise(function(t,n){o=r[e]=[t,n]});o[2]=i;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,t.nc&&c.setAttribute("nonce",t.nc),c.src=t.p+"bundle."+({0:"admin.widget"}[e]||e)+".min.js";var u=setTimeout(n,12e4);return c.onerror=c.onload=n,a.appendChild(c),i},t.m=e,t.c=o,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t.oe=function(e){throw e},t(t.s=355)}({355:function(e,t,n){n.p=n(54)("bundle.forms.apphookselect"),n.e(0).then(function(e){var t=n(0);t(function(){var e=window.apphooks_configuration||{},n=t("#application_urls, #id_application_urls"),o=n.find("option:selected"),r=t(".form-row.application_namespace, .form-row.field-application_namespace"),i=r.find("#application_namespace, #id_application_namespace"),a=t(".form-row.application_configs, .form-row.field-application_configs"),c=a.find("#application_configs, #id_application_configs"),u=a.find("#add_application_configs"),f=i.val();n.setupNamespaces=function(){var n=t(this).find("option:selected");if(t(c).length>0&&e[n.val()]){c.html("");for(var o=0;o<e[n.val()].length;o++){var i="";e[n.val()][o][0]===window.apphooks_configuration_value&&(i='selected="selected"'),c.append("<option "+i+' value="'+e[n.val()][o][0]+'">'+e[n.val()][o][1]+"</option>")}u.attr("href",window.apphooks_configuration_url[n.val()]+(window.showRelatedObjectPopup?"?_popup=1":"")),a.removeClass("hidden"),r.addClass("hidden")}else a.addClass("hidden"),n.data("namespace")?r.removeClass("hidden"):r.addClass("hidden")},n.setupNamespaces(),n.on("change",function(){var e=t(this),r=e.find("option:selected");n.setupNamespaces(),e.val()||(i.val(""),i.removeAttr("value")),o.val()===r.val()?f&&i.val(f):r.data("namespace")?i.val(r.data("namespace")):(i.val(""),i.removeAttr("value"))})})}.bind(null,n)).catch(n.oe)},54:function(e,t){var n=function(e){var t=new RegExp(e+".*$","gi");if(document.currentScript)return document.currentScript.src.replace(t,"");var n,o;return n=document.getElementsByTagName("script"),o=function(e,n){for(var o,r,i=0;i<e.length;i++)if(r=null,void 0!==e[i].getAttribute.length&&(r=e[i].getAttribute(n,2)),r&&(o=r,o=o.split("?")[0].split("/").pop(),o.match(t)))return r}(n,"src"),o?o.replace(t,""):""};e.exports=n}});