chunk-MWIFVNKP.js 175 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566
  1. import {
  2. C,
  3. t as t5
  4. } from "./chunk-LSDW2622.js";
  5. import {
  6. e as e4,
  7. t as t3
  8. } from "./chunk-IQNZZCQJ.js";
  9. import {
  10. w as w2
  11. } from "./chunk-TODU7HVH.js";
  12. import {
  13. n as n3
  14. } from "./chunk-PZKZIMMP.js";
  15. import {
  16. A,
  17. B,
  18. C as C2,
  19. K,
  20. O,
  21. P,
  22. R,
  23. U as U2,
  24. X,
  25. Y,
  26. Z,
  27. a,
  28. ie,
  29. k,
  30. l as l3,
  31. m as m3,
  32. ne,
  33. o as o3,
  34. oe,
  35. u as u3,
  36. w,
  37. y as y2
  38. } from "./chunk-YLVXZ2PS.js";
  39. import {
  40. dt,
  41. f as f2,
  42. j
  43. } from "./chunk-WFSV2B2I.js";
  44. import {
  45. n as n2,
  46. t as t4
  47. } from "./chunk-MFFE4I2S.js";
  48. import {
  49. a as a2,
  50. n
  51. } from "./chunk-XBH7TGC2.js";
  52. import {
  53. e as e5,
  54. h,
  55. i,
  56. o as o4
  57. } from "./chunk-K3NA3LQS.js";
  58. import {
  59. M,
  60. f as f3
  61. } from "./chunk-TRK7CKWP.js";
  62. import {
  63. r as r2,
  64. z
  65. } from "./chunk-6P6NA7JB.js";
  66. import {
  67. l as l2
  68. } from "./chunk-7XXXCK2A.js";
  69. import {
  70. m as m2,
  71. o as o2,
  72. u as u2
  73. } from "./chunk-N2663GRX.js";
  74. import {
  75. e as e3,
  76. u
  77. } from "./chunk-WEMIK25H.js";
  78. import {
  79. c as c3,
  80. o2 as o
  81. } from "./chunk-XNLG7T2T.js";
  82. import {
  83. c as c2,
  84. f,
  85. l,
  86. s as s3,
  87. y
  88. } from "./chunk-2Z6LERTI.js";
  89. import {
  90. c,
  91. e as e2
  92. } from "./chunk-OWVBLVP3.js";
  93. import {
  94. U
  95. } from "./chunk-VNFRAYHO.js";
  96. import {
  97. e
  98. } from "./chunk-WSRBH7BF.js";
  99. import {
  100. g
  101. } from "./chunk-ULGDPLM2.js";
  102. import {
  103. s,
  104. s3 as s2
  105. } from "./chunk-EMJ4ZSM2.js";
  106. import {
  107. m
  108. } from "./chunk-IKP3YN53.js";
  109. import {
  110. r,
  111. t,
  112. t2
  113. } from "./chunk-GZT4BVFP.js";
  114. // node_modules/@arcgis/core/core/BidiText.js
  115. var i2 = new C();
  116. function n4(r18) {
  117. if (!i2.hasBidiChar(r18))
  118. return [r18, false];
  119. let n17;
  120. return n17 = i2.checkContextual(r18) === "rtl" ? "IDNNN" : "ICNNN", [i2.bidiTransform(r18, n17, "VLYSN"), true];
  121. }
  122. // node_modules/@arcgis/core/symbols/cim/CIMResourceManager.js
  123. var o5 = ";base64,";
  124. var s4 = class {
  125. constructor() {
  126. this._resourceMap = new Map(), this._inFlightResourceMap = new Map(), this.geometryEngine = null;
  127. }
  128. destroy() {
  129. this._inFlightResourceMap.clear(), this._resourceMap.clear();
  130. }
  131. getResource(e11) {
  132. return this._resourceMap.get(e11) ?? null;
  133. }
  134. async fetchResource(e11, r18) {
  135. const t8 = { width: 0, height: 0 }, o11 = this._resourceMap, s10 = o11.get(e11);
  136. if (s10)
  137. return t8.width = s10.width, t8.height = s10.height, t8;
  138. let c9 = this._inFlightResourceMap.get(e11);
  139. return c9 || (c9 = i3(e11, r18), this._inFlightResourceMap.set(e11, c9), c9 = c9.then((r19) => {
  140. if (this._inFlightResourceMap.delete(e11), r19.ok) {
  141. o11.set(e11, r19.value);
  142. const s11 = r19.value;
  143. return t8.width = s11.width, t8.height = s11.height, t8;
  144. }
  145. return t8;
  146. }), c9);
  147. }
  148. deleteResource(e11) {
  149. this._inFlightResourceMap.delete(e11), this._resourceMap.delete(e11);
  150. }
  151. };
  152. function i3(s10, i8) {
  153. if (s10.includes(o5)) {
  154. const e11 = new Image();
  155. return e11.src = s10, e11.decode().then(() => ({ ok: true, value: e11 })).catch((e12) => g(e12) ? { ok: false, error: e12 } : { ok: false, error: new s2("invalid-resource", `Could not fetch requested resource at ${s10}`) });
  156. }
  157. return U(s10, { responseType: "image", ...i8 }).then((e11) => ({ ok: true, value: e11.data })).catch((e11) => g(e11) ? { ok: false, error: e11 } : { ok: false, error: new s2("invalid-resource", `Could not fetch requested resource at ${s10}`) });
  158. }
  159. // node_modules/@arcgis/core/symbols/cim/TextRasterizer.js
  160. function e6(t8) {
  161. return `rgb(${t8.slice(0, 3).toString()})`;
  162. }
  163. function i4(t8) {
  164. return `rgba(${t8.slice(0, 3).toString()},${t8[3]})`;
  165. }
  166. var s5 = class {
  167. rasterizeText(t8, s10) {
  168. this._textRasterizationCanvas || (this._textRasterizationCanvas = document.createElement("canvas"));
  169. const r18 = this._textRasterizationCanvas, o11 = r18.getContext("2d");
  170. this._setFontProperties(o11, s10), this.parameters = s10, this.textLines = t8.split(/\r?\n/), this.lineHeight = this._computeLineHeight();
  171. const h6 = this._computeTextWidth(o11, s10), { decoration: a10, weight: l9 } = s10.font;
  172. this.lineThroughWidthOffset = a10 && a10 === "line-through" ? 0.1 * this.lineHeight : 0;
  173. const d2 = this.lineHeight * this.textLines.length;
  174. r18.width = h6 + 2 * this.lineThroughWidthOffset, r18.height = d2, this.renderedLineHeight = Math.round(this.lineHeight * s10.pixelRatio), this.renderedHaloSize = s10.halo.size * s10.pixelRatio, this.renderedWidth = h6 * s10.pixelRatio, this.renderedHeight = d2 * s10.pixelRatio, this.lineThroughWidthOffset *= s10.pixelRatio, this.fillStyle = i4(s10.color), this.haloStyle = e6(s10.halo.color);
  175. const c9 = this.renderedLineHeight, g5 = this.renderedHaloSize;
  176. this._setFontProperties(o11, s10);
  177. const f8 = n5(o11.textAlign, this.renderedWidth) + g5, u9 = g5, p3 = g5 > 0;
  178. let x3 = this.lineThroughWidthOffset, m7 = 0;
  179. p3 && this._renderHalo(o11, f8, u9, x3, m7, s10), m7 += u9, x3 += f8;
  180. for (const e11 of this.textLines)
  181. o11.globalCompositeOperation = "destination-out", o11.fillStyle = "rgb(0, 0, 0)", o11.fillText(e11, x3, m7), o11.globalCompositeOperation = "source-over", o11.fillStyle = this.fillStyle, o11.fillText(e11, x3, m7), a10 && a10 !== "none" && this._renderDecoration(o11, x3, m7, a10, l9), m7 += c9;
  182. const _4 = this.renderedWidth + 2 * this.lineThroughWidthOffset, H3 = this.renderedHeight, z3 = o11.getImageData(0, 0, _4, H3), w4 = new Uint8Array(z3.data);
  183. if (s10.premultiplyColors) {
  184. let t9;
  185. for (let e11 = 0; e11 < w4.length; e11 += 4)
  186. t9 = w4[e11 + 3] / 255, w4[e11] = w4[e11] * t9, w4[e11 + 1] = w4[e11 + 1] * t9, w4[e11 + 2] = w4[e11 + 2] * t9;
  187. }
  188. return { size: [_4, H3], image: new Uint32Array(w4.buffer), sdf: false, simplePattern: false, anchorX: 0, anchorY: 0 };
  189. }
  190. _renderHalo(t8, e11, i8, s10, n17, r18) {
  191. const o11 = this.renderedWidth, h6 = this.renderedHeight;
  192. this._haloRasterizationCanvas || (this._haloRasterizationCanvas = document.createElement("canvas")), this._haloRasterizationCanvas.width = o11, this._haloRasterizationCanvas.height = h6;
  193. const a10 = this._haloRasterizationCanvas, l9 = a10.getContext("2d");
  194. l9.clearRect(0, 0, o11, h6), this._setFontProperties(l9, r18);
  195. const { decoration: d2, weight: c9 } = r18.font;
  196. l9.fillStyle = this.haloStyle, l9.strokeStyle = this.haloStyle;
  197. const g5 = this.renderedHaloSize < 3;
  198. l9.lineJoin = g5 ? "miter" : "round", g5 ? this._renderHaloEmulated(l9, e11, i8, d2, c9) : this._renderHaloNative(l9, e11, i8, d2, c9), t8.globalAlpha = this.parameters.halo.color[3], t8.drawImage(a10, 0, 0, o11, h6, s10, n17, o11, h6), t8.globalAlpha = 1;
  199. }
  200. _renderHaloEmulated(t8, e11, i8, s10, n17) {
  201. const o11 = this.renderedLineHeight, h6 = this.renderedHaloSize;
  202. for (const a10 of this.textLines) {
  203. for (const [s11, n18] of r3)
  204. t8.fillText(a10, e11 + h6 * s11, i8 + h6 * n18);
  205. s10 && s10 !== "none" && this._renderDecoration(t8, e11, i8, s10, n17), i8 += o11;
  206. }
  207. }
  208. _renderHaloNative(t8, e11, i8, s10, n17) {
  209. const r18 = this.renderedLineHeight, o11 = this.renderedHaloSize;
  210. for (const h6 of this.textLines) {
  211. const a10 = 2 * o11, l9 = 5, d2 = 0.1;
  212. for (let r19 = 0; r19 < l9; r19++) {
  213. const o12 = 1 - (l9 - 1) * d2 + r19 * d2;
  214. t8.lineWidth = o12 * a10, t8.strokeText(h6, e11, i8), s10 && s10 !== "none" && this._renderDecoration(t8, e11, i8, s10, n17);
  215. }
  216. i8 += r18;
  217. }
  218. }
  219. _setFontProperties(e11, i8) {
  220. const s10 = i8.font, n17 = `${s10.style} ${s10.weight} ${u(i8.size * i8.pixelRatio)}px ${s10.family}, sans-serif`;
  221. let r18;
  222. switch (e11.font = n17, e11.textBaseline = "top", i8.horizontalAlignment) {
  223. case "left":
  224. default:
  225. r18 = "left";
  226. break;
  227. case "right":
  228. r18 = "right";
  229. break;
  230. case "center":
  231. r18 = "center";
  232. }
  233. e11.textAlign = r18;
  234. }
  235. computeTextSize(t8, e11) {
  236. this._textRasterizationCanvas || (this._textRasterizationCanvas = document.createElement("canvas"));
  237. const i8 = this._textRasterizationCanvas, s10 = i8.getContext("2d");
  238. this._setFontProperties(s10, e11), this.parameters = e11, this.textLines = t8.split(/\r?\n/), this.lineHeight = this._computeLineHeight();
  239. const n17 = this._computeTextWidth(s10, e11), r18 = this.lineHeight * this.textLines.length;
  240. return i8.width = n17, i8.height = r18, [n17 * e11.pixelRatio, r18 * e11.pixelRatio];
  241. }
  242. _computeTextWidth(t8, e11) {
  243. let i8 = 0;
  244. for (const n17 of this.textLines)
  245. i8 = Math.max(i8, t8.measureText(n17).width);
  246. const s10 = e11.font;
  247. return (s10.style === "italic" || s10.style === "oblique" || typeof s10.weight == "string" && (s10.weight === "bold" || s10.weight === "bolder") || typeof s10.weight == "number" && s10.weight > 600) && (i8 += 0.3 * t8.measureText("w").width), i8 += 2 * this.parameters.halo.size, Math.round(i8);
  248. }
  249. _computeLineHeight() {
  250. let t8 = 1.275 * this.parameters.size;
  251. const e11 = this.parameters.font.decoration;
  252. return e11 && e11 === "underline" && (t8 *= 1.3), Math.round(t8 + 2 * this.parameters.halo.size);
  253. }
  254. _renderDecoration(t8, e11, i8, s10, n17) {
  255. const r18 = 0.9 * this.lineHeight, o11 = n17 === "bold" ? 0.06 : n17 === "bolder" ? 0.09 : 0.04;
  256. switch (t8.textAlign) {
  257. case "center":
  258. e11 -= this.renderedWidth / 2;
  259. break;
  260. case "right":
  261. e11 -= this.renderedWidth;
  262. }
  263. const h6 = t8.textBaseline;
  264. if (s10 === "underline")
  265. switch (h6) {
  266. case "top":
  267. i8 += r18;
  268. break;
  269. case "middle":
  270. i8 += r18 / 2;
  271. }
  272. else if (s10 === "line-through")
  273. switch (h6) {
  274. case "top":
  275. i8 += r18 / 1.5;
  276. break;
  277. case "middle":
  278. i8 += r18 / 3;
  279. }
  280. t8.save(), t8.beginPath(), t8.strokeStyle = t8.fillStyle, t8.lineWidth = Math.ceil(r18 * o11), t8.moveTo(e11 - this.lineThroughWidthOffset, i8), t8.lineTo(e11 + this.renderedWidth + 2 * this.lineThroughWidthOffset, i8), t8.stroke(), t8.restore();
  281. }
  282. };
  283. function n5(t8, e11) {
  284. return t8 === "center" ? 0.5 * e11 : t8 === "right" ? e11 : 0;
  285. }
  286. var r3 = [];
  287. {
  288. const t8 = 16;
  289. for (let e11 = 0; e11 < 360; e11 += 360 / t8)
  290. r3.push([Math.cos(Math.PI * e11 / 180), Math.sin(Math.PI * e11 / 180)]);
  291. }
  292. // node_modules/@arcgis/core/core/floatRGBA.js
  293. function o6(o11, r18, e11 = 0) {
  294. const i8 = o(o11, 0, f4);
  295. for (let t8 = 0; t8 < 4; t8++)
  296. r18[e11 + t8] = Math.floor(256 * l4(i8 * n6[t8]));
  297. }
  298. function r4(t8, o11 = 0) {
  299. let r18 = 0;
  300. for (let n17 = 0; n17 < 4; n17++)
  301. r18 += t8[o11 + n17] * e7[n17];
  302. return r18;
  303. }
  304. var n6 = [1, 256, 65536, 16777216];
  305. var e7 = [1 / 256, 1 / 65536, 1 / 16777216, 1 / 4294967296];
  306. var f4 = r4(new Uint8ClampedArray([255, 255, 255, 255]));
  307. function l4(t8) {
  308. return t8 - Math.floor(t8);
  309. }
  310. // node_modules/@arcgis/core/symbols/cim/CIMPlacements.js
  311. var t6 = class {
  312. constructor() {
  313. this.setIdentity();
  314. }
  315. getAngle() {
  316. return (this.rz == null || this.rz === 0 && this.rz_c !== 1 && this.rz_s !== 0) && (this.rz = Math.atan2(this.rz_s, this.rz_c)), this.rz;
  317. }
  318. setIdentity() {
  319. this.tx = 0, this.ty = 0, this.tz = 0, this.s = 1, this.rx = 0, this.ry = 0, this.rz = 0, this.rz_c = 1, this.rz_s = 0;
  320. }
  321. setTranslate(t8, s10) {
  322. this.tx = t8, this.ty = s10;
  323. }
  324. setTranslateZ(t8) {
  325. this.tz = t8;
  326. }
  327. setRotateCS(t8, s10) {
  328. this.rz = void 0, this.rz_c = t8, this.rz_s = s10;
  329. }
  330. setRotate(t8) {
  331. this.rz = t8, this.rz_c = void 0, this.rz_s = void 0;
  332. }
  333. setRotateY(t8) {
  334. this.ry = t8;
  335. }
  336. setScale(t8) {
  337. this.s = t8;
  338. }
  339. setMeasure(t8) {
  340. this.m = t8;
  341. }
  342. };
  343. // node_modules/@arcgis/core/symbols/cim/CIMEffects.js
  344. var r5 = class {
  345. constructor(t8) {
  346. this._geometry = t8;
  347. }
  348. next() {
  349. const t8 = this._geometry;
  350. return this._geometry = null, t8;
  351. }
  352. };
  353. // node_modules/@arcgis/core/symbols/cim/CIMCursor.js
  354. function a3(i8) {
  355. const n17 = m(i8);
  356. return P2(n17), n17;
  357. }
  358. function r6(t8) {
  359. if (!t8)
  360. return null;
  361. l(t8) ? t8.y = -t8.y : c2(t8) ? l5(t8.rings) : y(t8) ? l5(t8.paths) : f(t8) && u4(t8.points);
  362. }
  363. function u4(t8) {
  364. if (t8) {
  365. const i8 = t8.length;
  366. for (let n17 = 0; n17 < i8; n17++)
  367. t8[n17][1] = -t8[n17][1];
  368. }
  369. }
  370. function l5(t8) {
  371. if (t8)
  372. for (const i8 of t8)
  373. u4(i8);
  374. }
  375. function c4(t8) {
  376. if (t8) {
  377. for (let i8 = t8.length - 1; i8 > 0; --i8)
  378. t8[i8][0] -= t8[i8 - 1][0], t8[i8][1] -= t8[i8 - 1][1];
  379. }
  380. }
  381. function f5(t8) {
  382. if (t8)
  383. for (const i8 of t8)
  384. c4(i8);
  385. }
  386. function p(t8) {
  387. if (t8) {
  388. const i8 = t8.length;
  389. for (let n17 = 1; n17 < i8; ++n17)
  390. t8[n17][0] += t8[n17 - 1][0], t8[n17][1] += t8[n17 - 1][1];
  391. }
  392. }
  393. function m4(t8) {
  394. if (t8)
  395. for (const i8 of t8)
  396. p(i8);
  397. }
  398. function P2(t8) {
  399. t8 && (c2(t8) ? m4(t8.rings) : y(t8) ? m4(t8.paths) : f(t8) && p(t8.points), r6(t8));
  400. }
  401. function x(t8) {
  402. t8 && (r6(t8), c2(t8) ? f5(t8.rings) : y(t8) ? f5(t8.paths) : f(t8) && c4(t8.points));
  403. }
  404. function g2(t8) {
  405. if (t8)
  406. for (const i8 of t8)
  407. d(i8);
  408. }
  409. function d(t8) {
  410. t8 && t8.reverse();
  411. }
  412. function y3(t8, i8, n17) {
  413. return [t8[0] + (i8[0] - t8[0]) * n17, t8[1] + (i8[1] - t8[1]) * n17];
  414. }
  415. function C3(t8) {
  416. return !(!t8 || t8.length === 0) && (t8[0][0] === t8[t8.length - 1][0] && t8[0][1] === t8[t8.length - 1][1]);
  417. }
  418. function I(t8) {
  419. return t8[4];
  420. }
  421. function j2(t8, i8) {
  422. t8[4] = i8;
  423. }
  424. var G = class {
  425. constructor(t8, s10, e11, a10) {
  426. this.acceptPolygon = s10, this.acceptPolyline = e11, this.geomUnitsPerPoint = a10, this.pathCount = -1, this.pathIndex = -1, this.iteratePath = false, t8 && (c2(t8) ? s10 && (this.multiPath = t8.rings, this.isClosed = true) : y(t8) ? e11 && (this.multiPath = t8.paths, this.isClosed = false) : s3(t8) && s10 && (this.multiPath = b(t8).rings, this.isClosed = true), this.multiPath && (this.pathCount = this.multiPath.length)), this.internalPlacement = new t6();
  427. }
  428. next() {
  429. if (!this.multiPath)
  430. return null;
  431. for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
  432. this.iteratePath || this.pathIndex++;
  433. const t8 = this.processPath(this.multiPath[this.pathIndex]);
  434. if (t8)
  435. return t8;
  436. }
  437. return this.pathCount = -1, this.pathIndex = -1, this.multiPath = null, null;
  438. }
  439. };
  440. var U3 = class {
  441. constructor(t8, i8, n17, s10) {
  442. this.inputGeometries = t8, this.acceptPolygon = i8, this.acceptPolyline = n17, this.geomUnitsPerPoint = s10, this.pathCount = -1, this.pathIndex = -1, this.iteratePath = false;
  443. }
  444. next() {
  445. for (; ; ) {
  446. if (!this.multiPath) {
  447. let t8 = this.inputGeometries.next();
  448. for (; t8; ) {
  449. if (c2(t8) ? this.acceptPolygon && (this.multiPath = t8.rings, this.isClosed = true) : y(t8) ? this.acceptPolyline && (this.multiPath = t8.paths, this.isClosed = false) : s3(t8) && this.acceptPolygon && (this.multiPath = b(t8).rings, this.isClosed = true), this.multiPath) {
  450. this.pathCount = this.multiPath.length, this.pathIndex = -1;
  451. break;
  452. }
  453. t8 = this.inputGeometries.next();
  454. }
  455. if (!this.multiPath)
  456. return null;
  457. }
  458. for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
  459. this.iteratePath || this.pathIndex++;
  460. const t8 = this.processPath(this.multiPath[this.pathIndex]);
  461. if (t8)
  462. return t8;
  463. }
  464. this.pathCount = -1, this.pathIndex = -1, this.multiPath = null;
  465. }
  466. }
  467. };
  468. function b(t8) {
  469. return { rings: [[[t8.xmin, t8.ymin], [t8.xmin, t8.ymax], [t8.xmax, t8.ymax], [t8.xmax, t8.ymin], [t8.xmin, t8.ymin]]] };
  470. }
  471. // node_modules/@arcgis/core/symbols/cim/effects/EffectAddControlPoints.js
  472. var o7 = class {
  473. static local() {
  474. return o7.instance === null && (o7.instance = new o7()), o7.instance;
  475. }
  476. execute(s10, t8, e11, i8) {
  477. return new r7(s10, t8, e11);
  478. }
  479. };
  480. o7.instance = null;
  481. var r7 = class {
  482. constructor(s10, t8, e11) {
  483. this._inputGeometries = s10, this._angleTolerance = t8.angleTolerance !== void 0 ? t8.angleTolerance : 120, this._maxCosAngle = Math.cos((1 - Math.abs(this._angleTolerance) / 180) * Math.PI);
  484. }
  485. next() {
  486. let n17 = this._inputGeometries.next();
  487. for (; n17; ) {
  488. if (c2(n17)) {
  489. this._isClosed = true;
  490. const t8 = m(n17);
  491. return this._processMultipath(t8.rings), t8;
  492. }
  493. if (y(n17)) {
  494. this._isClosed = false;
  495. const t8 = m(n17);
  496. return this._processMultipath(t8.paths), t8;
  497. }
  498. if (s3(n17)) {
  499. if (this._maxCosAngle)
  500. return n17;
  501. this._isClosed = true;
  502. const s10 = [[n17.xmin, n17.ymin], [n17.xmin, n17.ymax], [n17.xmax, n17.ymax], [n17.xmax, n17.ymin], [n17.xmin, n17.ymin]];
  503. return this._processPath(s10), { rings: [s10] };
  504. }
  505. n17 = this._inputGeometries.next();
  506. }
  507. return null;
  508. }
  509. _processMultipath(s10) {
  510. if (s10)
  511. for (const t8 of s10)
  512. this._processPath(t8);
  513. }
  514. _processPath(s10) {
  515. if (s10) {
  516. let t8, e11, i8, o11, r18, l9, a10 = s10.length, h6 = s10[0];
  517. this._isClosed && ++a10;
  518. for (let c9 = 1; c9 < a10; ++c9) {
  519. let m7;
  520. m7 = this._isClosed && c9 === a10 - 1 ? s10[0] : s10[c9];
  521. const _4 = m7[0] - h6[0], u9 = m7[1] - h6[1], p3 = Math.sqrt(_4 * _4 + u9 * u9);
  522. if (c9 > 1 && p3 > 0 && i8 > 0) {
  523. (t8 * _4 + e11 * u9) / p3 / i8 <= this._maxCosAngle && j2(h6, 1);
  524. }
  525. c9 === 1 && (o11 = _4, r18 = u9, l9 = p3), p3 > 0 && (h6 = m7, t8 = _4, e11 = u9, i8 = p3);
  526. }
  527. if (this._isClosed && i8 > 0 && l9 > 0) {
  528. (t8 * o11 + e11 * r18) / l9 / i8 <= this._maxCosAngle && j2(s10[0], 1);
  529. }
  530. }
  531. }
  532. };
  533. // node_modules/@arcgis/core/symbols/cim/CurveHelper.js
  534. var e8 = 0.03;
  535. var s6 = class {
  536. constructor() {
  537. this._path = [];
  538. }
  539. path() {
  540. return this._path;
  541. }
  542. addPath(t8, e11) {
  543. e11 || t8.reverse(), Array.prototype.push.apply(this._path, t8), e11 || t8.reverse();
  544. }
  545. static mergePath(t8, e11) {
  546. e11 && Array.prototype.push.apply(t8, e11);
  547. }
  548. startPath(t8) {
  549. this._path.push(t8);
  550. }
  551. lineTo(t8) {
  552. this._path.push(t8);
  553. }
  554. close() {
  555. const t8 = this._path;
  556. t8.length > 1 && (t8[0][0] === t8[t8.length - 1][0] && t8[0][1] === t8[t8.length - 1][1] || t8.push([t8[0][0], t8[0][1]]));
  557. }
  558. };
  559. var n7 = class {
  560. constructor(t8 = 0, e11 = false) {
  561. }
  562. normalize(t8) {
  563. const e11 = Math.sqrt(t8[0] * t8[0] + t8[1] * t8[1]);
  564. e11 !== 0 && (t8[0] /= e11, t8[1] /= e11);
  565. }
  566. calculateLength(t8, e11) {
  567. const s10 = e11[0] - t8[0], n17 = e11[1] - t8[1];
  568. return Math.sqrt(s10 * s10 + n17 * n17);
  569. }
  570. calculateSegLength(t8, e11) {
  571. return this.calculateLength(t8[e11], t8[e11 + 1]);
  572. }
  573. calculatePathLength(t8) {
  574. let e11 = 0;
  575. const s10 = t8 ? t8.length : 0;
  576. for (let n17 = 0; n17 < s10 - 1; ++n17)
  577. e11 += this.calculateSegLength(t8, n17);
  578. return e11;
  579. }
  580. calculatePathArea(t8) {
  581. let e11 = 0;
  582. const s10 = t8 ? t8.length : 0;
  583. for (let n17 = 0; n17 < s10 - 1; ++n17)
  584. e11 += (t8[n17 + 1][0] - t8[n17][0]) * (t8[n17 + 1][1] + t8[n17][1]);
  585. return e11 / 2;
  586. }
  587. getCoord2D(t8, e11, s10) {
  588. return [t8[0] + (e11[0] - t8[0]) * s10, t8[1] + (e11[1] - t8[1]) * s10];
  589. }
  590. getSegCoord2D(t8, e11, s10) {
  591. return this.getCoord2D(t8[e11], t8[e11 + 1], s10);
  592. }
  593. getAngle(t8, e11, s10) {
  594. const n17 = e11[0] - t8[0], r18 = e11[1] - t8[1];
  595. return Math.atan2(r18, n17);
  596. }
  597. getSegAngle(t8, e11, s10) {
  598. return this.getAngle(t8[e11], t8[e11 + 1], s10);
  599. }
  600. getAngleCS(t8, e11, s10) {
  601. const n17 = e11[0] - t8[0], r18 = e11[1] - t8[1], h6 = Math.sqrt(n17 * n17 + r18 * r18);
  602. return h6 > 0 ? [n17 / h6, r18 / h6] : [1, 0];
  603. }
  604. getSegAngleCS(t8, e11, s10) {
  605. return this.getAngleCS(t8[e11], t8[e11 + 1], s10);
  606. }
  607. cut(t8, e11, s10, n17) {
  608. return [s10 <= 0 ? t8[e11] : this.getSegCoord2D(t8, e11, s10), n17 >= 1 ? t8[e11 + 1] : this.getSegCoord2D(t8, e11, n17)];
  609. }
  610. addSegment(t8, e11, s10) {
  611. s10 && t8.push(e11[0]), t8.push(e11[1]);
  612. }
  613. getSubCurve(t8, e11, s10) {
  614. const n17 = [];
  615. return this.appendSubCurve(n17, t8, e11, s10) ? n17 : null;
  616. }
  617. appendSubCurve(t8, e11, s10, n17) {
  618. const r18 = e11 ? e11.length - 1 : 0;
  619. let h6 = 0, l9 = true, o11 = 0;
  620. for (; o11 < r18; ) {
  621. const r19 = this.calculateSegLength(e11, o11);
  622. if (r19 !== 0) {
  623. if (l9) {
  624. if (h6 + r19 > s10) {
  625. const a10 = (s10 - h6) / r19;
  626. let u9 = 1, c9 = false;
  627. h6 + r19 >= n17 && (u9 = (n17 - h6) / r19, c9 = true);
  628. const i8 = this.cut(e11, o11, a10, u9);
  629. if (i8 && this.addSegment(t8, i8, l9), c9)
  630. break;
  631. l9 = false;
  632. }
  633. } else {
  634. if (h6 + r19 > n17) {
  635. const s11 = this.cut(e11, o11, 0, (n17 - h6) / r19);
  636. s11 && this.addSegment(t8, s11, l9);
  637. break;
  638. }
  639. this.addSegment(t8, [e11[o11], e11[o11 + 1]], l9);
  640. }
  641. h6 += r19, ++o11;
  642. } else
  643. ++o11;
  644. }
  645. return true;
  646. }
  647. getCIMPointAlong(t8, e11) {
  648. const s10 = t8 ? t8.length - 1 : 0;
  649. let n17 = 0, r18 = -1;
  650. for (; r18 < s10; ) {
  651. ++r18;
  652. const s11 = this.calculateSegLength(t8, r18);
  653. if (s11 !== 0) {
  654. if (n17 + s11 > e11) {
  655. const h6 = (e11 - n17) / s11;
  656. return this.getCoord2D(t8[r18], t8[r18 + 1], h6);
  657. }
  658. n17 += s11;
  659. }
  660. }
  661. return null;
  662. }
  663. isEmpty(t8, e11) {
  664. if (!t8 || t8.length <= 1)
  665. return true;
  666. const s10 = t8 ? t8.length - 1 : 0;
  667. let n17 = -1;
  668. for (; n17 < s10; ) {
  669. if (++n17, t8[n17 + 1][0] !== t8[n17][0] || t8[n17 + 1][1] !== t8[n17][1])
  670. return false;
  671. if (e11 && t8[n17 + 1][2] !== t8[n17][2])
  672. return false;
  673. }
  674. return true;
  675. }
  676. offset(e11, s10, n17, r18, h6) {
  677. if (!e11 || e11.length < 2)
  678. return null;
  679. let l9 = 0, o11 = e11[l9++], a10 = l9;
  680. for (; l9 < e11.length; ) {
  681. const t8 = e11[l9];
  682. t8[0] === o11[0] && t8[1] === o11[1] || (l9 !== a10 && (e11[a10] = e11[l9]), o11 = e11[a10++]), l9++;
  683. }
  684. const u9 = e11[0][0] === e11[a10 - 1][0] && e11[0][1] === e11[a10 - 1][1];
  685. if (u9 && --a10, a10 < (u9 ? 3 : 2))
  686. return null;
  687. const c9 = [];
  688. o11 = u9 ? e11[a10 - 1] : null;
  689. let i8 = e11[0];
  690. for (let g5 = 0; g5 < a10; g5++) {
  691. const h7 = g5 === a10 - 1 ? u9 ? e11[0] : null : e11[g5 + 1];
  692. if (o11)
  693. if (h7) {
  694. const e12 = [h7[0] - i8[0], h7[1] - i8[1]];
  695. this.normalize(e12);
  696. const l10 = [i8[0] - o11[0], i8[1] - o11[1]];
  697. this.normalize(l10);
  698. const a11 = l10[0] * e12[1] - l10[1] * e12[0], u10 = l10[0] * e12[0] + l10[1] * e12[1];
  699. if (a11 === 0 && u10 === 1) {
  700. i8 = h7;
  701. continue;
  702. }
  703. if (a11 >= 0 == s10 <= 0) {
  704. if (u10 < 1) {
  705. const t8 = [e12[0] - l10[0], e12[1] - l10[1]];
  706. this.normalize(t8);
  707. const n18 = Math.sqrt((1 + u10) / 2);
  708. if (n18 > 1 / r18) {
  709. const e13 = -Math.abs(s10) / n18;
  710. c9.push([i8[0] - t8[0] * e13, i8[1] - t8[1] * e13]);
  711. }
  712. }
  713. } else
  714. switch (n17) {
  715. case O.Mitered: {
  716. const t8 = Math.sqrt((1 + u10) / 2);
  717. if (t8 > 0 && 1 / t8 < r18) {
  718. const n18 = [e12[0] - l10[0], e12[1] - l10[1]];
  719. this.normalize(n18);
  720. const r19 = Math.abs(s10) / t8;
  721. c9.push([i8[0] - n18[0] * r19, i8[1] - n18[1] * r19]);
  722. break;
  723. }
  724. }
  725. case O.Bevelled:
  726. c9.push([i8[0] + l10[1] * s10, i8[1] - l10[0] * s10]), c9.push([i8[0] + e12[1] * s10, i8[1] - e12[0] * s10]);
  727. break;
  728. case O.Rounded:
  729. if (u10 < 1) {
  730. c9.push([i8[0] + l10[1] * s10, i8[1] - l10[0] * s10]);
  731. const t8 = Math.floor(2.5 * (1 - u10));
  732. if (t8 > 0) {
  733. const n18 = 1 / t8;
  734. let r19 = n18;
  735. for (let h8 = 1; h8 < t8; h8++, r19 += n18) {
  736. const t9 = [l10[1] * (1 - r19) + e12[1] * r19, -l10[0] * (1 - r19) - e12[0] * r19];
  737. this.normalize(t9), c9.push([i8[0] + t9[0] * s10, i8[1] + t9[1] * s10]);
  738. }
  739. }
  740. c9.push([i8[0] + e12[1] * s10, i8[1] - e12[0] * s10]);
  741. }
  742. break;
  743. case O.Square:
  744. default:
  745. if (a11 < 0)
  746. c9.push([i8[0] + (l10[1] + l10[0]) * s10, i8[1] + (l10[1] - l10[0]) * s10]), c9.push([i8[0] + (e12[1] - e12[0]) * s10, i8[1] - (e12[0] + e12[1]) * s10]);
  747. else {
  748. const t8 = Math.sqrt((1 + Math.abs(u10)) / 2), n18 = [e12[0] - l10[0], e12[1] - l10[1]];
  749. this.normalize(n18);
  750. const r19 = s10 / t8;
  751. c9.push([i8[0] - n18[0] * r19, i8[1] - n18[1] * r19]);
  752. }
  753. }
  754. } else {
  755. const t8 = [i8[0] - o11[0], i8[1] - o11[1]];
  756. this.normalize(t8), c9.push([i8[0] + t8[1] * s10, i8[1] - t8[0] * s10]);
  757. }
  758. else {
  759. const t8 = [h7[0] - i8[0], h7[1] - i8[1]];
  760. this.normalize(t8), c9.push([i8[0] + t8[1] * s10, i8[1] - t8[0] * s10]);
  761. }
  762. o11 = i8, i8 = h7;
  763. }
  764. return c9.length < (u9 ? 3 : 2) ? null : (u9 && c9.push([c9[0][0], c9[0][1]]), c9);
  765. }
  766. };
  767. // node_modules/@arcgis/core/symbols/cim/effects/EffectArrow.js
  768. var l6 = 1.7320508075688772;
  769. var c5 = 5;
  770. var u5 = P.OpenEnded;
  771. var h2 = class {
  772. static local() {
  773. return h2.instance === null && (h2.instance = new h2()), h2.instance;
  774. }
  775. execute(t8, e11, r18, n17) {
  776. return new a4(t8, e11, r18);
  777. }
  778. };
  779. h2.instance = null;
  780. var a4 = class extends U3 {
  781. constructor(t8, e11, o11) {
  782. super(t8, false, true), this._curveHelper = new n7(), this._width = (e11.width !== void 0 ? e11.width : c5) * o11, this._arrowType = e11.geometricEffectArrowType !== void 0 ? e11.geometricEffectArrowType : e11.arrowType !== void 0 ? e11.arrowType : u5, this._offsetFlattenError = e8 * o11;
  783. }
  784. processPath(t8) {
  785. switch (this._arrowType) {
  786. case P.OpenEnded:
  787. default:
  788. return this._constructSimpleArrow(t8, true);
  789. case P.Block:
  790. return this._constructSimpleArrow(t8, false);
  791. case P.Crossed:
  792. return this._constructCrossedArrow(t8);
  793. }
  794. }
  795. _constructSimpleArrow(t8, e11) {
  796. const r18 = this._curveHelper.calculatePathLength(t8);
  797. let n17 = this._width;
  798. r18 < 2 * n17 && (n17 = r18 / 2);
  799. const s10 = this._curveHelper.getSubCurve(t8, 0, r18 - n17);
  800. if (!s10)
  801. return null;
  802. const i8 = n17 / 2;
  803. if (this._curveHelper.isEmpty(s10, false))
  804. return null;
  805. const l9 = this._constructOffset(s10, -i8);
  806. if (!l9)
  807. return null;
  808. const c9 = this._constructOffset(s10, i8);
  809. if (!c9)
  810. return null;
  811. const u9 = this._constructArrowBasePoint(l9, -i8 / 2);
  812. if (!u9)
  813. return null;
  814. const h6 = this._constructArrowBasePoint(c9, i8 / 2);
  815. if (!h6)
  816. return null;
  817. const a10 = t8[t8.length - 1];
  818. e11 || (this._makeControlPoint(c9, true), this._makeControlPoint(l9, true));
  819. const _4 = new s6();
  820. return _4.addPath(c9, true), _4.lineTo(h6), this._makeControlPoint(_4.path()), _4.lineTo(a10), this._makeControlPoint(_4.path()), _4.lineTo(u9), this._makeControlPoint(_4.path()), _4.addPath(l9, false), e11 ? { paths: [_4.path()] } : (_4.close(), { rings: [_4.path()] });
  821. }
  822. _constructCrossedArrow(t8) {
  823. const e11 = this._curveHelper.calculatePathLength(t8);
  824. let r18 = this._width;
  825. e11 < r18 * (1 + l6 + 1) && (r18 = e11 / (1 + l6 + 1));
  826. const n17 = this._curveHelper.getSubCurve(t8, 0, e11 - r18 * (1 + l6));
  827. if (!n17)
  828. return null;
  829. const s10 = r18 / 2;
  830. if (this._curveHelper.isEmpty(n17, false))
  831. return null;
  832. const i8 = this._constructOffset(n17, s10);
  833. if (!i8)
  834. return null;
  835. const c9 = this._constructOffset(n17, -s10);
  836. if (!c9)
  837. return null;
  838. const u9 = this._curveHelper.getSubCurve(t8, 0, e11 - r18);
  839. if (!u9)
  840. return null;
  841. if (this._curveHelper.isEmpty(u9, false))
  842. return null;
  843. const h6 = this._constructOffset(u9, s10);
  844. if (!h6)
  845. return null;
  846. const a10 = this._constructOffset(u9, -s10);
  847. if (!a10)
  848. return null;
  849. const _4 = h6[h6.length - 1], f8 = this._constructArrowBasePoint(h6, s10 / 2);
  850. if (!f8)
  851. return null;
  852. const p3 = a10[a10.length - 1], m7 = this._constructArrowBasePoint(a10, -s10 / 2);
  853. if (!m7)
  854. return null;
  855. const d2 = t8[t8.length - 1];
  856. this._makeControlPoint(i8, false), this._makeControlPoint(c9, false);
  857. const w4 = new s6();
  858. return w4.addPath(i8, true), this._makeControlPoint(w4.path()), w4.lineTo(p3), w4.lineTo(m7), this._makeControlPoint(w4.path()), w4.lineTo(d2), this._makeControlPoint(w4.path()), w4.lineTo(f8), this._makeControlPoint(w4.path()), w4.lineTo(_4), this._makeControlPoint(w4.path()), w4.addPath(c9, false), { paths: [w4.path()] };
  859. }
  860. _constructOffset(t8, e11) {
  861. return this._curveHelper.offset(t8, e11, O.Rounded, 4, this._offsetFlattenError);
  862. }
  863. _constructArrowBasePoint(t8, e11) {
  864. if (!t8 || t8.length < 2)
  865. return null;
  866. const r18 = t8[t8.length - 2], n17 = t8[t8.length - 1], o11 = [n17[0] - r18[0], n17[1] - r18[1]];
  867. return this._curveHelper.normalize(o11), [n17[0] + o11[1] * e11, n17[1] - o11[0] * e11];
  868. }
  869. _makeControlPoint(t8, r18 = false) {
  870. j2(r18 ? t8[0] : t8[t8.length - 1], 1);
  871. }
  872. };
  873. // node_modules/@arcgis/core/symbols/cim/effects/EffectBuffer.js
  874. var f6 = class {
  875. static local() {
  876. return f6.instance === null && (f6.instance = new f6()), f6.instance;
  877. }
  878. execute(e11, t8, s10, i8) {
  879. return new h3(e11, t8, s10, i8);
  880. }
  881. };
  882. f6.instance = null;
  883. var h3 = class {
  884. constructor(e11, t8, s10, i8) {
  885. this._inputGeometries = e11, this._curveHelper = new n7(), this._size = (t8.size !== void 0 ? t8.size : 1) * s10, this._offsetFlattenError = e8 * s10;
  886. }
  887. next() {
  888. let n17 = this._inputGeometries.next();
  889. for (; n17; ) {
  890. if (s3(n17))
  891. if (this._size > 0) {
  892. const e11 = [[n17.xmin, n17.ymin], [n17.xmin, n17.ymax], [n17.xmax, n17.ymax], [n17.xmax, n17.ymin], [n17.xmin, n17.ymin]], t8 = this._curveHelper.offset(e11, this._size, O.Rounded, 4, this._offsetFlattenError);
  893. if (t8)
  894. return { rings: [t8] };
  895. } else {
  896. if (!(this._size < 0))
  897. return n17;
  898. if (Math.min(n17.xmax - n17.xmin, n17.ymax - n17.ymin) + 2 * this._size > 0)
  899. return { xmin: n17.xmin - this._size, xmax: n17.xmax + this._size, ymin: n17.ymin - this._size, ymax: n17.ymax + this._size };
  900. }
  901. if (c2(n17)) {
  902. if (this._size === 0)
  903. return n17;
  904. const e11 = [];
  905. for (const t8 of n17.rings) {
  906. const s10 = this._curveHelper.offset(t8, this._size, O.Rounded, 4, this._offsetFlattenError);
  907. s10 && e11.push(s10);
  908. }
  909. if (e11.length)
  910. return { rings: e11 };
  911. }
  912. if (y(n17) && this._size > 0) {
  913. const e11 = [];
  914. for (const t8 of n17.paths)
  915. if (t8 && t8.length > 1) {
  916. const s10 = this._curveHelper.offset(t8, this._size, O.Rounded, 4, this._offsetFlattenError), i8 = this._curveHelper.offset(t8, -this._size, O.Rounded, 4, this._offsetFlattenError);
  917. if (s10 && i8) {
  918. for (let e12 = i8.length - 1; e12 >= 0; e12--)
  919. s10.push(i8[e12]);
  920. s10.push([s10[0][0], s10[0][1]]), e11.push(s10);
  921. }
  922. }
  923. if (e11.length)
  924. return { rings: e11 };
  925. }
  926. l(n17) && this._size, n17 = this._inputGeometries.next();
  927. }
  928. return null;
  929. }
  930. };
  931. // node_modules/@arcgis/core/symbols/cim/effects/EffectControlMeasureLine.js
  932. var _ = class {
  933. static local() {
  934. return _.instance === null && (_.instance = new _()), _.instance;
  935. }
  936. execute(s10, t8, i8, h6) {
  937. return new c6(s10, t8, i8);
  938. }
  939. };
  940. _.instance = null;
  941. var c6 = class {
  942. constructor(s10, t8, i8) {
  943. this._default_point_size = 20, this._inputGeometries = s10, this._geomUnitsPerPoint = i8, this._rule = t8.rule ?? R.FullGeometry, this._default_size = this._default_point_size * i8;
  944. }
  945. next() {
  946. let e11;
  947. for (; e11 = this._inputGeometries.next(); ) {
  948. let r18;
  949. if (l(e11) ? r18 = this._processGeom([[[e11.x, e11.y]]]) : f(e11) ? r18 = this._processGeom([e11.points]) : y(e11) ? r18 = this._processGeom(e11.paths) : c2(e11) && (r18 = this._processGeom(e11.rings)), r18 && r18.length)
  950. return { paths: r18 };
  951. }
  952. return null;
  953. }
  954. _clone(s10) {
  955. return [s10[0], s10[1]];
  956. }
  957. _mid(s10, t8) {
  958. return [(s10[0] + t8[0]) / 2, (s10[1] + t8[1]) / 2];
  959. }
  960. _mix(s10, t8, i8, h6) {
  961. return [s10[0] * t8 + i8[0] * h6, s10[1] * t8 + i8[1] * h6];
  962. }
  963. _add(s10, t8) {
  964. return [s10[0] + t8[0], s10[1] + t8[1]];
  965. }
  966. _add2(s10, t8, i8) {
  967. return [s10[0] + t8, s10[1] + i8];
  968. }
  969. _sub(s10, t8) {
  970. return [s10[0] - t8[0], s10[1] - t8[1]];
  971. }
  972. _dist(s10, t8) {
  973. return Math.sqrt((s10[0] - t8[0]) * (s10[0] - t8[0]) + (s10[1] - t8[1]) * (s10[1] - t8[1]));
  974. }
  975. _norm(s10) {
  976. return Math.sqrt(s10[0] * s10[0] + s10[1] * s10[1]);
  977. }
  978. _normalize(s10, t8 = 1) {
  979. const i8 = t8 / this._norm(s10);
  980. s10[0] *= i8, s10[1] *= i8;
  981. }
  982. _leftPerpendicular(s10) {
  983. const t8 = -s10[1], i8 = s10[0];
  984. s10[0] = t8, s10[1] = i8;
  985. }
  986. _leftPerp(s10) {
  987. return [-s10[1], s10[0]];
  988. }
  989. _rightPerpendicular(s10) {
  990. const t8 = s10[1], i8 = -s10[0];
  991. s10[0] = t8, s10[1] = i8;
  992. }
  993. _rightPerp(s10) {
  994. return [s10[1], -s10[0]];
  995. }
  996. _dotProduct(s10, t8) {
  997. return s10[0] * t8[0] + s10[1] * t8[1];
  998. }
  999. _crossProduct(s10, t8) {
  1000. return s10[0] * t8[1] - s10[1] * t8[0];
  1001. }
  1002. _rotateDirect(s10, t8, i8) {
  1003. const h6 = s10[0] * t8 - s10[1] * i8, e11 = s10[0] * i8 + s10[1] * t8;
  1004. s10[0] = h6, s10[1] = e11;
  1005. }
  1006. _makeCtrlPt(s10) {
  1007. const t8 = [s10[0], s10[1]];
  1008. return j2(t8, 1), t8;
  1009. }
  1010. _addAngledTicks(s10, t8, i8, h6) {
  1011. const e11 = this._sub(i8, t8);
  1012. this._normalize(e11);
  1013. const r18 = this._crossProduct(e11, this._sub(h6, t8));
  1014. let _4;
  1015. _4 = r18 > 0 ? this._rightPerp(e11) : this._leftPerp(e11);
  1016. const c9 = Math.abs(r18) / 2, u9 = [];
  1017. u9.push([t8[0] + (_4[0] - e11[0]) * c9, t8[1] + (_4[1] - e11[1]) * c9]), u9.push(t8), u9.push(i8), u9.push([i8[0] + (_4[0] + e11[0]) * c9, i8[1] + (_4[1] + e11[1]) * c9]), s10.push(u9);
  1018. }
  1019. _addBezier2(s10, t8, i8, h6, e11) {
  1020. if (e11-- == 0)
  1021. return void s10.push(h6);
  1022. const r18 = this._mid(t8, i8), _4 = this._mid(i8, h6), c9 = this._mid(r18, _4);
  1023. this._addBezier2(s10, t8, r18, c9, e11), this._addBezier2(s10, c9, _4, h6, e11);
  1024. }
  1025. _addBezier3(s10, t8, i8, h6, e11, r18) {
  1026. if (r18-- == 0)
  1027. return void s10.push(e11);
  1028. const _4 = this._mid(t8, i8), c9 = this._mid(i8, h6), u9 = this._mid(h6, e11), o11 = this._mid(_4, c9), n17 = this._mid(c9, u9), a10 = this._mid(o11, n17);
  1029. this._addBezier3(s10, t8, _4, o11, a10, r18), this._addBezier3(s10, a10, n17, u9, e11, r18);
  1030. }
  1031. _add90DegArc(s10, t8, i8, h6, e11) {
  1032. const r18 = e11 ?? this._crossProduct(this._sub(i8, t8), this._sub(h6, t8)) > 0, _4 = this._mid(t8, i8), c9 = this._sub(_4, t8);
  1033. r18 ? this._leftPerpendicular(c9) : this._rightPerpendicular(c9), _4[0] += c9[0], _4[1] += c9[1], this._addBezier3(s10, t8, this._mix(t8, 0.33333, _4, 0.66667), this._mix(i8, 0.33333, _4, 0.66667), i8, 4);
  1034. }
  1035. _addArrow(s10, t8, i8) {
  1036. const h6 = t8[0], e11 = t8[1], r18 = t8[t8.length - 1], _4 = this._sub(h6, e11);
  1037. this._normalize(_4);
  1038. const c9 = this._crossProduct(_4, this._sub(r18, e11)), u9 = 0.5 * c9, o11 = this._leftPerp(_4), n17 = [r18[0] - o11[0] * c9, r18[1] - o11[1] * c9], a10 = t8.length - 1, p3 = [];
  1039. p3.push(i8 ? [-o11[0], -o11[1]] : o11);
  1040. let l9 = [-_4[0], -_4[1]];
  1041. for (let d2 = 1; d2 < a10 - 1; d2++) {
  1042. const s11 = this._sub(t8[d2 + 1], t8[d2]);
  1043. this._normalize(s11);
  1044. const i9 = this._dotProduct(s11, l9), h7 = this._crossProduct(s11, l9), e12 = Math.sqrt((1 + i9) / 2), r19 = this._sub(s11, l9);
  1045. this._normalize(r19), r19[0] /= e12, r19[1] /= e12, p3.push(h7 < 0 ? [-r19[0], -r19[1]] : r19), l9 = s11;
  1046. }
  1047. p3.push(this._rightPerp(l9));
  1048. for (let d2 = p3.length - 1; d2 > 0; d2--)
  1049. s10.push([t8[d2][0] + p3[d2][0] * u9, t8[d2][1] + p3[d2][1] * u9]);
  1050. s10.push([n17[0] + p3[0][0] * u9, n17[1] + p3[0][1] * u9]), s10.push([n17[0] + p3[0][0] * c9, n17[1] + p3[0][1] * c9]), s10.push(h6), s10.push([n17[0] - p3[0][0] * c9, n17[1] - p3[0][1] * c9]), s10.push([n17[0] - p3[0][0] * u9, n17[1] - p3[0][1] * u9]);
  1051. for (let d2 = 1; d2 < p3.length; d2++)
  1052. s10.push([t8[d2][0] - p3[d2][0] * u9, t8[d2][1] - p3[d2][1] * u9]);
  1053. }
  1054. _cp2(s10, t8, i8) {
  1055. return s10.length >= 2 ? s10[1] : this._add2(s10[0], t8 * this._default_size, i8 * this._default_size);
  1056. }
  1057. _cp3(s10, t8, i8, h6) {
  1058. if (s10.length >= 3)
  1059. return s10[2];
  1060. const e11 = this._mix(s10[0], 1 - i8, t8, i8), r18 = this._sub(t8, s10[0]);
  1061. return this._normalize(r18), this._rightPerpendicular(r18), [e11[0] + r18[0] * h6 * this._default_size, e11[1] + r18[1] * h6 * this._default_size];
  1062. }
  1063. _arrowPath(s10) {
  1064. if (s10.length > 2)
  1065. return s10;
  1066. const t8 = s10[0], i8 = this._cp2(s10, -4, 0), h6 = this._sub(t8, i8);
  1067. this._normalize(h6);
  1068. const e11 = this._rightPerp(h6);
  1069. return [t8, i8, [t8[0] + (e11[0] - h6[0]) * this._default_size, t8[1] + (e11[1] - h6[1]) * this._default_size]];
  1070. }
  1071. _arrowLastSeg(s10) {
  1072. const t8 = s10[0], i8 = this._cp2(s10, -4, 0);
  1073. let h6;
  1074. if (s10.length >= 3)
  1075. h6 = s10[s10.length - 1];
  1076. else {
  1077. const s11 = this._sub(t8, i8);
  1078. this._normalize(s11);
  1079. const e11 = this._rightPerp(s11);
  1080. h6 = [t8[0] + (e11[0] - s11[0]) * this._default_size, t8[1] + (e11[1] - s11[1]) * this._default_size];
  1081. }
  1082. return [i8, h6];
  1083. }
  1084. _processGeom(s10) {
  1085. if (!s10)
  1086. return null;
  1087. const t8 = [];
  1088. for (const i8 of s10) {
  1089. if (!i8 || i8.length === 0)
  1090. continue;
  1091. const s11 = i8.length;
  1092. let h6 = i8[0];
  1093. switch (this._rule) {
  1094. case R.PerpendicularFromFirstSegment: {
  1095. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = [];
  1096. r18.push(e11), r18.push(this._mid(h6, s12)), t8.push(r18);
  1097. break;
  1098. }
  1099. case R.ReversedFirstSegment: {
  1100. const s12 = this._cp2(i8, 0, -1);
  1101. t8.push([s12, h6]);
  1102. break;
  1103. }
  1104. case R.PerpendicularToSecondSegment: {
  1105. const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = [];
  1106. r18.push(this._mid(s12, e11)), r18.push(h6), t8.push(r18);
  1107. break;
  1108. }
  1109. case R.SecondSegmentWithTicks: {
  1110. const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
  1111. let _4;
  1112. _4 = this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerp(_4) : this._leftPerp(r18);
  1113. const c9 = [];
  1114. c9.push([s12[0] + (_4[0] - r18[0]) / 3, s12[1] + (_4[1] - r18[1]) / 3]), c9.push(s12), c9.push(e11), c9.push([e11[0] + (_4[0] + r18[0]) / 3, e11[1] + (_4[1] + r18[1]) / 3]), t8.push(c9);
  1115. break;
  1116. }
  1117. case R.DoublePerpendicular: {
  1118. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 3), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
  1119. this._normalize(_4);
  1120. const c9 = this._crossProduct(_4, this._sub(h6, e11));
  1121. this._leftPerpendicular(_4);
  1122. const u9 = [];
  1123. u9.push(h6), u9.push([e11[0] + _4[0] * c9, e11[1] + _4[1] * c9]), t8.push(u9);
  1124. const o11 = [];
  1125. o11.push([e11[0] - _4[0] * c9, e11[1] - _4[1] * c9]), o11.push(s12), t8.push(o11);
  1126. break;
  1127. }
  1128. case R.OppositeToFirstSegment: {
  1129. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 3), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
  1130. this._normalize(_4);
  1131. const c9 = this._crossProduct(_4, this._sub(h6, e11));
  1132. this._leftPerpendicular(_4);
  1133. const u9 = [];
  1134. u9.push([e11[0] + _4[0] * c9, e11[1] + _4[1] * c9]), u9.push([e11[0] - _4[0] * c9, e11[1] - _4[1] * c9]), t8.push(u9);
  1135. break;
  1136. }
  1137. case R.TriplePerpendicular: {
  1138. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
  1139. this._normalize(_4);
  1140. const c9 = this._crossProduct(_4, this._sub(h6, e11));
  1141. this._leftPerpendicular(_4);
  1142. const u9 = [];
  1143. u9.push([e11[0] + _4[0] * c9 * 0.8, e11[1] + _4[1] * c9 * 0.8]), u9.push([r18[0] + 0.8 * (h6[0] - r18[0]), r18[1] + 0.8 * (h6[1] - r18[1])]), t8.push(u9), t8.push([e11, r18]);
  1144. const o11 = [];
  1145. o11.push([e11[0] - _4[0] * c9 * 0.8, e11[1] - _4[1] * c9 * 0.8]), o11.push([r18[0] + 0.8 * (s12[0] - r18[0]), r18[1] + 0.8 * (s12[1] - r18[1])]), t8.push(o11);
  1146. break;
  1147. }
  1148. case R.HalfCircleFirstSegment: {
  1149. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = this._mid(h6, s12);
  1150. let _4 = this._sub(s12, h6);
  1151. const c9 = Math.cos(Math.PI / 18), u9 = Math.sin(Math.PI / 18), o11 = Math.sqrt((1 + c9) / 2), n17 = Math.sqrt((1 - c9) / 2), a10 = [];
  1152. let p3;
  1153. this._crossProduct(_4, this._sub(e11, h6)) > 0 ? (a10.push(h6), _4 = this._sub(h6, r18), p3 = s12) : (a10.push(s12), _4 = this._sub(s12, r18), p3 = h6), this._rotateDirect(_4, o11, n17), _4[0] /= o11, _4[1] /= o11;
  1154. for (let t9 = 1; t9 <= 18; t9++)
  1155. a10.push(this._add(r18, _4)), this._rotateDirect(_4, c9, u9);
  1156. a10.push(p3), t8.push(a10);
  1157. break;
  1158. }
  1159. case R.HalfCircleSecondSegment: {
  1160. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 1, -1);
  1161. let r18 = this._sub(h6, s12);
  1162. this._normalize(r18);
  1163. const _4 = this._crossProduct(r18, this._sub(e11, s12)) / 2;
  1164. this._leftPerpendicular(r18);
  1165. const c9 = [s12[0] + r18[0] * _4, s12[1] + r18[1] * _4];
  1166. r18 = this._sub(s12, c9);
  1167. const u9 = Math.cos(Math.PI / 18);
  1168. let o11 = Math.sin(Math.PI / 18);
  1169. _4 > 0 && (o11 = -o11);
  1170. const n17 = [s12];
  1171. for (let t9 = 1; t9 <= 18; t9++)
  1172. this._rotateDirect(r18, u9, o11), n17.push(this._add(c9, r18));
  1173. t8.push(n17);
  1174. break;
  1175. }
  1176. case R.HalfCircleExtended: {
  1177. const e11 = this._cp2(i8, 0, -2), r18 = this._cp3(i8, e11, 1, -1);
  1178. let _4;
  1179. if (s11 >= 4)
  1180. _4 = i8[3];
  1181. else {
  1182. const s12 = this._sub(h6, e11);
  1183. _4 = this._add(r18, s12);
  1184. }
  1185. const c9 = this._dist(e11, r18) / 2 / 0.75, u9 = this._sub(e11, h6);
  1186. this._normalize(u9, c9);
  1187. const o11 = this._sub(r18, _4);
  1188. this._normalize(o11, c9);
  1189. const n17 = [_4, r18];
  1190. t8.push(n17);
  1191. const a10 = [this._clone(r18)];
  1192. this._addBezier3(a10, r18, this._add(r18, o11), this._add(e11, u9), e11, 4), a10.push(h6), t8.push(a10);
  1193. break;
  1194. }
  1195. case R.OpenCircle: {
  1196. const s12 = this._cp2(i8, -2, 0), e11 = this._sub(s12, h6), r18 = Math.cos(Math.PI / 18), _4 = -Math.sin(Math.PI / 18), c9 = [s12];
  1197. for (let t9 = 1; t9 <= 33; t9++)
  1198. this._rotateDirect(e11, r18, _4), c9.push(this._add(h6, e11));
  1199. t8.push(c9);
  1200. break;
  1201. }
  1202. case R.CoverageEdgesWithTicks: {
  1203. const e11 = this._cp2(i8, 0, -1);
  1204. let r18, _4;
  1205. if (s11 >= 3)
  1206. r18 = i8[2];
  1207. else {
  1208. const s12 = this._sub(e11, h6), t9 = this._leftPerp(s12);
  1209. r18 = [h6[0] + t9[0] - 0.25 * s12[0], h6[1] + t9[1] - 0.25 * s12[1]];
  1210. }
  1211. if (s11 >= 4)
  1212. _4 = i8[3];
  1213. else {
  1214. const s12 = this._mid(h6, e11), t9 = this._sub(h6, e11);
  1215. this._normalize(t9), this._leftPerpendicular(t9);
  1216. const i9 = this._crossProduct(t9, this._sub(r18, s12));
  1217. this._rightPerpendicular(t9), _4 = [r18[0] + t9[0] * i9 * 2, r18[1] + t9[1] * i9 * 2];
  1218. }
  1219. const c9 = this._sub(e11, h6);
  1220. let u9, o11;
  1221. u9 = this._crossProduct(c9, this._sub(r18, h6)) > 0 ? this._rightPerp(c9) : this._leftPerp(c9), o11 = [], o11.push(r18), o11.push(h6), o11.push([h6[0] + (u9[0] - c9[0]) / 3, h6[1] + (u9[1] - c9[1]) / 3]), t8.push(o11), u9 = this._crossProduct(c9, this._sub(_4, e11)) > 0 ? this._rightPerp(u9) : this._leftPerp(c9), o11 = [], o11.push([e11[0] + (u9[0] + c9[0]) / 3, e11[1] + (u9[1] + c9[1]) / 3]), o11.push(e11), o11.push(_4), t8.push(o11);
  1222. break;
  1223. }
  1224. case R.GapExtentWithDoubleTicks: {
  1225. const e11 = this._cp2(i8, 0, 2), r18 = this._cp3(i8, e11, 0, 1);
  1226. let _4;
  1227. if (s11 >= 4)
  1228. _4 = i8[3];
  1229. else {
  1230. const s12 = this._sub(e11, h6);
  1231. _4 = this._add(r18, s12);
  1232. }
  1233. this._addAngledTicks(t8, h6, e11, this._mid(r18, _4)), this._addAngledTicks(t8, r18, _4, this._mid(h6, e11));
  1234. break;
  1235. }
  1236. case R.GapExtentMidline: {
  1237. const e11 = this._cp2(i8, 2, 0), r18 = this._cp3(i8, e11, 0, 1);
  1238. let _4;
  1239. if (s11 >= 4)
  1240. _4 = i8[3];
  1241. else {
  1242. const s12 = this._sub(e11, h6);
  1243. _4 = this._add(r18, s12);
  1244. }
  1245. const c9 = [];
  1246. c9.push(this._mid(h6, r18)), c9.push(this._mid(e11, _4)), t8.push(c9);
  1247. break;
  1248. }
  1249. case R.Chevron: {
  1250. const e11 = this._cp2(i8, -1, -1);
  1251. let r18;
  1252. if (s11 >= 3)
  1253. r18 = i8[2];
  1254. else {
  1255. const s12 = this._sub(e11, h6);
  1256. this._leftPerpendicular(s12), r18 = this._add(h6, s12);
  1257. }
  1258. t8.push([e11, this._makeCtrlPt(h6), r18]);
  1259. break;
  1260. }
  1261. case R.PerpendicularWithArc: {
  1262. const s12 = this._cp2(i8, 0, -2), e11 = this._cp3(i8, s12, 0.5, -1);
  1263. let r18 = this._sub(s12, h6);
  1264. const _4 = this._norm(r18);
  1265. r18[0] /= _4, r18[1] /= _4;
  1266. const c9 = this._crossProduct(r18, this._sub(e11, h6));
  1267. let u9 = this._dotProduct(r18, this._sub(e11, h6));
  1268. u9 < 0.05 * _4 ? u9 = 0.05 * _4 : u9 > 0.95 * _4 && (u9 = 0.95 * _4);
  1269. const o11 = [h6[0] + r18[0] * u9, h6[1] + r18[1] * u9];
  1270. this._leftPerpendicular(r18);
  1271. let n17 = [];
  1272. n17.push([o11[0] - r18[0] * c9, o11[1] - r18[1] * c9]), n17.push([o11[0] + r18[0] * c9, o11[1] + r18[1] * c9]), t8.push(n17);
  1273. const a10 = [s12[0] + r18[0] * c9, s12[1] + r18[1] * c9];
  1274. r18 = this._sub(s12, a10);
  1275. const p3 = Math.cos(Math.PI / 18);
  1276. let l9 = Math.sin(Math.PI / 18);
  1277. c9 < 0 && (l9 = -l9), n17 = [h6, s12];
  1278. for (let t9 = 1; t9 <= 9; t9++)
  1279. this._rotateDirect(r18, p3, l9), n17.push(this._add(a10, r18));
  1280. t8.push(n17);
  1281. break;
  1282. }
  1283. case R.ClosedHalfCircle: {
  1284. const s12 = this._cp2(i8, 2, 0), e11 = this._mid(h6, s12), r18 = this._sub(s12, e11), _4 = Math.cos(Math.PI / 18), c9 = Math.sin(Math.PI / 18), u9 = [h6, s12];
  1285. for (let t9 = 1; t9 <= 18; t9++)
  1286. this._rotateDirect(r18, _4, c9), u9.push(this._add(e11, r18));
  1287. t8.push(u9);
  1288. break;
  1289. }
  1290. case R.TripleParallelExtended: {
  1291. const s12 = this._cp2(i8, 0, -2), r18 = this._cp3(i8, s12, 1, -2), _4 = this._mid(h6, s12), c9 = this._sub(r18, s12);
  1292. this._normalize(c9);
  1293. const u9 = Math.abs(this._crossProduct(c9, this._sub(_4, s12))) / 2, o11 = this._dist(s12, r18), n17 = [s12, h6];
  1294. n17.push([h6[0] + c9[0] * o11 * 0.5, h6[1] + c9[1] * o11 * 0.5]), t8.push(n17);
  1295. const a10 = [];
  1296. a10.push([_4[0] - c9[0] * u9, _4[1] - c9[1] * u9]), a10.push([_4[0] + c9[0] * o11 * 0.375, _4[1] + c9[1] * o11 * 0.375]), j2(a10[a10.length - 1], 1), a10.push([_4[0] + c9[0] * o11 * 0.75, _4[1] + c9[1] * o11 * 0.75]), t8.push(a10);
  1297. const p3 = [s12, r18];
  1298. t8.push(p3);
  1299. break;
  1300. }
  1301. case R.ParallelWithTicks: {
  1302. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(e11, s12);
  1303. this._normalize(r18);
  1304. const _4 = this._crossProduct(r18, this._sub(e11, h6));
  1305. this._leftPerpendicular(r18), this._addAngledTicks(t8, h6, s12, e11), this._addAngledTicks(t8, this._mix(h6, 1, r18, _4), this._mix(s12, 1, r18, _4), this._mid(h6, s12));
  1306. break;
  1307. }
  1308. case R.Parallel: {
  1309. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
  1310. this._normalize(r18);
  1311. const _4 = this._leftPerp(r18), c9 = this._crossProduct(r18, this._sub(e11, h6));
  1312. let u9 = [h6, s12];
  1313. t8.push(u9), u9 = [], u9.push([h6[0] + _4[0] * c9, h6[1] + _4[1] * c9]), u9.push([s12[0] + _4[0] * c9, s12[1] + _4[1] * c9]), t8.push(u9);
  1314. break;
  1315. }
  1316. case R.PerpendicularToFirstSegment: {
  1317. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._mid(h6, s12), _4 = this._sub(s12, h6);
  1318. this._normalize(_4);
  1319. const c9 = this._crossProduct(_4, this._sub(e11, h6));
  1320. this._leftPerpendicular(_4);
  1321. const u9 = [];
  1322. u9.push([r18[0] - _4[0] * c9 * 0.25, r18[1] - _4[1] * c9 * 0.25]), u9.push([r18[0] + _4[0] * c9 * 1.25, r18[1] + _4[1] * c9 * 1.25]), t8.push(u9);
  1323. break;
  1324. }
  1325. case R.ParallelOffset: {
  1326. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
  1327. this._normalize(r18);
  1328. const _4 = this._crossProduct(r18, this._sub(e11, h6));
  1329. this._leftPerpendicular(r18);
  1330. const c9 = [];
  1331. c9.push([h6[0] - r18[0] * _4, h6[1] - r18[1] * _4]), c9.push([s12[0] - r18[0] * _4, s12[1] - r18[1] * _4]), t8.push(c9);
  1332. const u9 = [];
  1333. u9.push([h6[0] + r18[0] * _4, h6[1] + r18[1] * _4]), u9.push([s12[0] + r18[0] * _4, s12[1] + r18[1] * _4]), t8.push(u9);
  1334. break;
  1335. }
  1336. case R.OffsetOpposite: {
  1337. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
  1338. this._normalize(r18);
  1339. const _4 = this._crossProduct(r18, this._sub(e11, h6));
  1340. this._leftPerpendicular(r18);
  1341. const c9 = [];
  1342. c9.push([h6[0] - r18[0] * _4, h6[1] - r18[1] * _4]), c9.push([s12[0] - r18[0] * _4, s12[1] - r18[1] * _4]), t8.push(c9);
  1343. break;
  1344. }
  1345. case R.OffsetSame: {
  1346. const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
  1347. this._normalize(r18);
  1348. const _4 = this._crossProduct(r18, this._sub(e11, h6));
  1349. this._leftPerpendicular(r18);
  1350. const c9 = [];
  1351. c9.push([h6[0] + r18[0] * _4, h6[1] + r18[1] * _4]), c9.push([s12[0] + r18[0] * _4, s12[1] + r18[1] * _4]), t8.push(c9);
  1352. break;
  1353. }
  1354. case R.CircleWithArc: {
  1355. let r18 = this._cp2(i8, 3, 0);
  1356. const _4 = this._cp3(i8, r18, 0.5, -1);
  1357. let c9, u9;
  1358. if (s11 >= 4)
  1359. c9 = i8[3], u9 = this._crossProduct(this._sub(c9, r18), this._sub(_4, r18)) > 0;
  1360. else {
  1361. c9 = r18, u9 = this._crossProduct(this._sub(c9, h6), this._sub(_4, h6)) > 0;
  1362. const s12 = 24 * this._geomUnitsPerPoint, t9 = this._sub(c9, h6);
  1363. this._normalize(t9, s12);
  1364. const i9 = Math.sqrt(2) / 2;
  1365. this._rotateDirect(t9, i9, u9 ? i9 : -i9), r18 = this._add(h6, t9);
  1366. }
  1367. const o11 = this._sub(r18, h6), n17 = Math.cos(Math.PI / 18), a10 = Math.sin(Math.PI / 18), p3 = [r18];
  1368. for (let s12 = 1; s12 <= 36; s12++)
  1369. this._rotateDirect(o11, n17, a10), p3.push(this._add(h6, o11));
  1370. this._add90DegArc(p3, r18, c9, _4, u9), j2(p3[p3.length - 8], 1), t8.push(p3);
  1371. break;
  1372. }
  1373. case R.DoubleJog: {
  1374. let e11, r18, _4 = this._cp2(i8, -3, 1);
  1375. if (e11 = s11 >= 3 ? i8[2] : this._add(h6, this._sub(h6, _4)), s11 >= 4)
  1376. r18 = i8[3];
  1377. else {
  1378. const s12 = h6;
  1379. h6 = _4, r18 = e11;
  1380. const t9 = this._dist(h6, s12), i9 = this._dist(r18, s12);
  1381. let c10 = 30 * this._geomUnitsPerPoint;
  1382. 0.5 * t9 < c10 && (c10 = 0.5 * t9), 0.5 * i9 < c10 && (c10 = 0.5 * i9), _4 = this._mix(h6, c10 / t9, s12, (t9 - c10) / t9), e11 = this._mix(r18, c10 / i9, s12, (i9 - c10) / i9);
  1383. }
  1384. const c9 = this._mid(h6, _4), u9 = this._mid(r18, e11), o11 = this._dist(h6, _4), n17 = this._dist(e11, r18);
  1385. let a10 = Math.min(o11, n17) / 8;
  1386. a10 = Math.min(a10, 24 * this._geomUnitsPerPoint);
  1387. const p3 = Math.cos(Math.PI / 4);
  1388. let l9 = this._sub(h6, _4);
  1389. this._normalize(l9, a10), this._crossProduct(l9, this._sub(r18, _4)) > 0 ? this._rotateDirect(l9, p3, -p3) : this._rotateDirect(l9, p3, p3);
  1390. let d2 = [];
  1391. d2.push(_4), d2.push(this._add(c9, l9)), d2.push(this._sub(c9, l9)), d2.push(h6), t8.push(d2), l9 = this._sub(r18, e11), this._normalize(l9, a10), this._crossProduct(l9, this._sub(h6, e11)) < 0 ? this._rotateDirect(l9, p3, p3) : this._rotateDirect(l9, p3, -p3), d2 = [], d2.push(e11), d2.push(this._add(u9, l9)), d2.push(this._sub(u9, l9)), d2.push(r18), t8.push(d2);
  1392. break;
  1393. }
  1394. case R.PerpendicularOffset: {
  1395. const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
  1396. this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerpendicular(r18) : this._leftPerpendicular(r18);
  1397. const _4 = [r18[0] / 8, r18[1] / 8], c9 = this._sub(this._mid(s12, e11), _4);
  1398. t8.push([c9, h6]);
  1399. break;
  1400. }
  1401. case R.LineExcludingLastSegment: {
  1402. const s12 = this._arrowPath(i8), h7 = [];
  1403. let e11 = s12.length - 2;
  1404. for (; e11--; )
  1405. h7.push(s12[e11]);
  1406. t8.push(h7);
  1407. break;
  1408. }
  1409. case R.MultivertexArrow: {
  1410. const s12 = this._arrowPath(i8), h7 = [];
  1411. this._addArrow(h7, s12, false), t8.push(h7);
  1412. break;
  1413. }
  1414. case R.CrossedArrow: {
  1415. const s12 = this._arrowPath(i8), h7 = [];
  1416. this._addArrow(h7, s12, true), t8.push(h7);
  1417. break;
  1418. }
  1419. case R.ChevronArrow: {
  1420. const [s12, e11] = this._arrowLastSeg(i8), r18 = 10 * this._geomUnitsPerPoint, _4 = this._sub(h6, s12);
  1421. this._normalize(_4);
  1422. const c9 = this._crossProduct(_4, this._sub(e11, s12)), u9 = this._leftPerp(_4), o11 = [e11[0] - u9[0] * c9 * 2, e11[1] - u9[1] * c9 * 2], n17 = [];
  1423. n17.push([e11[0] + _4[0] * r18, e11[1] + _4[1] * r18]), n17.push(h6), n17.push([o11[0] + _4[0] * r18, o11[1] + _4[1] * r18]), t8.push(n17);
  1424. break;
  1425. }
  1426. case R.ChevronArrowOffset: {
  1427. const [s12, e11] = this._arrowLastSeg(i8), r18 = this._sub(h6, s12);
  1428. this._normalize(r18);
  1429. const _4 = this._crossProduct(r18, this._sub(e11, s12));
  1430. this._leftPerpendicular(r18);
  1431. const c9 = [e11[0] - r18[0] * _4, e11[1] - r18[1] * _4], u9 = [];
  1432. u9.push([c9[0] + r18[0] * _4 * 0.5, c9[1] + r18[1] * _4 * 0.5]), u9.push(this._mid(c9, h6)), u9.push([c9[0] - r18[0] * _4 * 0.5, c9[1] - r18[1] * _4 * 0.5]), t8.push(u9);
  1433. break;
  1434. }
  1435. case R.PartialFirstSegment: {
  1436. const [s12, e11] = this._arrowLastSeg(i8), r18 = this._sub(h6, s12);
  1437. this._normalize(r18);
  1438. const _4 = this._crossProduct(r18, this._sub(e11, s12));
  1439. this._leftPerpendicular(r18);
  1440. const c9 = [e11[0] - r18[0] * _4, e11[1] - r18[1] * _4];
  1441. t8.push([s12, c9]);
  1442. break;
  1443. }
  1444. case R.Arch: {
  1445. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 1), r18 = this._sub(h6, s12), _4 = this._mix(e11, 1, r18, 0.55), c9 = this._mix(e11, 1, r18, -0.55), u9 = [h6];
  1446. this._addBezier2(u9, h6, _4, e11, 4), this._addBezier2(u9, e11, c9, s12, 4), t8.push(u9);
  1447. break;
  1448. }
  1449. case R.CurvedParallelTicks: {
  1450. const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
  1451. this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerpendicular(r18) : this._leftPerpendicular(r18);
  1452. const _4 = [r18[0] / 8, r18[1] / 8], c9 = this._sub(this._mid(s12, e11), _4), u9 = this._sub(this._mix(s12, 0.75, e11, 0.25), _4), o11 = this._sub(this._mix(s12, 0.25, e11, 0.75), _4), n17 = [s12];
  1453. this._addBezier2(n17, s12, u9, c9, 3), this._addBezier2(n17, c9, o11, e11, 3), t8.push(n17);
  1454. for (let i9 = 0; i9 < 8; i9++) {
  1455. const s13 = n17[2 * i9 + 1], h7 = [this._clone(s13)];
  1456. h7.push(this._add(s13, [r18[0] / 4, r18[1] / 4])), t8.push(h7);
  1457. }
  1458. break;
  1459. }
  1460. case R.Arc90Degrees: {
  1461. const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 1), r18 = [s12];
  1462. this._add90DegArc(r18, s12, h6, e11), t8.push(r18);
  1463. break;
  1464. }
  1465. case R.FullGeometry:
  1466. default:
  1467. t8.push(i8);
  1468. }
  1469. }
  1470. return t8;
  1471. }
  1472. };
  1473. // node_modules/@arcgis/core/symbols/cim/effects/EffectCut.js
  1474. var u6 = class {
  1475. static local() {
  1476. return u6.instance === null && (u6.instance = new u6()), u6.instance;
  1477. }
  1478. execute(e11, t8, u9, i8) {
  1479. return new s7(e11, t8, u9);
  1480. }
  1481. };
  1482. u6.instance = null;
  1483. var s7 = class extends U3 {
  1484. constructor(e11, u9, s10) {
  1485. super(e11, true, true), this._curveHelper = new n7(), this._beginCut = (u9.beginCut !== void 0 ? u9.beginCut : 1) * s10, this._endCut = (u9.endCut !== void 0 ? u9.endCut : 1) * s10, this._middleCut = (u9.middleCut !== void 0 ? u9.middleCut : 0) * s10, this._invert = u9.invert !== void 0 && u9.invert, this._beginCut < 0 && (this._beginCut = 0), this._endCut < 0 && (this._endCut = 0), this._middleCut < 0 && (this._middleCut = 0);
  1486. }
  1487. processPath(e11) {
  1488. const t8 = this._beginCut, u9 = this._endCut, s10 = this._middleCut, i8 = this._curveHelper.calculatePathLength(e11), r18 = [];
  1489. if (this._invert)
  1490. if (t8 === 0 && u9 === 0 && s10 === 0)
  1491. ;
  1492. else if (t8 + u9 + s10 >= i8)
  1493. r18.push(e11);
  1494. else {
  1495. let n17 = this._curveHelper.getSubCurve(e11, 0, t8);
  1496. n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, 0.5 * (i8 - s10), 0.5 * (i8 + s10)), n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, i8 - u9, u9), n17 && r18.push(n17);
  1497. }
  1498. else if (t8 === 0 && u9 === 0 && s10 === 0)
  1499. r18.push(e11);
  1500. else if (t8 + u9 + s10 >= i8)
  1501. ;
  1502. else if (s10 === 0) {
  1503. const s11 = this._curveHelper.getSubCurve(e11, t8, i8 - u9);
  1504. s11 && r18.push(s11);
  1505. } else {
  1506. let n17 = this._curveHelper.getSubCurve(e11, t8, 0.5 * (i8 - s10));
  1507. n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, 0.5 * (i8 + s10), i8 - u9), n17 && r18.push(n17);
  1508. }
  1509. return r18.length === 0 ? null : { paths: r18 };
  1510. }
  1511. };
  1512. // node_modules/@arcgis/core/symbols/cim/GeometryWalker.js
  1513. var i5 = 1e-7;
  1514. var n8 = class {
  1515. constructor() {
  1516. this._values = [], this.extPtGap = 0, this.ctrlPtGap = 0, this._length = 0, this._currentValue = 0;
  1517. }
  1518. isEmpty() {
  1519. return this._values.length === 0;
  1520. }
  1521. size() {
  1522. return this._values.length;
  1523. }
  1524. init(t8, s10, e11 = true) {
  1525. if (this._setEmpty(), !t8 || t8.length === 0)
  1526. return false;
  1527. for (let n17 = 0; n17 < t8.length; n17++) {
  1528. let s11 = Math.abs(t8[n17]);
  1529. e11 && s11 < i5 && (s11 = i5), this._values.push(s11), this._length += s11;
  1530. }
  1531. return s10 && 1 & t8.length && (this._length *= 2), this._length !== 0 && (this.ctrlPtGap = this.extPtGap = 0, this._currentValue = -1, true);
  1532. }
  1533. scale(t8) {
  1534. const s10 = this._values ? this._values.length : 0;
  1535. for (let e11 = 0; e11 < s10; ++e11)
  1536. this._values[e11] *= t8;
  1537. this._length *= t8, this.extPtGap *= t8, this.ctrlPtGap *= t8;
  1538. }
  1539. addValue(t8) {
  1540. this._length += t8, this._values.push(t8);
  1541. }
  1542. firstValue() {
  1543. return this._values[0];
  1544. }
  1545. lastValue() {
  1546. return this._values[this._values.length - 1];
  1547. }
  1548. nextValue() {
  1549. return this._currentValue++, this._currentValue === this._values.length && (this._currentValue = 0), this._values[this._currentValue];
  1550. }
  1551. reset() {
  1552. this._currentValue = -1;
  1553. }
  1554. length() {
  1555. return this._length;
  1556. }
  1557. _setEmpty() {
  1558. this.extPtGap = this.ctrlPtGap = this._length = 0, this._currentValue = -1, this._values.length = 0;
  1559. }
  1560. };
  1561. var h4;
  1562. !function(t8) {
  1563. t8[t8.FAIL = 0] = "FAIL", t8[t8.END = 1] = "END", t8[t8.CONTINUE = 2] = "CONTINUE";
  1564. }(h4 || (h4 = {}));
  1565. var r8 = class {
  1566. constructor() {
  1567. this.reset();
  1568. }
  1569. reset() {
  1570. this.segment = -1, this.segmentLength = 0, this.abscissa = 0, this.isPathEnd = false, this.isPartEnd = false;
  1571. }
  1572. isValid() {
  1573. return this.segment !== -1;
  1574. }
  1575. copyTo(t8) {
  1576. t8.segment = this.segment, t8.segmentLength = this.segmentLength, t8.abscissa = this.abscissa, t8.isPathEnd = this.isPathEnd, t8.isPartEnd = this.isPartEnd;
  1577. }
  1578. };
  1579. var a5 = class extends n7 {
  1580. constructor(t8 = 0, s10 = false) {
  1581. super(t8, s10), this._tolerance = e8, this._currentPosition = new r8();
  1582. }
  1583. updateTolerance(t8) {
  1584. this._tolerance = e8 * t8;
  1585. }
  1586. init(t8, s10, e11 = true) {
  1587. return e11 ? (this._patternLength = s10.length(), this._partExtPtGap = s10.extPtGap, this._partCtrlPtGap = s10.ctrlPtGap) : (this._patternLength = 0, this._partExtPtGap = 0, this._partCtrlPtGap = 0), this._currentPosition.reset(), this._partSegCount = 0, this._path = t8, this._seg = -1, this._setPosAtNextPart();
  1588. }
  1589. curPositionIsValid() {
  1590. return this._currentPosition.isValid();
  1591. }
  1592. nextPosition(t8, s10 = h4.FAIL) {
  1593. const e11 = new r8();
  1594. return !!this._nextPosition(t8, e11, null, s10) && (e11.copyTo(this._currentPosition), true);
  1595. }
  1596. curPointAndAngle(t8) {
  1597. t8.pt = this._getPoint(this._currentPosition);
  1598. const [s10, e11] = this._getAngle(this._currentPosition);
  1599. t8.ca = s10, t8.sa = e11;
  1600. }
  1601. nextPointAndAngle(t8, s10, e11 = h4.FAIL) {
  1602. const i8 = new r8();
  1603. if (!this._nextPosition(t8, i8, null, e11))
  1604. return false;
  1605. i8.copyTo(this._currentPosition), s10.pt = this._getPoint(i8);
  1606. const [n17, a10] = this._getAngle(i8);
  1607. return s10.ca = n17, s10.sa = a10, true;
  1608. }
  1609. nextCurve(t8) {
  1610. if (t8 === 0)
  1611. return null;
  1612. const s10 = [], e11 = new r8();
  1613. return this._nextPosition(t8, e11, s10, h4.END) ? (e11.copyTo(this._currentPosition), s10) : null;
  1614. }
  1615. isPathEnd() {
  1616. return this._currentPosition.isPathEnd;
  1617. }
  1618. getPathEnd() {
  1619. if (this._currentPosition.segment === -1)
  1620. throw new Error("missing segment");
  1621. return this._path[this._currentPosition.segment + 1];
  1622. }
  1623. _nextPosition(t8, s10, e11, i8) {
  1624. if (this._currentPosition.isPathEnd)
  1625. return false;
  1626. let n17 = this._currentPosition.abscissa;
  1627. for (this._currentPosition.segmentLength > 0 && (n17 /= this._currentPosition.segmentLength), this._currentPosition.copyTo(s10); s10.abscissa + t8 * this._partLengthRatio > s10.segmentLength + this._tolerance; ) {
  1628. if (e11) {
  1629. if (e11.length === 0)
  1630. if (n17 === 0) {
  1631. const t10 = this._path[s10.segment];
  1632. e11.push([t10[0], t10[1]]);
  1633. } else
  1634. e11.push(this.getSegCoord2D(this._path, s10.segment, n17));
  1635. const t9 = this._path[s10.segment + 1];
  1636. e11.push([t9[0], t9[1]]);
  1637. }
  1638. if (n17 = 0, t8 -= (s10.segmentLength - s10.abscissa) / this._partLengthRatio, this._partSegCount)
  1639. s10.segment = this._nextSegment(), s10.segmentLength = this.calculateSegLength(this._path, s10.segment), s10.abscissa = 0, this._partSegCount--;
  1640. else {
  1641. if (!this._setPosAtNextPart())
  1642. return i8 !== h4.FAIL && (s10.segmentLength = this.calculateSegLength(this._path, s10.segment), s10.isPartEnd = true, i8 === h4.END ? (s10.abscissa = s10.segmentLength, s10.isPathEnd = true) : s10.abscissa = s10.segmentLength + t8, true);
  1643. this._currentPosition.copyTo(s10);
  1644. }
  1645. }
  1646. if (s10.abscissa += t8 * this._partLengthRatio, e11) {
  1647. if (e11.length === 0)
  1648. if (n17 === 0) {
  1649. const t10 = this._path[s10.segment];
  1650. e11.push([t10[0], t10[1]]);
  1651. } else
  1652. e11.push(this.getSegCoord2D(this._path, s10.segment, n17));
  1653. const t9 = s10.abscissa / s10.segmentLength;
  1654. if (t9 === 1) {
  1655. const t10 = this._path[s10.segment + 1];
  1656. e11.push([t10[0], t10[1]]);
  1657. } else
  1658. e11.push(this.getSegCoord2D(this._path, s10.segment, t9));
  1659. }
  1660. return this._partSegCount || Math.abs(s10.abscissa - s10.segmentLength) < this._tolerance && (s10.isPathEnd = this._partIsLast, s10.isPartEnd = true), true;
  1661. }
  1662. _getPoint(t8) {
  1663. if (t8.segment === -1)
  1664. throw new Error("missing segment");
  1665. const s10 = t8.segmentLength <= 0 ? 0 : t8.abscissa / t8.segmentLength;
  1666. return this.getSegCoord2D(this._path, t8.segment, s10);
  1667. }
  1668. _getAngle(t8) {
  1669. if (t8.segment === -1)
  1670. throw new Error("missing segment");
  1671. const s10 = t8.segmentLength <= 0 ? 0 : t8.abscissa / t8.segmentLength;
  1672. return this.getSegAngleCS(this._path, t8.segment, s10);
  1673. }
  1674. _setPosAtNextPart() {
  1675. for (; this._partSegCount; )
  1676. this._hasNextSegment() && this._nextSegment(), this._partSegCount--;
  1677. if (!this._hasNextSegment())
  1678. return false;
  1679. for (this._partLength = 0, this._partIsLast = true, this._partSegCount = 0; this._hasNextSegment(); )
  1680. if (this._partLength += this.calculateSegLength(this._path, this._nextSegment()), this._partSegCount++, I(this._path[this._getEndPointIndex()]) === 1) {
  1681. this._partIsLast = !this._hasNextSegment();
  1682. break;
  1683. }
  1684. let s10 = this._partSegCount;
  1685. for (; s10; )
  1686. this._previousSegment(), --s10;
  1687. this._currentPosition.segment = this._nextSegment(), this._currentPosition.segmentLength = this.calculateSegLength(this._path, this._currentPosition.segment), this._currentPosition.abscissa = 0, this._currentPosition.isPathEnd = this._currentPosition.isPartEnd = false, --this._partSegCount;
  1688. const e11 = this._getStartPointIndex();
  1689. this._ctrlPtBegin = I(this._path[e11]) === 1;
  1690. let i8 = e11 + this._partSegCount + 1;
  1691. if (i8 >= this._path.length && (i8 = 0), this._ctrlPtEnd = I(this._path[i8]) === 1, this._patternLength > 0) {
  1692. const t8 = this._ctrlPtBegin ? this._partCtrlPtGap : this._partExtPtGap, s11 = this._ctrlPtEnd ? this._partCtrlPtGap : this._partExtPtGap;
  1693. let e12 = Math.round((this._partLength - (t8 + s11)) / this._patternLength);
  1694. e12 <= 0 && (e12 = t8 + s11 > 0 ? 0 : 1), this._partLengthRatio = this._partLength / (t8 + s11 + e12 * this._patternLength), this._partLengthRatio < 0.01 && (this._partLengthRatio = 1);
  1695. } else
  1696. this._partLengthRatio = 1;
  1697. return true;
  1698. }
  1699. _hasNextSegment() {
  1700. return this._seg < this._path.length - 2;
  1701. }
  1702. _previousSegment() {
  1703. return --this._seg;
  1704. }
  1705. _nextSegment() {
  1706. return ++this._seg;
  1707. }
  1708. _getStartPointIndex() {
  1709. return this._seg;
  1710. }
  1711. _getEndPointIndex() {
  1712. return this._seg + 1;
  1713. }
  1714. };
  1715. // node_modules/@arcgis/core/symbols/cim/effects/EffectDashes.js
  1716. var r9 = class {
  1717. static local() {
  1718. return r9.instance === null && (r9.instance = new r9()), r9.instance;
  1719. }
  1720. execute(t8, e11, s10, a10) {
  1721. return new n9(t8, e11, s10);
  1722. }
  1723. };
  1724. r9.instance = null;
  1725. var n9 = class extends U3 {
  1726. constructor(t8, e11, s10) {
  1727. super(t8, true, true), this._walker = new a5(), this._walker.updateTolerance(s10), this._endings = e11.lineDashEnding, this._customDashPos = -(e11.offsetAlongLine ?? 0) * s10, this._offsetAtEnd = (e11.customEndingOffset ?? 0) * s10, this._pattern = new n8(), this._pattern.init(e11.dashTemplate, true), this._pattern.scale(s10);
  1728. }
  1729. processPath(t8) {
  1730. if (this._pattern.length() === 0)
  1731. return this.iteratePath = false, { paths: [t8] };
  1732. if (!this.iteratePath) {
  1733. let e11 = true;
  1734. switch (this._endings) {
  1735. case k.HalfPattern:
  1736. case k.HalfGap:
  1737. default:
  1738. this._pattern.extPtGap = 0;
  1739. break;
  1740. case k.FullPattern:
  1741. this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.firstValue());
  1742. break;
  1743. case k.FullGap:
  1744. this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.lastValue());
  1745. break;
  1746. case k.NoConstraint:
  1747. this.isClosed || (e11 = false);
  1748. break;
  1749. case k.Custom:
  1750. this.isClosed || (this._pattern.extPtGap = 0.5 * this._offsetAtEnd);
  1751. }
  1752. const a11 = this._walker.calculatePathLength(t8);
  1753. if (this._pattern.isEmpty() || a11 < 0.1 * this._pattern.length())
  1754. return { paths: [t8] };
  1755. if (!this._walker.init(t8, this._pattern, e11))
  1756. return { paths: [t8] };
  1757. }
  1758. let a10;
  1759. if (this.iteratePath)
  1760. a10 = this._pattern.nextValue();
  1761. else {
  1762. let t9;
  1763. switch (this._endings) {
  1764. case k.HalfPattern:
  1765. default:
  1766. t9 = 0.5 * this._pattern.firstValue();
  1767. break;
  1768. case k.HalfGap:
  1769. t9 = 0.5 * -this._pattern.lastValue();
  1770. break;
  1771. case k.FullGap:
  1772. t9 = -this._pattern.lastValue();
  1773. break;
  1774. case k.FullPattern:
  1775. t9 = 0;
  1776. break;
  1777. case k.NoConstraint:
  1778. case k.Custom:
  1779. t9 = -this._customDashPos;
  1780. }
  1781. let e11 = t9 / this._pattern.length();
  1782. e11 -= Math.floor(e11), t9 = e11 * this._pattern.length(), this._pattern.reset(), a10 = this._pattern.nextValue();
  1783. let i9 = false;
  1784. for (; t9 >= a10; )
  1785. t9 -= a10, a10 = this._pattern.nextValue(), i9 = !i9;
  1786. a10 -= t9, i9 ? (this._walker.nextPosition(a10), a10 = this._pattern.nextValue()) : this.isClosed && (this._firstCurve = this._walker.nextCurve(a10), a10 = this._pattern.nextValue(), this._walker.nextPosition(a10), a10 = this._pattern.nextValue());
  1787. }
  1788. let i8 = this._walker.nextCurve(a10);
  1789. return i8 ? this._walker.isPathEnd() ? (this.iteratePath = false, this._firstCurve && (this._firstCurve.splice(0, 1), s6.mergePath(i8, this._firstCurve), this._firstCurve = null)) : (a10 = this._pattern.nextValue(), !this._walker.nextPosition(a10) || this._walker.isPathEnd() ? (this.iteratePath = false, this._firstCurve && (i8 = this._firstCurve, this._firstCurve = null)) : this.iteratePath = true) : (this.iteratePath = false, i8 = this._firstCurve, this._firstCurve = null), { paths: [i8] };
  1790. }
  1791. };
  1792. // node_modules/@arcgis/core/symbols/cim/effects/EffectDonut.js
  1793. var r10 = class {
  1794. static local() {
  1795. return r10.instance === null && (r10.instance = new r10()), r10.instance;
  1796. }
  1797. execute(t8, i8, e11, s10) {
  1798. return new m5(t8, i8, e11);
  1799. }
  1800. };
  1801. r10.instance = null;
  1802. var m5 = class {
  1803. constructor(t8, i8, r18) {
  1804. switch (this._inputGeometries = t8, this._curveHelper = new n7(), this._width = (i8.width !== void 0 ? i8.width : 2) * r18, i8.method) {
  1805. case B.Mitered:
  1806. default:
  1807. this._method = O.Mitered;
  1808. break;
  1809. case B.Bevelled:
  1810. this._method = O.Bevelled;
  1811. break;
  1812. case B.Rounded:
  1813. case B.TrueBuffer:
  1814. this._method = O.Rounded;
  1815. break;
  1816. case B.Square:
  1817. this._method = O.Square;
  1818. }
  1819. this._option = i8.option, this._offsetFlattenError = e8 * r18;
  1820. }
  1821. next() {
  1822. let e11 = this._inputGeometries.next();
  1823. for (; e11; ) {
  1824. if (s3(e11) && this._width > 0) {
  1825. if (Math.min(e11.xmax - e11.xmin, e11.ymax - e11.ymin) - 2 * this._width < 0)
  1826. return e11;
  1827. const t8 = [];
  1828. return t8.push([[e11.xmin, e11.ymin], [e11.xmin, e11.ymax], [e11.xmax, e11.ymax], [e11.xmax, e11.ymin], [e11.xmin, e11.ymin]]), t8.push([[e11.xmin + this._width, e11.ymin + this._width], [e11.xmax - this._width, e11.ymin + this._width], [e11.xmax - this._width, e11.ymax - this._width], [e11.xmin + this._width, e11.ymax - this._width], [e11.xmin + this._width, e11.ymin + this._width]]), { rings: t8 };
  1829. }
  1830. if (c2(e11) && this._width > 0) {
  1831. const t8 = [];
  1832. for (const i8 of e11.rings) {
  1833. const e12 = this._curveHelper.calculatePathLength(i8), s10 = this._curveHelper.offset(i8, this._width, this._method, 4, this._offsetFlattenError);
  1834. s10 && (e12 < 0 && s10.reverse(), t8.push(s10));
  1835. }
  1836. if (t8.length)
  1837. return { rings: t8 };
  1838. }
  1839. e11 = this._inputGeometries.next();
  1840. }
  1841. return null;
  1842. }
  1843. };
  1844. // node_modules/@arcgis/core/symbols/cim/effects/EffectJog.js
  1845. var s8 = class {
  1846. static local() {
  1847. return s8.instance === null && (s8.instance = new s8()), s8.instance;
  1848. }
  1849. execute(t8, i8, s10, n17) {
  1850. return new e9(t8, i8, s10);
  1851. }
  1852. };
  1853. s8.instance = null;
  1854. var e9 = class extends U3 {
  1855. constructor(t8, s10, e11) {
  1856. super(t8, false, true), this._curveHelper = new n7(), this._length = (s10.length !== void 0 ? s10.length : 20) * e11, this._angle = s10.angle !== void 0 ? s10.angle : 225, this._position = s10.position !== void 0 ? s10.position : 50, this._length < 0 && (this._length = -this._length), this._position < 20 && (this._position = 20), this._position > 80 && (this._position = 80), this._mirror = false;
  1857. }
  1858. processPath(t8) {
  1859. if (this._curveHelper.isEmpty(t8, false))
  1860. return null;
  1861. const i8 = t8[0], s10 = t8[t8.length - 1], e11 = [s10[0] - i8[0], s10[1] - i8[1]];
  1862. this._curveHelper.normalize(e11);
  1863. const n17 = [i8[0] + (s10[0] - i8[0]) * this._position / 100, i8[1] + (s10[1] - i8[1]) * this._position / 100], h6 = Math.cos((90 - this._angle) / 180 * Math.PI);
  1864. let r18 = Math.sin((90 - this._angle) / 180 * Math.PI);
  1865. this._mirror && (r18 = -r18), this._mirror = !this._mirror;
  1866. return { paths: [[i8, [n17[0] - this._length / 2 * h6, n17[1] - this._length / 2 * r18], [n17[0] + this._length / 2 * h6, n17[1] + this._length / 2 * r18], s10]] };
  1867. }
  1868. };
  1869. // node_modules/@arcgis/core/symbols/cim/effects/EffectMove.js
  1870. var n10 = class {
  1871. static local() {
  1872. return n10.instance === null && (n10.instance = new n10()), n10.instance;
  1873. }
  1874. execute(t8, s10, e11, i8) {
  1875. return new r11(t8, s10, e11);
  1876. }
  1877. };
  1878. n10.instance = null;
  1879. var r11 = class {
  1880. constructor(t8, s10, e11) {
  1881. this._inputGeometries = t8, this._offsetX = s10.offsetX !== void 0 ? s10.offsetX * e11 : 0, this._offsetY = s10.offsetY !== void 0 ? -s10.offsetY * e11 : 0;
  1882. }
  1883. next() {
  1884. let n17 = this._inputGeometries.next();
  1885. for (; n17; ) {
  1886. if (s3(n17))
  1887. return { xmin: n17.xmin + this._offsetX, xmax: n17.xmax + this._offsetX, ymin: n17.ymin + this._offsetY, ymax: n17.ymax + this._offsetY };
  1888. if (c2(n17)) {
  1889. const s10 = m(n17);
  1890. return this._moveMultipath(s10.rings, this._offsetX, this._offsetY), s10;
  1891. }
  1892. if (y(n17)) {
  1893. const s10 = m(n17);
  1894. return this._moveMultipath(s10.paths, this._offsetX, this._offsetY), s10;
  1895. }
  1896. if (f(n17)) {
  1897. const s10 = m(n17);
  1898. return this._movePath(s10.points, this._offsetX, this._offsetY), s10;
  1899. }
  1900. if (l(n17))
  1901. return { x: n17.x + this._offsetX, y: n17.y + this._offsetY };
  1902. n17 = this._inputGeometries.next();
  1903. }
  1904. return null;
  1905. }
  1906. _moveMultipath(t8, s10, e11) {
  1907. if (t8)
  1908. for (const i8 of t8)
  1909. this._movePath(i8, s10, e11);
  1910. }
  1911. _movePath(t8, s10, e11) {
  1912. if (t8)
  1913. for (const i8 of t8)
  1914. i8[0] += s10, i8[1] += e11;
  1915. }
  1916. };
  1917. // node_modules/@arcgis/core/symbols/cim/effects/EffectOffset.js
  1918. var r12 = class {
  1919. static local() {
  1920. return r12.instance === null && (r12.instance = new r12()), r12.instance;
  1921. }
  1922. execute(t8, e11, s10, i8) {
  1923. return new f7(t8, e11, s10);
  1924. }
  1925. };
  1926. r12.instance = null;
  1927. var f7 = class {
  1928. constructor(t8, e11, s10) {
  1929. this._inputGeometries = t8, this._curveHelper = new n7(), this._offset = (e11.offset ?? 1) * s10, this._method = e11.method, this._option = e11.option, this._offsetFlattenError = e8 * s10;
  1930. }
  1931. next() {
  1932. let i8 = this._inputGeometries.next();
  1933. for (; i8; ) {
  1934. if (this._offset === 0)
  1935. return i8;
  1936. if (s3(i8)) {
  1937. if (this._method === O.Rounded && this._offset > 0) {
  1938. const t8 = [[i8.xmin, i8.ymin], [i8.xmin, i8.ymax], [i8.xmax, i8.ymax], [i8.xmax, i8.ymin], [i8.xmin, i8.ymin]], e11 = this._curveHelper.offset(t8, -this._offset, this._method, 4, this._offsetFlattenError);
  1939. return e11 ? { rings: [e11] } : null;
  1940. }
  1941. if (Math.min(i8.xmax - i8.xmin, i8.ymax - i8.ymin) + 2 * this._offset > 0)
  1942. return { xmin: i8.xmin - this._offset, xmax: i8.xmax + this._offset, ymin: i8.ymin - this._offset, ymax: i8.ymax + this._offset };
  1943. }
  1944. if (c2(i8)) {
  1945. const t8 = [];
  1946. for (const e11 of i8.rings) {
  1947. const s10 = this._curveHelper.offset(e11, -this._offset, this._method, 4, this._offsetFlattenError);
  1948. s10 && t8.push(s10);
  1949. }
  1950. if (t8.length)
  1951. return { rings: t8 };
  1952. }
  1953. if (y(i8)) {
  1954. const t8 = [];
  1955. for (const e11 of i8.paths) {
  1956. const s10 = this._curveHelper.offset(e11, -this._offset, this._method, 4, this._offsetFlattenError);
  1957. s10 && t8.push(s10);
  1958. }
  1959. if (t8.length)
  1960. return { paths: t8 };
  1961. }
  1962. i8 = this._inputGeometries.next();
  1963. }
  1964. return null;
  1965. }
  1966. };
  1967. // node_modules/@arcgis/core/symbols/cim/effects/EffectReverse.js
  1968. var s9 = class {
  1969. static local() {
  1970. return s9.instance === null && (s9.instance = new s9()), s9.instance;
  1971. }
  1972. execute(e11, t8, r18, s10) {
  1973. return new n11(e11, t8, r18);
  1974. }
  1975. };
  1976. s9.instance = null;
  1977. var n11 = class {
  1978. constructor(e11, t8, r18) {
  1979. this._inputGeometries = e11, this._reverse = t8.reverse === void 0 || t8.reverse;
  1980. }
  1981. next() {
  1982. let s10 = this._inputGeometries.next();
  1983. for (; s10; ) {
  1984. if (!this._reverse)
  1985. return s10;
  1986. if (y(s10)) {
  1987. const t8 = m(s10);
  1988. return g2(t8.paths), t8;
  1989. }
  1990. s10 = this._inputGeometries.next();
  1991. }
  1992. return null;
  1993. }
  1994. };
  1995. // node_modules/@arcgis/core/symbols/cim/effects/EffectRotate.js
  1996. var u7 = class {
  1997. static local() {
  1998. return u7.instance === null && (u7.instance = new u7()), u7.instance;
  1999. }
  2000. execute(t8, n17, e11, r18) {
  2001. return new c7(t8, n17, e11);
  2002. }
  2003. };
  2004. u7.instance = null;
  2005. var c7 = class {
  2006. constructor(t8, n17, e11) {
  2007. this._inputGeometries = t8, this._rotateAngle = n17.angle !== void 0 ? n17.angle * Math.PI / 180 : 0;
  2008. }
  2009. next() {
  2010. let u9 = this._inputGeometries.next();
  2011. for (; u9; ) {
  2012. if (this._rotateAngle === 0)
  2013. return u9;
  2014. const c9 = u2();
  2015. c(c9, u9);
  2016. const l9 = (c9[2] + c9[0]) / 2, m7 = (c9[3] + c9[1]) / 2;
  2017. if (s3(u9)) {
  2018. const t8 = { rings: [[[u9.xmin, u9.ymin], [u9.xmin, u9.ymax], [u9.xmax, u9.ymax], [u9.xmax, u9.ymin], [u9.xmin, u9.ymin]]] };
  2019. return this._rotateMultipath(t8.rings, l9, m7), t8;
  2020. }
  2021. if (c2(u9)) {
  2022. const n17 = m(u9);
  2023. return this._rotateMultipath(n17.rings, l9, m7), n17;
  2024. }
  2025. if (y(u9)) {
  2026. const n17 = m(u9);
  2027. return this._rotateMultipath(n17.paths, l9, m7), n17;
  2028. }
  2029. if (f(u9)) {
  2030. const n17 = m(u9);
  2031. return this._rotatePath(n17.points, l9, m7), n17;
  2032. }
  2033. if (l(u9))
  2034. return u9;
  2035. u9 = this._inputGeometries.next();
  2036. }
  2037. return null;
  2038. }
  2039. _rotateMultipath(t8, n17, e11) {
  2040. if (t8)
  2041. for (const r18 of t8)
  2042. this._rotatePath(r18, n17, e11);
  2043. }
  2044. _rotatePath(t8, n17, e11) {
  2045. if (t8) {
  2046. const r18 = Math.cos(this._rotateAngle), i8 = Math.sin(this._rotateAngle);
  2047. for (const o11 of t8) {
  2048. const t9 = o11[0] - n17, s10 = o11[1] - e11;
  2049. o11[0] = n17 + t9 * r18 - s10 * i8, o11[1] = e11 + t9 * i8 + s10 * r18;
  2050. }
  2051. }
  2052. }
  2053. };
  2054. // node_modules/@arcgis/core/symbols/cim/effects/EffectScale.js
  2055. var c8 = class {
  2056. static local() {
  2057. return c8.instance === null && (c8.instance = new c8()), c8.instance;
  2058. }
  2059. execute(t8, s10, i8, r18) {
  2060. return new l7(t8, s10, i8);
  2061. }
  2062. };
  2063. c8.instance = null;
  2064. var l7 = class {
  2065. constructor(t8, s10, i8) {
  2066. this._inputGeometries = t8, this._xFactor = s10.xScaleFactor !== void 0 ? s10.xScaleFactor : 1.15, this._yFactor = s10.yScaleFactor !== void 0 ? s10.yScaleFactor : 1.15;
  2067. }
  2068. next() {
  2069. let c9 = this._inputGeometries.next();
  2070. for (; c9; ) {
  2071. if (this._xFactor === 1 && this._yFactor === 1)
  2072. return c9;
  2073. const l9 = u2();
  2074. c(l9, c9);
  2075. const u9 = (l9[2] + l9[0]) / 2, m7 = (l9[3] + l9[1]) / 2;
  2076. if (s3(c9)) {
  2077. const t8 = { rings: [[[c9.xmin, c9.ymin], [c9.xmin, c9.ymax], [c9.xmax, c9.ymax], [c9.xmax, c9.ymin], [c9.xmin, c9.ymin]]] };
  2078. return this._scaleMultipath(t8.rings, u9, m7), t8;
  2079. }
  2080. if (c2(c9)) {
  2081. const s10 = m(c9);
  2082. return this._scaleMultipath(s10.rings, u9, m7), s10;
  2083. }
  2084. if (y(c9)) {
  2085. const s10 = m(c9);
  2086. return this._scaleMultipath(s10.paths, u9, m7), s10;
  2087. }
  2088. if (f(c9)) {
  2089. const s10 = m(c9);
  2090. return this._scalePath(s10.points, u9, m7), s10;
  2091. }
  2092. if (l(c9))
  2093. return c9;
  2094. c9 = this._inputGeometries.next();
  2095. }
  2096. return null;
  2097. }
  2098. _scaleMultipath(t8, s10, i8) {
  2099. if (t8)
  2100. for (const r18 of t8)
  2101. this._scalePath(r18, s10, i8);
  2102. }
  2103. _scalePath(t8, s10, i8) {
  2104. if (t8)
  2105. for (const r18 of t8) {
  2106. const t9 = (r18[0] - s10) * this._xFactor, n17 = (r18[1] - i8) * this._yFactor;
  2107. r18[0] = s10 + t9, r18[1] = i8 + n17;
  2108. }
  2109. }
  2110. };
  2111. // node_modules/@arcgis/core/symbols/cim/effects/EffectWave.js
  2112. var r13 = class {
  2113. static local() {
  2114. return r13.instance === null && (r13.instance = new r13()), r13.instance;
  2115. }
  2116. execute(t8, e11, i8, s10) {
  2117. return new a6(t8, e11, i8);
  2118. }
  2119. };
  2120. r13.instance = null;
  2121. var a6 = class {
  2122. constructor(t8, e11, i8) {
  2123. this._inputGeometries = t8, this._height = (e11.amplitude !== void 0 ? e11.amplitude : 2) * i8, this._period = (e11.period !== void 0 ? e11.period : 3) * i8, this._style = e11.waveform, this._height <= 0 && (this._height = Math.abs(this._height)), this._period <= 0 && (this._period = Math.abs(this._period)), this._pattern = new n8(), this._pattern.addValue(this._period), this._pattern.addValue(this._period), this._walker = new a5(), this._walker.updateTolerance(i8);
  2124. }
  2125. next() {
  2126. let i8 = this._inputGeometries.next();
  2127. for (; i8; ) {
  2128. if (this._height === 0 || this._period === 0)
  2129. return i8;
  2130. if (y(i8)) {
  2131. const t8 = this._processGeom(i8.paths);
  2132. if (t8.length)
  2133. return { paths: t8 };
  2134. }
  2135. if (c2(i8)) {
  2136. const t8 = this._processGeom(i8.rings);
  2137. if (t8.length)
  2138. return { rings: t8 };
  2139. }
  2140. i8 = this._inputGeometries.next();
  2141. }
  2142. return null;
  2143. }
  2144. _processGeom(t8) {
  2145. const e11 = [];
  2146. for (const i8 of t8)
  2147. if (this._walker.init(i8, this._pattern))
  2148. switch (this._style) {
  2149. case A.Sinus:
  2150. default:
  2151. e11.push(this._constructCurve(i8, false));
  2152. break;
  2153. case A.Square:
  2154. e11.push(this._constructSquare(i8));
  2155. break;
  2156. case A.Triangle:
  2157. e11.push(this._constructTriangle(i8));
  2158. break;
  2159. case A.Random:
  2160. e11.push(this._constructCurve(i8, true));
  2161. }
  2162. else
  2163. e11.push(i8);
  2164. return e11;
  2165. }
  2166. _constructCurve(t8, e11) {
  2167. const s10 = new s6(), h6 = this._walker.calculatePathLength(t8);
  2168. let n17 = Math.round(h6 / this._period);
  2169. n17 === 0 && (n17 = 1);
  2170. const r18 = n17 * 16 + 1, a10 = h6 / n17, o11 = this._period / 16, l9 = 1 / r18, _4 = 2 * Math.PI * h6 / a10, c9 = 2 * Math.PI * Math.random(), p3 = 2 * Math.PI * Math.random(), u9 = 2 * Math.PI * Math.random(), d2 = 0.75 - Math.random() / 2, g5 = 0.75 - Math.random() / 2, w4 = {};
  2171. this._walker.curPointAndAngle(w4), s10.startPath(w4.pt);
  2172. let f8 = 0;
  2173. for (; ; ) {
  2174. if (!this._walker.nextPointAndAngle(o11, w4)) {
  2175. s10.lineTo(t8[t8.length - 1]);
  2176. break;
  2177. }
  2178. {
  2179. const t9 = f8;
  2180. let i8;
  2181. if (f8 += l9, e11) {
  2182. const e12 = this._height / 2 * (1 + 0.3 * Math.sin(d2 * _4 * t9 + c9));
  2183. i8 = e12 * Math.sin(_4 * t9 + p3), i8 += e12 * Math.sin(g5 * _4 * t9 + u9), i8 /= 2;
  2184. } else
  2185. i8 = 0.5 * this._height * Math.sin(0.5 * _4 * t9);
  2186. s10.lineTo([w4.pt[0] - i8 * w4.sa, w4.pt[1] + i8 * w4.ca]);
  2187. }
  2188. }
  2189. return s10.path();
  2190. }
  2191. _constructSquare(t8) {
  2192. const e11 = new s6(), s10 = this._walker.calculatePathLength(t8);
  2193. Math.round(s10 / this._period);
  2194. let h6 = true;
  2195. for (; ; ) {
  2196. let t9 = false;
  2197. if (this._walker.curPositionIsValid()) {
  2198. const i8 = {};
  2199. this._walker.curPointAndAngle(i8);
  2200. const s11 = {};
  2201. if (this._walker.nextPointAndAngle(this._period, s11)) {
  2202. const n17 = {};
  2203. this._walker.nextPointAndAngle(this._period, n17) && (h6 ? (e11.startPath(i8.pt), h6 = false) : e11.lineTo(i8.pt), e11.lineTo([i8.pt[0] - this._height / 2 * i8.sa, i8.pt[1] + this._height / 2 * i8.ca]), e11.lineTo([s11.pt[0] - this._height / 2 * s11.sa, s11.pt[1] + this._height / 2 * s11.ca]), e11.lineTo([s11.pt[0] + this._height / 2 * s11.sa, s11.pt[1] - this._height / 2 * s11.ca]), e11.lineTo([n17.pt[0] + this._height / 2 * n17.sa, n17.pt[1] - this._height / 2 * n17.ca]), t9 = true);
  2204. }
  2205. }
  2206. if (!t9) {
  2207. e11.lineTo(this._walker.getPathEnd());
  2208. break;
  2209. }
  2210. }
  2211. return e11.path();
  2212. }
  2213. _constructTriangle(t8) {
  2214. const e11 = new s6(), s10 = this._walker.calculatePathLength(t8);
  2215. Math.round(s10 / this._period);
  2216. let h6 = true;
  2217. for (; ; ) {
  2218. let t9 = false;
  2219. if (this._walker.curPositionIsValid()) {
  2220. const i8 = {};
  2221. this._walker.curPointAndAngle(i8);
  2222. const s11 = {};
  2223. if (this._walker.nextPointAndAngle(this._period / 2, s11)) {
  2224. const n17 = {};
  2225. this._walker.nextPointAndAngle(this._period, n17) && (this._walker.nextPosition(this._period / 2) && (h6 ? (e11.startPath(i8.pt), h6 = false) : e11.lineTo(i8.pt), e11.lineTo([s11.pt[0] - this._height / 2 * s11.sa, s11.pt[1] + this._height / 2 * s11.ca]), e11.lineTo([n17.pt[0] + this._height / 2 * n17.sa, n17.pt[1] - this._height / 2 * n17.ca])), t9 = true);
  2226. }
  2227. }
  2228. if (!t9) {
  2229. e11.lineTo(this._walker.getPathEnd());
  2230. break;
  2231. }
  2232. }
  2233. return e11.path();
  2234. }
  2235. };
  2236. // node_modules/@arcgis/core/symbols/cim/placements/PlacementAlongLineSameSize.js
  2237. var n12 = class {
  2238. static local() {
  2239. return n12.instance === null && (n12.instance = new n12()), n12.instance;
  2240. }
  2241. execute(t8, e11, s10, i8) {
  2242. return new a7(t8, e11, s10);
  2243. }
  2244. };
  2245. n12.instance = null;
  2246. var a7 = class extends G {
  2247. constructor(t8, e11, n17) {
  2248. super(t8, true, true), this._geometryWalker = new a5(), this._geometryWalker.updateTolerance(n17), this._angleToLine = e11.angleToLine ?? true, this._offset = (e11.offset ? e11.offset : 0) * n17, this._originalEndings = e11.endings, this._offsetAtEnd = (e11.customEndingOffset ? e11.customEndingOffset : 0) * n17, this._position = -(e11.offsetAlongLine ? e11.offsetAlongLine : 0) * n17, this._pattern = new n8(), this._pattern.init(e11.placementTemplate, false), this._pattern.scale(n17), this._endings = this._originalEndings;
  2249. }
  2250. processPath(t8) {
  2251. if (this._pattern.isEmpty())
  2252. return null;
  2253. let s10;
  2254. if (this.iteratePath)
  2255. s10 = this._pattern.nextValue();
  2256. else {
  2257. this._originalEndings === X.WithFullGap && this.isClosed ? this._endings = X.WithMarkers : this._endings = this._originalEndings, this._pattern.extPtGap = 0;
  2258. let i9, n17 = true;
  2259. switch (this._endings) {
  2260. case X.NoConstraint:
  2261. i9 = -this._position, i9 = this._adjustPosition(i9), n17 = false;
  2262. break;
  2263. case X.WithHalfGap:
  2264. default:
  2265. i9 = -this._pattern.lastValue() / 2;
  2266. break;
  2267. case X.WithFullGap:
  2268. i9 = -this._pattern.lastValue(), this._pattern.extPtGap = this._pattern.lastValue();
  2269. break;
  2270. case X.WithMarkers:
  2271. i9 = 0;
  2272. break;
  2273. case X.Custom:
  2274. i9 = -this._position, i9 = this._adjustPosition(i9), this._pattern.extPtGap = 0.5 * this._offsetAtEnd;
  2275. }
  2276. if (!this._geometryWalker.init(t8, this._pattern, n17))
  2277. return null;
  2278. this._pattern.reset();
  2279. let a10 = 0;
  2280. for (; i9 > a10; )
  2281. i9 -= a10, a10 = this._pattern.nextValue();
  2282. a10 -= i9, s10 = a10, this.iteratePath = true;
  2283. }
  2284. const i8 = {};
  2285. return this._geometryWalker.nextPointAndAngle(s10, i8) ? this._endings === X.WithFullGap && this._geometryWalker.isPathEnd() ? (this.iteratePath = false, null) : this._endings === X.WithMarkers && this._geometryWalker.isPathEnd() && (this.iteratePath = false, this.isClosed) ? null : (this.internalPlacement.setTranslate(i8.pt[0] - this._offset * i8.sa, i8.pt[1] + this._offset * i8.ca), this._angleToLine && this.internalPlacement.setRotateCS(i8.ca, i8.sa), this.internalPlacement) : (this.iteratePath = false, null);
  2286. }
  2287. _adjustPosition(t8) {
  2288. let e11 = t8 / this._pattern.length();
  2289. return e11 -= Math.floor(e11), e11 * this._pattern.length();
  2290. }
  2291. };
  2292. // node_modules/@arcgis/core/symbols/cim/placements/PlacementAtExtremities.js
  2293. var n13 = class {
  2294. static local() {
  2295. return n13.instance === null && (n13.instance = new n13()), n13.instance;
  2296. }
  2297. execute(t8, e11, s10, i8) {
  2298. return new r14(t8, e11, s10);
  2299. }
  2300. };
  2301. n13.instance = null;
  2302. var r14 = class extends G {
  2303. constructor(t8, e11, i8) {
  2304. super(t8, false, true), this._curveHelper = new n7(), this._angleToLine = e11.angleToLine === void 0 || e11.angleToLine, this._offset = e11.offset !== void 0 ? e11.offset * i8 : 0, this._type = e11.extremityPlacement, this._position = e11.offsetAlongLine !== void 0 ? e11.offsetAlongLine * i8 : 0, this._beginProcessed = false;
  2305. }
  2306. processPath(t8) {
  2307. let e11;
  2308. switch (this._type) {
  2309. case o3.Both:
  2310. default:
  2311. this._beginProcessed ? (e11 = this._atExtremities(t8, this._position, false), this._beginProcessed = false, this.iteratePath = false) : (e11 = this._atExtremities(t8, this._position, true), this._beginProcessed = true, this.iteratePath = true);
  2312. break;
  2313. case o3.JustBegin:
  2314. e11 = this._atExtremities(t8, this._position, true);
  2315. break;
  2316. case o3.JustEnd:
  2317. e11 = this._atExtremities(t8, this._position, false);
  2318. case o3.None:
  2319. }
  2320. return e11;
  2321. }
  2322. _atExtremities(t8, s10, i8) {
  2323. const n17 = t8.length;
  2324. if (n17 < 2)
  2325. return null;
  2326. const r18 = i8 ? 1 : n17 - 2, o11 = i8 ? n17 : -1, a10 = i8 ? 1 : -1;
  2327. let l9, h6 = 0, c9 = i8 ? t8[0] : t8[n17 - 1];
  2328. for (let _4 = r18; _4 !== o11; _4 += a10) {
  2329. l9 = c9, c9 = t8[_4];
  2330. const i9 = this._curveHelper.calculateLength(l9, c9);
  2331. if (h6 + i9 > s10) {
  2332. const t9 = (s10 - h6) / i9, [n18, r19] = this._curveHelper.getAngleCS(l9, c9, t9), o12 = y3(l9, c9, t9);
  2333. return this.internalPlacement.setTranslate(o12[0] - this._offset * r19, o12[1] + this._offset * n18), this._angleToLine && this.internalPlacement.setRotateCS(-n18, -r19), this.internalPlacement;
  2334. }
  2335. h6 += i9;
  2336. }
  2337. return null;
  2338. }
  2339. };
  2340. // node_modules/@arcgis/core/symbols/cim/placements/PlacementAtRatioPositions.js
  2341. var n14 = class {
  2342. static local() {
  2343. return n14.instance === null && (n14.instance = new n14()), n14.instance;
  2344. }
  2345. execute(t8, i8, s10, e11) {
  2346. return new a8(t8, i8, s10);
  2347. }
  2348. };
  2349. n14.instance = null;
  2350. var a8 = class extends G {
  2351. constructor(t8, e11, n17) {
  2352. super(t8, true, true), this._walker = new a5(), this._walker.updateTolerance(n17), this._angleToLine = e11.angleToLine === void 0 || e11.angleToLine, this._offset = e11.offset !== void 0 ? e11.offset * n17 : 0, this._beginGap = e11.beginPosition !== void 0 ? e11.beginPosition * n17 : 0, this._endGap = e11.endPosition !== void 0 ? e11.endPosition * n17 : 0, this._flipFirst = e11.flipFirst === void 0 || e11.flipFirst, this._pattern = new n8(), this._pattern.init(e11.positionArray, false, false), this._subPathLen = 0, this._posCount = this._pattern.size(), this._isFirst = true, this._prevPos = 0;
  2353. }
  2354. processPath(t8) {
  2355. if (this._pattern.isEmpty())
  2356. return null;
  2357. let i8;
  2358. if (this.iteratePath) {
  2359. const t9 = this._pattern.nextValue() * this._subPathLen, s11 = this._beginGap + t9;
  2360. i8 = s11 - this._prevPos, this._prevPos = s11;
  2361. } else {
  2362. if (this._posCount = this._pattern.size(), this._isFirst = true, this._prevPos = 0, this._subPathLen = this._walker.calculatePathLength(t8) - this._beginGap - this._endGap, this._subPathLen < 0)
  2363. return this.iteratePath = false, null;
  2364. if (!this._walker.init(t8, this._pattern, false))
  2365. return null;
  2366. this._pattern.reset();
  2367. const s11 = this._pattern.nextValue() * this._subPathLen, e11 = this._beginGap + s11;
  2368. i8 = e11 - this._prevPos, this._prevPos = e11, this.iteratePath = true;
  2369. }
  2370. const s10 = {};
  2371. if (!this._walker.nextPointAndAngle(i8, s10, h4.END))
  2372. return this.iteratePath = false, null;
  2373. this.internalPlacement.setTranslate(s10.pt[0] - this._offset * s10.sa, s10.pt[1] + this._offset * s10.ca);
  2374. const n17 = this._isFirst && this._flipFirst;
  2375. let a10, r18;
  2376. return this._angleToLine ? (a10 = s10.ca, r18 = s10.sa) : (a10 = 1, r18 = 0), n17 && (a10 = -a10, r18 = -r18), this.internalPlacement.setRotateCS(a10, r18), this._isFirst = false, this._posCount--, this._posCount === 0 && (this.iteratePath = false), this.internalPlacement;
  2377. }
  2378. };
  2379. // node_modules/@arcgis/core/symbols/cim/placements/PlacementInsidePolygon.js
  2380. function h5(t8) {
  2381. return t8.rings !== void 0;
  2382. }
  2383. var e10 = class {
  2384. static local() {
  2385. return e10.instance === null && (e10.instance = new e10()), e10.instance;
  2386. }
  2387. execute(t8, s10, i8, h6) {
  2388. return new n15(t8, s10, i8, h6);
  2389. }
  2390. };
  2391. e10.instance = null;
  2392. var n15 = class {
  2393. constructor(e11, n17, _4, r18) {
  2394. if (this._xMin = 0, this._xMax = 0, this._yMin = 0, this._yMax = 0, this._currentX = 0, this._currentY = 0, this._stepX = Math.abs(n17.stepX ?? 16) * _4, this._stepY = Math.abs(n17.stepY ?? 16) * _4, this._stepX !== 0 && this._stepY !== 0 && e11 && h5(e11) && e11.rings) {
  2395. if (this._gridType = n17.gridType ?? Y.Fixed, this._gridType === Y.Random) {
  2396. const s10 = n17.seed ?? 13, i8 = 1;
  2397. this._randomLCG = new t2(s10 * i8), this._randomness = (n17.randomness ?? 100) / 100, this._gridAngle = 0, this._shiftOddRows = false, this._cosAngle = 1, this._sinAngle = 0, this._offsetX = 0, this._offsetY = 0;
  2398. } else {
  2399. if (this._randomness = 0, this._gridAngle = n17.gridAngle ?? 0, this._shiftOddRows = n17.shiftOddRows ?? false, this._offsetX = (n17.offsetX ?? 0) * _4, this._offsetY = (n17.offsetY ?? 0) * _4, this._cosAngle = Math.cos(this._gridAngle / 180 * Math.PI), this._sinAngle = -Math.sin(this._gridAngle / 180 * Math.PI), this._stepX)
  2400. if (this._offsetX < 0)
  2401. for (; this._offsetX < -0.5 * this._stepX; )
  2402. this._offsetX += this._stepX;
  2403. else
  2404. for (; this._offsetX >= 0.5 * this._stepX; )
  2405. this._offsetX -= this._stepX;
  2406. if (this._stepY)
  2407. if (this._offsetY < 0)
  2408. for (; this._offsetY < -0.5 * this._stepY; )
  2409. this._offsetY += this._stepY;
  2410. else
  2411. for (; this._offsetY >= 0.5 * this._stepY; )
  2412. this._offsetY -= this._stepY;
  2413. }
  2414. this._graphicOriginX = 0, this._graphicOriginY = 0, this._internalPlacement = new t6(), this._calculateMinMax(e11), this._geometry = e11;
  2415. }
  2416. }
  2417. next() {
  2418. return this._geometry ? this._nextInside() : null;
  2419. }
  2420. _calculateMinMax(t8) {
  2421. let s10, i8, h6, e11, n17, _4, r18, o11;
  2422. this._xMin = 0, this._xMax = 0, this._yMin = 0, this._yMax = 0, n17 = _4 = Number.MAX_VALUE, r18 = o11 = -Number.MAX_VALUE;
  2423. for (const a10 of t8.rings) {
  2424. const t9 = a10 ? a10.length : 0;
  2425. for (let f8 = 0; f8 < t9; ++f8)
  2426. s10 = a10[f8][0] - this._graphicOriginX - this._offsetX, i8 = a10[f8][1] - this._graphicOriginY - this._offsetY, h6 = this._cosAngle * s10 - this._sinAngle * i8, e11 = this._sinAngle * s10 + this._cosAngle * i8, n17 = Math.min(n17, h6), r18 = Math.max(r18, h6), _4 = Math.min(_4, e11), o11 = Math.max(o11, e11);
  2427. }
  2428. n17 += this._graphicOriginX, r18 += this._graphicOriginX, _4 += this._graphicOriginY, o11 += this._graphicOriginY, this._xMin = Math.round(n17 / this._stepX), this._xMax = Math.round(r18 / this._stepX), this._yMin = Math.round(_4 / this._stepY), this._yMax = Math.round(o11 / this._stepY), this._currentX = this._xMax + 1, this._currentY = this._yMin - 1;
  2429. }
  2430. _nextInside() {
  2431. for (; ; ) {
  2432. if (this._currentX > this._xMax) {
  2433. if (this._currentY++, this._currentY > this._yMax)
  2434. return null;
  2435. this._currentX = this._xMin, this._shiftOddRows && this._currentY % 2 && this._currentX--;
  2436. }
  2437. let t8 = this._currentX * this._stepX + this._offsetX;
  2438. this._shiftOddRows && this._currentY % 2 && (t8 += 0.5 * this._stepX);
  2439. const s10 = this._currentY * this._stepY + this._offsetY;
  2440. let h6, e11;
  2441. return this._currentX++, this._gridType === Y.Random ? (h6 = this._graphicOriginX + t8 + this._stepX * this._randomness * (0.5 - this._randomLCG.getFloat()) * 2 / 3, e11 = this._graphicOriginY + s10 + this._stepY * this._randomness * (0.5 - this._randomLCG.getFloat()) * 2 / 3) : (h6 = this._graphicOriginX + this._cosAngle * t8 + this._sinAngle * s10, e11 = this._graphicOriginY - this._sinAngle * t8 + this._cosAngle * s10), this._internalPlacement.setTranslate(h6, e11), this._internalPlacement;
  2442. }
  2443. }
  2444. };
  2445. // node_modules/@arcgis/core/symbols/cim/placements/PlacementOnLine.js
  2446. var r15 = 1e-3;
  2447. var l8 = class {
  2448. static local() {
  2449. return l8.instance === null && (l8.instance = new l8()), l8.instance;
  2450. }
  2451. execute(e11, t8, n17, i8) {
  2452. return new o8(e11, t8, n17);
  2453. }
  2454. };
  2455. l8.instance = null;
  2456. var o8 = class extends G {
  2457. constructor(e11, t8, n17) {
  2458. super(e11, true, true), this._curveHelper = new n7(), this._angleToLine = t8.angleToLine === void 0 || t8.angleToLine, this._offset = t8.offset !== void 0 ? t8.offset * n17 : 0, this._relativeTo = t8.relativeTo, this._position = t8.startPointOffset !== void 0 ? t8.startPointOffset * n17 : 0, this._epsilon = r15 * n17;
  2459. }
  2460. processPath(e11) {
  2461. const i8 = this._position;
  2462. if (this._relativeTo === Z.SegmentMidpoint) {
  2463. for (this.iteratePath || (this._segmentCount = e11.length, this._curSegment = 1, this.iteratePath = true); this._curSegment < this._segmentCount; ) {
  2464. const n17 = this._curSegment;
  2465. this._curSegment++;
  2466. const i9 = e11[n17 - 1], s10 = e11[n17], r19 = this._curveHelper.calculateLength(i9, s10);
  2467. if (r19 < this._epsilon)
  2468. continue;
  2469. const l9 = 0.5 + this._position / r19, [o11, a10] = this._curveHelper.getAngleCS(i9, s10, l9), h6 = y3(i9, s10, l9);
  2470. return this.internalPlacement.setTranslate(h6[0] - this._offset * a10, h6[1] + this._offset * o11), this._angleToLine && this.internalPlacement.setRotateCS(o11, a10), this.internalPlacement;
  2471. }
  2472. return this.iteratePath = false, null;
  2473. }
  2474. this._relativeTo === Z.LineEnd && d(e11);
  2475. const r18 = this.onLine(e11, i8);
  2476. return this._relativeTo === Z.LineEnd && d(e11), r18;
  2477. }
  2478. onLine(e11, n17) {
  2479. let i8, r18 = false;
  2480. switch (this._relativeTo) {
  2481. case Z.LineMiddle:
  2482. default:
  2483. i8 = this._curveHelper.calculatePathLength(e11) / 2 + n17;
  2484. break;
  2485. case Z.LineBeginning:
  2486. i8 = n17;
  2487. break;
  2488. case Z.LineEnd:
  2489. i8 = n17, r18 = true;
  2490. }
  2491. const l9 = e11.length;
  2492. let o11, a10 = 0, h6 = e11[0];
  2493. for (let s10 = 1; s10 < l9; ++s10) {
  2494. o11 = h6, h6 = e11[s10];
  2495. const n18 = this._curveHelper.calculateLength(o11, h6);
  2496. if (a10 + n18 > i8) {
  2497. const e12 = (i8 - a10) / n18, [s11, l10] = this._curveHelper.getAngleCS(o11, h6, e12), c9 = y3(o11, h6, e12), u9 = r18 ? -this._offset : this._offset;
  2498. return this.internalPlacement.setTranslate(c9[0] - u9 * l10, c9[1] + u9 * s11), this._angleToLine && (r18 ? this.internalPlacement.setRotateCS(-s11, -l10) : this.internalPlacement.setRotateCS(s11, l10)), this.internalPlacement;
  2499. }
  2500. a10 += n18;
  2501. }
  2502. return null;
  2503. }
  2504. };
  2505. // node_modules/@arcgis/core/symbols/cim/placements/PlacementOnVertices.js
  2506. var n16 = class {
  2507. static local() {
  2508. return n16.instance === null && (n16.instance = new n16()), n16.instance;
  2509. }
  2510. execute(t8, s10, e11, i8) {
  2511. return new a9(t8, s10, e11);
  2512. }
  2513. };
  2514. n16.instance = null;
  2515. var r16 = 1e-15;
  2516. var a9 = class extends G {
  2517. constructor(t8, s10, e11) {
  2518. super(t8, true, true), this._curveHelper = new n7(), this._angleToLine = s10.angleToLine === void 0 || s10.angleToLine, this._offset = s10.offset !== void 0 ? s10.offset * e11 : 0, this._endPoints = s10.placeOnEndPoints === void 0 || s10.placeOnEndPoints, this._controlPoints = s10.placeOnControlPoints === void 0 || s10.placeOnControlPoints, this._regularVertices = s10.placeOnRegularVertices === void 0 || s10.placeOnRegularVertices, this._tags = [], this._tagIterator = 0;
  2519. }
  2520. processPath(t8) {
  2521. if (this.iteratePath || (this._preparePath(t8), this.iteratePath = true), this._tagIterator >= this._tags.length)
  2522. return this._tags.length = 0, this._tagIterator = 0, this.iteratePath = false, null;
  2523. const s10 = this._tags[this._tagIterator];
  2524. this._angleToLine && this.internalPlacement.setRotate(s10[2]);
  2525. let e11 = s10[0], i8 = s10[1];
  2526. if (this._offset !== 0) {
  2527. const t9 = Math.cos(s10[2]), n17 = Math.sin(s10[2]);
  2528. e11 -= this._offset * n17, i8 += this._offset * t9;
  2529. }
  2530. return this.internalPlacement.setTranslate(e11, i8), this._tagIterator++, this.internalPlacement;
  2531. }
  2532. _preparePath(t8) {
  2533. this._tags.length = 0, this._tagIterator = 0;
  2534. const i8 = C3(t8), n17 = t8.length - 1;
  2535. let r18, a10, h6 = 0, l9 = 0, _4 = 0, c9 = 0, g5 = 0;
  2536. for (; h6 < n17; ) {
  2537. h6++, r18 = t8[h6 - 1], a10 = t8[h6];
  2538. const s10 = I(r18), u9 = I(a10);
  2539. (this._angleToLine || this._offset !== 0) && (c9 = this._curveHelper.getAngle(r18, a10, 0)), h6 === 1 ? i8 ? (l9 = c9, _4 = s10) : (this._endPoints || this._controlPoints && s10 === 1) && this._tags.push([r18[0], r18[1], c9]) : s10 === 1 ? this._controlPoints && this._tags.push([r18[0], r18[1], o9(g5, c9)]) : this._regularVertices && this._tags.push([r18[0], r18[1], o9(g5, c9)]), (this._angleToLine || this._offset !== 0) && (g5 = this._curveHelper.getAngle(r18, a10, 1)), h6 === n17 && (i8 ? u9 === 1 || _4 === 1 ? this._controlPoints && this._tags.push([a10[0], a10[1], o9(g5, l9)]) : this._regularVertices && this._tags.push([a10[0], a10[1], o9(g5, l9)]) : (this._endPoints || this._controlPoints && u9 === 1) && this._tags.push([a10[0], a10[1], g5]));
  2540. }
  2541. this._tagIterator = 0;
  2542. }
  2543. };
  2544. function o9(t8, s10) {
  2545. const e11 = Math.PI;
  2546. for (; Math.abs(s10 - t8) > e11 + 2 * r16; )
  2547. s10 - t8 > e11 ? s10 -= 2 * e11 : s10 += 2 * e11;
  2548. return (t8 + s10) / 2;
  2549. }
  2550. // node_modules/@arcgis/core/symbols/cim/placements/PlacementPolygonCenter.js
  2551. function o10(t8) {
  2552. return t8.rings !== void 0;
  2553. }
  2554. var r17 = class {
  2555. static local() {
  2556. return r17.instance === null && (r17.instance = new r17()), r17.instance;
  2557. }
  2558. execute(t8, e11, n17, s10) {
  2559. return new i6(t8, e11, n17);
  2560. }
  2561. };
  2562. r17.instance = null;
  2563. var i6 = class {
  2564. constructor(t8, e11, o11) {
  2565. this._geometry = t8, this._offsetX = e11.offsetX !== void 0 ? e11.offsetX * o11 : 0, this._offsetY = e11.offsetY !== void 0 ? e11.offsetY * o11 : 0, this._method = e11.method !== void 0 ? e11.method : K.OnPolygon, this._internalPlacement = new t6();
  2566. }
  2567. next() {
  2568. const t8 = this._geometry;
  2569. return this._geometry = null, t8 && o10(t8) ? this._polygonCenter(t8) : null;
  2570. }
  2571. _polygonCenter(n17) {
  2572. let o11 = false;
  2573. switch (this._method) {
  2574. case K.OnPolygon:
  2575. default:
  2576. case K.CenterOfMass:
  2577. case K.BoundingBoxCenter: {
  2578. const s10 = u2();
  2579. c(s10, n17), this._internalPlacement.setTranslate((s10[2] + s10[0]) / 2 + this._offsetX, (s10[3] + s10[1]) / 2 + this._offsetY), o11 = true;
  2580. break;
  2581. }
  2582. }
  2583. return o11 ? this._internalPlacement : null;
  2584. }
  2585. };
  2586. // node_modules/@arcgis/core/symbols/cim/CIMOperators.js
  2587. function A2(p3) {
  2588. if (!p3)
  2589. return null;
  2590. switch (p3.type) {
  2591. case "CIMGeometricEffectAddControlPoints":
  2592. return o7.local();
  2593. case "CIMGeometricEffectArrow":
  2594. return h2.local();
  2595. case "CIMGeometricEffectBuffer":
  2596. return f6.local();
  2597. case "CIMGeometricEffectControlMeasureLine":
  2598. return _.local();
  2599. case "CIMGeometricEffectCut":
  2600. return u6.local();
  2601. case "CIMGeometricEffectDashes":
  2602. return r9.local();
  2603. case "CIMGeometricEffectDonut":
  2604. return r10.local();
  2605. case "CIMGeometricEffectJog":
  2606. return s8.local();
  2607. case "CIMGeometricEffectMove":
  2608. return n10.local();
  2609. case "CIMGeometricEffectOffset":
  2610. return r12.local();
  2611. case "CIMGeometricEffectReverse":
  2612. return s9.local();
  2613. case "CIMGeometricEffectRotate":
  2614. return u7.local();
  2615. case "CIMGeometricEffectScale":
  2616. return c8.local();
  2617. case "CIMGeometricEffectWave":
  2618. return r13.local();
  2619. }
  2620. return null;
  2621. }
  2622. function g3(e11) {
  2623. if (!e11)
  2624. return null;
  2625. switch (e11.type) {
  2626. case "CIMMarkerPlacementAlongLineSameSize":
  2627. return n12.local();
  2628. case "CIMMarkerPlacementAtExtremities":
  2629. return n13.local();
  2630. case "CIMMarkerPlacementAtRatioPositions":
  2631. return n14.local();
  2632. case "CIMMarkerPlacementInsidePolygon":
  2633. return e10.local();
  2634. case "CIMMarkerPlacementOnLine":
  2635. return l8.local();
  2636. case "CIMMarkerPlacementOnVertices":
  2637. return n16.local();
  2638. case "CIMMarkerPlacementPolygonCenter":
  2639. return r17.local();
  2640. }
  2641. return null;
  2642. }
  2643. // node_modules/@arcgis/core/symbols/cim/Rect.js
  2644. var t7 = class {
  2645. constructor(t8 = 0, h6 = 0, i8 = 0, s10 = 0) {
  2646. this.x = t8, this.y = h6, this.width = i8, this.height = s10;
  2647. }
  2648. get isEmpty() {
  2649. return this.width <= 0 || this.height <= 0;
  2650. }
  2651. union(t8) {
  2652. this.x = Math.min(this.x, t8.x), this.y = Math.min(this.y, t8.y), this.width = Math.max(this.width, t8.width), this.height = Math.max(this.height, t8.height);
  2653. }
  2654. };
  2655. // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/BoundingBox.js
  2656. var i7 = class {
  2657. constructor(i8, e11, s10, r18) {
  2658. this.center = t4(i8, e11), this.centerT = n2(), this.halfWidth = s10 / 2, this.halfHeight = r18 / 2, this.width = s10, this.height = r18;
  2659. }
  2660. get x() {
  2661. return this.center[0];
  2662. }
  2663. get y() {
  2664. return this.center[1];
  2665. }
  2666. get blX() {
  2667. return this.center[0] + this.halfWidth;
  2668. }
  2669. get blY() {
  2670. return this.center[1] + this.halfHeight;
  2671. }
  2672. get trX() {
  2673. return this.center[0] - this.halfWidth;
  2674. }
  2675. get trY() {
  2676. return this.center[1] - this.halfHeight;
  2677. }
  2678. get xmin() {
  2679. return this.x - this.halfWidth;
  2680. }
  2681. get xmax() {
  2682. return this.x + this.halfWidth;
  2683. }
  2684. get ymin() {
  2685. return this.y - this.halfHeight;
  2686. }
  2687. get ymax() {
  2688. return this.y + this.halfHeight;
  2689. }
  2690. set x(t8) {
  2691. this.center[0] = t8;
  2692. }
  2693. set y(t8) {
  2694. this.center[1] = t8;
  2695. }
  2696. clone() {
  2697. return new i7(this.x, this.y, this.width, this.height);
  2698. }
  2699. serialize(t8) {
  2700. return t8.writeF32(this.center[0]), t8.writeF32(this.center[1]), t8.push(this.width), t8.push(this.height), t8;
  2701. }
  2702. findCollisionDelta(t8, h6 = 4) {
  2703. const i8 = Math.abs(t8.centerT[0] - this.centerT[0]), e11 = Math.abs(t8.centerT[1] - this.centerT[1]), s10 = (t8.halfWidth + this.halfWidth + h6) / i8, r18 = (t8.halfHeight + this.halfHeight + h6) / e11, n17 = Math.min(s10, r18);
  2704. return Math.log2(n17);
  2705. }
  2706. extend(t8) {
  2707. const h6 = Math.min(this.xmin, t8.xmin), i8 = Math.min(this.ymin, t8.ymin), e11 = Math.max(this.xmax, t8.xmax) - h6, s10 = Math.max(this.ymax, t8.ymax) - i8, r18 = h6 + e11 / 2, n17 = i8 + s10 / 2;
  2708. this.width = e11, this.height = s10, this.halfWidth = e11 / 2, this.halfHeight = s10 / 2, this.x = r18, this.y = n17;
  2709. }
  2710. static deserialize(t8) {
  2711. const h6 = t8.readF32(), e11 = t8.readF32(), s10 = t8.readInt32(), r18 = t8.readInt32();
  2712. return new i7(h6, e11, s10, r18);
  2713. }
  2714. };
  2715. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/shapingUtils.js
  2716. var m6 = 26;
  2717. var u8 = 4;
  2718. var g4 = m6 + u8;
  2719. var _2 = m6 - 6;
  2720. var p2 = 3;
  2721. var x2 = 8;
  2722. var w3 = Math.PI / 180;
  2723. var y4 = class {
  2724. constructor(t8, s10, e11, i8) {
  2725. this._rotationT = n(), this._xBounds = 0, this._yBounds = 0, this.minZoom = 0, this.maxZoom = 255, this._bounds = null;
  2726. const n17 = e11.rect, o11 = new Float32Array(8);
  2727. t8 *= i8, s10 *= i8;
  2728. const r18 = e11.code ? n17.width * i8 : e11.metrics.width, a10 = e11.code ? n17.height * i8 : e11.metrics.height;
  2729. o11[0] = t8, o11[1] = s10, o11[2] = t8 + r18, o11[3] = s10, o11[4] = t8, o11[5] = s10 + a10, o11[6] = t8 + r18, o11[7] = s10 + a10, this._data = o11, this._setTextureCoords(n17), this._scale = i8, this._mosaic = e11, this.x = t8, this.y = s10, this.maxOffset = Math.max(t8 + r18, s10 + a10);
  2730. }
  2731. get width() {
  2732. return this._mosaic.metrics.width * this._scale;
  2733. }
  2734. get mosaic() {
  2735. return this._mosaic;
  2736. }
  2737. set angle(s10) {
  2738. this._angle = s10, h(this._rotationT, -s10), this._setOffsets(this._data);
  2739. }
  2740. get angle() {
  2741. return this._angle;
  2742. }
  2743. get xTopLeft() {
  2744. return this._data[0];
  2745. }
  2746. get yTopLeft() {
  2747. return this._data[1];
  2748. }
  2749. get xBottomRight() {
  2750. return this._data[6];
  2751. }
  2752. get yBottomRight() {
  2753. return this._data[7];
  2754. }
  2755. get texcoords() {
  2756. return this._texcoords;
  2757. }
  2758. get textureBinding() {
  2759. return this._mosaic.textureBinding;
  2760. }
  2761. get offsets() {
  2762. return this._offsets || this._setOffsets(this._data), this._offsets;
  2763. }
  2764. get char() {
  2765. return String.fromCharCode(this._mosaic.code);
  2766. }
  2767. get code() {
  2768. return this._mosaic.code;
  2769. }
  2770. get bounds() {
  2771. if (!this._bounds) {
  2772. const { height: t8, width: e11 } = this._mosaic.metrics, i8 = e11 * this._scale, o11 = Math.abs(t8) * this._scale, r18 = new Float32Array(8);
  2773. r18[0] = this.x, r18[1] = this.y, r18[2] = this.x + i8, r18[3] = this.y, r18[4] = this.x, r18[5] = this.y + o11, r18[6] = this.x + i8, r18[7] = this.y + o11;
  2774. const a10 = o4(n(), this._rotationT, this._T);
  2775. a2(r18, r18, a10);
  2776. let c9 = 1 / 0, d2 = 1 / 0, f8 = 0, m7 = 0;
  2777. for (let s10 = 0; s10 < 4; s10++) {
  2778. const t9 = r18[2 * s10], e12 = r18[2 * s10 + 1];
  2779. c9 = Math.min(c9, t9), d2 = Math.min(d2, e12), f8 = Math.max(f8, t9), m7 = Math.max(m7, e12);
  2780. }
  2781. const u9 = f8 - c9, g5 = m7 - d2, _4 = c9 + u9 / 2, p3 = d2 + g5 / 2;
  2782. this._bounds = new i7(_4, p3, u9, g5);
  2783. }
  2784. return this._bounds;
  2785. }
  2786. setTransform(t8) {
  2787. this._T = t8, this._offsets = null;
  2788. }
  2789. _setOffsets(t8) {
  2790. this._offsets || (this._offsets = { upperLeft: 0, upperRight: 0, lowerLeft: 0, lowerRight: 0 });
  2791. const e11 = this._offsets, i8 = new Float32Array(8), o11 = o4(n(), this._rotationT, this._T);
  2792. a2(i8, t8, o11), e11.upperLeft = w2(i8[0] * x2, i8[1] * x2), e11.upperRight = w2(i8[2] * x2, i8[3] * x2), e11.lowerLeft = w2(i8[4] * x2, i8[5] * x2), e11.lowerRight = w2(i8[6] * x2, i8[7] * x2);
  2793. }
  2794. _setTextureCoords({ x: t8, y: s10, width: e11, height: i8 }) {
  2795. this._texcoords = { upperLeft: w2(t8, s10), upperRight: w2(t8 + e11, s10), lowerLeft: w2(t8, s10 + i8), lowerRight: w2(t8 + e11, s10 + i8) };
  2796. }
  2797. };
  2798. var M2 = (t8, s10) => ({ code: 0, page: 0, sdf: true, rect: new t5(0, 0, 11, 8), textureBinding: s10, metrics: { advance: 0, height: 4, width: t8, left: 0, top: 0 } });
  2799. var T = class {
  2800. constructor(t8, s10, e11) {
  2801. this._rotation = 0, this._decorate(t8, s10, e11), this.glyphs = t8, this.bounds = this._createBounds(t8), this.isMultiline = s10.length > 1, this._hasRotation = e11.angle !== 0, this._T = this._createGlyphTransform(this.bounds, e11);
  2802. for (const i8 of t8)
  2803. i8.setTransform(this._T);
  2804. }
  2805. setRotation(e11) {
  2806. if (e11 === 0 && this._rotation === 0)
  2807. return;
  2808. this._rotation = e11;
  2809. const i8 = this._T, n17 = h(n(), e11);
  2810. o4(i8, n17, i8);
  2811. for (const t8 of this.glyphs)
  2812. t8.setTransform(this._T);
  2813. }
  2814. _decorate(t8, s10, e11) {
  2815. if (!e11.decoration || e11.decoration === "none" || !t8.length)
  2816. return;
  2817. const i8 = e11.scale, h6 = e11.decoration === "underline" ? g4 : _2, n17 = t8[0].textureBinding;
  2818. for (const o11 of s10) {
  2819. const s11 = o11.startX * i8, e12 = o11.startY * i8, r18 = (o11.width + o11.glyphWidthEnd) * i8;
  2820. t8.push(new y4(s11, e12 + h6 * i8, M2(r18, n17), 1));
  2821. }
  2822. }
  2823. get boundsT() {
  2824. const t8 = this.bounds, s10 = r2(n2(), t8.x, t8.y);
  2825. if (z(s10, s10, this._T), this._hasRotation) {
  2826. const e11 = Math.max(t8.width, t8.height);
  2827. return new i7(s10[0], s10[1], e11, e11);
  2828. }
  2829. return new i7(s10[0], s10[1], t8.width, t8.height);
  2830. }
  2831. _createBounds(t8) {
  2832. let s10 = 1 / 0, e11 = 1 / 0, i8 = 0, h6 = 0;
  2833. for (const r18 of t8)
  2834. s10 = Math.min(s10, r18.xTopLeft), e11 = Math.min(e11, r18.yTopLeft), i8 = Math.max(i8, r18.xTopLeft + r18.width), h6 = Math.max(h6, r18.yBottomRight);
  2835. const n17 = i8 - s10, o11 = h6 - e11;
  2836. return new i7(s10 + n17 / 2, e11 + o11 / 2, n17, o11);
  2837. }
  2838. _createGlyphTransform(t8, s10) {
  2839. const n17 = w3 * s10.angle, r18 = n(), c9 = n2();
  2840. return i(r18, r18, r2(c9, s10.xOffset, -s10.yOffset)), s10.isCIM ? e5(r18, r18, n17) : (i(r18, r18, r2(c9, t8.x, t8.y)), e5(r18, r18, n17), i(r18, r18, r2(c9, -t8.x, -t8.y))), r18;
  2841. }
  2842. };
  2843. var B2 = class {
  2844. constructor(t8, s10, e11, i8, h6, n17) {
  2845. this.glyphWidthEnd = 0, this.startX = 0, this.startY = 0, this.start = Math.max(0, Math.min(s10, e11)), this.end = Math.max(0, Math.max(s10, e11)), this.end < t8.length && (this.glyphWidthEnd = t8[this.end].metrics.width), this.width = i8, this.yMin = h6, this.yMax = n17;
  2846. }
  2847. };
  2848. var R2 = (t8) => t8 === 10;
  2849. var b2 = (t8) => t8 === 32;
  2850. function L(t8, s10, e11) {
  2851. const i8 = new Array(), h6 = 1 / e11.scale, n17 = e11.maxLineWidth * h6, o11 = s10 ? t8.length - 1 : 0, r18 = s10 ? -1 : t8.length, a10 = s10 ? -1 : 1;
  2852. let c9 = o11, d2 = 0, f8 = 0, l9 = c9, m7 = l9, u9 = 0, g5 = 1 / 0, _4 = 0;
  2853. for (; c9 !== r18; ) {
  2854. const { code: s11, metrics: e12 } = t8[c9], h7 = Math.abs(e12.top);
  2855. if (R2(s11) || b2(s11) || (g5 = Math.min(g5, h7), _4 = Math.max(_4, h7 + e12.height)), R2(s11))
  2856. c9 !== o11 && (i8.push(new B2(t8, l9, c9 - a10, d2, g5, _4)), g5 = 1 / 0, _4 = 0), d2 = 0, l9 = c9 + a10, m7 = c9 + a10, f8 = 0;
  2857. else if (b2(s11))
  2858. m7 = c9 + a10, f8 = 0, u9 = e12.advance, d2 += e12.advance;
  2859. else if (d2 > n17) {
  2860. if (m7 !== l9) {
  2861. const s12 = m7 - 2 * a10;
  2862. d2 -= u9, i8.push(new B2(t8, l9, s12, d2 - f8, g5, _4)), g5 = 1 / 0, _4 = 0, l9 = m7, d2 = f8;
  2863. } else
  2864. i8.push(new B2(t8, l9, c9 - a10, d2, g5, _4)), g5 = 1 / 0, _4 = 0, l9 = c9, m7 = c9, d2 = 0;
  2865. d2 += e12.advance, f8 += e12.advance;
  2866. } else
  2867. d2 += e12.advance, f8 += e12.advance;
  2868. c9 += a10;
  2869. }
  2870. const p3 = new B2(t8, l9, c9 - a10, d2, g5, _4);
  2871. return p3.start >= 0 && p3.end < t8.length && i8.push(p3), i8;
  2872. }
  2873. function v(t8, s10) {
  2874. let e11 = 0;
  2875. for (let n17 = 0; n17 < t8.length; n17++) {
  2876. const { width: s11 } = t8[n17];
  2877. e11 = Math.max(s11, e11);
  2878. }
  2879. const i8 = s10.decoration === "underline" ? u8 : 0, h6 = t8[0].yMin;
  2880. return { x: 0, y: h6, height: t8[t8.length - 1].yMax + s10.lineHeight * (t8.length - 1) + i8 - h6, width: e11 };
  2881. }
  2882. function j3(t8, s10, e11) {
  2883. const i8 = e11.scale, h6 = new Array(), n17 = L(t8, s10, e11), o11 = v(n17, e11), { vAlign: r18, hAlign: a10 } = e11, d2 = r18 === t3.Baseline ? 1 : 0, f8 = d2 ? 0 : r18 - 1, l9 = (1 - d2) * -o11.y + f8 * (o11.height / 2) + (d2 ? 1 : 0) * -m6;
  2884. for (let c9 = 0; c9 < n17.length; c9++) {
  2885. const { start: s11, end: o12, width: r19 } = n17[c9];
  2886. let d3 = -1 * (a10 + 1) * (r19 / 2) - p2;
  2887. const f9 = c9 * e11.lineHeight + l9 - p2;
  2888. n17[c9].startX = d3, n17[c9].startY = f9;
  2889. for (let e12 = s11; e12 <= o12; e12++) {
  2890. const s12 = t8[e12];
  2891. if (R2(s12.code))
  2892. continue;
  2893. const n18 = new y4(d3 + s12.metrics.left, f9 - s12.metrics.top, s12, i8);
  2894. d3 += s12.metrics.advance, h6.push(n18);
  2895. }
  2896. }
  2897. return new T(h6, n17, e11);
  2898. }
  2899. // node_modules/@arcgis/core/symbols/cim/CIMSymbolDrawHelper.js
  2900. var I2 = Math.PI / 180;
  2901. var v2 = 10;
  2902. var L2 = s.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");
  2903. var z2 = class {
  2904. constructor(t8) {
  2905. this._t = t8;
  2906. }
  2907. static createIdentity() {
  2908. return new z2([1, 0, 0, 0, 1, 0]);
  2909. }
  2910. clone() {
  2911. const t8 = this._t;
  2912. return new z2(t8.slice());
  2913. }
  2914. transform(t8) {
  2915. const e11 = this._t;
  2916. return [e11[0] * t8[0] + e11[1] * t8[1] + e11[2], e11[3] * t8[0] + e11[4] * t8[1] + e11[5]];
  2917. }
  2918. static createScale(t8, e11) {
  2919. return new z2([t8, 0, 0, 0, e11, 0]);
  2920. }
  2921. scale(t8, e11) {
  2922. const s10 = this._t;
  2923. return s10[0] *= t8, s10[1] *= t8, s10[2] *= t8, s10[3] *= e11, s10[4] *= e11, s10[5] *= e11, this;
  2924. }
  2925. scaleRatio() {
  2926. return Math.sqrt(this._t[0] * this._t[0] + this._t[1] * this._t[1]);
  2927. }
  2928. static createTranslate(t8, e11) {
  2929. return new z2([0, 0, t8, 0, 0, e11]);
  2930. }
  2931. translate(t8, e11) {
  2932. const s10 = this._t;
  2933. return s10[2] += t8, s10[5] += e11, this;
  2934. }
  2935. static createRotate(t8) {
  2936. const e11 = Math.cos(t8), s10 = Math.sin(t8);
  2937. return new z2([e11, -s10, 0, s10, e11, 0]);
  2938. }
  2939. rotate(t8) {
  2940. return z2.multiply(this, z2.createRotate(t8), this);
  2941. }
  2942. static multiply(t8, e11, s10) {
  2943. const i8 = t8._t, r18 = e11._t, n17 = i8[0] * r18[0] + i8[3] * r18[1], o11 = i8[1] * r18[0] + i8[4] * r18[1], a10 = i8[2] * r18[0] + i8[5] * r18[1] + r18[2], h6 = i8[0] * r18[3] + i8[3] * r18[4], l9 = i8[1] * r18[3] + i8[4] * r18[4], c9 = i8[2] * r18[3] + i8[5] * r18[4] + r18[5], m7 = s10._t;
  2944. return m7[0] = n17, m7[1] = o11, m7[2] = a10, m7[3] = h6, m7[4] = l9, m7[5] = c9, s10;
  2945. }
  2946. invert() {
  2947. const t8 = this._t;
  2948. let e11 = t8[0] * t8[4] - t8[1] * t8[3];
  2949. if (e11 === 0)
  2950. return new z2([0, 0, 0, 0, 0, 0]);
  2951. e11 = 1 / e11;
  2952. const s10 = (t8[1] * t8[5] - t8[2] * t8[4]) * e11, i8 = (t8[2] * t8[3] - t8[0] * t8[5]) * e11, r18 = t8[4] * e11, n17 = -t8[1] * e11, o11 = -t8[3] * e11, a10 = t8[0] * e11;
  2953. return new z2([r18, n17, s10, o11, a10, i8]);
  2954. }
  2955. };
  2956. var F = class {
  2957. constructor(t8, e11) {
  2958. this._transfos = [], this._sizeTransfos = [], this._geomUnitsPerPoint = 1, this._placementPool = new e(t6, null, null, 100), this._earlyReturn = false, this._mapRotation = 0, this._resourceManager = t8 || new s4(), this._transfos.push(e11 || z2.createIdentity()), this._sizeTransfos.push(e11 ? e11.scaleRatio() : 1);
  2959. }
  2960. setTransform(t8, e11) {
  2961. this._transfos = [t8 || z2.createIdentity()], this._sizeTransfos = [e11 || (t8 ? t8.scaleRatio() : 1)];
  2962. }
  2963. setGeomUnitsPerPoint(t8) {
  2964. this._geomUnitsPerPoint = t8;
  2965. }
  2966. transformPt(t8) {
  2967. return this._transfos[this._transfos.length - 1].transform(t8);
  2968. }
  2969. transformSize(t8) {
  2970. return t8 * this._sizeTransfos[this._sizeTransfos.length - 1];
  2971. }
  2972. reverseTransformPt(t8) {
  2973. return this._transfos[this._transfos.length - 1].invert().transform(t8);
  2974. }
  2975. reverseTransformSize(t8) {
  2976. return t8 / this._sizeTransfos[this._sizeTransfos.length - 1];
  2977. }
  2978. geomUnitsPerPoint() {
  2979. return this.isEmbedded() ? 1 : this._geomUnitsPerPoint;
  2980. }
  2981. isEmbedded() {
  2982. return this._transfos.length > 1;
  2983. }
  2984. back() {
  2985. return this._transfos[this._transfos.length - 1];
  2986. }
  2987. push(t8, e11) {
  2988. const s10 = e11 ? t8.scaleRatio() : 1;
  2989. z2.multiply(t8, this.back(), t8), this._transfos.push(t8), this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length - 1] * s10);
  2990. }
  2991. pop() {
  2992. this._transfos.splice(-1, 1), this._sizeTransfos.splice(-1, 1);
  2993. }
  2994. drawSymbol(t8, e11) {
  2995. if (t8)
  2996. switch (t8.type) {
  2997. case "CIMPointSymbol":
  2998. case "CIMLineSymbol":
  2999. case "CIMPolygonSymbol":
  3000. this.drawMultiLayerSymbol(t8, e11);
  3001. break;
  3002. case "CIMTextSymbol":
  3003. this.drawTextSymbol(t8, e11);
  3004. }
  3005. }
  3006. drawMultiLayerSymbol(t8, e11) {
  3007. if (!t8)
  3008. return;
  3009. const s10 = t8.symbolLayers;
  3010. if (!s10)
  3011. return;
  3012. const i8 = t8.effects;
  3013. if (i8 && i8.length > 0) {
  3014. const t9 = this.executeEffects(i8, e11);
  3015. if (t9) {
  3016. let e12 = t9.next();
  3017. for (; e12; )
  3018. this.drawSymbolLayers(s10, e12), e12 = t9.next();
  3019. }
  3020. } else
  3021. this.drawSymbolLayers(s10, e11);
  3022. }
  3023. executeEffects(t8, e11) {
  3024. const s10 = this._resourceManager.geometryEngine;
  3025. let i8 = new r5(e11);
  3026. for (const r18 of t8) {
  3027. const t9 = A2(r18);
  3028. t9 && (i8 = t9.execute(i8, r18, this.geomUnitsPerPoint(), s10));
  3029. }
  3030. return i8;
  3031. }
  3032. drawSymbolLayers(t8, e11) {
  3033. let s10 = t8.length;
  3034. for (; s10--; ) {
  3035. const i8 = t8[s10];
  3036. if (!i8 || i8.enable === false)
  3037. continue;
  3038. const r18 = i8.effects;
  3039. if (r18 && r18.length > 0) {
  3040. const t9 = this.executeEffects(r18, e11);
  3041. if (t9) {
  3042. let e12 = null;
  3043. for (; (e12 = t9.next()) && (this.drawSymbolLayer(i8, e12), !this._earlyReturn); )
  3044. ;
  3045. }
  3046. } else
  3047. this.drawSymbolLayer(i8, e11);
  3048. if (this._earlyReturn)
  3049. return;
  3050. }
  3051. }
  3052. drawSymbolLayer(t8, e11) {
  3053. switch (t8.type) {
  3054. case "CIMSolidFill":
  3055. this.drawSolidFill(e11, t8.color);
  3056. break;
  3057. case "CIMHatchFill":
  3058. this.drawHatchFill(e11, t8);
  3059. break;
  3060. case "CIMPictureFill":
  3061. this.drawPictureFill(e11, t8);
  3062. break;
  3063. case "CIMGradientFill":
  3064. this.drawGradientFill(e11, t8);
  3065. break;
  3066. case "CIMSolidStroke":
  3067. this.drawSolidStroke(e11, t8.color, t8.width, t8.capStyle, t8.joinStyle, t8.miterLimit);
  3068. break;
  3069. case "CIMPictureStroke":
  3070. this.drawPictureStroke(e11, t8);
  3071. break;
  3072. case "CIMGradientStroke":
  3073. this.drawGradientStroke(e11, t8);
  3074. break;
  3075. case "CIMCharacterMarker":
  3076. case "CIMPictureMarker":
  3077. case "CIMVectorMarker":
  3078. this.drawMarkerLayer(t8, e11);
  3079. }
  3080. }
  3081. drawHatchFill(t8, e11) {
  3082. const s10 = this._buildHatchPolyline(e11, t8, this.geomUnitsPerPoint());
  3083. s10 && (this.pushClipPath(t8), this.drawMultiLayerSymbol(e11.lineSymbol, s10), this.popClipPath());
  3084. }
  3085. drawPictureFill(t8, e11) {
  3086. }
  3087. drawGradientFill(t8, e11) {
  3088. }
  3089. drawPictureStroke(t8, e11) {
  3090. }
  3091. drawGradientStroke(t8, e11) {
  3092. }
  3093. drawMarkerLayer(t8, e11) {
  3094. const s10 = t8.markerPlacement;
  3095. if (s10) {
  3096. const i8 = g3(s10);
  3097. if (i8) {
  3098. const r18 = s10.type === "CIMMarkerPlacementInsidePolygon";
  3099. r18 && this.pushClipPath(e11);
  3100. const n17 = i8.execute(e11, s10, this.geomUnitsPerPoint(), this._resourceManager.geometryEngine);
  3101. if (n17) {
  3102. let e12 = null;
  3103. for (; (e12 = n17.next()) && (this.drawMarker(t8, e12), !this._earlyReturn); )
  3104. ;
  3105. }
  3106. r18 && this.popClipPath();
  3107. }
  3108. } else {
  3109. const s11 = this._placementPool.acquire();
  3110. if (l(e11))
  3111. s11.tx = e11.x, s11.ty = e11.y, this.drawMarker(t8, s11);
  3112. else if (c2(e11))
  3113. [s11.tx, s11.ty] = e2(e11), this.drawMarker(t8, s11);
  3114. else
  3115. for (const i8 of e11.points)
  3116. if (s11.tx = i8[0], s11.ty = i8[1], this.drawMarker(t8, s11), this._earlyReturn)
  3117. break;
  3118. this._placementPool.release(s11);
  3119. }
  3120. }
  3121. drawMarker(t8, e11) {
  3122. switch (t8.type) {
  3123. case "CIMCharacterMarker":
  3124. case "CIMPictureMarker":
  3125. this.drawPictureMarker(t8, e11);
  3126. break;
  3127. case "CIMVectorMarker":
  3128. this.drawVectorMarker(t8, e11);
  3129. }
  3130. }
  3131. drawPictureMarker(t8, e11) {
  3132. if (!t8)
  3133. return;
  3134. const i8 = this._resourceManager.getResource(t8.url), r18 = t8.size ?? 10;
  3135. if (t(i8) || r18 <= 0)
  3136. return;
  3137. const n17 = i8.width, o11 = i8.height;
  3138. if (!n17 || !o11)
  3139. return;
  3140. const a10 = n17 / o11, h6 = t8.scaleX ?? 1, l9 = z2.createIdentity(), c9 = t8.anchorPoint;
  3141. if (c9) {
  3142. let e12 = c9.x, s10 = c9.y;
  3143. t8.anchorPointUnits !== "Absolute" && (e12 *= r18 * a10 * h6, s10 *= r18), l9.translate(-e12, -s10);
  3144. }
  3145. let m7 = t8.rotation ?? 0;
  3146. t8.rotateClockwise && (m7 = -m7), this._mapRotation && (m7 += this._mapRotation), m7 && l9.rotate(m7 * I2);
  3147. let f8 = t8.offsetX ?? 0, u9 = t8.offsetY ?? 0;
  3148. if (f8 || u9) {
  3149. if (this._mapRotation) {
  3150. const t9 = I2 * this._mapRotation, e12 = Math.cos(t9), s10 = Math.sin(t9), i9 = f8 * s10 + u9 * e12;
  3151. f8 = f8 * e12 - u9 * s10, u9 = i9;
  3152. }
  3153. l9.translate(f8, u9);
  3154. }
  3155. const _4 = this.geomUnitsPerPoint();
  3156. _4 !== 1 && l9.scale(_4, _4);
  3157. const d2 = e11.getAngle();
  3158. d2 && l9.rotate(d2), l9.translate(e11.tx, e11.ty), this.push(l9, false), this.drawImage(t8.url, r18, t8.scaleX), this.pop();
  3159. }
  3160. drawVectorMarker(t8, e11) {
  3161. if (!t8)
  3162. return;
  3163. const s10 = t8.markerGraphics;
  3164. if (!s10)
  3165. return;
  3166. const i8 = t8.size ?? 10, r18 = t8.frame, n17 = r18 ? r18.ymax - r18.ymin : 0, o11 = i8 && n17 ? i8 / n17 : 1, a10 = z2.createIdentity();
  3167. r18 && a10.translate(0.5 * -(r18.xmax + r18.xmin), 0.5 * -(r18.ymax + r18.ymin));
  3168. const h6 = t8.anchorPoint;
  3169. if (h6) {
  3170. let e12 = h6.x, s11 = h6.y;
  3171. t8.anchorPointUnits !== "Absolute" ? r18 && (e12 *= r18.xmax - r18.xmin, s11 *= r18.ymax - r18.ymin) : (e12 /= o11, s11 /= o11), a10.translate(-e12, -s11);
  3172. }
  3173. o11 !== 1 && a10.scale(o11, o11);
  3174. let l9 = t8.rotation ?? 0;
  3175. t8.rotateClockwise && (l9 = -l9), this._mapRotation && (l9 += this._mapRotation), l9 && a10.rotate(l9 * I2);
  3176. let c9 = t8.offsetX ?? 0, m7 = t8.offsetY ?? 0;
  3177. if (c9 || m7) {
  3178. if (this._mapRotation) {
  3179. const t9 = I2 * this._mapRotation, e12 = Math.cos(t9), s11 = Math.sin(t9), i9 = c9 * s11 + m7 * e12;
  3180. c9 = c9 * e12 - m7 * s11, m7 = i9;
  3181. }
  3182. a10.translate(c9, m7);
  3183. }
  3184. const f8 = this.geomUnitsPerPoint();
  3185. f8 !== 1 && a10.scale(f8, f8);
  3186. const u9 = e11.getAngle();
  3187. u9 && a10.rotate(u9), a10.translate(e11.tx, e11.ty), this.push(a10, t8.scaleSymbolsProportionally);
  3188. for (const _4 of s10)
  3189. if (_4 && _4.symbol && _4.geometry || L2.error("Invalid marker graphic", _4), this.drawSymbol(_4.symbol, _4.geometry), this._earlyReturn)
  3190. break;
  3191. this.pop();
  3192. }
  3193. drawTextSymbol(t8, e11) {
  3194. if (!t8)
  3195. return;
  3196. if (!l(e11))
  3197. return;
  3198. if ((t8.height ?? 10) <= 0)
  3199. return;
  3200. const s10 = z2.createIdentity();
  3201. let i8 = t8.angle ?? 0;
  3202. i8 = -i8, i8 && s10.rotate(i8 * I2);
  3203. const r18 = t8.offsetX ?? 0, n17 = t8.offsetY ?? 0;
  3204. (r18 || n17) && s10.translate(r18, n17);
  3205. const o11 = this.geomUnitsPerPoint();
  3206. o11 !== 1 && s10.scale(o11, o11), s10.translate(e11.x, e11.y), this.push(s10, false), this.drawText(t8), this.pop();
  3207. }
  3208. _buildHatchPolyline(t8, e11, s10) {
  3209. let i8 = (t8.separation !== void 0 ? t8.separation : 4) * s10, r18 = t8.rotation !== void 0 ? t8.rotation : 0;
  3210. if (i8 === 0)
  3211. return null;
  3212. i8 < 0 && (i8 = -i8);
  3213. let n17 = 0;
  3214. const a10 = 0.5 * i8;
  3215. for (; n17 > a10; )
  3216. n17 -= i8;
  3217. for (; n17 < -a10; )
  3218. n17 += i8;
  3219. const l9 = u2();
  3220. c(l9, e11), l9[0] -= a10, l9[1] -= a10, l9[2] += a10, l9[3] += a10;
  3221. const c9 = [[l9[0], l9[1]], [l9[0], l9[3]], [l9[2], l9[3]], [l9[2], l9[1]]];
  3222. for (; r18 > 180; )
  3223. r18 -= 180;
  3224. for (; r18 < 0; )
  3225. r18 += 180;
  3226. const m7 = Math.cos(r18 * I2), f8 = Math.sin(r18 * I2), u9 = -i8 * f8, _4 = i8 * m7;
  3227. let d2, p3, y5, g5;
  3228. n17 = (t8.offsetX !== void 0 ? t8.offsetX * s10 : 0) * f8 - (t8.offsetY !== void 0 ? t8.offsetY * s10 : 0) * m7, d2 = y5 = Number.MAX_VALUE, p3 = g5 = -Number.MAX_VALUE;
  3229. for (const o11 of c9) {
  3230. const t9 = o11[0], e12 = o11[1], s11 = m7 * t9 + f8 * e12, i9 = -f8 * t9 + m7 * e12;
  3231. d2 = Math.min(d2, s11), y5 = Math.min(y5, i9), p3 = Math.max(p3, s11), g5 = Math.max(g5, i9);
  3232. }
  3233. y5 = Math.floor(y5 / i8) * i8;
  3234. let P3 = m7 * d2 - f8 * y5 - u9 * n17 / i8, x3 = f8 * d2 + m7 * y5 - _4 * n17 / i8, w4 = m7 * p3 - f8 * y5 - u9 * n17 / i8, M3 = f8 * p3 + m7 * y5 - _4 * n17 / i8;
  3235. const b3 = 1 + Math.round((g5 - y5) / i8), S = [];
  3236. for (let o11 = 0; o11 < b3; o11++)
  3237. P3 += u9, x3 += _4, w4 += u9, M3 += _4, S.push([[P3, x3], [w4, M3]]);
  3238. return { paths: S };
  3239. }
  3240. };
  3241. var U4 = class extends F {
  3242. constructor(t8, e11) {
  3243. super(t8, e11), this.reset();
  3244. }
  3245. reset() {
  3246. this._xmin = this._ymin = 1 / 0, this._xmax = this._ymax = -1 / 0, this._clipCount = 0;
  3247. }
  3248. envelope() {
  3249. return new t7(this._xmin, this._ymin, this._xmax - this._xmin, this._ymax - this._ymin);
  3250. }
  3251. bounds() {
  3252. return o2(this._xmin, this._ymin, this._xmax, this._ymax);
  3253. }
  3254. drawSolidFill(t8) {
  3255. if (t8 && !(this._clipCount > 0))
  3256. if (c2(t8))
  3257. this._processPath(t8.rings, 0);
  3258. else if (y(t8))
  3259. this._processPath(t8.paths, 0);
  3260. else if (s3(t8)) {
  3261. const e11 = G2(t8);
  3262. e11 && this._processPath(e11.rings, 0);
  3263. } else
  3264. console.error("drawSolidFill Unexpected geometry type!");
  3265. }
  3266. drawSolidStroke(t8, e11, s10) {
  3267. if (!t8 || this._clipCount > 0)
  3268. return;
  3269. const i8 = 0.5 * this.transformSize(s10);
  3270. if (c2(t8))
  3271. this._processPath(t8.rings, i8);
  3272. else if (y(t8))
  3273. this._processPath(t8.paths, i8);
  3274. else if (s3(t8)) {
  3275. const e12 = G2(t8);
  3276. e12 && this._processPath(e12.rings, i8);
  3277. } else
  3278. console.error("drawSolidStroke unexpected geometry type!");
  3279. }
  3280. pushClipPath(t8) {
  3281. this.drawSolidFill(t8), ++this._clipCount;
  3282. }
  3283. popClipPath() {
  3284. --this._clipCount;
  3285. }
  3286. drawImage(t8, e11, s10) {
  3287. let r18 = s10 * e11, n17 = e11;
  3288. const o11 = this._resourceManager.getResource(t8);
  3289. !e11 && r(o11) && (r18 = s10 * o11.width, n17 = o11.height), this._merge(this.transformPt([-r18 / 2, -n17 / 2]), 0), this._merge(this.transformPt([-r18 / 2, n17 / 2]), 0), this._merge(this.transformPt([r18 / 2, -n17 / 2]), 0), this._merge(this.transformPt([r18 / 2, n17 / 2]), 0);
  3290. }
  3291. drawText(t8) {
  3292. this._textRasterizer || (this._textRasterizer = new s5());
  3293. }
  3294. _processPath(t8, e11) {
  3295. if (t8)
  3296. for (const s10 of t8) {
  3297. const t9 = s10 ? s10.length : 0;
  3298. if (t9 > 1) {
  3299. this._merge(this.transformPt(s10[0]), e11);
  3300. for (let i8 = 1; i8 < t9; ++i8)
  3301. this._merge(this.transformPt(s10[i8]), e11);
  3302. }
  3303. }
  3304. }
  3305. _merge(t8, e11) {
  3306. t8[0] - e11 < this._xmin && (this._xmin = t8[0] - e11), t8[0] + e11 > this._xmax && (this._xmax = t8[0] + e11), t8[1] - e11 < this._ymin && (this._ymin = t8[1] - e11), t8[1] + e11 > this._ymax && (this._ymax = t8[1] + e11);
  3307. }
  3308. };
  3309. var j4 = class extends F {
  3310. constructor() {
  3311. super(...arguments), this._searchPoint = [0, 0], this._searchDistPoint = 0;
  3312. }
  3313. hitTest(t8, e11, s10, i8, r18, o11) {
  3314. const a10 = o11 * u(1);
  3315. this.setTransform(), this.setGeomUnitsPerPoint(a10), this._searchPoint = [(t8[0] + t8[2]) / 2, (t8[1] + t8[3]) / 2], this._searchDistPoint = (t8[2] - t8[0]) / 2 / a10, this._textInfo = i8;
  3316. const h6 = e11 && (e11.type === "CIMPointSymbol" && e11.angleAlignment !== "Map" || e11.type === "CIMTextSymbol");
  3317. return this._mapRotation = h6 ? r18 : 0, this._earlyReturn = false, this.drawSymbol(e11, s10), this._earlyReturn;
  3318. }
  3319. drawSolidFill(t8, e11) {
  3320. this._hitTestFill(t8);
  3321. }
  3322. drawHatchFill(t8, e11) {
  3323. this._hitTestFill(t8);
  3324. }
  3325. drawPictureFill(t8, e11) {
  3326. this._hitTestFill(t8);
  3327. }
  3328. drawGradientFill(t8, e11) {
  3329. this._hitTestFill(t8);
  3330. }
  3331. drawSolidStroke(t8, e11, s10, i8, r18, n17) {
  3332. this._hitTestStroke(t8, s10);
  3333. }
  3334. drawPictureStroke(t8, e11) {
  3335. this._hitTestStroke(t8, e11.width);
  3336. }
  3337. drawGradientStroke(t8, e11) {
  3338. this._hitTestStroke(t8, e11.width);
  3339. }
  3340. drawMarkerLayer(t8, e11) {
  3341. t8.markerPlacement && t8.markerPlacement.type === "CIMMarkerPlacementInsidePolygon" ? this._hitTestFill(e11) : super.drawMarkerLayer(t8, e11);
  3342. }
  3343. pushClipPath(t8) {
  3344. }
  3345. popClipPath() {
  3346. }
  3347. drawImage(t8, e11, i8) {
  3348. const r18 = this._resourceManager.getResource(t8);
  3349. if (t(r18) || r18.height === 0 || e11 === 0)
  3350. return;
  3351. const n17 = e11 * this.geomUnitsPerPoint(), o11 = n17 * i8 * (r18.width / r18.height), a10 = this.reverseTransformPt(this._searchPoint), h6 = this._searchDistPoint;
  3352. Math.abs(a10[0]) < o11 / 2 + h6 && Math.abs(a10[1]) < n17 / 2 + h6 && (this._earlyReturn = true);
  3353. }
  3354. drawText(e11) {
  3355. const s10 = this._textInfo;
  3356. if (!s10)
  3357. return;
  3358. const i8 = s10.get(e11);
  3359. if (!i8)
  3360. return;
  3361. const { text: r18, mosaicItem: n17 } = i8;
  3362. if (!n17 || n17.glyphMosaicItems.length === 0)
  3363. return;
  3364. const o11 = e11.height ?? v2, a10 = B3(e11.lineGapType, e11.lineGap ?? 0, o11), h6 = n4(r18)[1], l9 = n17.glyphMosaicItems, c9 = j3(l9, h6, { scale: o11 / j, angle: 0, xOffset: 0, yOffset: 0, hAlign: E(e11.horizontalAlignment), vAlign: H(e11.verticalAlignment), maxLineWidth: 512, lineHeight: f2 * Math.max(0.25, Math.min(a10 || 1, 4)), decoration: e11.font.decoration || "none", isCIM: true }), m7 = this.reverseTransformPt(this._searchPoint), f8 = m7[0], u9 = m7[1];
  3365. for (const t8 of c9.glyphs)
  3366. if (f8 > t8.xTopLeft && f8 < t8.xBottomRight && u9 > -t8.yBottomRight && u9 < -t8.yTopLeft) {
  3367. this._earlyReturn = true;
  3368. break;
  3369. }
  3370. }
  3371. _hitTestFill(t8) {
  3372. let e11 = null;
  3373. if (s3(t8)) {
  3374. const s11 = t8;
  3375. e11 = [[[s11.xmin, s11.ymin], [s11.xmin, s11.ymax], [s11.xmax, s11.ymax], [s11.xmax, s11.ymin], [s11.xmin, s11.ymin]]];
  3376. } else if (c2(t8))
  3377. e11 = t8.rings;
  3378. else {
  3379. if (!y(t8))
  3380. return;
  3381. e11 = t8.paths;
  3382. }
  3383. const s10 = this.reverseTransformPt(this._searchPoint);
  3384. if (this._pointInPolygon(s10, e11) && (this._earlyReturn = true), !this._earlyReturn) {
  3385. const t9 = this.reverseTransformSize(this._searchDistPoint) * this.geomUnitsPerPoint();
  3386. this._nearLine(s10, e11, t9) && (this._earlyReturn = true);
  3387. }
  3388. }
  3389. _hitTestStroke(t8, e11) {
  3390. let s10 = null;
  3391. if (s3(t8)) {
  3392. const e12 = t8;
  3393. s10 = [[[e12.xmin, e12.ymin], [e12.xmin, e12.ymax], [e12.xmax, e12.ymax], [e12.xmax, e12.ymin], [e12.xmin, e12.ymin]]];
  3394. } else if (c2(t8))
  3395. s10 = t8.rings;
  3396. else {
  3397. if (!y(t8))
  3398. return;
  3399. s10 = t8.paths;
  3400. }
  3401. const i8 = this.reverseTransformPt(this._searchPoint), r18 = e11 * this.geomUnitsPerPoint(), n17 = this.reverseTransformSize(this._searchDistPoint) * this.geomUnitsPerPoint();
  3402. this._nearLine(i8, s10, r18 / 2 + n17) && (this._earlyReturn = true);
  3403. }
  3404. _pointInPolygon(t8, e11) {
  3405. let s10 = 0;
  3406. for (const i8 of e11) {
  3407. const e12 = i8.length;
  3408. for (let r18 = 1; r18 < e12; ++r18) {
  3409. const e13 = i8[r18 - 1], n17 = i8[r18];
  3410. if (e13[1] > t8[1] == n17[1] > t8[1])
  3411. continue;
  3412. (n17[0] - e13[0]) * (t8[1] - e13[1]) - (n17[1] - e13[1]) * (t8[0] - e13[0]) > 0 ? s10++ : s10--;
  3413. }
  3414. }
  3415. return s10 !== 0;
  3416. }
  3417. _nearLine(t8, e11, s10) {
  3418. for (const i8 of e11) {
  3419. const e12 = i8.length;
  3420. for (let r18 = 1; r18 < e12; ++r18) {
  3421. const e13 = i8[r18 - 1], n17 = i8[r18];
  3422. let o11 = (n17[0] - e13[0]) * (n17[0] - e13[0]) + (n17[1] - e13[1]) * (n17[1] - e13[1]);
  3423. if (o11 === 0)
  3424. continue;
  3425. o11 = Math.sqrt(o11);
  3426. const a10 = ((n17[0] - e13[0]) * (t8[1] - e13[1]) - (n17[1] - e13[1]) * (t8[0] - e13[0])) / o11;
  3427. if (Math.abs(a10) < s10) {
  3428. const i9 = ((n17[0] - e13[0]) * (t8[0] - e13[0]) + (n17[1] - e13[1]) * (t8[1] - e13[1])) / o11;
  3429. if (i9 > -s10 && i9 < o11 + s10)
  3430. return true;
  3431. }
  3432. }
  3433. }
  3434. return false;
  3435. }
  3436. };
  3437. var A3 = class extends F {
  3438. constructor(t8, e11, s10) {
  3439. super(e11, s10), this._ctx = t8;
  3440. }
  3441. drawSolidFill(t8, e11) {
  3442. if (!t8)
  3443. return;
  3444. if (c2(t8))
  3445. this._buildPath(t8.rings, true);
  3446. else if (y(t8))
  3447. this._buildPath(t8.paths, true);
  3448. else if (s3(t8))
  3449. this._buildPath(G2(t8).rings, true);
  3450. else {
  3451. if (!f(t8))
  3452. return;
  3453. console.log("CanvasDrawHelper.drawSolidFill - No implementation!");
  3454. }
  3455. const s10 = this._ctx;
  3456. s10.fillStyle = typeof e11 == "string" ? e11 : "rgba(" + Math.round(e11[0]) + "," + Math.round(e11[1]) + "," + Math.round(e11[2]) + "," + e11[3] / 255 + ")", s10.fill("evenodd");
  3457. }
  3458. drawSolidStroke(t8, e11, s10, i8, r18, n17) {
  3459. if (!t8 || !e11 || s10 === 0)
  3460. return;
  3461. if (c2(t8))
  3462. this._buildPath(t8.rings, true);
  3463. else if (y(t8))
  3464. this._buildPath(t8.paths, false);
  3465. else {
  3466. if (!s3(t8))
  3467. return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");
  3468. this._buildPath(G2(t8).rings, true);
  3469. }
  3470. const o11 = this._ctx;
  3471. o11.strokeStyle = typeof e11 == "string" ? e11 : "rgba(" + Math.round(e11[0]) + "," + Math.round(e11[1]) + "," + Math.round(e11[2]) + "," + e11[3] / 255 + ")", o11.lineWidth = this.transformSize(s10) + 0.5, this._setCapStyle(i8), this._setJoinStyle(r18), o11.miterLimit = n17, o11.stroke();
  3472. }
  3473. pushClipPath(t8) {
  3474. if (this._ctx.save(), c2(t8))
  3475. this._buildPath(t8.rings, true);
  3476. else if (y(t8))
  3477. this._buildPath(t8.paths, true);
  3478. else {
  3479. if (!s3(t8))
  3480. return;
  3481. this._buildPath(G2(t8).rings, true);
  3482. }
  3483. this._ctx.clip("evenodd");
  3484. }
  3485. popClipPath() {
  3486. this._ctx.restore();
  3487. }
  3488. drawImage(t8, e11, i8) {
  3489. const r18 = this._resourceManager.getResource(t8);
  3490. if (t(r18))
  3491. return;
  3492. const n17 = this._ctx, o11 = n17.canvas.width, a10 = n17.canvas.height;
  3493. let h6 = e11 * i8 * (r18.width / r18.height), l9 = i8 * e11;
  3494. e11 || (h6 = i8 * r18.width, l9 = i8 * r18.height);
  3495. const c9 = this.transformPt([0, 0]), m7 = this.transformSize(h6), f8 = this.transformSize(l9);
  3496. this._ctx.drawImage(r18, 0, 0, r18.width, r18.height, c9[0] - m7 / 2, c9[1] - f8 / 2, Math.min(m7, o11), Math.min(f8, a10));
  3497. }
  3498. drawText(t8) {
  3499. this._textRasterizer || (this._textRasterizer = new s5());
  3500. }
  3501. _buildPath(t8, e11) {
  3502. const s10 = this._ctx;
  3503. if (s10.beginPath(), t8)
  3504. for (const i8 of t8) {
  3505. const t9 = i8 ? i8.length : 0;
  3506. if (t9 > 1) {
  3507. let r18 = this.transformPt(i8[0]);
  3508. s10.moveTo(r18[0], r18[1]);
  3509. for (let e12 = 1; e12 < t9; ++e12)
  3510. r18 = this.transformPt(i8[e12]), s10.lineTo(r18[0], r18[1]);
  3511. e11 && s10.closePath();
  3512. }
  3513. }
  3514. }
  3515. _setCapStyle(t8) {
  3516. switch (t8) {
  3517. case U2.Butt:
  3518. this._ctx.lineCap = "butt";
  3519. break;
  3520. case U2.Round:
  3521. this._ctx.lineCap = "round";
  3522. break;
  3523. case U2.Square:
  3524. this._ctx.lineCap = "square";
  3525. }
  3526. }
  3527. _setJoinStyle(t8) {
  3528. switch (t8) {
  3529. case w.Bevel:
  3530. this._ctx.lineJoin = "bevel";
  3531. break;
  3532. case w.Round:
  3533. this._ctx.lineJoin = "round";
  3534. break;
  3535. case w.Miter:
  3536. this._ctx.lineJoin = "miter";
  3537. }
  3538. }
  3539. };
  3540. var G2 = (t8) => t8 ? { spatialReference: t8.spatialReference, rings: [[[t8.xmin, t8.ymin], [t8.xmin, t8.ymax], [t8.xmax, t8.ymax], [t8.xmax, t8.ymin], [t8.xmin, t8.ymin]]] } : null;
  3541. var E = (t8) => {
  3542. switch (t8) {
  3543. case "Left":
  3544. return e4.Left;
  3545. case "Right":
  3546. return e4.Right;
  3547. case "Center":
  3548. return e4.Center;
  3549. case "Justify":
  3550. return L2.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."), e4.Center;
  3551. }
  3552. };
  3553. var H = (t8) => {
  3554. switch (t8) {
  3555. case "Top":
  3556. return t3.Top;
  3557. case "Center":
  3558. return t3.Center;
  3559. case "Bottom":
  3560. return t3.Bottom;
  3561. case "Baseline":
  3562. return t3.Baseline;
  3563. }
  3564. };
  3565. var B3 = (t8, e11, s10) => {
  3566. switch (t8) {
  3567. case "ExtraLeading":
  3568. return 1 + e11 / s10;
  3569. case "Multiple":
  3570. return e11;
  3571. case "Exact":
  3572. return e11 / s10;
  3573. }
  3574. };
  3575. // node_modules/@arcgis/core/symbols/cim/CIMSymbolHelper.js
  3576. var V = Math.PI;
  3577. var B4 = V / 2;
  3578. var X2 = 4;
  3579. var U5 = 10;
  3580. var _3 = 96 / 72;
  3581. var H2 = Math.PI / 180;
  3582. var Y2 = s.getLogger("esri.symbols.cim.CIMSymbolHelper");
  3583. function q(e11) {
  3584. if (!e11 || !e11.type)
  3585. return null;
  3586. let t8;
  3587. switch (e11.type) {
  3588. case "cim":
  3589. return e11.data;
  3590. case "web-style":
  3591. return e11;
  3592. case "simple-marker":
  3593. t8 = Z2.fromSimpleMarker(e11);
  3594. break;
  3595. case "picture-marker":
  3596. t8 = Z2.fromPictureMarker(e11);
  3597. break;
  3598. case "simple-line":
  3599. t8 = Z2.fromSimpleLineSymbol(e11);
  3600. break;
  3601. case "simple-fill":
  3602. t8 = Z2.fromSimpleFillSymbol(e11);
  3603. break;
  3604. case "picture-fill":
  3605. t8 = Z2.fromPictureFillSymbol(e11);
  3606. break;
  3607. case "text":
  3608. t8 = Z2.fromTextSymbol(e11);
  3609. }
  3610. return { type: "CIMSymbolReference", symbol: t8 };
  3611. }
  3612. function W(e11, t8) {
  3613. switch (t8.type) {
  3614. case "CIMSymbolReference":
  3615. return W(e11, t8.symbol);
  3616. case "CIMPointSymbol": {
  3617. const r18 = { x: 0, y: 0 };
  3618. e11.drawSymbol(t8, r18);
  3619. break;
  3620. }
  3621. case "CIMLineSymbol": {
  3622. const r18 = { paths: [[[0, 0], [0, 1]]] };
  3623. e11.drawSymbol(t8, r18);
  3624. break;
  3625. }
  3626. case "CIMPolygonSymbol": {
  3627. const r18 = { rings: [[[0, 0], [0, 1], [0, 0]]] };
  3628. e11.drawSymbol(t8, r18);
  3629. break;
  3630. }
  3631. case "CIMTextSymbol": {
  3632. const r18 = { x: 0, y: 0 };
  3633. e11.drawSymbol(t8, r18);
  3634. break;
  3635. }
  3636. case "CIMVectorMarker": {
  3637. const r18 = new t6();
  3638. e11.drawMarker(t8, r18);
  3639. break;
  3640. }
  3641. }
  3642. return e11.envelope();
  3643. }
  3644. function $(e11) {
  3645. if (!e11)
  3646. return 0;
  3647. switch (e11.type) {
  3648. case "CIMMarkerPlacementAlongLineSameSize":
  3649. case "CIMMarkerPlacementAlongLineRandomSize":
  3650. case "CIMMarkerPlacementAtExtremities":
  3651. case "CIMMarkerPlacementAtMeasuredUnits":
  3652. case "CIMMarkerPlacementAtRatioPositions":
  3653. case "CIMMarkerPlacementOnLine":
  3654. case "CIMMarkerPlacementOnVertices":
  3655. return Math.abs(e11.offset);
  3656. default:
  3657. return 0;
  3658. }
  3659. }
  3660. function J(e11) {
  3661. if (!e11)
  3662. return 0;
  3663. switch (e11.type) {
  3664. case "CIMGeometricEffectArrow":
  3665. return Math.abs(0.5 * e11.width);
  3666. case "CIMGeometricEffectBuffer":
  3667. return Math.abs(e11.size);
  3668. case "CIMGeometricEffectExtension":
  3669. case "CIMGeometricEffectRadial":
  3670. return Math.abs(e11.length);
  3671. case "CIMGeometricEffectJog":
  3672. return Math.abs(0.5 * e11.length);
  3673. case "CIMGeometricEffectMove":
  3674. return Math.max(Math.abs(M(e11.offsetX)), Math.abs(M(e11.offsetY)));
  3675. case "CIMGeometricEffectOffset":
  3676. case "CIMGeometricEffectOffsetTangent":
  3677. return Math.abs(e11.offset);
  3678. case "CIMGeometricEffectRegularPolygon":
  3679. return Math.abs(e11.radius);
  3680. case "CIMGeometricEffectRotate":
  3681. case "CIMGeometricEffectScale":
  3682. default:
  3683. return 0;
  3684. case "CIMGeometricEffectTaperedPolygon":
  3685. return 0.5 * Math.max(Math.abs(e11.fromWidth), Math.abs(e11.toWidth));
  3686. case "CIMGeometricEffectWave":
  3687. return Math.abs(e11.amplitude);
  3688. }
  3689. }
  3690. function K2(e11) {
  3691. if (!e11)
  3692. return 0;
  3693. let t8 = 0;
  3694. for (const r18 of e11)
  3695. t8 += J(r18);
  3696. return t8;
  3697. }
  3698. var Q = class {
  3699. getSymbolInflateSize(e11, t8, r18, o11, a10) {
  3700. return e11 || (e11 = [0, 0, 0, 0]), t8 ? this._getInflateSize(e11, t8, r18, o11, a10) : e11;
  3701. }
  3702. static safeSize(e11) {
  3703. const t8 = Math.max(Math.abs(e11[0]), Math.abs(e11[2])), r18 = Math.max(Math.abs(e11[1]), Math.abs(e11[3]));
  3704. return Math.sqrt(t8 * t8 + r18 * r18);
  3705. }
  3706. _vectorMarkerBounds(e11, t8, r18, o11) {
  3707. let a10 = true;
  3708. const i8 = u2();
  3709. if (t8 && t8.markerGraphics)
  3710. for (const s10 of t8.markerGraphics) {
  3711. const t9 = [0, 0, 0, 0];
  3712. s10.geometry && (c(i8, s10.geometry), t9[0] = 0, t9[1] = 0, t9[2] = 0, t9[3] = 0, this.getSymbolInflateSize(t9, s10.symbol, r18, 0, o11), i8[0] += t9[0], i8[1] += t9[1], i8[2] += t9[2], i8[3] += t9[3], a10 ? (e11[0] = i8[0], e11[1] = i8[1], e11[2] = i8[2], e11[3] = i8[3], a10 = false) : (e11[0] = Math.min(e11[0], i8[0]), e11[1] = Math.min(e11[1], i8[1]), e11[2] = Math.max(e11[2], i8[2]), e11[3] = Math.max(e11[3], i8[3])));
  3713. }
  3714. return e11;
  3715. }
  3716. _getInflateSize(e11, t8, r18, o11, a10) {
  3717. if (fe(t8)) {
  3718. const i8 = this._getLayersInflateSize(e11, t8.symbolLayers, r18, o11, a10), s10 = K2(t8.effects);
  3719. return s10 > 0 && (i8[0] -= s10, i8[1] -= s10, i8[2] += s10, i8[3] += s10), i8;
  3720. }
  3721. return this._getTextInflatedSize(e11, t8, a10);
  3722. }
  3723. _getLayersInflateSize(e11, t8, r18, o11, a10) {
  3724. let i8 = true;
  3725. if (!t8)
  3726. return e11;
  3727. for (const n17 of t8) {
  3728. if (!n17)
  3729. continue;
  3730. let t9 = [0, 0, 0, 0];
  3731. switch (n17.type) {
  3732. case "CIMSolidFill":
  3733. case "CIMPictureFill":
  3734. case "CIMHatchFill":
  3735. case "CIMGradientFill":
  3736. break;
  3737. case "CIMSolidStroke":
  3738. case "CIMPictureStroke":
  3739. case "CIMGradientStroke": {
  3740. const e12 = n17;
  3741. let r19 = e12.width;
  3742. e12.capStyle === U2.Square || e12.joinStyle === w.Miter ? r19 /= 1.4142135623730951 : r19 /= 2, t9[0] = -r19, t9[1] = -r19, t9[2] = r19, t9[3] = r19;
  3743. break;
  3744. }
  3745. case "CIMCharacterMarker":
  3746. case "CIMVectorMarker":
  3747. case "CIMPictureMarker": {
  3748. const e12 = n17;
  3749. if (n17.type === "CIMVectorMarker") {
  3750. const e13 = n17;
  3751. if (t9 = this._vectorMarkerBounds(t9, e13, r18, a10), e13.frame) {
  3752. const r19 = (e13.frame.xmin + e13.frame.xmax) / 2, o12 = (e13.frame.ymin + e13.frame.ymax) / 2;
  3753. t9[0] -= r19, t9[1] -= o12, t9[2] -= r19, t9[3] -= o12;
  3754. const a11 = e13.size / (e13.frame.ymax - e13.frame.ymin);
  3755. t9[0] *= a11, t9[1] *= a11, t9[2] *= a11, t9[3] *= a11;
  3756. }
  3757. } else if (n17.type === "CIMPictureMarker") {
  3758. const o12 = n17, a11 = r18.getResource(o12.url);
  3759. let i10 = 1;
  3760. r(a11) && a11.height && (i10 = a11.width / a11.height);
  3761. const l11 = e12.size / 2, c10 = e12.size * i10 * o12.scaleX / 2;
  3762. t9 = [-c10, -l11, c10, l11];
  3763. } else {
  3764. const r19 = e12.size / 2;
  3765. t9 = [-r19, -r19, r19, r19];
  3766. }
  3767. if (e12.anchorPoint) {
  3768. let r19, o12;
  3769. e12.anchorPointUnits === "Absolute" ? (r19 = e12.anchorPoint.x, o12 = e12.anchorPoint.y) : (r19 = e12.anchorPoint.x * (t9[2] - t9[0]), o12 = e12.anchorPoint.y * (t9[3] - t9[1])), t9[0] -= r19, t9[1] -= o12, t9[2] -= r19, t9[3] -= o12;
  3770. }
  3771. let i9 = M(e12.rotation);
  3772. if (e12.rotateClockwise && (i9 = -i9), o11 && (i9 -= o11), i9) {
  3773. const e13 = H2 * i9, r19 = Math.cos(e13), o12 = Math.sin(e13), a11 = u2([n3, n3, -n3, -n3]);
  3774. m2(a11, [t9[0] * r19 - t9[1] * o12, t9[0] * o12 + t9[1] * r19]), m2(a11, [t9[0] * r19 - t9[3] * o12, t9[0] * o12 + t9[3] * r19]), m2(a11, [t9[2] * r19 - t9[1] * o12, t9[2] * o12 + t9[1] * r19]), m2(a11, [t9[2] * r19 - t9[3] * o12, t9[2] * o12 + t9[3] * r19]), t9 = a11;
  3775. }
  3776. let l10 = M(e12.offsetX), c9 = M(e12.offsetY);
  3777. if (o11) {
  3778. const e13 = H2 * o11, t10 = Math.cos(e13), r19 = Math.sin(e13), a11 = l10 * r19 + c9 * t10;
  3779. l10 = l10 * t10 - c9 * r19, c9 = a11;
  3780. }
  3781. t9[0] += l10, t9[1] += c9, t9[2] += l10, t9[3] += c9;
  3782. const m7 = $(e12.markerPlacement);
  3783. m7 > 0 && (t9[0] -= m7, t9[1] -= m7, t9[2] += m7, t9[3] += m7);
  3784. break;
  3785. }
  3786. }
  3787. const l9 = K2(n17.effects);
  3788. l9 > 0 && (t9[0] -= l9, t9[1] -= l9, t9[2] += l9, t9[3] += l9), i8 ? (e11[0] = t9[0], e11[1] = t9[1], e11[2] = t9[2], e11[3] = t9[3], i8 = false) : (e11[0] = Math.min(e11[0], t9[0]), e11[1] = Math.min(e11[1], t9[1]), e11[2] = Math.max(e11[2], t9[2]), e11[3] = Math.max(e11[3], t9[3]));
  3789. }
  3790. return e11;
  3791. }
  3792. _getTextInflatedSize(e11, r18, o11) {
  3793. const a10 = r18.height ?? U5;
  3794. if (e11[0] = -a10 / 2, e11[1] = -a10 / 2, e11[2] = a10 / 2, e11[3] = a10 / 2, !o11)
  3795. return e11;
  3796. const i8 = o11.get(r18);
  3797. if (!i8)
  3798. return e11;
  3799. const { text: s10, mosaicItem: n17 } = i8;
  3800. if (!n17 || n17.glyphMosaicItems.length === 0)
  3801. return e11;
  3802. const l9 = B3(r18.lineGapType, r18.lineGap ?? 0, a10), c9 = n4(s10)[1], m7 = n17.glyphMosaicItems, f8 = j3(m7, c9, { scale: a10 / j, angle: M(r18.angle), xOffset: M(r18.offsetX), yOffset: M(r18.offsetY), hAlign: E(r18.horizontalAlignment), vAlign: H(r18.verticalAlignment), maxLineWidth: 512, lineHeight: f2 * Math.max(0.25, Math.min(l9 || 1, 4)), decoration: r18.font.decoration || "none", isCIM: true }).boundsT;
  3803. return e11[0] = f8.x - f8.halfWidth, e11[1] = -f8.y - f8.halfHeight, e11[2] = f8.x + f8.halfWidth, e11[3] = -f8.y + f8.halfHeight, e11;
  3804. }
  3805. };
  3806. var Z2 = class {
  3807. static getEnvelope(e11, t8) {
  3808. const r18 = new U4(t8);
  3809. if (Array.isArray(e11)) {
  3810. let t9;
  3811. for (const o11 of e11)
  3812. t9 ? t9.union(W(r18, o11)) : t9 = W(r18, o11);
  3813. return t9;
  3814. }
  3815. return W(r18, e11);
  3816. }
  3817. static getTextureAnchor(e11, t8) {
  3818. const r18 = this.getEnvelope(e11, t8);
  3819. if (!r18)
  3820. return [0, 0, 0];
  3821. const o11 = (r18.x + 0.5 * r18.width) * _3, a10 = -(r18.y + 0.5 * r18.height) * _3, i8 = r18.width * _3 + 2, s10 = r18.height * _3 + 2;
  3822. return [o11 / i8, a10 / s10, s10];
  3823. }
  3824. static rasterize(e11, t8, r18, o11, a10 = true) {
  3825. const i8 = r18 || this.getEnvelope(t8, o11);
  3826. if (!i8)
  3827. return [null, 0, 0, 0, 0];
  3828. const s10 = (i8.x + 0.5 * i8.width) * _3, n17 = (i8.y + 0.5 * i8.height) * _3;
  3829. e11.width = i8.width * _3, e11.height = i8.height * _3, r18 || (e11.width += 2, e11.height += 2);
  3830. const l9 = e11.getContext("2d"), c9 = z2.createScale(_3, -_3);
  3831. c9.translate(0.5 * e11.width - s10, 0.5 * e11.height + n17);
  3832. const m7 = new A3(l9, o11, c9);
  3833. switch (t8.type) {
  3834. case "CIMPointSymbol": {
  3835. const e12 = { type: "point", x: 0, y: 0 };
  3836. m7.drawSymbol(t8, e12);
  3837. break;
  3838. }
  3839. case "CIMVectorMarker": {
  3840. const e12 = new t6();
  3841. m7.drawMarker(t8, e12);
  3842. break;
  3843. }
  3844. }
  3845. const f8 = l9.getImageData(0, 0, e11.width, e11.height), y5 = new Uint8Array(f8.data);
  3846. if (a10) {
  3847. let e12;
  3848. for (let t9 = 0; t9 < y5.length; t9 += 4)
  3849. e12 = y5[t9 + 3] / 255, y5[t9] = y5[t9] * e12, y5[t9 + 1] = y5[t9 + 1] * e12, y5[t9 + 2] = y5[t9 + 2] * e12;
  3850. }
  3851. return [y5, e11.width, e11.height, -s10 / e11.width, -n17 / e11.height];
  3852. }
  3853. static fromTextSymbol(e11) {
  3854. const { angle: r18, color: o11, font: a10, haloColor: i8, haloSize: s10, horizontalAlignment: n17, kerning: l9, text: c9, verticalAlignment: m7, xoffset: f8, yoffset: y5 } = e11;
  3855. let h6, M3, p3, u9, S;
  3856. a10 && (h6 = a10.family, M3 = a10.style, p3 = a10.weight, u9 = a10.size, S = a10.decoration);
  3857. let d2 = false;
  3858. if (c9) {
  3859. d2 = n4(c9)[1];
  3860. }
  3861. return { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, anchorPointUnits: "Relative", dominantSizeAxis3D: "Y", size: 10, billboardMode3D: "FaceNearPlane", frame: { xmin: -5, ymin: -5, xmax: 5, ymax: 5 }, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: { x: 0, y: 0 }, symbol: { type: "CIMTextSymbol", angle: r18, blockProgression: C2.BTT, depth3D: 1, extrapolateBaselines: true, fontEffects: l3.Normal, fontEncoding: a.Unicode, fontFamilyName: h6 || "Arial", fontStyleName: ne2(M3, p3), fontType: u3.Unspecified, haloSize: s10, height: u9, hinting: y2.Default, horizontalAlignment: ae(n17 ?? "center"), kerning: l9, letterWidth: 100, ligatures: true, lineGapType: "Multiple", offsetX: M(f8), offsetY: M(y5), strikethrough: S === "line-through", underline: S === "underline", symbol: { type: "CIMPolygonSymbol", symbolLayers: [{ type: "CIMSolidFill", enable: true, color: se(o11) }] }, haloSymbol: { type: "CIMPolygonSymbol", symbolLayers: [{ type: "CIMSolidFill", enable: true, color: se(i8) }] }, shadowColor: [0, 0, 0, 255], shadowOffsetX: 1, shadowOffsetY: 1, textCase: "Normal", textDirection: d2 ? ne.RTL : ne.LTR, verticalAlignment: ie2(m7 ?? "baseline"), verticalGlyphOrientation: oe.Right, wordSpacing: 100, billboardMode3D: m3.FaceNearPlane }, textString: c9 }], scaleSymbolsProportionally: true, respectFrame: true }], scaleX: 1, angleAlignment: "Display" };
  3862. }
  3863. static fromPictureFillSymbol(e11) {
  3864. const { height: t8, outline: r18, width: o11, xoffset: a10, xscale: i8, yoffset: s10, yscale: n17 } = e11, l9 = [], c9 = { type: "CIMPolygonSymbol", symbolLayers: l9 };
  3865. if (r18) {
  3866. const { cap: e12, join: t9, miterLimit: o12, width: a11 } = r18;
  3867. l9.push({ type: "CIMSolidStroke", color: se(r18.color), capStyle: re(e12), joinStyle: oe2(t9), miterLimit: o12, width: a11 });
  3868. }
  3869. let m7 = e11.url;
  3870. e11.type === "esriPFS" && e11.imageData && (m7 = e11.imageData);
  3871. const f8 = "angle" in e11 ? e11.angle : 0, y5 = o11 * (i8 || 1), h6 = t8 * (n17 || 1);
  3872. return l9.push({ type: "CIMPictureFill", invertBackfaceTexture: false, scaleX: 1, textureFilter: ie.Picture, tintColor: null, url: m7, height: h6, width: y5, offsetX: M(a10), offsetY: M(s10), rotation: M(-f8), colorSubstitutions: null }), c9;
  3873. }
  3874. static fromSimpleFillSymbol(e11) {
  3875. const { color: t8, style: r18, outline: a10 } = e11, s10 = [], n17 = { type: "CIMPolygonSymbol", symbolLayers: s10 };
  3876. let l9 = null;
  3877. if (a10) {
  3878. const { cap: e12, join: t9, style: r19 } = a10;
  3879. r19 !== "solid" && r19 !== "none" && r19 !== "esriSLSSolid" && r19 !== "esriSLSNull" && (l9 = [{ type: "CIMGeometricEffectDashes", dashTemplate: me(r19, e12), lineDashEnding: "NoConstraint", scaleDash: true, offsetAlongLine: null }]), s10.push({ type: "CIMSolidStroke", color: se(a10.color), capStyle: re(e12), joinStyle: oe2(t9), miterLimit: a10.miterLimit, width: a10.width, effects: l9 });
  3880. }
  3881. if (r18 && r18 !== "solid" && r18 !== "none" && r18 !== "esriSFSSolid" && r18 !== "esriSFSNull") {
  3882. const e12 = { type: "CIMLineSymbol", symbolLayers: [{ type: "CIMSolidStroke", color: se(t8), capStyle: U2.Butt, joinStyle: w.Miter, width: 0.75 }] };
  3883. let a11 = 0;
  3884. const n18 = c3(Math.ceil(window.devicePixelRatio)), l10 = he(r18) ? 8 * n18 : 10 * n18;
  3885. switch (r18) {
  3886. case "vertical":
  3887. case "esriSFSVertical":
  3888. a11 = 90;
  3889. break;
  3890. case "forward-diagonal":
  3891. case "esriSFSForwardDiagonal":
  3892. case "diagonal-cross":
  3893. case "esriSFSDiagonalCross":
  3894. a11 = -45;
  3895. break;
  3896. case "backward-diagonal":
  3897. case "esriSFSBackwardDiagonal":
  3898. a11 = 45;
  3899. break;
  3900. case "cross":
  3901. case "esriSFSCross":
  3902. a11 = 0;
  3903. }
  3904. s10.push({ type: "CIMHatchFill", lineSymbol: e12, offsetX: 0, offsetY: 0, rotation: a11, separation: l10 }), r18 === "cross" || r18 === "esriSFSCross" ? s10.push({ type: "CIMHatchFill", lineSymbol: m(e12), offsetX: 0, offsetY: 0, rotation: 90, separation: l10 }) : r18 !== "diagonal-cross" && r18 !== "esriSFSDiagonalCross" || s10.push({ type: "CIMHatchFill", lineSymbol: m(e12), offsetX: 0, offsetY: 0, rotation: 45, separation: l10 });
  3905. } else
  3906. !r18 || r18 !== "solid" && r18 !== "esriSFSSolid" || s10.push({ type: "CIMSolidFill", enable: true, color: se(t8) });
  3907. return n17;
  3908. }
  3909. static fromSimpleLineSymbol(e11) {
  3910. const { cap: t8, color: r18, join: o11, marker: a10, miterLimit: i8, style: s10, width: n17 } = e11;
  3911. let l9 = null;
  3912. s10 !== "solid" && s10 !== "none" && s10 !== "esriSLSSolid" && s10 !== "esriSLSNull" && (l9 = [{ type: "CIMGeometricEffectDashes", dashTemplate: me(s10, t8), lineDashEnding: "NoConstraint", scaleDash: true, offsetAlongLine: null }]);
  3913. const c9 = [];
  3914. if (a10) {
  3915. let e12;
  3916. switch (a10.placement) {
  3917. case "begin-end":
  3918. e12 = o3.Both;
  3919. break;
  3920. case "begin":
  3921. e12 = o3.JustBegin;
  3922. break;
  3923. case "end":
  3924. e12 = o3.JustEnd;
  3925. break;
  3926. default:
  3927. e12 = o3.None;
  3928. }
  3929. const t9 = Z2.fromSimpleMarker(a10, n17, r18).symbolLayers[0];
  3930. t9.markerPlacement = { type: "CIMMarkerPlacementAtExtremities", angleToLine: true, offset: 0, extremityPlacement: e12, offsetAlongLine: 0 }, c9.push(t9);
  3931. }
  3932. return s10 !== "none" && s10 !== "esriSLSNull" && c9.push({ type: "CIMSolidStroke", color: se(r18), capStyle: re(t8), joinStyle: oe2(o11), miterLimit: i8, width: n17, effects: l9 }), { type: "CIMLineSymbol", symbolLayers: c9 };
  3933. }
  3934. static fromPictureMarker(e11) {
  3935. const { angle: t8, height: r18, width: o11, xoffset: a10, yoffset: i8 } = e11;
  3936. let s10 = e11.url;
  3937. return e11.type === "esriPMS" && e11.imageData && (s10 = e11.imageData), { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMPictureMarker", invertBackfaceTexture: false, scaleX: 1, textureFilter: ie.Picture, tintColor: null, url: s10, size: r18, width: o11, offsetX: M(a10), offsetY: M(i8), rotation: M(-t8) }] };
  3938. }
  3939. static fromSimpleMarker(e11, t8, r18) {
  3940. const { style: o11 } = e11, a10 = e11.color ?? r18;
  3941. if (o11 === "path") {
  3942. const t9 = [];
  3943. if ("outline" in e11 && e11.outline) {
  3944. const r20 = e11.outline;
  3945. t9.push({ type: "CIMSolidStroke", enable: true, width: u(Math.round(e3(r20.width))), color: se(r20.color) });
  3946. }
  3947. t9.push({ type: "CIMSolidFill", enable: true, color: se(a10), path: e11.path });
  3948. const [r19, o12] = ye("square");
  3949. return { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, rotation: M(-e11.angle), size: M(e11.size || 6), offsetX: M(e11.xoffset), offsetY: M(e11.yoffset), frame: r19, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: o12, symbol: { type: "CIMPolygonSymbol", symbolLayers: t9 } }] }] };
  3950. }
  3951. const [i8, s10] = ye(o11);
  3952. let n17;
  3953. if (s10 && i8) {
  3954. const r19 = [];
  3955. if ("outline" in e11 && e11.outline) {
  3956. const t9 = e11.outline;
  3957. r19.push({ type: "CIMSolidStroke", enable: true, width: t9.width > 0.667 ? u(Math.round(e3(t9.width))) : t9.width, color: se(t9.color) });
  3958. } else
  3959. !t8 || e11.type !== "line-marker" || e11.style !== "cross" && e11.style !== "x" || r19.push({ type: "CIMSolidStroke", enable: true, width: t8, color: se(a10) });
  3960. r19.push({ type: "CIMSolidFill", enable: true, color: se(a10) });
  3961. const o12 = { type: "CIMPolygonSymbol", symbolLayers: r19 };
  3962. n17 = { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, rotation: M(-e11.angle), size: M(e11.size || 6 * t8), offsetX: M(e11.xoffset), offsetY: M(e11.yoffset), frame: i8, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: s10, symbol: o12 }] }] };
  3963. }
  3964. return n17;
  3965. }
  3966. static fromCIMHatchFill(e11) {
  3967. const t8 = e11.separation ?? X2, r18 = t8 / 2, o11 = 4, a10 = e11.lineSymbol;
  3968. let i8 = this._getLineSymbolPeriod(e11.lineSymbol) || o11;
  3969. for (; i8 < o11; )
  3970. i8 *= 2;
  3971. const s10 = i8 / 2;
  3972. return { type: "CIMVectorMarker", frame: { xmin: -s10, xmax: s10, ymin: -r18, ymax: r18 }, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: { paths: [[[-s10, 0], [s10, 0]]] }, symbol: a10 }], size: t8 };
  3973. }
  3974. static _getLineSymbolPeriod(e11) {
  3975. if (e11) {
  3976. const t8 = this._getEffectsRepeat(e11.effects);
  3977. if (t8)
  3978. return t8;
  3979. if (e11.symbolLayers) {
  3980. for (const r18 of e11.symbolLayers)
  3981. if (r18) {
  3982. const e12 = this._getEffectsRepeat(r18.effects);
  3983. if (e12)
  3984. return e12;
  3985. switch (r18.type) {
  3986. case "CIMCharacterMarker":
  3987. case "CIMPictureMarker":
  3988. case "CIMVectorMarker":
  3989. case "CIMObjectMarker3D":
  3990. case "CIMglTFMarker3D": {
  3991. const e13 = this._getPlacementRepeat(r18.markerPlacement);
  3992. if (e13)
  3993. return e13;
  3994. }
  3995. }
  3996. }
  3997. }
  3998. }
  3999. return 0;
  4000. }
  4001. static _getEffectsRepeat(e11) {
  4002. if (e11) {
  4003. for (const t8 of e11)
  4004. if (t8)
  4005. switch (t8.type) {
  4006. case "CIMGeometricEffectDashes": {
  4007. const e12 = t8.dashTemplate;
  4008. if (e12 && e12.length) {
  4009. let t9 = 0;
  4010. for (const r18 of e12)
  4011. t9 += r18;
  4012. return 1 & e12.length && (t9 *= 2), t9;
  4013. }
  4014. break;
  4015. }
  4016. case "CIMGeometricEffectWave":
  4017. return t8.period;
  4018. default:
  4019. Y2.error(`unsupported geometric effect type ${t8.type}`);
  4020. }
  4021. }
  4022. return 0;
  4023. }
  4024. static _getPlacementRepeat(e11) {
  4025. if (e11)
  4026. switch (e11.type) {
  4027. case "CIMMarkerPlacementAlongLineSameSize":
  4028. case "CIMMarkerPlacementAlongLineRandomSize":
  4029. case "CIMMarkerPlacementAlongLineVariableSize": {
  4030. const t8 = e11.placementTemplate;
  4031. if (t8 && t8.length) {
  4032. let e12 = 0;
  4033. for (const r18 of t8)
  4034. e12 += r18;
  4035. return 1 & t8.length && (e12 *= 2), e12;
  4036. }
  4037. break;
  4038. }
  4039. }
  4040. return 0;
  4041. }
  4042. static fromCIMInsidePolygon(e11) {
  4043. const t8 = e11.markerPlacement, r18 = { type: e11.type, ...e11 };
  4044. r18.markerPlacement = null, r18.anchorPoint = null;
  4045. const o11 = Math.abs(t8.stepX), a10 = Math.abs(t8.stepY), i8 = (t8.randomness ?? 100) / 100;
  4046. let s10, n17, c9, f8;
  4047. if (t8.gridType === "Random") {
  4048. const e12 = e3(dt), r19 = Math.max(Math.floor(e12 / o11), 1), y5 = Math.max(Math.floor(e12 / a10), 1);
  4049. s10 = r19 * o11 / 2, n17 = y5 * a10 / 2, c9 = 2 * n17;
  4050. const h6 = new t2(t8.seed), M3 = i8 * o11 / 1.5, p3 = i8 * a10 / 1.5;
  4051. f8 = [];
  4052. for (let t9 = 0; t9 < r19; t9++)
  4053. for (let e13 = 0; e13 < y5; e13++) {
  4054. const r20 = t9 * o11 - s10 + M3 * (0.5 - h6.getFloat()), i9 = e13 * a10 - n17 + p3 * (0.5 - h6.getFloat());
  4055. f8.push({ x: r20, y: i9 }), t9 === 0 && f8.push({ x: r20 + 2 * s10, y: i9 }), e13 === 0 && f8.push({ x: r20, y: i9 + 2 * n17 });
  4056. }
  4057. } else
  4058. t8.shiftOddRows === true ? (s10 = o11 / 2, n17 = a10, c9 = 2 * a10, f8 = [{ x: -s10, y: 0 }, { x: s10, y: 0 }, { x: 0, y: n17 }, { x: 0, y: -n17 }]) : (s10 = o11 / 2, n17 = a10 / 2, c9 = a10, f8 = [{ x: 0, y: 0 }]);
  4059. return { type: "CIMVectorMarker", frame: { xmin: -s10, xmax: s10, ymin: -n17, ymax: n17 }, markerGraphics: f8.map((e12) => ({ type: "CIMMarkerGraphic", geometry: e12, symbol: { type: "CIMPointSymbol", symbolLayers: [r18] } })), size: c9 };
  4060. }
  4061. static getFillColor(e11) {
  4062. if (!e11)
  4063. return null;
  4064. switch (e11.type) {
  4065. case "CIMPolygonSymbol":
  4066. if (e11.symbolLayers)
  4067. for (const t8 of e11.symbolLayers) {
  4068. const e12 = Z2.getFillColor(t8);
  4069. if (e12 != null)
  4070. return e12;
  4071. }
  4072. break;
  4073. case "CIMTextSymbol":
  4074. return Z2.getFillColor(e11.symbol);
  4075. case "CIMSolidFill":
  4076. return e11.color;
  4077. }
  4078. }
  4079. static getStrokeColor(e11) {
  4080. if (e11)
  4081. switch (e11.type) {
  4082. case "CIMPolygonSymbol":
  4083. case "CIMLineSymbol":
  4084. if (e11.symbolLayers)
  4085. for (const t8 of e11.symbolLayers) {
  4086. const e12 = Z2.getStrokeColor(t8);
  4087. if (e12 !== void 0)
  4088. return e12;
  4089. }
  4090. break;
  4091. case "CIMTextSymbol":
  4092. return Z2.getStrokeColor(e11.symbol);
  4093. case "CIMSolidStroke":
  4094. return e11.color;
  4095. }
  4096. }
  4097. static getStrokeWidth(e11) {
  4098. if (e11)
  4099. switch (e11.type) {
  4100. case "CIMPolygonSymbol":
  4101. case "CIMLineSymbol":
  4102. if (e11.symbolLayers)
  4103. for (const t8 of e11.symbolLayers) {
  4104. const e12 = Z2.getStrokeWidth(t8);
  4105. if (e12 !== void 0)
  4106. return e12;
  4107. }
  4108. break;
  4109. case "CIMTextSymbol":
  4110. return Z2.getStrokeWidth(e11.symbol);
  4111. case "CIMSolidStroke":
  4112. case "CIMGradientStroke":
  4113. case "CIMPictureStroke":
  4114. return e11.width;
  4115. }
  4116. }
  4117. static getSize(e11) {
  4118. if (e11)
  4119. switch (e11.type) {
  4120. case "CIMTextSymbol":
  4121. return e11.height;
  4122. case "CIMPointSymbol": {
  4123. let t8 = 0;
  4124. if (e11.symbolLayers) {
  4125. for (const r18 of e11.symbolLayers)
  4126. if (r18)
  4127. switch (r18.type) {
  4128. case "CIMCharacterMarker":
  4129. case "CIMPictureMarker":
  4130. case "CIMVectorMarker":
  4131. case "CIMObjectMarker3D":
  4132. case "CIMglTFMarker3D": {
  4133. const e12 = r18.size;
  4134. e12 > t8 && (t8 = e12);
  4135. break;
  4136. }
  4137. }
  4138. }
  4139. return t8;
  4140. }
  4141. case "CIMLineSymbol":
  4142. case "CIMPolygonSymbol": {
  4143. let t8 = 0;
  4144. if (e11.symbolLayers) {
  4145. for (const r18 of e11.symbolLayers)
  4146. if (r18)
  4147. switch (r18.type) {
  4148. case "CIMSolidStroke":
  4149. case "CIMPictureStroke":
  4150. case "CIMGradientStroke": {
  4151. const e12 = r18.width;
  4152. e12 > t8 && (t8 = e12);
  4153. break;
  4154. }
  4155. case "CIMCharacterMarker":
  4156. case "CIMPictureMarker":
  4157. case "CIMVectorMarker":
  4158. case "CIMObjectMarker3D":
  4159. case "CIMglTFMarker3D":
  4160. if (f3(r18.markerPlacement)) {
  4161. const e12 = r18.size;
  4162. e12 > t8 && (t8 = e12);
  4163. }
  4164. }
  4165. }
  4166. return t8;
  4167. }
  4168. }
  4169. }
  4170. static getMarkerScaleRatio(e11) {
  4171. if (e11 && e11.type === "CIMVectorMarker") {
  4172. if (e11.scaleSymbolsProportionally !== false && e11.frame) {
  4173. const t8 = e11.frame.ymax - e11.frame.ymin;
  4174. return e11.size / t8;
  4175. }
  4176. }
  4177. return 1;
  4178. }
  4179. };
  4180. var ee = class {
  4181. static rasterizeSimpleFill(e11, t8, r18) {
  4182. t8 !== "solid" && t8 !== "none" && t8 !== "esriSFSSolid" && t8 !== "esriSFSNull" || console.error("Unexpected: style does not require rasterization");
  4183. const o11 = c3(Math.ceil(r18)), a10 = he(t8) ? 8 * o11 : 16 * o11, s10 = 2 * o11;
  4184. e11.width = a10, e11.height = a10;
  4185. const n17 = e11.getContext("2d");
  4186. n17.strokeStyle = "#FFFFFF", n17.lineWidth = o11, n17.beginPath(), t8 !== "vertical" && t8 !== "cross" && t8 !== "esriSFSCross" && t8 !== "esriSFSVertical" || (n17.moveTo(a10 / 2, -s10), n17.lineTo(a10 / 2, a10 + s10)), t8 !== "horizontal" && t8 !== "cross" && t8 !== "esriSFSCross" && t8 !== "esriSFSHorizontal" || (n17.moveTo(-s10, a10 / 2), n17.lineTo(a10 + s10, a10 / 2)), t8 !== "forward-diagonal" && t8 !== "diagonal-cross" && t8 !== "esriSFSDiagonalCross" && t8 !== "esriSFSForwardDiagonal" || (n17.moveTo(-s10, -s10), n17.lineTo(a10 + s10, a10 + s10), n17.moveTo(a10 - s10, -s10), n17.lineTo(a10 + s10, s10), n17.moveTo(-s10, a10 - s10), n17.lineTo(s10, a10 + s10)), t8 !== "backward-diagonal" && t8 !== "diagonal-cross" && t8 !== "esriSFSBackwardDiagonal" && t8 !== "esriSFSDiagonalCross" || (n17.moveTo(a10 + s10, -s10), n17.lineTo(-s10, a10 + s10), n17.moveTo(s10, -s10), n17.lineTo(-s10, s10), n17.moveTo(a10 + s10, a10 - s10), n17.lineTo(a10 - s10, a10 + s10)), n17.stroke();
  4187. const l9 = n17.getImageData(0, 0, e11.width, e11.height), c9 = new Uint8Array(l9.data);
  4188. let m7;
  4189. for (let i8 = 0; i8 < c9.length; i8 += 4)
  4190. m7 = c9[i8 + 3] / 255, c9[i8] = c9[i8] * m7, c9[i8 + 1] = c9[i8 + 1] * m7, c9[i8 + 2] = c9[i8 + 2] * m7;
  4191. return [c9, e11.width, e11.height];
  4192. }
  4193. static rasterizeSimpleLine(e11, t8) {
  4194. return this.rasterizeDash(e11, t8);
  4195. }
  4196. static rasterizeDash(e11, t8) {
  4197. const o11 = t8 === "Butt", a10 = t8 === "Square", i8 = !o11 && !a10;
  4198. e11.length % 2 == 1 && (e11 = [...e11, ...e11]);
  4199. const s10 = 15.5, n17 = 2 * s10;
  4200. let l9 = 0;
  4201. for (const r18 of e11)
  4202. l9 += r18;
  4203. const c9 = Math.round(l9 * s10), m7 = new Float32Array(c9 * n17), f8 = 0.5 * s10;
  4204. let y5 = 0, h6 = 0, M3 = 0.5, p3 = true;
  4205. for (const r18 of e11) {
  4206. for (y5 = h6, h6 += r18 * s10; M3 <= h6; ) {
  4207. let e12 = 0.5;
  4208. for (; e12 < n17; ) {
  4209. const t9 = (e12 - 0.5) * c9 + M3 - 0.5, r19 = i8 ? (e12 - s10) * (e12 - s10) : Math.abs(e12 - s10);
  4210. m7[t9] = p3 ? o11 ? Math.max(Math.max(y5 + f8 - M3, r19), Math.max(M3 - h6 + f8, r19)) : r19 : i8 ? Math.min((M3 - y5) * (M3 - y5) + r19, (M3 - h6) * (M3 - h6) + r19) : a10 ? Math.min(Math.max(M3 - y5, r19), Math.max(h6 - M3, r19)) : Math.min(Math.max(M3 - y5 + f8, r19), Math.max(h6 + f8 - M3, r19)), e12++;
  4211. }
  4212. M3++;
  4213. }
  4214. p3 = !p3;
  4215. }
  4216. const u9 = m7.length, S = new Uint8Array(4 * u9);
  4217. for (let d2 = 0; d2 < u9; ++d2) {
  4218. const e12 = (i8 ? Math.sqrt(m7[d2]) : m7[d2]) / s10;
  4219. o6(e12, S, 4 * d2);
  4220. }
  4221. return [S, c9, n17];
  4222. }
  4223. };
  4224. var te = class {
  4225. static findApplicableOverrides(e11, t8, r18) {
  4226. if (e11 && t8) {
  4227. if (e11.primitiveName) {
  4228. let o11 = false;
  4229. for (const t9 of r18)
  4230. if (t9.primitiveName === e11.primitiveName) {
  4231. o11 = true;
  4232. break;
  4233. }
  4234. if (!o11)
  4235. for (const a10 of t8)
  4236. a10.primitiveName === e11.primitiveName && r18.push(a10);
  4237. }
  4238. switch (e11.type) {
  4239. case "CIMPointSymbol":
  4240. case "CIMLineSymbol":
  4241. case "CIMPolygonSymbol":
  4242. if (e11.effects)
  4243. for (const o11 of e11.effects)
  4244. te.findApplicableOverrides(o11, t8, r18);
  4245. if (e11.symbolLayers)
  4246. for (const o11 of e11.symbolLayers)
  4247. te.findApplicableOverrides(o11, t8, r18);
  4248. break;
  4249. case "CIMTextSymbol":
  4250. break;
  4251. case "CIMSolidStroke":
  4252. case "CIMPictureStroke":
  4253. case "CIMGradientStroke":
  4254. case "CIMSolidFill":
  4255. case "CIMPictureFill":
  4256. case "CIMHatchFill":
  4257. case "CIMGradientFill":
  4258. case "CIMVectorMarker":
  4259. case "CIMCharacterMarker":
  4260. case "CIMPictureMarker":
  4261. if (e11.effects)
  4262. for (const o11 of e11.effects)
  4263. te.findApplicableOverrides(o11, t8, r18);
  4264. if (e11.markerPlacement && te.findApplicableOverrides(e11.markerPlacement, t8, r18), e11.type === "CIMVectorMarker") {
  4265. if (e11.markerGraphics)
  4266. for (const o11 of e11.markerGraphics)
  4267. te.findApplicableOverrides(o11, t8, r18), te.findApplicableOverrides(o11.symbol, t8, r18);
  4268. } else
  4269. e11.type === "CIMCharacterMarker" ? te.findApplicableOverrides(e11.symbol, t8, r18) : e11.type === "CIMHatchFill" ? te.findApplicableOverrides(e11.lineSymbol, t8, r18) : e11.type === "CIMPictureMarker" && te.findApplicableOverrides(e11.animatedSymbolProperties, t8, r18);
  4270. }
  4271. }
  4272. }
  4273. static findEffectOverrides(e11, t8, r18) {
  4274. if (!t8 || !e11)
  4275. return;
  4276. const o11 = e11.length;
  4277. for (let a10 = 0; a10 < o11; a10++) {
  4278. const o12 = e11[a10]?.primitiveName;
  4279. if (o12) {
  4280. let e12 = false;
  4281. for (const t9 of r18)
  4282. if (t9.primitiveName === o12) {
  4283. e12 = true;
  4284. break;
  4285. }
  4286. if (!e12)
  4287. for (const a11 of t8)
  4288. a11.primitiveName === o12 && r18.push(a11);
  4289. }
  4290. }
  4291. }
  4292. static applyOverrides(e11, t8, r18, o11) {
  4293. if (!t8)
  4294. return;
  4295. const a10 = (e12) => e12 ? e12.charAt(0).toLowerCase() + e12.substr(1) : e12;
  4296. if (e11.primitiveName) {
  4297. for (const i8 of t8)
  4298. if (i8.primitiveName === e11.primitiveName) {
  4299. const t9 = a10(i8.propertyName);
  4300. if (o11 && o11.push({ cim: e11, nocapPropertyName: t9, value: e11[t9] }), i8.expression && (i8.value = te.toValue(i8.propertyName, i8.expression)), r18) {
  4301. let t10 = false;
  4302. for (const o12 of r18)
  4303. o12.primitiveName === e11.primitiveName && (t10 = true);
  4304. t10 || r18.push(i8);
  4305. }
  4306. e11[t9] = i8.value;
  4307. }
  4308. }
  4309. switch (e11.type) {
  4310. case "CIMPointSymbol":
  4311. case "CIMLineSymbol":
  4312. case "CIMPolygonSymbol":
  4313. if (e11.effects)
  4314. for (const a11 of e11.effects)
  4315. te.applyOverrides(a11, t8, r18, o11);
  4316. if (e11.symbolLayers)
  4317. for (const a11 of e11.symbolLayers)
  4318. te.applyOverrides(a11, t8, r18, o11);
  4319. break;
  4320. case "CIMTextSymbol":
  4321. break;
  4322. case "CIMSolidStroke":
  4323. case "CIMSolidFill":
  4324. case "CIMVectorMarker":
  4325. if (e11.effects)
  4326. for (const a11 of e11.effects)
  4327. te.applyOverrides(a11, t8, r18, o11);
  4328. if (e11.type === "CIMVectorMarker" && e11.markerGraphics)
  4329. for (const a11 of e11.markerGraphics)
  4330. te.applyOverrides(a11, t8, r18, o11), te.applyOverrides(a11.symbol, t8, r18, o11);
  4331. }
  4332. }
  4333. static restoreOverrides(e11) {
  4334. for (const t8 of e11)
  4335. t8.cim[t8.nocapPropertyName] = t8.value;
  4336. }
  4337. static buildOverrideKey(e11) {
  4338. let t8 = "";
  4339. for (const r18 of e11)
  4340. r18.value !== void 0 && (t8 += `${r18.primitiveName}${r18.propertyName}${JSON.stringify(r18.value)}`);
  4341. return t8;
  4342. }
  4343. static toValue(t8, r18) {
  4344. if (t8 === "DashTemplate")
  4345. return r18.split(" ").map((e11) => Number(e11));
  4346. if (t8 === "Color") {
  4347. const t9 = new l2(r18).toRgba();
  4348. return t9[3] *= 255, t9;
  4349. }
  4350. return r18;
  4351. }
  4352. };
  4353. var re = (e11) => {
  4354. if (!e11)
  4355. return U2.Butt;
  4356. switch (e11) {
  4357. case "butt":
  4358. return U2.Butt;
  4359. case "square":
  4360. return U2.Square;
  4361. case "round":
  4362. return U2.Round;
  4363. }
  4364. };
  4365. var oe2 = (e11) => {
  4366. if (!e11)
  4367. return w.Miter;
  4368. switch (e11) {
  4369. case "miter":
  4370. return w.Miter;
  4371. case "round":
  4372. return w.Round;
  4373. case "bevel":
  4374. return w.Bevel;
  4375. }
  4376. };
  4377. var ae = (e11) => {
  4378. if (t(e11))
  4379. return "Center";
  4380. switch (e11) {
  4381. case "left":
  4382. return "Left";
  4383. case "right":
  4384. return "Right";
  4385. case "center":
  4386. return "Center";
  4387. }
  4388. };
  4389. var ie2 = (e11) => {
  4390. if (t(e11))
  4391. return "Center";
  4392. switch (e11) {
  4393. case "baseline":
  4394. return "Baseline";
  4395. case "top":
  4396. return "Top";
  4397. case "middle":
  4398. return "Center";
  4399. case "bottom":
  4400. return "Bottom";
  4401. }
  4402. };
  4403. var se = (e11) => {
  4404. if (!e11)
  4405. return [0, 0, 0, 0];
  4406. const { r: t8, g: r18, b: o11, a: a10 } = e11;
  4407. return [t8, r18, o11, 255 * a10];
  4408. };
  4409. var ne2 = (e11, t8) => {
  4410. const r18 = le(t8), o11 = ce(e11);
  4411. return r18 && o11 ? `${r18}-${o11}` : `${r18}${o11}`;
  4412. };
  4413. var le = (e11) => {
  4414. if (!e11)
  4415. return "";
  4416. switch (e11.toLowerCase()) {
  4417. case "bold":
  4418. case "bolder":
  4419. return "bold";
  4420. }
  4421. return "";
  4422. };
  4423. var ce = (e11) => {
  4424. if (!e11)
  4425. return "";
  4426. switch (e11.toLowerCase()) {
  4427. case "italic":
  4428. case "oblique":
  4429. return "italic";
  4430. }
  4431. return "";
  4432. };
  4433. var me = (e11, t8) => {
  4434. const r18 = t8 === "butt";
  4435. switch (e11) {
  4436. case "dash":
  4437. case "esriSLSDash":
  4438. return r18 ? [4, 3] : [3, 4];
  4439. case "dash-dot":
  4440. case "esriSLSDashDot":
  4441. return r18 ? [4, 3, 1, 3] : [3, 4, 0, 4];
  4442. case "dot":
  4443. case "esriSLSDot":
  4444. return r18 ? [1, 3] : [0, 4];
  4445. case "long-dash":
  4446. case "esriSLSLongDash":
  4447. return r18 ? [8, 3] : [7, 4];
  4448. case "long-dash-dot":
  4449. case "esriSLSLongDashDot":
  4450. return r18 ? [8, 3, 1, 3] : [7, 4, 0, 4];
  4451. case "long-dash-dot-dot":
  4452. case "esriSLSDashDotDot":
  4453. return r18 ? [8, 3, 1, 3, 1, 3] : [7, 4, 0, 4, 0, 4];
  4454. case "short-dash":
  4455. case "esriSLSShortDash":
  4456. return r18 ? [4, 1] : [3, 2];
  4457. case "short-dash-dot":
  4458. case "esriSLSShortDashDot":
  4459. return r18 ? [4, 1, 1, 1] : [3, 2, 0, 2];
  4460. case "short-dash-dot-dot":
  4461. case "esriSLSShortDashDotDot":
  4462. return r18 ? [4, 1, 1, 1, 1, 1] : [3, 2, 0, 2, 0, 2];
  4463. case "short-dot":
  4464. case "esriSLSShortDot":
  4465. return r18 ? [1, 1] : [0, 2];
  4466. case "solid":
  4467. case "esriSLSSolid":
  4468. case "none":
  4469. return Y2.error("Unexpected: style does not require rasterization"), [0, 0];
  4470. default:
  4471. return Y2.error(`Tried to rasterize SLS, but found an unexpected style: ${e11}!`), [0, 0];
  4472. }
  4473. };
  4474. function fe(e11) {
  4475. return e11.symbolLayers !== void 0;
  4476. }
  4477. var ye = (e11) => {
  4478. const t8 = 100, r18 = 50;
  4479. let o11, a10;
  4480. const i8 = e11;
  4481. if (i8 === "circle" || i8 === "esriSMSCircle") {
  4482. const e12 = 0.25;
  4483. let t9 = Math.acos(1 - e12 / r18), i9 = Math.ceil(V / t9 / 4);
  4484. i9 === 0 && (i9 = 1), t9 = B4 / i9, i9 *= 4;
  4485. const s10 = [];
  4486. s10.push([r18, 0]);
  4487. for (let o12 = 1; o12 < i9; o12++)
  4488. s10.push([r18 * Math.cos(o12 * t9), -r18 * Math.sin(o12 * t9)]);
  4489. s10.push([r18, 0]), o11 = { rings: [s10] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
  4490. } else if (i8 === "cross" || i8 === "esriSMSCross") {
  4491. const e12 = 0;
  4492. o11 = { rings: [[[e12, r18], [e12, e12], [r18, e12], [r18, -e12], [e12, -e12], [e12, -r18], [-e12, -r18], [-e12, -e12], [-r18, -e12], [-r18, e12], [-e12, e12], [-e12, r18], [e12, r18]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
  4493. } else if (i8 === "diamond" || i8 === "esriSMSDiamond")
  4494. o11 = { rings: [[[-r18, 0], [0, r18], [r18, 0], [0, -r18], [-r18, 0]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
  4495. else if (i8 === "square" || i8 === "esriSMSSquare")
  4496. o11 = { rings: [[[-r18, -r18], [-r18, r18], [r18, r18], [r18, -r18], [-r18, -r18]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
  4497. else if (i8 === "x" || i8 === "esriSMSX") {
  4498. const e12 = 0;
  4499. o11 = { rings: [[[0, e12], [r18 - e12, r18], [r18, r18 - e12], [e12, 0], [r18, e12 - r18], [r18 - e12, -r18], [0, -e12], [e12 - r18, -r18], [-r18, e12 - r18], [-e12, 0], [-r18, r18 - e12], [e12 - r18, r18], [0, e12]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
  4500. } else if (i8 === "triangle" || i8 === "esriSMSTriangle") {
  4501. const e12 = t8 * 0.5773502691896257, r19 = -e12, i9 = 2 / 3 * t8, s10 = i9 - t8;
  4502. o11 = { rings: [[[r19, s10], [0, i9], [e12, s10], [r19, s10]]] }, a10 = { xmin: r19, ymin: s10, xmax: e12, ymax: i9 };
  4503. } else
  4504. i8 === "arrow" && (o11 = { rings: [[[-50, 50], [50, 0], [-50, -50], [-33, -20], [-33, 20], [-50, 50]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 });
  4505. return [a10, o11];
  4506. };
  4507. var he = (e11) => e11 === "vertical" || e11 === "horizontal" || e11 === "cross" || e11 === "esriSFSCross" || e11 === "esriSFSVertical" || e11 === "esriSFSHorizontal";
  4508. export {
  4509. n4 as n,
  4510. a3 as a,
  4511. x,
  4512. A2 as A,
  4513. g3 as g,
  4514. j3 as j,
  4515. r5 as r,
  4516. o6 as o,
  4517. r4 as r2,
  4518. s4 as s,
  4519. t7 as t,
  4520. s5 as s2,
  4521. j4 as j2,
  4522. q,
  4523. Q,
  4524. Z2 as Z,
  4525. ee,
  4526. te,
  4527. me
  4528. };
  4529. //# sourceMappingURL=chunk-MWIFVNKP.js.map