PageSourceSearch

https://carleasepolska.pl/assets/ui/admin/resources/admin/assets/t…/collection_controller-rc99K8O.js

js carleasepolska.pl collected 2026-10-01 15:43:07 UTC 4,235 bytes, 1 lines download raw bytes

1function _assert_this_initialized(e){if(e===0[0])throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _class_call_check(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n,s=0;s<t.length;s++)n=t[s],n.enumerable=n.enumerable,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _create_class(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _get_prototype_of(e){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},_get_prototype_of(e)}function _inherits(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_set_prototype_of(e,t)}function _possible_constructor_return(e,t){return t&&(_type_of(t)==="object"||typeof t=="function")?t:_assert_this_initialized(e)}function _set_prototype_of(e,t){return _set_prototype_of=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},_set_prototype_of(e,t)}function _type_of(e){return"@swc/helpers - typeof",e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _is_native_reflect_construct(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _create_super(e){var t=_is_native_reflect_construct();return function(){var s,i,o=_get_prototype_of(e);return t?(i=_get_prototype_of(this).constructor,s=Reflect.construct(o,arguments,i)):s=o.apply(this,arguments),_possible_constructor_return(this,s)}}import{Controller}from"@hotwired/stimulus";var _class=function(e){"use strict";_inherits(t,e);var n=_create_super(t);function t(){return _class_call_check(this,t),n.apply(this,arguments)}return _create_class(t,[{key:"add",value:function(){if(""===this.prototypeValue)return;var t,n,s,o,i,a=this.prototypeValue.replace(/__name__/g,String(this.indexValue));if(this.indexValue+=1,o=document.createElement("template"),o.innerHTML=a.trim(),t=o.content.firstElementChild,null===t)return;this.listTarget.appendChild(t),(n=(i=window).initTinymcePlugin)===null||n===0[0]?0[0]:n.call(i),this.refresh(),(s=t.querySelector("input, textarea, select"))===null||s===0[0]?0[0]:s.focus(),this.announce("Dodano: ".concat(this.titleOf(t)))}},{key:"remove",value:function(t){var s,o,i,a,r,n=t.currentTarget.closest('[data-collections--collection-target="item"]');if(null===n)return;r=this.titleOf(n),s=(i=n.nextElementSibling)!==null&&i!==0[0]?i:n.previousElementSibling,n.remove(),this.refresh(),o=(a=s?.querySelector('[data-collections--collection-target="remove"]'))!==null&&a!==0[0]?a:this.element.querySelector('[data-action~="collections--collection#add"]'),o?.focus(),this.announce("Usunięto: ".concat(r))}},{key:"refresh",value:function(){var t=this;this.itemTargets.forEach(function(e,n){var s,o="".concat(t.nounValue," ").concat(n+1),i=e.querySelector('[data-collections--collection-target="title"]');i&&(i.textContent=o),s=e.querySelector('[data-collections--collection-target="remove"]'),s?.setAttribute("aria-label","Usuń: ".concat(o.toLowerCase()))}),this.hasEmptyTarget&&(this.emptyTarget.hidden=this.itemTargets.length>0)}},{key:"titleOf",value:function(t){var n,s,o;return(o=(s=t.querySelector('[data-collections--collection-target="title"]'))===null||s===0[0]?0[0]:(n=s.textContent)===null||n===0[0]?0[0]:n.trim().toLowerCase())!==null&&o!==0[0]?o:""}},{key:"announce",value:function(t){this.hasStatusTarget&&(this.statusTarget.textContent=t)}}]),t}(Controller);_define_property(_class,"targets",["list","item","title","remove","empty","status"]),_define_property(_class,"values",{prototype:{type:String,default:""},index:{type:Number,default:0},noun:{type:String,default:"Pozycja"}});export{_class as default}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.