PageSourceSearch

https://cdn.infourok.ru/assets/common/controllers/modal-job-select…/modal-job-selection_controller-vQIC5B0.js

js infourok.ru collected 2026-09-24 08:52:52 UTC 11,126 bytes, 323 lines download raw bytes

1/// <reference path="../../../../../../../global.d.ts" />
2/// <reference path="../../../../../../../iu.d.ts" />
3function _assert_this_initialized(self) {
4    if (self === void 0) {
5        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6    }
7    return self;
8}
9function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10    try {
11        var info = gen[key](arg);
12        var value = info.value;
13    } catch (error) {
14        reject(error);
15        return;
16    }
17    if (info.done) {
18        resolve(value);
19    } else {
20        Promise.resolve(value).then(_next, _throw);
21    }
22}
23function _async_to_generator(fn) {
24    return function() {
25        var self = this, args = arguments;
26        return new Promise(function(resolve, reject) {
27            var gen = fn.apply(self, args);
28            function _next(value) {
29                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
30            }
31            function _throw(err) {
32                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
33            }
34            _next(undefined);
35        });
36    };
37}
38function _class_call_check(instance, Constructor) {
39    if (!(instance instanceof Constructor)) {
40        throw new TypeError("Cannot call a class as a function");
41    }
42}
43function _defineProperties(target, props) {
44    for(var i = 0; i < props.length; i++){
45        var descriptor = props[i];
46        descriptor.enumerable = descriptor.enumerable || false;
47        descriptor.configurable = true;
48        if ("value" in descriptor) descriptor.writable = true;
49        Object.defineProperty(target, descriptor.key, descriptor);
50    }
51}
52function _create_class(Constructor, protoProps, staticProps) {
53    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
54    if (staticProps) _defineProperties(Constructor, staticProps);
55    return Constructor;
56}
57function _define_property(obj, key, value) {
58    if (key in obj) {
59        Object.defineProperty(obj, key, {
60            value: value,
61            enumerable: true,
62            configurable: true,
63            writable: true
64        });
65    } else {
66        obj[key] = value;
67    }
68    return obj;
69}
70function _get_prototype_of(o) {
71    _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
72        return o.__proto__ || Object.getPrototypeOf(o);
73    };
74    return _get_prototype_of(o);
75}
76function _inherits(subClass, superClass) {
77    if (typeof superClass !== "function" && superClass !== null) {
78        throw new TypeError("Super expression must either be null or a function");
79    }
80    subClass.prototype = Object.create(superClass && superClass.prototype, {
81        constructor: {
82            value: subClass,
83            writable: true,
84            configurable: true
85        }
86    });
87    if (superClass) _set_prototype_of(subClass, superClass);
88}
89function _possible_constructor_return(self, call) {
90    if (call && (_type_of(call) === "object" || typeof call === "function")) {
91        return call;
92    }
93    return _assert_this_initialized(self);
94}
95function _set_prototype_of(o, p) {
96    _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
97        o.__proto__ = p;
98        return o;
99    };
100    return _set_prototype_of(o, p);
101}
102function _type_of(obj) {
103    "@swc/helpers - typeof";
104    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
105}
106function _is_native_reflect_construct() {
107    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
108    if (Reflect.construct.sham) return false;
109    if (typeof Proxy === "function") return true;
110    try {
111        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
112        return true;
113    } catch (e) {
114        return false;
115    }
116}
117function _create_super(Derived) {
118    var hasNativeReflectConstruct = _is_native_reflect_construct();
119    return function _createSuperInternal() {
120        var Super = _get_prototype_of(Derived), result;
121        if (hasNativeReflectConstruct) {
122            var NewTarget = _get_prototype_of(this).constructor;
123            result = Reflect.construct(Super, arguments, NewTarget);
124        } else {
125            result = Super.apply(this, arguments);
126        }
127        return _possible_constructor_return(this, result);
128    };
129}
130function _ts_generator(thisArg, body) {
131    var f, y, t, g, _ = {
132        label: 0,
133        sent: function() {
134            if (t[0] & 1) throw t[1];
135            return t[1];
136        },
137        trys: [],
138        ops: []
139    };
140    return g = {
141        next: verb(0),
142        "throw": verb(1),
143        "return": verb(2)
144    }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
145        return this;
146    }), g;
147    function verb(n) {
148        return function(v) {
149            return step([
150                n,
151                v
152            ]);
153        };
154    }
155    function step(op) {
156        if (f) throw new TypeError("Generator is already executing.");
157        while(_)try {
158            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
159            if (y = 0, t) op = [
160                op[0] & 2,
161                t.value
162            ];
163            switch(op[0]){
164                case 0:
165                case 1:
166                    t = op;
167                    break;
168                case 4:
169                    _.label++;
170                    return {
171                        value: op[1],
172                        done: false
173                    };
174                case 5:
175                    _.label++;
176                    y = op[1];
177                    op = [
178                        0
179                    ];
180                    continue;
181                case 7:
182                    op = _.ops.pop();
183                    _.trys.pop();
184                    continue;
185                default:
186                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
187                        _ = 0;
188                        continue;
189                    }
190                    if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
191                        _.label = op[1];
192                        break;
193                    }
194                    if (op[0] === 6 && _.label < t[1]) {
195                        _.label = t[1];
196                        t = op;
197                        break;
198                    }
199                    if (t && _.label < t[2]) {
200                        _.label = t[2];
201                        _.ops.push(op);
202                        break;
203                    }
204                    if (t[2]) _.ops.pop();
205                    _.trys.pop();
206                    continue;
207            }
208            op = body.call(thisArg, _);
209        } catch (e) {
210            op = [
211                6,
212                e
213            ];
214            y = 0;
215        } finally{
216            f = t = 0;
217        }
218        if (op[0] & 5) throw op[1];
219        return {
220            value: op[0] ? op[1] : void 0,
221            done: true
222        };
223    }
224}
225import { Controller } from "@hotwired/stimulus";
226import { useDebounce } from "stimulus-use";
227import { waitForWindowFn } from "../../../helpers/waitForWindowFn.js";
228var _class = /*#__PURE__*/ function(Controller) {
229    "use strict";
230    _inherits(_class, Controller);
231    var _super = _create_super(_class);
232    function _class() {
233        _class_call_check(this, _class);
234        return _super.apply(this, arguments);
235    }
236    _create_class(_class, [
237        {
238            key: "connect",
239            value: function connect() {
240                useDebounce(this, {
241                    wait: 200
242                });
243                this.initTooltip();
244            }
245        },
246        {
247            key: "onInput",
248            value: function onInput() {
249                var query = this.schoolInputTarget.value.trim();
250                if (query.length === 0) {
251                    this.hideCatalog();
252                } else {
253                    this.showCatalog();
254                }
255            }
256        },
257        {
258            key: "hideCatalog",
259            value: function hideCatalog() {
260                this.schoolCatalogTarget.classList.remove("modal-map__school-catalog--active");
261            }
262        },
263        {
264            key: "showCatalog",
265            value: function showCatalog() {
266                this.schoolCatalogTarget.classList.add("modal-map__school-catalog--active");
267            }
268        },
269        {
270            key: "initTooltip",
271            value: function initTooltip() {
272                return _async_to_generator(function() {
273                    var e;
274                    return _ts_generator(this, function(_state) {
275                        switch(_state.label){
276                            case 0:
277                                _state.trys.push([
278                                    0,
279                                    2,
280                                    ,
281                                    3
282                                ]);
283                                return [
284                                    4,
285                                    waitForWindowFn("tippy")
286                                ];
287                            case 1:
288                                _state.sent();
289                                return [
290                                    3,
291                                    3
292                                ];
293                            case 2:
294                                e = _state.sent();
295                                return [
296                                    2
297                                ];
298                            case 3:
299                                window.tippy(".modal-map__input-icon", {
300                                    content: "Попробуйте ввести индекс, и, если в&nbsp;предложенном списке названия Вашего ОУ&nbsp;не&nbsp;будет, пожалуйста, пришлите на&nbsp;почту [email protected] наименование&nbsp;ОУ по&nbsp;уставу (полное и&nbsp;сокращённое), его адрес (индекс, страну, область/край, город/посёлок, улицу, дом) и&nbsp;мы&nbsp;внесём его в&nbsp;базу.",
301                                    allowHTML: true,
302                                    interactive: true,
303                                    zIndex: 99999999
304                                });
305                                return [
306                                    2
307                                ];
308                        }
309                    });
310                })();
311            }
312        }
313    ]);
314    return _class;
315}(Controller);
316_define_property(_class, "targets", [
317    "schoolCatalog",
318    "schoolInput"
319]);
320_define_property(_class, "debounces", [
321    "onInput"
322]);
323/* stimulusFetch: 'lazy' */ 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.